diff --git a/build_dependencies/aja/include/ajadriver/linux/driverdbg.h b/build_dependencies/aja/include/ajadriver/linux/driverdbg.h new file mode 100644 index 0000000..4e02442 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/linux/driverdbg.h @@ -0,0 +1,181 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +/////////////////////////////////////////////////////////////// +// +// NTV2 Linux v2.6 Device Driver for AJA boards. +// +//////////////////////////////////////////////////////////// +// +// Filename: driverdbg.h +// Purpose: Macros used for debugging the ntv2driver. +// Notes: +// +/////////////////////////////////////////////////////////////// + +#define MSG(string, args...) printk(KERN_ALERT string , ##args) + +#define SHOW_DMA_CTL_STRUCT(p) \ +do { \ + MSG("DMAControl Struct %p\n" \ + "\tframeNumber\t%d\n" \ + "\tframeBuffer\t%p\n" \ + "\tframeOffsetSrc\t%d\n" \ + "\tframeOffsetDest\t%d\n" \ + "\tnumBytes\t%d\n" \ + "\tdownSample\t%d\n" \ + "\tlinePitch\t%d\n" \ + "\tpoll\t%d\n", \ + &p, \ + p.frameNumber, p.frameBuffer, p.frameOffsetSrc, p.frameOffsetDest, \ + p.numBytes, p.downSample, p.linePitch, p.poll ); \ +} while (0) + +#define SHOW_AUTOCIRCULATE_DATA_STRUCT(p) \ +do { \ + MSG("AutoCirculateData Struct %p\n" \ + "\tcommand\t%d\n" \ + "\tchannelSpec\t%d\n" \ + "\tlVal1\t%ld\n" \ + "\tlVal2\t%ld\n" \ + "\tbVal1\t%d\n" \ + "\tbVal2\t%d\n" \ + "\tpvVal1\t%p\n" \ + "\tpvVal2\t%p\n" \ + &p, \ + p.eCommand, p.channelSpec, p.lVal1, p.lVal2, \ + p.bVal1, p.bVal2, p.pvVal1, p.pvVal2 ); \ +} while (0) + +#define SHOW_INTERNAL_AUTOCIRCULATE_STRUCT(p) \ +do { \ + MSG("Internal AutoCirculate Struct 0x%p\n" \ + "\tstate\t%d\n" \ + "\tchannelSpec\t%d\n" \ + "\trecording\t%ld\n" \ + "\tcurrentFrame\t%ld\n" \ + "\tstartFrame\t%ld\n" \ + "\tendFrame\t%ld\n" \ + "\tactiveFrame\t%ld\n" \ + "\tactiveFrameRegister\t%ld\n" \ + "\tcirculateWithAudio\t%d\n" \ + "\tcirculateWithRP188\t%d\n" \ + "\tcirculateWithColorCorrection\t%d\n" \ + "\tcirculateWithVidProc\t%d\n" \ + "\tcirculateWithCustomAncData\t%d\n" \ + "\tenableFbfChange\t%d\n" \ + "\tenableFboChange\t%d\n" \ + "\tstartTimeStamp\t0x%llx\n" \ + "\tstartAudioClockTimeStamp\t0x%llx\n" \ + "\tframesProcessed\t%ld\n" \ + "\tdroppedFrames\t%ld\n" \ + "\tPlus some frameStampStuff\n", \ + p, \ + p->state, \ + p->channelSpec, \ + (long)p->recording, \ + (long)p->currentFrame, \ + (long)p->startFrame, \ + (long)p->endFrame, \ + (long)p->activeFrame, \ + (long)p->activeFrameRegister, \ + (int)p->circulateWithAudio, \ + (int)p->circulateWithRP188, \ + (int)p->circulateWithColorCorrection, \ + (int)p->circulateWithVidProc, \ + (int)p->circulateWithCustomAncData, \ + (int)p->enableFbfChange, \ + (int)p->enableFboChange, \ + p->startTimeStamp, \ + p->startAudioClockTimeStamp, \ + (long)p->framesProcessed, \ + (long)p->droppedFrames \ + ); \ +} while (0) + +#define SHOW_FRAME_STAMP_STRUCT(p) \ +do { \ + MSG("FRAME_STAMP_STRUCT\t%p\n" \ + "\tchannelSpec\t\t%d\n" \ + "\tframeTime\t\t%lld\n" \ + "\tframe\t\t\t%ld\n" \ + "\taudioClockTimeStamp\t%lld\n" \ + "\taudioExpectedAddress\t%ld\n" \ + "\taudioInStartAddress\t%ld\n" \ + "\taudioInStopAddress\t%ld\n" \ + "\taudioOutStopAddress\t%ld\n" \ + "\taudioOutStartAddress\t%ld\n" \ + "\tbytesRead\t\t%ld\n" \ + "\tstartSample\t\t%ld\n" \ + "\t------------------\t\n" \ + "\tcurrentTime\t\t\t%lld\n" \ + "\tcurrentFrame\t\t\t%ld\n" \ + "\tRP188 Data unavailable\n" \ + "\tcurrentFrameTime\t\t%lld\n" \ + "\taudioClockCurrentTime\t\t%lld\n" \ + "\tcurrentAudioExpectedAddress\t%ld\n" \ + "\tcurrentAudioStartAddress\t%ld\n" \ + "\tcurrentFieldCount\t\t%ld\n" \ + "\tcurrentLineCount\t\t%ld\n" \ + "\tcurrentReps\t\t\t%ld\n" \ + "\tcurrenthUser\t\t\t%ld\n", \ + p, \ + p->channelSpec, p->frameTime, (long)p->frame, \ + p->audioClockTimeStamp, (long)p->audioExpectedAddress, \ + (long)p->audioInStartAddress, (long)p->audioInStopAddress, \ + (long)p->audioOutStopAddress, (long)p->audioOutStartAddress, \ + (long)p->bytesRead, (long)p->startSample, \ + \ + p->currentTime, (long)p->currentFrame, p->currentFrameTime, \ + p->audioClockCurrentTime, (long)p->currentAudioExpectedAddress, \ + (long)p->currentAudioStartAddress, \ + (long)p->currentFieldCount, (long)p->currentLineCount,\ + (long)p->currentReps, (long)p->currenthUser\ + ); \ +} while (0) + +#define SHOW_INTERNAL_FRAME_STAMP_STRUCT(p) \ +do { \ + MSG("INTERNAL_FRAME_STAMP_STRUCT\t%p\n" \ + "\tframeTime\t\t%lld\n" \ + "\taudioClockTimeStamp\t%lld\n" \ + "\taudioExpectedAddress\t%ld\n" \ + "\taudioInStartAddress\t%ld\n" \ + "\taudioInStopAddress\t%ld\n" \ + "\taudioOutStopAddress\t%ld\n" \ + "\taudioOutStartAddress\t%ld\n" \ + "\tbytesRead\t\t%ld\n" \ + "\tstartSample\t\t%ld\n" \ + "\t------------------\t\n" \ + "\tRP188 Data unavailable\n" \ + "\tvalidCount\t\t%ld\n" \ + "\trepeatCount\t\t%ld\n" \ + "\thUser\t\t\t%ld\n", \ + p, \ + p->frameTime, \ + p->audioClockTimeStamp, (long)p->audioExpectedAddress, \ + (long)p->audioInStartAddress, (long)p->audioInStopAddress, \ + (long)p->audioOutStopAddress, (long)p->audioOutStartAddress, \ + (long)p->bytesRead, (long)p->startSample, \ + \ + (long)p->validCount, (long)p->repeatCount,\ + (long)p->hUser\ + ); \ +} while (0) + +#define SHOW_DMA_IOCTL(s) \ +{ \ + MSG("Received " #s " for boardNumber %d\n", boardNumber); \ + SHOW_DMA_CTL_STRUCT(param); \ + char *bufInfo = (param.frameBuffer) ? "User mode buffer\n" : "Driver allocated buffer\n"; \ + MSG("%s", bufInfo); \ +} + +#define SHOULD_SHOW_DMA_DEBUG_MESSAGE(frameNumber, audioFrameNumber) \ +( \ + (MsgsEnabled(NTV2_DRIVER_DMA_AUDIO_DEBUG_MESSAGES) && ((frameNumber) == (audioFrameNumber))) \ +|| (MsgsEnabled(NTV2_DRIVER_DMA_VIDEO_DEBUG_MESSAGES) && ((frameNumber) != (audioFrameNumber))) \ +) + + diff --git a/build_dependencies/aja/include/ajadriver/linux/fs1wait.h b/build_dependencies/aja/include/ajadriver/linux/fs1wait.h new file mode 100644 index 0000000..bc8f855 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/linux/fs1wait.h @@ -0,0 +1,80 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +// Backported from 2.6 kernel so we can do wait_event_interruptible_timeout(). + +#ifndef _NTV2_LINUX_WAIT_H +#define _NTV2_LINUX_WAIT_H + + + +#ifdef __KERNEL__ + +#include +#include +#include +#include +#include + +#define __wait_event_timeout(wq, condition, ret) \ +do { \ + wait_queue_t __wait; \ + init_waitqueue_entry(&__wait, current); \ + \ + add_wait_queue(&wq, &__wait); \ + for (;;) { \ + set_current_state(TASK_UNINTERRUPTIBLE); \ + if (condition) \ + break; \ + ret = schedule_timeout(ret); \ + if (!ret) \ + break; \ + } \ + current->state = TASK_RUNNING; \ + remove_wait_queue(&wq, &__wait); \ +} while (0) + +#define wait_event_timeout(wq, condition, timeout) \ +({ \ + long __ret = timeout; \ + if (!(condition)) \ + __wait_event_timeout(wq, condition, __ret); \ + __ret; \ +}) + + +#define __wait_event_interruptible_timeout(wq, condition, ret) \ +do { \ + wait_queue_t __wait; \ + init_waitqueue_entry(&__wait, current); \ + \ + add_wait_queue(&wq, &__wait); \ + for (;;) { \ + set_current_state(TASK_INTERRUPTIBLE); \ + if (condition) \ + break; \ + if (!signal_pending(current)) { \ + ret = schedule_timeout(ret); \ + if (!ret) \ + break; \ + continue; \ + } \ + ret = -ERESTARTSYS; \ + break; \ + } \ + current->state = TASK_RUNNING; \ + remove_wait_queue(&wq, &__wait); \ +} while (0) + +#define wait_event_interruptible_timeout(wq, condition, timeout) \ +({ \ + long __ret = timeout; \ + if (!(condition)) \ + __wait_event_interruptible_timeout(wq, condition, __ret); \ + __ret; \ +}) + +#endif /* __KERNEL__ */ + +#endif diff --git a/build_dependencies/aja/include/ajadriver/linux/ntv2dma.h b/build_dependencies/aja/include/ajadriver/linux/ntv2dma.h new file mode 100644 index 0000000..fc8d13e --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/linux/ntv2dma.h @@ -0,0 +1,338 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2dma.h +// Purpose: ntv2 driver dma engines +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2DMA_HEADER +#define NTV2DMA_HEADER + +#ifdef AJA_RDMA +struct nvidia_p2p_page_table; +struct nvidia_p2p_dma_mapping; +#endif + +#define DMA_NUM_ENGINES 4 +#define DMA_NUM_CONTEXTS 2 + +#define DMA_TRANSFERCOUNT_64 0x10000000 +#define DMA_TRANSFERCOUNT_TOHOST 0x80000000 +#define DMA_TRANSFERCOUNT_BYTES 4 +#define DMA_DESCRIPTOR_PAGES_MAX 1024 + +typedef enum _NTV2DmaMethod +{ + DmaMethodIllegal, + DmaMethodAja, + DmaMethodNwl, + DmaMethodXlnx +} NTV2DmaMethod; + +typedef enum _NTV2DmaState +{ + DmaStateUnknown, // not configured + DmaStateConfigure, // configure engine + DmaStateIdle, // waiting for work + DmaStateSetup, // setup dma transfer + DmaStateTransfer, // dma transfer + DmaStateFinish, // finish dma + DmaStateRelease, // release resources + DmaStateDead // engine has failed +} NTV2DmaState; + +// aja descriptors +typedef struct _dmaDescriptor32 +{ + ULWord ulHostAddress; + ULWord ulLocalAddress; + ULWord ulTransferCount; + ULWord ulNextAddress; +} DMA_DESCRIPTOR32, *PDMA_DESCRIPTOR32; + +typedef struct _dmaDescriptor64 +{ + ULWord ulHostAddressLow; + ULWord ulLocalAddress; + ULWord ulTransferCount; + ULWord ulNextAddressLow; + ULWord ulHostAddressHigh; + ULWord ulNextAddressHigh; + ULWord ulReserved0; + ULWord ulReserved1; +} DMA_DESCRIPTOR64, *PDMA_DESCRIPTOR64; + +// nwl dma descriptor +typedef struct _nwlDmaDescriptor +{ + ULWord ulControl; // descriptor processing/interrupt control + ULWord ulTransferCount; // number of bytes to transfer + ULWord64 llHostAddress; // system address + ULWord64 llLocalAddress; // card address + ULWord64 llNextAddress; // next descriptor address (0 = last) +} NWL_DESCRIPTOR, *PNWL_DESCRIPTOR; + +// xilinx descriptor +typedef struct _xlnxDmaDescriptor +{ + ULWord ulControl; // descriptor processing/interrupt control + ULWord ulTransferCount; // transfer length in bytes + ULWord64 llSrcAddress; // source address + ULWord64 llDstAddress; // destination address + ULWord64 llNextAddress; // next desc address +} XLNX_DESCRIPTOR, *PXLNX_DESCRIPTOR; + +// dma page map +typedef struct _dmaPageRoot + + +{ + struct list_head bufferHead; // locked buffer list + spinlock_t bufferLock; // lock buffer list + bool lockAuto; // automatically lock buffers + bool lockMap; // automatically map buffers + LWord64 lockCounter; // lock access counter + LWord64 lockTotalSize; // current locked bytes + LWord64 lockMaxSize; // maximum locked bytes +} DMA_PAGE_ROOT, *PDMA_PAGE_ROOT; + +typedef struct _dmaPageBuffer +{ + struct list_head bufferEntry; // locked buffer list + LWord refCount; // reference count + void* pUserAddress; // user buffer address + ULWord userSize; // user buffer size + ULWord direction; // dma direction + bool pageLock; // pages are locked + bool busMap; // bus is mapped (p2p) + bool sgMap; // segment mapped + bool sgHost; // segment map synced to host + ULWord numPages; // pages locked + struct page** pPageList; // page lock list + ULWord pageListSize; // page list allocation + ULWord numSgs; // pages mapped + struct scatterlist* pSgList; // scatter gather list + ULWord sgListSize; // scatter list allocation + LWord64 lockCount; // lock access count + LWord64 lockSize; // locked bytes + bool rdma; // use nvidia rdma +#ifdef AJA_RDMA + ULWord64 rdmaAddress; // rdma gpu aligned buffer address + ULWord64 rdmaOffset; // rdma gpu aligned offset + ULWord64 rdmaLen; // rdma buffer length + ULWord64 rdmaAlignedLen; // rdma gpu aligned buffer length + struct nvidia_p2p_page_table* rdmaPage; + struct nvidia_p2p_dma_mapping* rdmaMap; +#endif +} DMA_PAGE_BUFFER, *PDMA_PAGE_BUFFER; + +// dma transfer parameters +typedef struct _dmaParams +{ + ULWord deviceNumber; // device number + PDMA_PAGE_ROOT pPageRoot; // dma locked page cache + bool toHost; // transfer to host + NTV2DMAEngine dmaEngine; // dma engine + NTV2Channel videoChannel; // video channel for frame size + PVOID pVidUserVa; // user video buffer + ULWord64 videoBusAddress; // p2p video bus address + ULWord videoBusSize; // p2p video bus size + ULWord64 messageBusAddress; // p2p message bus address + ULWord messageData; // p2p message data + ULWord videoFrame; // card video frame + ULWord vidNumBytes; // number of bytes per segment + ULWord frameOffset; // card video offset + ULWord vidUserPitch; // user buffer pitch + ULWord vidFramePitch; // card frame pitch + ULWord numSegments; // number of segments + PVOID pAudUserVa; // audio user buffer + NTV2AudioSystem audioSystem; // audio system target + ULWord audNumBytes; // number of audio bytes + ULWord audOffset; // card audio offset + PVOID pAncF1UserVa; // anc field 1 user buffer + ULWord ancF1Frame; // anc field 1 frame + ULWord ancF1NumBytes; // number of anc field 1 bytes + ULWord ancF1Offset; // anc field 1 frame offset + PVOID pAncF2UserVa; // anc field 2 user buffer + ULWord ancF2Frame; // anc field 2 frame + ULWord ancF2NumBytes; // number of anc field 2 bytes + ULWord ancF2Offset; // anc field 2 frame offset + ULWord audioSystemCount; // number of multi-link audio systems +} DMA_PARAMS, *PDMA_PARAMS; + +// video scatter list to descriptor map +typedef struct _dmaVideoSegment +{ + ULWord cardAddress; // card address + ULWord cardSize; // card total transfer size + ULWord cardPitch; // card segment pitch + ULWord systemPitch; // system segment pitch + ULWord segmentSize; // segment size + ULWord segmentCount; // segment count + bool invertImage; // invert segments + ULWord64 transferAddress; // scatter transfer address + ULWord transferSize; // scatter transfer size + ULWord systemOffset; // system bytes transferred + ULWord segmentIndex; // segment transfer index +} DMA_VIDEO_SEGMENT, *PDMA_VIDEO_SEGMENT; + +// audio scatter list to descriptor map +#define MAX_NUM_AUDIO_LINKS 4 +typedef struct _dmaAudioSegment +{ + //ULWord engIndex; + ULWord systemSize; // dma system buffer size + ULWord transferSize; // audio transfer size + ULWord ringAddress[MAX_NUM_AUDIO_LINKS]; // ring buffer address + ULWord ringCount; // number of rings + ULWord ringSize; // ring buffer size + ULWord64 pageAddress; // page address + ULWord pageSize; // page size + ULWord audioStart; // audio transfer start offset + ULWord audioSize; // audio size + ULWord ringIndex; // transfer ring index + ULWord systemOffset; // system transfer bytes + ULWord pageOffset; // page transfer bytes + ULWord audioOffset; // audio transfer bytes +} DMA_AUDIO_SEGMENT, *PDMA_AUDIO_SEGMENT; + +// anc scatter list to descriptor map +typedef struct _dmaAncSegment +{ + ULWord ancAddress; // anc buffer address + ULWord ancSize; // anc buffer size + ULWord64 transferAddress; // scatter transfer address + ULWord transferSize; // scatter transfer size + ULWord systemOffset; // system bytes transferred + ULWord transferOffset; // scatter bytes transferred +} DMA_ANC_SEGMENT, *PDMA_ANC_SEGMENT; + +// dma transfer context +typedef struct _dmaContext_ +{ + ULWord deviceNumber; // device number + ULWord engIndex; // engine index + char* engName; // engine name string + ULWord conIndex; // context index + ULWord dmaIndex; // dma index + bool dmaC2H; // dma to host + bool conInit; // context initialized + bool inUse; // context acquired + bool doVideo; // dma video buffer (transfer data) + bool doAudio; // dma audio buffer (transfer data) + bool doAncF1; // dma ancillary field 1 buffer (transfer data) + bool doAncF2; // dma ancillary field 2 buffer (transfer data) + bool doMessage; // dma gma message (transfer data) + PDMA_PAGE_BUFFER pVideoPageBuffer; // video page buffer + PDMA_PAGE_BUFFER pAudioPageBuffer; // audio page buffer + PDMA_PAGE_BUFFER pAncF1PageBuffer; // anc field 1 page buffer + PDMA_PAGE_BUFFER pAncF2PageBuffer; // anc field 2 page buffer + DMA_PAGE_BUFFER videoPageBuffer; // default video page buffer + DMA_PAGE_BUFFER audioPageBuffer; // default audio page buffer + DMA_PAGE_BUFFER ancF1PageBuffer; // default anc field 1 page buffer + DMA_PAGE_BUFFER ancF2PageBuffer; // default anc field 2 page buffer + DMA_VIDEO_SEGMENT dmaVideoSegment; // video segment data (transfer data) + DMA_AUDIO_SEGMENT dmaAudioSegment; // audio segment data (transfer data) + DMA_ANC_SEGMENT dmaAncF1Segment; // ancillary field 1 segment data (transfer data) + DMA_ANC_SEGMENT dmaAncF2Segment; // ancillary field 2 segment data (transfer data) + ULWord64 messageBusAddress; // gma message bus target address + ULWord messageCardAddress; // gma message frame buffer source address +} DMA_CONTEXT, *PDMA_CONTEXT; + +// dma engine parameters +typedef struct _dmaEngine_ +{ + ULWord deviceNumber; // device number + ULWord engIndex; // engine index + char* engName; // engine name string + bool engInit; // engine initialized + bool dmaEnable; // transfer enable + NTV2DmaMethod dmaMethod; // dma method + ULWord dmaIndex; // dma index + bool dmaC2H; // dma to host + ULWord maxVideoSize; // maximum video transfer size + ULWord maxVideoPages; // maximum video pages + ULWord maxAudioSize; // maximum audio transfer size + ULWord maxAudioPages; // maximum audio pages + ULWord maxAncSize; // maximum anc transfer size + ULWord maxAncPages; // maximum anc pages + ULWord maxDescriptors; // maximum number of descriptors + bool transferP2P; // is p2p transfer; + NTV2DmaState state; // dma engine state + spinlock_t engineLock; // engine data structure lock + unsigned long engineFlags; // engine lock flags + struct semaphore contextSemaphore; // context traffic control + struct semaphore transferSemaphore; // hardware traffic control + wait_queue_head_t transferEvent; // dma transfer complete event + volatile unsigned long transferDone; // dma transfer done bit + DMA_CONTEXT dmaContext[DMA_NUM_CONTEXTS]; // dma transfer context + PVOID pDescriptorVirtual[DMA_DESCRIPTOR_PAGES_MAX]; // virtual descriptor aligned address + dma_addr_t descriptorPhysical[DMA_DESCRIPTOR_PAGES_MAX]; // physical descriptor aligned address + ULWord numDescriptorPages; // number of allocated descriptor pages + LWord64 programStartCount; // count program hardware dma starts + LWord64 programCompleteCount; // count program hardware dma completes + LWord64 programDescriptorCount; // count program hardware descriptors + LWord64 programErrorCount; // count program errors + LWord64 programBytes; // count program hardware bytes transferred + LWord64 programStartTime; // program transfer start time + LWord64 programStopTime; // program transfer stop time + LWord64 programTime; // sum program hardware transfer time + LWord64 interruptCount; // count dma interrupts + LWord64 scTransferCount; // count to card transfers + LWord64 scRdmaCount; // count gpu to card transfers + LWord64 scErrorCount; // count errors + LWord64 scDescriptorCount; // count descriptors + LWord64 scTransferBytes; // sum bytes transferred + LWord64 scTransferTime; // sum software transfer time + LWord64 scLockWaitTime; // sum page lock time + LWord64 scLockTime; // sum page lock time + LWord64 scDmaWaitTime; // sum wait for dma hardware time + LWord64 scDmaTime; // sum hardware dma time + LWord64 scUnlockTime; // sum page unlock time + LWord64 scHardTime; // sum hardware dma time + LWord64 scLastDisplayTime; // last stat display time + LWord64 csTransferCount; // count from card transfers + LWord64 csRdmaCount; // count card to gpu transfers + LWord64 csErrorCount; + LWord64 csDescriptorCount; + LWord64 csTransferBytes; + LWord64 csTransferTime; + LWord64 csLockWaitTime; + LWord64 csLockTime; + LWord64 csDmaWaitTime; + LWord64 csDmaTime; + LWord64 csUnlockTime; + LWord64 csHardTime; + LWord64 csLastDisplayTime; +} DMA_ENGINE, *PDMA_ENGINE; + +int dmaInit(ULWord deviceNumber); +void dmaRelease(ULWord deviceNumber); + +int dmaPageRootInit(ULWord deviceNumber, PDMA_PAGE_ROOT pRoot); +void dmaPageRootRelease(ULWord deviceNumber, PDMA_PAGE_ROOT pRoot); +int dmaPageRootAdd(ULWord deviceNumber, PDMA_PAGE_ROOT pRoot, + PVOID pAddress, ULWord size, bool rdma, bool map); +int dmaPageRootRemove(ULWord deviceNumber, PDMA_PAGE_ROOT pRoot, + PVOID pAddress, ULWord size); +int dmaPageRootPrune(ULWord deviceNumber, PDMA_PAGE_ROOT pRoot, ULWord size); +void dmaPageRootAuto(ULWord deviceNumber, PDMA_PAGE_ROOT pRoot, + bool lockAuto, bool lockMap, ULWord64 maxSize); + +PDMA_PAGE_BUFFER dmaPageRootFind(ULWord deviceNumber, PDMA_PAGE_ROOT pRoot, + PVOID pAddress, ULWord size); +void dmaPageRootFree(ULWord deviceNumber, PDMA_PAGE_ROOT pRoot, PDMA_PAGE_BUFFER pBuffer); + +int dmaEnable(ULWord deviceNumber); +void dmaDisable(ULWord deviceNumber); + +int dmaTransfer(PDMA_PARAMS pDmaParams); +int dmaTargetP2P(ULWord deviceNumber, NTV2_DMA_P2P_CONTROL_STRUCT* pParams); + +void dmaInterrupt(ULWord deviceNumber, ULWord intStatus); + +#endif diff --git a/build_dependencies/aja/include/ajadriver/linux/ntv2driver.h b/build_dependencies/aja/include/ajadriver/linux/ntv2driver.h new file mode 100644 index 0000000..5e1acd8 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/linux/ntv2driver.h @@ -0,0 +1,104 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +/////////////////////////////////////////////////////////////// +// +// NTV2 Linux v2.6 Device Driver for AJA OEM boards. +// +//////////////////////////////////////////////////////////// +// +// Filename: ntv2driver.h +// Purpose: Main headerfile for driver. +// Notes: PCI Device IDs, memory sizes, fops prototypes +// +/////////////////////////////////////////////////////////////// +#ifndef NTV2_DRIVER_HEADER +#define NTV2_DRIVER_HEADER + +#include + +// Defines +#define NTV2_MAJOR 0 + +#define ntv2_spin_lock_irqsave(l, f) spin_lock_irqsave((l), (f)) +#define ntv2_spin_unlock_irqrestore(l, f) spin_unlock_irqrestore((l), (f)) + +// the VendorID/DeviceID for the hardware +#define NTV2_VENDOR_ID 0xF1D0 +#define NTV2_DEVICE_ID_CORVID1 0xDAFE +#define NTV2_DEVICE_ID_LHI 0xDAFF +#define NTV2_DEVICE_ID_IOEXPRESS 0xDB00 +#define NTV2_DEVICE_ID_CORVID22 0xDB01 +#define NTV2_DEVICE_ID_KONA3G 0xDB02 +#define NTV2_DEVICE_ID_CORVID3G 0xDB03 +#define NTV2_DEVICE_ID_KONA3G_QUAD 0xDB04 +#define NTV2_DEVICE_ID_LHE_PLUS 0xDB05 +#define NTV2_DEVICE_ID_IOXT 0xDB06 +#define NTV2_DEVICE_ID_KONA3G_P2P 0xDB07 +#define NTV2_DEVICE_ID_KONA3G_QUAD_P2P 0xDB08 +#define NTV2_DEVICE_ID_CORVID24 0xDB09 +#define NTV2_DEVICE_ID_TTAP 0xDB11 +#define NTV2_DEVICE_ID_KONA4 0xEB0B +#define NTV2_DEVICE_ID_KONA4_UFC 0xEB0C +#define NTV2_DEVICE_ID_CORVID88 0xEB0D +#define NTV2_DEVICE_ID_CORVID44 0xEB0E +#define NTV2_DEVICE_ID_CORVIDHEVC_MB31 0xEB15 +#define NTV2_DEVICE_ID_CORVIDHEVC_K7 0xEB16 +#define NTV2_DEVICE_ID_CORVIDHDBT 0xEB18 +#define NTV2_DEVICE_ID_CORVID446 0xEB19 +#define NTV2_DEVICE_ID_KONAIP_CH1SFP 0xEB1A +#define NTV2_DEVICE_ID_KONAIP_PHANTOM 0xEB1B +#define NTV2_DEVICE_ID_KONAIP_CH2SFP 0xEB1C +#define NTV2_DEVICE_ID_IO4KPLUS 0xEB1D +#define NTV2_DEVICE_ID_IOIP 0xEB1E +#define NTV2_DEVICE_ID_KONA5 0xEB1F +#define NTV2_DEVICE_ID_KONA5IP 0xEB20 +#define NTV2_DEVICE_ID_KONA1 0xEB23 +#define NTV2_DEVICE_ID_KONAHDMI 0xEB24 +#define NTV2_DEVICE_ID_CORVID44_12g 0xEB25 +#define NTV2_DEVICE_ID_TTAPPRO 0xEB26 +#define NTV2_DEVICE_ID_IOX3 0xEB27 +#define PRIVATIZE(name) AJANTV2_ ## name + + +// The kernel has only one namespace, so make the NTV2Params global +// structure have a unique name per boardtype. Access function for +// this per-board data is provided also. +#define NTV2Params PRIVATIZE(NTV2Params) +#define NTV2ModuleParams PRIVATIZE(NTV2ModuleParams) + +#define MapFrameBuffers PRIVATIZE(MapFrameBuffers) +#define NumDmaDriverBuffers PRIVATIZE(NumDmaDriverBuffers) + +int init_module(void); +void cleanup_module(void); + +loff_t ntv2_lseek(struct file *file, loff_t off, int whence); +ssize_t ntv2_read(struct file *file, char *buf, size_t count, loff_t *f_pos); +ssize_t ntv2_write(struct file *file, const char *buf, size_t count, loff_t *f_pos); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) +long ntv2_ioctl(struct file *file, unsigned int cmd, unsigned long arg); +#else +int ntv2_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); +#endif +int ntv2_mmap(struct file *file,struct vm_area_struct* vma); +int ntv2_open(struct inode *minode, struct file *mfile); +int ntv2_release(struct inode *minode, struct file *mfile); + + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) +#define smp_mb__before_clear_bit smp_mb__before_atomic +#define smp_mb__after_clear_bit smp_mb__after_atomic +#endif + + +#endif // NTV2_DRIVER_HEADER + +/* + * Local variables: + * c-indent-level: 4 + * c-basic-offset: 4 + * tab-width: 4 + * End: + */ diff --git a/build_dependencies/aja/include/ajadriver/linux/ntv2driverautocirculate.h b/build_dependencies/aja/include/ajadriver/linux/ntv2driverautocirculate.h new file mode 100644 index 0000000..4a55439 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/linux/ntv2driverautocirculate.h @@ -0,0 +1,278 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +/////////////////////////////////////////////////////////////// +// +// NTV2 Linux v2.6 Device Driver for AJA OEM boards. +// +//////////////////////////////////////////////////////////// +// +// Filename: ntv2driverautocirculate.h +// Purpose: Header file for autocirculate methods. +// Notes: +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2DRIVERAUTOCIRCULATE_H +#define NTV2DRIVERAUTOCIRCULATE_H + +#include "ntv2dma.h" +#include "../ntv2kona.h" + + +////////////////////////////////////////////////////////////////////////////////////// +// Defines +////////////////////////////////////////////////////////////////////////////////////// +#define ILLEGAL_CHANNELSPEC(channelSpec) (((unsigned)channelSpec > (unsigned)NTV2CROSSPOINT_INPUT8) || (channelSpec == NTV2CROSSPOINT_MATTE) || (channelSpec == NTV2CROSSPOINT_FGKEY)) + +//#define NUM_CIRCULATE_FRAMES 128 // intended to exceed highest configuration number; KiPro currently uses 99 frame buffers +#define NUM_CIRCULATORS 18 // number of 'channels' which have auto-circulate capability +#define TIMECODE_ARRAY_SIZE 18 +#define NTV2_INVALID_FRAME 0xFFFFFFFF + + +////////////////////////////////////////////////////////////////////////////////////// +// Typedefs +////////////////////////////////////////////////////////////////////////////////////// + +typedef struct { + NTV2ColorCorrectionMode mode; + UWord saturationValue; /// only used in 3way color correction mode. + ULWord ccLookupTables[NTV2_COLORCORRECTOR_TABLESIZE/4]; /// R,G, and B lookup tables already formated for our hardware. +} INTERNAL_ColorCorrectionInfo; + +typedef struct +{ + //! Processor RDTSC at time of play or record. + LWord64 frameTime; + //! 48kHz clock in reg 28 extended to 64 bits + ULWord64 audioClockTimeStamp; // Register 28 with Wrap Logic + //! The address that was used to transfer + ULWord audioExpectedAddress; + //! For record - first position in buffer of audio (includes base offset) + ULWord audioInStartAddress; // AudioInAddress at the time this Frame was stamped. + //! For record - end position (exclusive) in buffer of audio (includes base offset) + ULWord audioInStopAddress; // AudioInAddress at the Frame AFTER this Frame was stamped. + //! For play - first position in buffer of audio + ULWord audioOutStopAddress; // AudioOutAddress at the time this Frame was stamped. + //! For play - end position (exclusive) in buffer of audio + ULWord audioOutStartAddress; // AudioOutAddress at the Frame AFTER this Frame was stamped. + ULWord audioPreWrapBytes; // For DMA Transfer + + ULWord audioPostWrapBytes; + + //! Total audio and video bytes transfered + ULWord bytesRead; + /** The actaul start sample when this frame was started in VBI + * This may be used to check sync against audioInStartAddress (Play) or + * audioOutStartAddress (Record). In record it will always be equal, but + * in playback if the clocks drift or the user supplies non aligned + * audio sizes, then this will give the current difference from expected + * vs actual position. To be useful, play audio must be clocked in at + * the correct rate. + */ + ULWord startSample; + //! Associated timecode (RP-188) + RP188_STRUCT rp188; + //! Valid counts from n..0 in the isr. Set to n when valid + LWord validCount; // Used to throttle record and playback, See AutoCirculate Method in driver + //! Repeat is set to n at beginning of DMA. Moved to repeat on completion. + LWord repeatCount; // Used to throttle record and playback, See AutoCirculate Method in driver + //! Opaque user variable + ULWord64 hUser; // A user cookie returned by frame stamp + + NTV2FrameBufferFormat frameBufferFormat; + NTV2VideoFrameBufferOrientation frameBufferOrientation; + INTERNAL_ColorCorrectionInfo colorCorrectionInfo; + AutoCircVidProcInfo vidProcInfo; + NTV2RoutingTable ntv2RoutingTable; + AUTOCIRCULATE_TASK_STRUCT taskInfo; + AutoCircGenericTask taskArray[AUTOCIRCULATE_TASK_MAX_TASKS]; + bool videoTransferPending; + INTERNAL_TIMECODE_STRUCT internalTCArray; + INTERNAL_SDI_STATUS_STRUCT internalSDIStatusArray; + ULWord frameFlags; + ULWord ancTransferSize; + ULWord ancField2TransferSize; + ULWord auxData[NTV2_HDMIAuxMaxFrames*NTV2_HDMIAuxDataSize/4]; + ULWord auxDataSize; +} INTERNAL_FRAME_STAMP_STRUCT; + +typedef struct +{ + NTV2AutoCirculateState state; + NTV2Crosspoint channelSpec; + bool recording; + LWord currentFrame; + LWord startFrame; + LWord endFrame; + LWord activeFrame; + LWord activeFrameRegister; + bool circulateWithAudio; + bool circulateWithRP188; + bool circulateWithColorCorrection; + bool circulateWithVidProc; + bool circulateWithCustomAncData; + bool circulateWithHDMIAux; + bool circulateWithFields; + bool enableFbfChange; + bool enableFboChange; + LWord64 startTimeStamp; + ULWord64 startAudioClockTimeStamp; + ULWord framesProcessed; + ULWord droppedFrames; + ULWord nextFrame; + INTERNAL_FRAME_STAMP_STRUCT frameStamp[NTV2_MAX_FRAMEBUFFERS]; + ULWord nextAudioOutputAddress; + ULWord transferFrame; + ULWord audioTransferOffset; + ULWord audioTransferSize; + ULWord audioStartSample; + ULWord audioDropsRequired; + ULWord audioDropsCompleted; + ULWord ancTransferOffset; + ULWord ancTransferSize; + ULWord ancField2TransferOffset; + ULWord ancField2TransferSize; + LWord64 lastInterruptTime; + LWord64 prevInterruptTime; + ULWord64 lastAudioClockTimeStamp; + LWord64 startTime; + bool circulateWithLTC; + AUTOCIRCULATE_TASK_STRUCT recordTaskInfo; + AutoCircGenericTask recordTaskArray[AUTOCIRCULATE_TASK_MAX_TASKS]; + INTERNAL_TIMECODE_STRUCT timeCodeArray[TIMECODE_ARRAY_SIZE]; + LWord timeCodeIndex; + LWord timeCodeDelay; + ULWord deviceNumber; + NTV2AudioSystem audioSystem; + LWord channelCount; + + // Keep track of interrupt timing per channel + LWord64 VBIRDTSC; + LWord64 VBILastRDTSC; + ULWord VBIAudioOut; + bool startAudioNextFrame; + bool stopAudioNextFrame; + ULWord audioSystemCount; +} INTERNAL_AUTOCIRCULATE_STRUCT; + +////////////////////////////////////////////////////////////////////////////////////// +// Prototypes +////////////////////////////////////////////////////////////////////////////////////// + +// Initialize all Auto Circulators -- done at driver load time. +int AutoCirculateInitialize(ULWord boardNumber); + +int AutoCirculateControl(ULWord boardNumber, AUTOCIRCULATE_DATA *acData); + +int AutoCirculateStatus(ULWord boardNumber, AUTOCIRCULATE_STATUS_STRUCT *acStatus); + +int AutoCirculateStatus_Ex(ULWord boardNumber, AUTOCIRCULATE_STATUS *acStatus); + +int AutoCirculateFrameStamp(ULWord boardNumber, AUTOCIRCULATE_FRAME_STAMP_COMBO_STRUCT *frameStampCombo); + +int AutoCirculateCaptureTask(ULWord boardNumber, AUTOCIRCULATE_FRAME_STAMP_COMBO_STRUCT *pFrameStampCombo); + +int AutoCirculateTransfer(ULWord boardNumber, AUTOCIRCULATE_TRANSFER_COMBO_STRUCT *acXferCombo); + +int AutoCirculateTransfer_Ex(ULWord boardNumber, PDMA_PAGE_ROOT pPageRoot, AUTOCIRCULATE_TRANSFER *acXferCombo); + +// +// Workhorse functions +// + +int OemAutoCirculateInit ( ULWord boardNumber, + NTV2Crosspoint channelSpec, + LWord lStartFrameNum, + LWord lEndFrameNum, + NTV2AudioSystem audioSystem, + LWord lChanelCount, + bool bWithAudio, + bool bWithRP188, + bool bFbfChange, + bool bFboChange, + bool bWithColorCorrection, + bool bWithVidProc, + bool bWithCustomAncData, + bool bWithLTC, + bool bWithFields, + bool bWithHDMIAux, + bool bWithASPlus1, + bool bWithASPlus2, + bool bWithASPlus3 + ); + +ULWord GetAudioFrameBufferNumber(ULWord boardNumber, ULWord boardID, NTV2AudioSystem audioSystem); + +ULWord GetAudioTransferInfo(ULWord boardNumber, NTV2AudioSystem audioSystem, ULWord currentOffset,ULWord numBytesToTransfer,ULWord* preWrapBytes,ULWord* postWrapBytes); + +ULWord GetAudioSamplesPerFrame(ULWord boardNumber, NTV2AudioSystem audioSystem, ULWord cadenceFrame, ULWord granularity, bool fieldMode); + +ULWord GetAudioReadOffset(ULWord boardNumber, NTV2AudioSystem audioSystem); + +NTV2AudioRate GetAudioRate(ULWord boardNumber, NTV2AudioSystem audioSystem); + +ULWord GetAudioSamplesPerSecond(ULWord boardNumber, NTV2AudioSystem audioSystem); + +ULWord GetAudioWrapAddress(ULWord boardNumber, NTV2AudioSystem audioSystem); + +NTV2AudioBufferSize GetAudioBufferSize(ULWord boardNumber, NTV2AudioSystem audioSystem); + +ULWord GetAudioLastIn(ULWord boardNumber, NTV2AudioSystem audioSystem); + +ULWord GetAudioLastOut(ULWord boardNumber, NTV2AudioSystem audioSystem); + +int OemAutoCirculateMessage(ULWord boardNumber, NTV2Crosspoint channelSpec, ULWord frameNumber); + +void oemAutoCirculateTransferFields(ULWord deviceNumber, + INTERNAL_AUTOCIRCULATE_STRUCT* pAuto, + DMA_PARAMS* pDmaParams, + ULWord frameNumber, bool drop); + +ULWord Get2MFrameSize(ULWord boardNumber, NTV2Channel channel); + +bool BoardIs2MCompatible(ULWord boardNumber); + +void OemAutoCirculate(ULWord boardNumber, NTV2Crosspoint channelSpec); + +int OemAutoCirculateStart (ULWord boardNumber, NTV2Crosspoint channelSpec, ULWord64 startTime); + +int OemAutoCirculateStop (ULWord boardNumber, NTV2Crosspoint channelSpec); + +int OemAutoCirculateAbort (ULWord boardNumber, NTV2Crosspoint channelSpec); + +int OemAutoCirculatePause (ULWord boardNumber, NTV2Crosspoint channelSpec, bool bPlay, bool bClearDF); + +int OemAutoCirculateFlush (ULWord boardNumber, NTV2Crosspoint channelSpec, bool bClearDF); + +int OemAutoCirculatePreroll (ULWord boardNumber, NTV2Crosspoint channelSpec, LWord lPrerollFrames); + +void OemAutoCirculateReset (ULWord boardNumber, NTV2Crosspoint channelSpec); + +LWord OemAutoCirculateFindNextAvailFrame(INTERNAL_AUTOCIRCULATE_STRUCT* pAuto); + +void SetAudioPlaybackMode(ULWord boardNumber, NTV2_GlobalAudioPlaybackMode mode); + +NTV2_GlobalAudioPlaybackMode GetAudioPlaybackMode(ULWord boardNumber); + +ULWord GetNumFrameBuffers(ULWord boardNumber, ULWord boardID); + +void OemAutoCirculateSetupNTV2Routing(ULWord boardNumber, NTV2RoutingTable* pNTV2RoutingTable); + +void oemAutoCirculateWriteHDMIAux(ULWord deviceNumber, ULWord* pAuxData, ULWord auxDataSize); + +NTV2VideoFormat GetNTV2VideoFormat(UByte status, UByte frameRateHiBit); + +ULWord DownloadLinearLUTToHW (ULWord boardNumber, NTV2Channel channel, int bank); + +ULWord64 GetAudioClock(ULWord boardNumber); + +void CopyFrameStampOldToNew(const FRAME_STAMP_STRUCT * pInOldStruct, FRAME_STAMP * pOutNewStruct); + +int AutoCirculateFrameStampImmediate(ULWord deviceNumber, FRAME_STAMP * pInOutFrameStamp, NTV2_RP188 * pOutTimecodeArray); + +bool oemAutoCirculateCanDoFieldMode(ULWord deviceNumber, NTV2Crosspoint channelSpec); + +#endif // NTV2DRIVERAUTOCIRCULATE_H diff --git a/build_dependencies/aja/include/ajadriver/linux/ntv2driverbigphysarea.h b/build_dependencies/aja/include/ajadriver/linux/ntv2driverbigphysarea.h new file mode 100644 index 0000000..a6bf26d --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/linux/ntv2driverbigphysarea.h @@ -0,0 +1,24 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +/////////////////////////////////////////////////////////////// +// +// NTV2 Linux v2.6 Device Driver for AJA boards. +// +//////////////////////////////////////////////////////////// +// +// Filename: ntv2driverbigphysarea.h +// Purpose: Header file to enable support for optional BIGPHYSAREA kernel patch. +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2DRIVERBIGPHYSAREA_HEADER +#define NTV2DRIVERBIGPHYSAREA_HEADER + +// Define this only if you've installed the bigphysarea patch +// If not, comment out only this single line: +//#define USE_BIGPHYSAREA + +#endif + diff --git a/build_dependencies/aja/include/ajadriver/linux/ntv2driverdbgmsgctl.h b/build_dependencies/aja/include/ajadriver/linux/ntv2driverdbgmsgctl.h new file mode 100644 index 0000000..8ebc4f6 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/linux/ntv2driverdbgmsgctl.h @@ -0,0 +1,27 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +/////////////////////////////////////////////////////////////// +// +// NTV2 Linux v2.6 Device Driver for AJA boards. +// +//////////////////////////////////////////////////////////// +// +// Filename: ntv2driverdbgmsgctl.c +// Purpose: Header file for dynamic debug message control +// Notes: +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2DRIVERDEBUGMSGCTL_H +#define NTV2DRIVERDEBUGMSGCTL_H + +bool MsgsEnabled(NTV2_DriverDebugMessageSet msgSet); + +int ControlDebugMessages( NTV2_DriverDebugMessageSet msgSet, + bool enable); + +void ShowDebugMessageControl(NTV2_DriverDebugMessageSet msgSet); +#endif + diff --git a/build_dependencies/aja/include/ajadriver/linux/ntv2driverstatus.h b/build_dependencies/aja/include/ajadriver/linux/ntv2driverstatus.h new file mode 100644 index 0000000..da28a6f --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/linux/ntv2driverstatus.h @@ -0,0 +1,29 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +/////////////////////////////////////////////////////////////// +// +// NTV2 Linux v2.6 Device Driver for AJA devices. +// +//////////////////////////////////////////////////////////// +// +// Filename: ntv2driverstatus.h +// Purpose: Header file for getting versions +// Notes: Origin: ntv2status.cpp. Doesn't have all functions +// from that file. +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2DRIVERSTATUS_HEADER +#define NTV2DRIVERSTATUS_HEADER + +void getDeviceVersionString(ULWord deviceNumber, char *deviceVersionString, ULWord strMax); +void getPCIFPGAVersionString(ULWord deviceNumber, char *pcifpgaVersionString, ULWord strMax); +NTV2DeviceID getDeviceID(ULWord deviceNumber); +void getDeviceIDString(ULWord deviceNumber, char *deviceIDString, ULWord strMax); +void getDriverVersionString(char *driverVersionString, ULWord strMax); +void getDeviceSerialNumberString(ULWord deviceNumber, char *deviceIDString, ULWord strMax); + +#endif + diff --git a/build_dependencies/aja/include/ajadriver/linux/ntv2drivertask.h b/build_dependencies/aja/include/ajadriver/linux/ntv2drivertask.h new file mode 100644 index 0000000..54c06fd --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/linux/ntv2drivertask.h @@ -0,0 +1,28 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +/////////////////////////////////////////////////////////////// +// +// NTV2 Linux v2.6 Device Driver for AJA OEM boards. +// +//////////////////////////////////////////////////////////// +// +// Filename: ntv2drivertask.h +// Purpose: Header file for autocirculate methods. +// Notes: +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2DRIVERTASK_H +#define NTV2DRIVERTASK_H + + +bool InitTaskArray(AutoCircGenericTask* pTaskArray, ULWord numTasks); + +ULWord CopyTaskArray(AutoCircGenericTask* pDstArray, ULWord dstSize, ULWord dstMax, + const AutoCircGenericTask* pSrcArray, ULWord srcSize, ULWord srcNum); + +//bool DoTaskArray(INTERNAL_AUTOCIRCULATE_STRUCT* pAuto, AutoCircGenericTask* pTaskArray, ULWord numTasks); + +#endif // NTV2DRIVERTASK_H diff --git a/build_dependencies/aja/include/ajadriver/linux/ntv2kona2.h b/build_dependencies/aja/include/ajadriver/linux/ntv2kona2.h new file mode 100644 index 0000000..efe591c --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/linux/ntv2kona2.h @@ -0,0 +1,31 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +/////////////////////////////////////////////////////////////// +// +// NTV2 Linux v2.6 Device Driver for AJA devices. +// +//////////////////////////////////////////////////////////// +// +// Filename: ntv2kona2.h +// Purpose: Header Kona2 specific functions. +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2KONA2_HEADER +#define NTV2KONA2_HEADER + +#include "../ntv2system.h" + +bool GetConverterOutFormat(ULWord deviceNumber, NTV2VideoFormat* format); +NTV2VideoFormat GetDeviceVideoFormat(ULWord deviceNumber, NTV2Channel channel); + +uint32_t ntv2ReadRegCon32(Ntv2SystemContext* context, uint32_t regNum); +bool ntv2ReadRegMSCon32(Ntv2SystemContext* context, uint32_t regNum, uint32_t* regValue, RegisterMask mask, RegisterShift shift); +bool ntv2WriteRegCon32(Ntv2SystemContext* context, uint32_t regNum, uint32_t regValue); +bool ntv2WriteRegMSCon32(Ntv2SystemContext* context, uint32_t regNum, uint32_t regValue, RegisterMask mask, RegisterShift shift); +uint32_t ntv2ReadVirtRegCon32(Ntv2SystemContext* context, uint32_t regNum); +bool ntv2WriteVirtRegCon32(Ntv2SystemContext* context, uint32_t regNum, uint32_t data); + +#endif diff --git a/build_dependencies/aja/include/ajadriver/linux/ntv2serial.h b/build_dependencies/aja/include/ajadriver/linux/ntv2serial.h new file mode 100644 index 0000000..2d0dead --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/linux/ntv2serial.h @@ -0,0 +1,53 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +/////////////////////////////////////////////////////////////// +// +// NTV2 Linux v2.6 Device Driver for AJA devices. +// +//////////////////////////////////////////////////////////// +// +// Filename: ntv2serial.h +// Purpose: Serial port control header. +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2SERIAL_HEADER +#define NTV2SERIAL_HEADER + +#include "ntv2system.h" + +#define NTV2_TTY_NAME "ttyNTV" + +struct ntv2_serial { + int index; + char name[80]; + Ntv2SystemContext* system_context; + Ntv2Register uart_reg; + Ntv2Register route_reg; + u32 route_mask; + + bool uart_enable; + spinlock_t state_lock; + + struct uart_port uart_port; + bool busy; +}; + +struct ntv2_serial *ntv2_serial_open(Ntv2SystemContext* sys_con, + const char *name, int index); +void ntv2_serial_close(struct ntv2_serial *ntv2_ser); + +int ntv2_serial_configure(struct ntv2_serial *ntv2_ser, + Ntv2Register uart_reg, + Ntv2Register route_reg, + u32 route_mask); + +int ntv2_serial_enable(struct ntv2_serial *ntv2_ser); +int ntv2_serial_disable(struct ntv2_serial *ntv2_ser); +bool ntv2_serial_active(struct ntv2_serial *ntv2_ser); + +int ntv2_serial_interrupt(struct ntv2_serial *ntv2_ser); + +#endif diff --git a/build_dependencies/aja/include/ajadriver/linux/registerio.h b/build_dependencies/aja/include/ajadriver/linux/registerio.h new file mode 100644 index 0000000..9552597 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/linux/registerio.h @@ -0,0 +1,889 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +/////////////////////////////////////////////////////////////// +// +// NTV2 Linux v2.6 Device Driver for AJA devices. +// +//////////////////////////////////////////////////////////// +// +// Filename: registerio.h +// Purpose: Read/write real and virtual registers header file +// Notes: +// +/////////////////////////////////////////////////////////////// + +#ifndef REGISTERIO_H +#define REGISTERIO_H + +#include + +//As of 2.6.26 semaphore is in include/linux +#include +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25)) +# include +#else +# include +#endif + +// Some kernel version sensitive macro-rama +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +#define NTV2_LINUX_IRQ_SHARED_FLAG IRQF_SHARED +#define NTV2_LINUX_IRQ_SAMPLE_RANDOM_FLAG IRQF_SAMPLE_RANDOM +#else +#define NTV2_LINUX_IRQ_SHARED_FLAG SA_SHIRQ +#define NTV2_LINUX_IRQ_SAMPLE_RANDOM_FLAG SA_SAMPLE_RANDOM +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18) +#define NTV2_LINUX_PCI_REG_DRIVER_FUNC(x) pci_register_driver(x) +#else +#define NTV2_LINUX_PCI_REG_DRIVER_FUNC(x) pci_module_init(x) +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) +# define NTV2_LINUX_SG_INIT_TABLE_FUNC(x,y) sg_init_table((x),(y)) +#else +# define NTV2_LINUX_SG_INIT_TABLE_FUNC(x,y) memset((x),0,sizeof(struct scatterlist) * (y)); +#endif + +#include "ntv2driverautocirculate.h" +#include "../ntv2hdmiin.h" +#include "../ntv2hdmiin4.h" +#include "../ntv2kona.h" +#include "../ntv2setup.h" + +// clean old stuff +#define FGVCROSSPOINTMASK (BIT_0+BIT_1+BIT_2+BIT_3) +#define FGVCROSSPOINTSHIFT (0) +#define BGVCROSSPOINTMASK (BIT_4+BIT_5+BIT_6+BIT_7) +#define BGVCROSSPOINTSHIFT (4) +#define FGKCROSSPOINTMASK (BIT_8+BIT_9+BIT_10+BIT_11) +#define FGKCROSSPOINTSHIFT (8) +#define BGKCROSSPOINTMASK (BIT_12+BIT_13+BIT_14+BIT_15) +#define BGKCROSSPOINTSHIFT (12) + +#define VIDPROCMUX1MASK (BIT_0+BIT_1) +#define VIDPROCMUX1SHIFT (0) +#define VIDPROCMUX2MASK (BIT_2+BIT_3) +#define VIDPROCMUX2SHIFT (2) +#define VIDPROCMUX3MASK (BIT_4+BIT_5) +#define VIDPROCMUX3SHIFT (4) +#define VIDPROCMUX4MASK (BIT_6+BIT_7) +#define VIDPROCMUX4SHIFT (6) +#define VIDPROCMUX5MASK (BIT_8+BIT_9) +#define VIDPROCMUX5SHIFT (8) + +// Comment out SOFTWARE_UART_FIFO define to turn off software FIFO completely. +//# define SOFTWARE_UART_FIFO +# ifdef SOFTWARE_UART_FIFO +// Comment out either UARTRXFIFOSIZE or UARTTXFIFOSIZE to disable +// Rx or Tx software FIFO. +# define UARTRXFIFOSIZE 20 +# define UARTTXFIFOSIZE 20 +# endif // SOFTWARE_UART_FIFO + +//#define FPGA_REQ_FOR_DMA (eFPGAVideoProc) +//#define NTV2_MAX_FPGA (eFPGAVideoProc) + +#define NTV2_MAX_HDMI_MONITOR 4 + +// Singleton module params +typedef struct ntv2_module_private +{ + int NTV2Major; + UWord numNTV2Devices; + char * name; + char * driverName; + ULWord intrBitLut[eNumInterruptTypes]; + struct class *class; + + // uart driver + struct uart_driver *uart_driver; + u32 uart_max; + atomic_t uart_index; + +} NTV2ModulePrivateParams; + +typedef enum +{ + eIrqFpga = 0, + eNumNTV2IRQDevices +} ntv2_irq_device_t; + +// Define interrupt control, dma, and flash register bits +enum +{ + kIntOutputVBLEnable = BIT (0), + kIntInput1VBLEnable = BIT (1), + kIntInput2VBLEnable = BIT (2), + kIntAudioWrapEnable = BIT (3), + kIntAudioOutWrapEnable = BIT (4), + kIntAudioInWrapEnable = BIT (5), + kIntAuxVerticalEnable = BIT (11), + + // Status register + kIntOutput1VBLActive = BIT (31), + kIntOutput1VBLClear = BIT (31), + + kIntInput1VBLActive = BIT (30), + kintInput1VBLClear = BIT (30), + + kIntInput2VBLActive = BIT (29), + kIntInput2VBLClear = BIT (29), + + kIntAudioWrapActive = BIT (28), + kIntAudioWrapClear = BIT (28), + + kIntAudioOutWrapActive = BIT (27), + kIntAudioOutWrapClear = BIT (27), + + kIntUartTx2Active = BIT (26), + kIntUartTx2Clear = BIT (26), + + kIntOutput2VBLActive = BIT (8), + kIntOutput2VBLClear = BIT (23), + + kIntOutput3VBLActive = BIT (7), + kIntOutput3VBLClear = BIT (22), + + kIntOutput4VBLActive = BIT (6), + kIntOutput4VBL = BIT (21), + + kIntAuxVerticalActive = BIT (12), + kIntAuxVerticalClear = BIT (12), + + kIntI2C2Active = BIT (13), + kIntI2C2Clear = BIT (13), + + kIntI2C1Active = BIT (14), + kIntI2C1Clear = BIT (14), + + // Status register 2 + kIntInput3VBLActive = BIT (30), + kIntInput3VBLClear = BIT (30), + + kIntInput4VBLActive = BIT (29), + kIntInput4VBLClear = BIT (29), + + kIntInput5VBLActive = BIT (28), + kIntInput5VBLClear = BIT (28), + + kIntInput6VBLActive = BIT (27), + kIntInput6VBLClear = BIT (27), + + kIntInput7VBLActive = BIT (26), + kIntInput7VBLClear = BIT (26), + + kIntInput8VBLActive = BIT (25), + kIntInput8VBLClear = BIT (25), + + kIntOutput5VBLActive = BIT (31), + kIntOutput5VBLClear = BIT (19), + + kIntOutput6VBLActive = BIT (24), + kIntOutput6VBLClear = BIT (18), + + kIntOutput7VBLActive = BIT (23), + kIntOutput7VBLClear = BIT (17), + + kIntOutput8VBLActive = BIT (22), + kIntOutput8VBLClear = BIT (16), + + kIntDma1Enable = BIT (0), + kIntDma2Enable = BIT (1), + kIntDma3Enable = BIT (2), + kIntDma4Enable = BIT (3), + kIntBusErrEnable = BIT (4), + kIntDmaEnableMask = BIT (0) + BIT (1) + BIT (2) + BIT (3) + BIT (4), + + kIntValidation = BIT (26), + + kIntDMA1 = BIT (27), + kIntDMA2 = BIT (28), + kIntDMA3 = BIT (29), + kIntDMA4 = BIT (30), + kIntBusErr = BIT (31), + kIntDmaMask = BIT (27) + BIT (28) + BIT (29) + BIT (30) + BIT (31), + + kIntPBChange = BIT (0), + kIntLowPower = BIT (1), + kIntDisplayFifo = BIT (2), + kIntSATAChange = BIT (3), // CF Presence Detect Change in Bones product .... + kIntTemp1High = BIT (4), + kIntTemp2High = BIT (5), + kIntPowerButtonChange = BIT (6), + kIntCPLDMask = BIT (0) + BIT (1) + BIT (2) + BIT (3) + BIT (4) + BIT(5) + BIT(6), + + kDma1Go = BIT (0), + kDma2Go = BIT (1), + kDma3Go = BIT (2), + kDma4Go = BIT (3), + + kRegDMAToHostBit = BIT (31), + kRegDMAAudioModeBit = BIT (30), + + kRegFlashResetBit = BIT (10), + kRegFlashDoneBit = BIT (9), + kRegFlashPgmRdyBit = BIT (8), + kRegFlashDataMask = BIT (7) + BIT (6) + BIT (5) + BIT (4) + BIT (3) + BIT (2) + BIT (1) + BIT (0) +}; + +// The ntv2_irq_device_t enums must match up with the array of function +// pointers below. + +// Params that are per-device +typedef struct ntv2_private +{ + struct pci_dev *pci_dev; + ULWord deviceNumber; + ULWord busNumber; + ULWord pci_device; + char name[16]; + struct cdev cdev; + + // Base Address Values + unsigned long _unmappedBAR0Address; + unsigned long _mappedBAR0Address; + ULWord _BAR0MemorySize; + + unsigned long _unmappedBAR1Address; + unsigned long _mappedBAR1Address; + ULWord _BAR1MemorySize; + + unsigned long _unmappedBAR2Address; + unsigned long _mappedBAR2Address; + ULWord _BAR2MemorySize; + + // Holds the number of hardware registers this device supports + // Obtained from ntv2devicefeatures.cpp + ULWord _numberOfHWRegisters; + + // Reserved HighMem DMA Buffer if needed. + // used when setting boot option mem = totalmem-16Megs for SD or 64 Megs for HD. + // this is NumDmaDriverBuffers frames worth. + + // These are the video registers + unsigned long _VideoAddress; + ULWord _VideoMemorySize; + + // The NWL dma registers actually live in BAR0, but usually BAR0 is used to map + // the video control registers, so use a different set of variables for NWL to avoid confusion. + unsigned long _NwlAddress; + ULWord _NwlMemorySize; + + // The Xlnx dma registers live in 64K BAR1. + unsigned long _XlnxAddress; + ULWord _XlnxMemorySize; + + // The bigphysarea kernel patch returns a virtual address to contiguous LowMem + unsigned long _dmaBuffer; + + caddr_t _virtBuffer; + ULWord _bigphysBufferSize; // # of bytes allocated. + + // Pointers to Channel 1 and Channel 2 Frame Buffers + // This pointer along with the value of _pCh1Control or _pCh1Control + // register to address a given frame in the frame buffer. +// unsigned long* _Ch1BaseAddress; +// unsigned long* _Ch2BaseAddress; + + // Registers - See hdntv.pdf or Ntv2.pdf for details. + + unsigned long _pGlobalControl; + unsigned long _pGlobalControl2; + + // clean old stuff + unsigned long _pVideoProcessingControl; + unsigned long _pVideoProcessingCrossPointControl; + + // interrupt + unsigned long _pInterruptControl; + unsigned long _pInterruptControl2; + + unsigned long _pStatus; + unsigned long _pStatus2; + + // audio control + unsigned long _pAudioControl; + unsigned long _pAudioSource; + unsigned long _pAudioLastOut; + unsigned long _pAudioLastIn; + + unsigned long _pAudio2Control; + unsigned long _pAudio2Source; + unsigned long _pAudio2LastOut; + unsigned long _pAudio2LastIn; + + unsigned long _pAudio3Control; + unsigned long _pAudio3Source; + unsigned long _pAudio3LastOut; + unsigned long _pAudio3LastIn; + + unsigned long _pAudio4Control; + unsigned long _pAudio4Source; + unsigned long _pAudio4LastOut; + unsigned long _pAudio4LastIn; + + unsigned long _pAudio5Control; + unsigned long _pAudio5Source; + unsigned long _pAudio5LastOut; + unsigned long _pAudio5LastIn; + + unsigned long _pAudio6Control; + unsigned long _pAudio6Source; + unsigned long _pAudio6LastOut; + unsigned long _pAudio6LastIn; + + unsigned long _pAudio7Control; + unsigned long _pAudio7Source; + unsigned long _pAudio7LastOut; + unsigned long _pAudio7LastIn; + + unsigned long _pAudio8Control; + unsigned long _pAudio8Source; + unsigned long _pAudio8LastOut; + unsigned long _pAudio8LastIn; + + unsigned long _pAudioSampleCounter; + + // aja dma registers + unsigned long _pDMA1HostAddress; + unsigned long _pDMA1LocalAddress; + unsigned long _pDMA1TransferCount; + unsigned long _pDMA1NextDescriptor; + unsigned long _pDMA2HostAddress; + unsigned long _pDMA2LocalAddress; + unsigned long _pDMA2TransferCount; + unsigned long _pDMA2NextDescriptor; + unsigned long _pDMA3HostAddress; + unsigned long _pDMA3LocalAddress; + unsigned long _pDMA3TransferCount; + unsigned long _pDMA3NextDescriptor; + unsigned long _pDMA4HostAddress; + unsigned long _pDMA4LocalAddress; + unsigned long _pDMA4TransferCount; + unsigned long _pDMA4NextDescriptor; + + unsigned long _pDMA1HostAddressHigh; + unsigned long _pDMA1NextDescriptorHigh; + unsigned long _pDMA2HostAddressHigh; + unsigned long _pDMA2NextDescriptorHigh; + unsigned long _pDMA3HostAddressHigh; + unsigned long _pDMA3NextDescriptorHigh; + unsigned long _pDMA4HostAddressHigh; + unsigned long _pDMA4NextDescriptorHigh; + + unsigned long _pDMAControlStatus; + unsigned long _pDMAInterruptControl; + + bool _bMultiChannel; + + unsigned long _pDeviceID; // device ID register + +# ifdef SOFTWARE_UART_FIFO +# ifdef UARTTXFIFOSIZE + unsigned long _pUARTTransmitData; +# endif +# ifdef UARTRXFIFOSIZE + unsigned long _pUARTReceiveData; +# endif + unsigned long _pUARTControl; + +# ifdef UARTTXFIFOSIZE + unsigned long _pUARTTransmitData2; +# endif +# ifdef UARTRXFIFOSIZE + unsigned long _pUARTReceiveData2; +# endif + unsigned long _pUARTControl2; +# endif // SOFTWARE_UART_FIFO + NTV2DeviceID _DeviceID; // device ID value + + wait_queue_head_t _interruptWait[eNumInterruptTypes]; + + ULWord64 _interruptCount[eNumInterruptTypes]; + unsigned long _interruptHappened[eNumInterruptTypes]; + + struct semaphore _I2CMutex; + + // dma engines + NTV2DmaMethod _dmaMethod; + DMA_ENGINE _dmaEngine[DMA_NUM_ENGINES]; + ULWord _dmaNumEngines; + struct semaphore _dmaSerialSemaphore; + int _numXlnxH2CEngines; + int _numXlnxC2HEngines; + + // Autocirculate stuff. + + INTERNAL_AUTOCIRCULATE_STRUCT _AutoCirculate[NUM_CIRCULATORS]; + NTV2Crosspoint _LkUpAcChanSpecGivenEngine[NUM_CIRCULATORS]; + + //audio clock! + ULWord _ulNumberOfWrapsOfClockSampleCounter;//The software sample counter is 64 bit... + // So this keeps track of the number of wraps + // around of the 32-bit HW counter. + ULWord _ulLastClockSampleCounter; //value the register had last time it was read; + + spinlock_t _registerSpinLock; + spinlock_t _autoCirculateLock; + spinlock_t _virtualRegisterLock; + spinlock_t _nwlRegisterLock[NUM_NWL_REGS]; + spinlock_t _p2pInterruptControlRegisterLock; + spinlock_t _audioClockLock; + spinlock_t _bankAndRegisterAccessLock; + struct semaphore _mailBoxSemaphore; + + NTV2_GlobalAudioPlaybackMode _globalAudioPlaybackMode; + + ULWord _videoBitfileProgramming; + bool _startAudioNextFrame; + + bool _bitFileInfoSet[eFPGA_NUM_FPGAs]; + BITFILE_INFO_STRUCT bitFileInfo[eFPGA_NUM_FPGAs]; + + VirtualProcAmpRegisters _virtualProcAmpRegisters; + HardwareProcAmpRegisterImage _hwProcAmpRegisterImage; + +# ifdef SOFTWARE_UART_FIFO +# ifdef UARTRXFIFOSIZE + spinlock_t uartRxFifoLock; + UByte uartRxFifo[UARTRXFIFOSIZE]; + ULWord uartRxFifoSize; + bool uartRxFifoOverrun; + + spinlock_t uartRxFifoLock2; + UByte uartRxFifo2[UARTRXFIFOSIZE]; + ULWord uartRxFifoSize2; + bool uartRxFifoOverrun2; +# endif + +# ifdef UARTTXFIFOSIZE + spinlock_t uartTxFifoLock; + UByte uartTxFifo[UARTTXFIFOSIZE]; + ULWord uartTxFifoSize; + + spinlock_t uartTxFifoLock2; + UByte uartTxFifo2[UARTTXFIFOSIZE]; + ULWord uartTxFifoSize2; +# endif +# endif // SOFTWARE_UART_FIFO + + + unsigned int _ntv2IRQ[eNumNTV2IRQDevices]; + + ULWord _audioSyncTolerance; + ULWord _dmaSerialize; + ULWord _syncChannels; + + NTV2Crosspoint _syncChannel1; + NTV2Crosspoint _syncChannel2; + + // Virtual registers + ULWord _virtualRegisterMem[MAX_NUM_VIRTUAL_REGISTERS]; + + // + // Control panel additions + // + ULWord _ApplicationPID; // 10184 + ULWord _ApplicationCode; // 10185 + + ULWord _ApplicationReferenceCount; // 10326 and 10327 + + ULWord _VirtualMailBoxTimeoutNS; // 10478 // Units are 100 ns, not nanoseconds! + + // P2P - Peer to peer messaging + unsigned long _pMessageChannel1; // control register kerenel address + unsigned long _pMessageChannel2; + unsigned long _pMessageChannel3; + unsigned long _pMessageChannel4; + unsigned long _pMessageChannel5; + unsigned long _pMessageChannel6; + unsigned long _pMessageChannel7; + unsigned long _pMessageChannel8; + + unsigned long _pPhysicalMessageChannel1; // control registere bus address + unsigned long _pPhysicalMessageChannel2; + unsigned long _pPhysicalMessageChannel3; + unsigned long _pPhysicalMessageChannel4; + unsigned long _pPhysicalMessageChannel5; + unsigned long _pPhysicalMessageChannel6; + unsigned long _pPhysicalMessageChannel7; + unsigned long _pPhysicalMessageChannel8; + + unsigned long _pMessageInterruptStatus; // kerenel address + unsigned long _pMessageInterruptControl; + + unsigned long _pPhysicalOutputChannel1; // bus address + unsigned long _pPhysicalOutputChannel2; + unsigned long _pPhysicalOutputChannel3; + unsigned long _pPhysicalOutputChannel4; + unsigned long _pPhysicalOutputChannel5; + unsigned long _pPhysicalOutputChannel6; + unsigned long _pPhysicalOutputChannel7; + unsigned long _pPhysicalOutputChannel8; + + unsigned long _FrameAperturePhysicalAddress; // bus + unsigned long _FrameApertureBaseAddress; // kernel + ULWord _FrameApertureBaseSize; + unsigned long _pFrameApertureOffset; + + ULWord _PCIDeviceControlOffset; + + Ntv2SystemContext systemContext; +// struct ntv2_genlock *m_pGenlockMonitor; + struct ntv2_hdmiin *m_pHDMIInputMonitor[NTV2_MAX_HDMI_MONITOR]; + struct ntv2_hdmiin4 *m_pHDMIIn4Monitor[NTV2_MAX_HDMI_MONITOR]; + struct ntv2_hdmiout4 *m_pHDMIOut4Monitor[NTV2_MAX_HDMI_MONITOR]; + struct ntv2_serial *m_pSerialPort; + struct ntv2_mcap *m_pBitstream; + struct ntv2_setup *m_pSetupMonitor; + + bool registerEnable; + bool serialActive; + +#if defined(AJA_HEVC) + unsigned long _hevcDevNum; +#endif + + ULWord _AncF2StartMemory[NTV2_MAX_NUM_CHANNELS]; + ULWord _AncF2StopMemory[NTV2_MAX_NUM_CHANNELS]; + ULWord _AncF2Size[NTV2_MAX_NUM_CHANNELS]; +} NTV2PrivateParams; + +NTV2ModulePrivateParams * getNTV2ModuleParams(void); +NTV2PrivateParams * getNTV2Params(unsigned int deviceNumber); + +// Null mask and null shift for ReadRegister and WriteRegister +// +#define NO_MASK (0xFFFFFFFF) +#define NO_SHIFT (0) + +#define NTV2REGWRITEMODEMASK (BIT_20+BIT_21) +#define NTV2REGWRITEMODESHIFT (20) +#define NTV2LEDSTATEMASK (BIT_16+BIT_17+BIT_18+BIT_19) +#define NTV2LEDSTATESHIFT (16) + +// Billions and billions of prototypes for reading and writing registers +// +ULWord READ_REGISTER_ULWord( unsigned long address); +ULWord READ_REGISTER_UWord( unsigned long address); +ULWord READ_REGISTER_UByte( unsigned long address); + +void WRITE_REGISTER_ULWord( unsigned long address, ULWord regValue); +void WRITE_REGISTER_UWord( unsigned long address, ULWord regValue); +void WRITE_REGISTER_UByte( unsigned long address, ULWord regValue); + +void GetActiveFrameBufferSize(ULWord deviceNumber,NTV2FrameDimensions * frameBufferSize); + +// Write a single register with mask and shift +void WriteRegister( ULWord deviceNumber, + ULWord registerNumber, + ULWord registerValue, + ULWord registerMask, + ULWord registerShift); + +// Write a group of registers as a block +void WriteRegisterBufferULWord( ULWord deviceNumber, + ULWord registerNumber, + ULWord* sourceData, + ULWord sourceDataSizeULWords); + +ULWord ReadRegister(ULWord deviceNumber,ULWord registerNumber, ULWord registerMask, ULWord registerShift); + +// old stuff +void WriteVideoProcessingControl(ULWord deviceNumber,ULWord value); +ULWord ReadVideoProcessingControl(ULWord deviceNumber); +void WriteVideoProcessingControlCrosspoint(ULWord deviceNumber,ULWord value); +ULWord ReadVideoProcessingControlCrosspoint(ULWord deviceNumber); + +void SetBackgroundKeyCrosspoint(ULWord deviceNumber, NTV2Crosspoint crosspoint); +void SetBackgroundVideoCrosspoint(ULWord deviceNumber, NTV2Crosspoint crosspoint); +void SetForegroundKeyCrosspoint(ULWord deviceNumber, NTV2Crosspoint crosspoint); +void SetForegroundVideoCrosspoint(ULWord deviceNumber, NTV2Crosspoint crosspoint); + +void WriteInterruptRegister(ULWord deviceNumber ,ULWord value); +ULWord ReadInterruptRegister(ULWord deviceNumber); +ULWord ReadStatusRegister(ULWord deviceNumber); + +void WriteInterrupt2Register(ULWord deviceNumber ,ULWord value); +ULWord ReadInterrupt2Register(ULWord deviceNumber); +ULWord ReadStatus2Register(ULWord deviceNumber); + +void SetRegisterWriteMode(ULWord deviceNumber, NTV2Channel channel, NTV2RegisterWriteMode value); +NTV2RegisterWriteMode GetRegisterWriteMode(ULWord deviceNumber, NTV2Channel channel); + +void SetLEDState(ULWord deviceNumber,ULWord value); +ULWord GetLEDState(ULWord deviceNumber); + +void SetSingleLED(ULWord deviceNumber,ULWord bitNum); +void ClearSingleLED(ULWord deviceNumber,ULWord bitNum); + +// audio out last +ULWord ReadAudioLastOut(ULWord deviceNumber); +ULWord ReadAudioLastOut2(ULWord deviceNumber); +ULWord ReadAudioLastOut3(ULWord deviceNumber); +ULWord ReadAudioLastOut4(ULWord deviceNumber); +ULWord ReadAudioLastOut5(ULWord deviceNumber); +ULWord ReadAudioLastOut6(ULWord deviceNumber); +ULWord ReadAudioLastOut7(ULWord deviceNumber); +ULWord ReadAudioLastOut8(ULWord deviceNumber); + +// audio in last +ULWord ReadAudioLastIn(ULWord deviceNumber); +ULWord ReadAudioLastIn2(ULWord deviceNumber); +ULWord ReadAudioLastIn3(ULWord deviceNumber); +ULWord ReadAudioLastIn4(ULWord deviceNumber); +ULWord ReadAudioLastIn5(ULWord deviceNumber); +ULWord ReadAudioLastIn6(ULWord deviceNumber); +ULWord ReadAudioLastIn7(ULWord deviceNumber); +ULWord ReadAudioLastIn8(ULWord deviceNumber); + +ULWord ReadAudioSampleCounter(ULWord deviceNumber); + +void AvInterruptControl(ULWord deviceNumber, + INTERRUPT_ENUMS eInterruptType, // Which interrupt + ULWord enable); // 0: disable, nonzero: enable + +void ClearInput1VerticalInterrupt(ULWord deviceNumber); +void ClearInput2VerticalInterrupt(ULWord deviceNumber); +void ClearInput3VerticalInterrupt(ULWord deviceNumber); +void ClearInput4VerticalInterrupt(ULWord deviceNumber); +void ClearInput5VerticalInterrupt(ULWord deviceNumber); +void ClearInput6VerticalInterrupt(ULWord deviceNumber); +void ClearInput7VerticalInterrupt(ULWord deviceNumber); +void ClearInput8VerticalInterrupt(ULWord deviceNumber); + +void ClearOutputVerticalInterrupt(ULWord deviceNumber); +void ClearOutput2VerticalInterrupt(ULWord deviceNumber); +void ClearOutput3VerticalInterrupt(ULWord deviceNumber); +void ClearOutput4VerticalInterrupt(ULWord deviceNumber); +void ClearOutput5VerticalInterrupt(ULWord deviceNumber); +void ClearOutput6VerticalInterrupt(ULWord deviceNumber); +void ClearOutput7VerticalInterrupt(ULWord deviceNumber); +void ClearOutput8VerticalInterrupt(ULWord deviceNumber); + +void ClearAudioInterrupt(ULWord deviceNumber); + +void ClearUartRxInterrupt(ULWord deviceNumber); + +void ClearUartTxInterrupt(ULWord deviceNumber); +void ClearUartTxInterrupt2(ULWord deviceNumber); + +ULWord ReadDeviceIDRegister(ULWord deviceNumber); + +////////////////////////////////////////////////////////////////// +// Aja methods +// +ULWord ReadDMARegister(ULWord deviceNumber, ULWord regNum); +void WriteDMARegister(ULWord deviceNumber, ULWord regNum, ULWord value); +bool ConfigureDMAChannels(ULWord deviceNumber); +void WriteDMAHostAddressLow(ULWord deviceNumber, ULWord index, ULWord value); +void WriteDMAHostAddressHigh(ULWord deviceNumber, ULWord index, ULWord value); +void WriteDMALocalAddress(ULWord deviceNumber, ULWord index, ULWord value); +void WriteDMATransferCount(ULWord deviceNumber, ULWord index, ULWord value); +void WriteDMANextDescriptorLow(ULWord deviceNumber, ULWord index, ULWord value); +void WriteDMANextDescriptorHigh(ULWord deviceNumber, ULWord index, ULWord value); +ULWord ReadDMAControlStatus(ULWord deviceNumber); +void WriteDMAControlStatus(ULWord deviceNumber,ULWord value); +void SetDMAEngineStatus(ULWord deviceNumber, int index, bool enable); +int GetDMAEngineStatus(ULWord deviceNumber, int index); +ULWord ReadDMAInterruptControl(ULWord deviceNumber); +void WriteDMAInterruptControl(ULWord deviceNumber, ULWord value); +void EnableDMAInterrupt(ULWord deviceNumber, NTV2DMAInterruptMask interruptMask); +void DisableDMAInterrupt(ULWord deviceNumber, NTV2DMAInterruptMask interruptMask); +void ClearDMAInterrupt(ULWord deviceNumber, NTV2DMAStatusBits clearBit); +void ClearDMAInterrupts(ULWord deviceNumber); + +////////////////////////////////////////////////////////////////// +// Nwl methods +// +ULWord ReadNwlRegister(ULWord deviceNumber, ULWord regNum); +void WriteNwlRegister(ULWord deviceNumber, ULWord regNum, ULWord value); +bool ConfigureNwlChannels(ULWord deviceNumber); +bool IsNwlChannel(ULWord deviceNumber, bool bC2H, int index); +void WriteNwlCommonControlStatus(ULWord deviceNumber, ULWord value); +void WriteNwlControlStatus(ULWord deviceNumber, bool bC2H, ULWord index, ULWord value); +void WriteNwlChainStartAddressLow(ULWord deviceNumber, bool bC2H, ULWord index, ULWord value); +void WriteNwlChainStartAddressHigh(ULWord deviceNumber, bool bC2H, ULWord index, ULWord value); +ULWord ReadNwlCommonControlStatus(ULWord deviceNumber); +ULWord ReadNwlCapabilities(ULWord deviceNumber, bool bC2H, ULWord index); +ULWord ReadNwlControlStatus(ULWord deviceNumber, bool bC2H, ULWord index); +ULWord ReadNwlHardwareTime(ULWord deviceNumber, bool bC2H, ULWord index); +ULWord ReadNwlChainCompleteByteCount(ULWord deviceNumber, bool bC2H, ULWord index); +void ResetNwlHardware(ULWord deviceNumber, bool bC2H, ULWord index); +void EnableNwlUserInterrupt(ULWord deviceNumber); +void DisableNwlUserInterrupt(ULWord deviceNumber); +void EnableNwlDmaInterrupt(ULWord deviceNumber); +void DisableNwlDmaInterrupt(ULWord deviceNumber); +void ClearNwlUserInterrupt(ULWord deviceNumber); +void ClearNwlS2C0Interrupt(ULWord deviceNumber); +void ClearNwlC2S0Interrupt(ULWord deviceNumber); +void ClearNwlS2C1Interrupt(ULWord deviceNumber); +void ClearNwlC2S1Interrupt(ULWord deviceNumber); + +////////////////////////////////////////////////////////////////// +// Xlnx methods +// +ULWord ReadXlnxRegister(ULWord deviceNumber, ULWord regNum); +void WriteXlnxRegister(ULWord deviceNumber, ULWord regNum, ULWord value); +bool ConfigureXlnxChannels(ULWord deviceNumber); +bool IsXlnxChannel(ULWord deviceNumber, bool bC2H, int index); +ULWord XlnxChannelRegBase(ULWord deviceNumber, bool bC2H, int index); +ULWord XlnxSgdmaRegBase(ULWord deviceNumber, bool bC2H, int index); +ULWord XlnxConfigRegBase(ULWord deviceNumber); +ULWord XlnxIrqRegBase(ULWord deviceNumber); +ULWord XlnxIrqBitMask(ULWord deviceNumber, bool bC2H, int index); +void EnableXlnxUserInterrupt(ULWord deviceNumber, int index); +void DisableXlnxUserInterrupt(ULWord deviceNumber, int index); +ULWord ReadXlnxUserInterrupt(ULWord deviceNumber); +bool IsXlnxUserInterrupt(ULWord deviceNumber, int index, ULWord intReg); +void EnableXlnxDmaInterrupt(ULWord deviceNumber, bool bC2H, int index); +void DisableXlnxDmaInterrupt(ULWord deviceNumber, bool bC2H, int index); +void EnableXlnxDmaInterrupts(ULWord deviceNumber); +void DisableXlnxDmaInterrupts(ULWord deviceNumber); +void DisableXlnxInterrupts(ULWord deviceNumber); +ULWord ReadXlnxDmaInterrupt(ULWord deviceNumber); +bool IsXlnxDmaInterrupt(ULWord deviceNumber, bool bC2H, int index, ULWord intReg); +bool StartXlnxDma(ULWord deviceNumber, bool bC2H, int index); +bool StopXlnxDma(ULWord deviceNumber, bool bC2H, int index); +void StopAllXlnxDma(ULWord deviceNumber); +ULWord ReadXlnxDmaStatus(ULWord deviceNumber, bool bC2H, int index); +ULWord ClearXlnxDmaStatus(ULWord deviceNumber, bool bC2H, int index); +bool IsXlnxDmaActive(ULWord status); +bool IsXlnxDmaError(ULWord status); +bool WaitXlnxDmaActive(ULWord deviceNumber, bool bC2H, int index, bool active); +void WriteXlnxDmaEngineStartLow(ULWord deviceNumber, bool bC2H, int index, ULWord addressLow); +void WriteXlnxDmaEngineStartHigh(ULWord deviceNumber, bool bC2H, int index, ULWord addressHigh); +void WriteXlnxDmaEngineStartAdjacent(ULWord deviceNumber, bool bC2H, int index, ULWord adjacent); +ULWord ReadXlnxPerformanceCycleCount(ULWord deviceNumber, bool bC2H, int index); +ULWord ReadXlnxPerformanceDataCount(ULWord deviceNumber, bool bC2H, int index); +ULWord ReadXlnxMaxReadRequestSize(ULWord deviceNumber); + +////////////////////////////////////////////////////////////////// +// Interrupt methods +// +void EnableAllInterrupts(ULWord deviceNumber); +void DisableAllInterrupts(ULWord deviceNumber); + +void StopAllDMAEngines(ULWord deviceNumber); + +//////////////////////////////////////////////////////////////////////////////////////////// +// LTC methods (reuses RP188 structure) + +void SetLTCData (ULWord deviceNumber, NTV2Channel channel, RP188_STRUCT rp188Data); +void GetLTCData (ULWord deviceNumber, NTV2Channel channel, RP188_STRUCT* rp188Data); + +//////////////////////////////////////////////////////////////////////////////////////////// +// OEM RP188 methods + +void SetRP188Data (ULWord deviceNumber, NTV2Channel channel, RP188_STRUCT rp188Data); +void GetRP188Data (ULWord deviceNumber, NTV2Channel channel, RP188_STRUCT* rp188Data); + +//////////////////////////////////////////////////////////////////////////////////////////// +// OEM Custom Ancillary Data methods + +void SetCustomAncillaryDataMode(ULWord deviceNumber, NTV2Channel channel, bool bEnable); + +void SetCustomAncillaryData (ULWord deviceNumber, NTV2Channel channel, CUSTOM_ANC_STRUCT *customAncInfo); + +//////////////////////////////////////////////////////////////////////////////////////////// +// OEM UART methods +void Init422Uart(ULWord deviceNumber); +#ifdef SOFTWARE_UART_FIFO +#ifdef UARTRXFIFOSIZE +ULWord ReadUARTReceiveData(ULWord deviceNumber); +ULWord ReadUARTReceiveData2(ULWord deviceNumber); +#endif +#ifdef UARTTXFIFOSIZE +void WriteUARTTransmitData(ULWord deviceNumber,ULWord value); +void WriteUARTTransmitData2(ULWord deviceNumber,ULWord value); +#endif +ULWord ReadUARTControl(ULWord deviceNumber); +ULWord ReadUARTControl2(ULWord deviceNumber); +#endif // SOFTWARE_UART_FIFO + +////////////////////////////////////////////////////////////////// +// OEM Color Correction Methods +// +void SetColorCorrectionMode(ULWord deviceNumber, NTV2Channel channel, NTV2ColorCorrectionMode mode); +ULWord GetColorCorrectionMode(ULWord deviceNumber, NTV2Channel channel); +void SetColorCorrectionOutputBank (ULWord deviceNumber, NTV2Channel channel, ULWord bank); +ULWord GetColorCorrectionOutputBank (ULWord deviceNumber, NTV2Channel channel); +void SetColorCorrectionHostAccessBank (ULWord deviceNumber, NTV2ColorCorrectionHostAccessBank value); +NTV2ColorCorrectionHostAccessBank GetColorCorrectionHostAccessBank (ULWord deviceNumber, NTV2Channel channel); +void SetColorCorrectionSaturation (ULWord deviceNumber, NTV2Channel channel, ULWord value); +ULWord GetColorCorrectionSaturation (ULWord deviceNumber, NTV2Channel channel); + +////////////////////////////////////////////////////////////////// +// Utility methods +// +bool IsSaveRecallRegister(ULWord deviceNumber, ULWord regNum); +void GetDeviceSerialNumberWords(ULWord deviceNumber, ULWord *low, ULWord *high); +void itoa64(ULWord64 i, char *buffer); +inline void interruptHousekeeping(NTV2PrivateParams* pNTV2Params, INTERRUPT_ENUMS interrupt); +void InitDNXAddressLUT(unsigned long address); + +////////////////////////////////////////////////////////////////// +// P2P methods +// +ULWord ReadMessageChannel1(ULWord deviceNumber); +ULWord ReadMessageChannel2(ULWord deviceNumber); +ULWord ReadMessageChannel3(ULWord deviceNumber); +ULWord ReadMessageChannel4(ULWord deviceNumber); +ULWord ReadMessageChannel5(ULWord deviceNumber); +ULWord ReadMessageChannel6(ULWord deviceNumber); +ULWord ReadMessageChannel7(ULWord deviceNumber); +ULWord ReadMessageChannel8(ULWord deviceNumber); + +ULWord ReadMessageInterruptStatus(ULWord deviceNumber); +ULWord ReadMessageInterruptControl(ULWord deviceNumber); + +void EnableMessageChannel1Interrupt(ULWord deviceNumber); +void DisableMessageChannel1Interrupt(ULWord deviceNumber); +void ClearMessageChannel1Interrupt(ULWord deviceNumber); + +void EnableMessageChannel2Interrupt(ULWord deviceNumber); +void DisableMessageChannel2Interrupt(ULWord deviceNumber); +void ClearMessageChannel2Interrupt(ULWord deviceNumber); + +void EnableMessageChannel3Interrupt(ULWord deviceNumber); +void DisableMessageChannel3Interrupt(ULWord deviceNumber); +void ClearMessageChannel3Interrupt(ULWord deviceNumber); + +void EnableMessageChannel4Interrupt(ULWord deviceNumber); +void DisableMessageChannel4Interrupt(ULWord deviceNumber); +void ClearMessageChannel4Interrupt(ULWord deviceNumber); + +void EnableMessageChannel5Interrupt(ULWord deviceNumber); +void DisableMessageChannel5Interrupt(ULWord deviceNumber); +void ClearMessageChannel5Interrupt(ULWord deviceNumber); + +void EnableMessageChannel6Interrupt(ULWord deviceNumber); +void DisableMessageChannel6Interrupt(ULWord deviceNumber); +void ClearMessageChannel6Interrupt(ULWord deviceNumber); + +void EnableMessageChannel7Interrupt(ULWord deviceNumber); +void DisableMessageChannel7Interrupt(ULWord deviceNumber); +void ClearMessageChannel7Interrupt(ULWord deviceNumber); + +void EnableMessageChannel8Interrupt(ULWord deviceNumber); +void DisableMessageChannel8Interrupt(ULWord deviceNumber); +void ClearMessageChannel8Interrupt(ULWord deviceNumber); + +ULWord ReadFrameApertureOffset(ULWord deviceNumber); +void WriteFrameApertureOffset(ULWord deviceNumber, ULWord value); +void WriteFrameAperture(ULWord deviceNumber, ULWord offset, ULWord value); + +bool DeviceCanDoP2P(ULWord deviceNumber); + +void SetLUTEnable(ULWord deviceNumber, NTV2Channel channel, ULWord enable); +void SetLUTV2HostAccessBank(ULWord deviceNumber, NTV2ColorCorrectionHostAccessBank value); +void SetLUTV2OutputBank(ULWord deviceNumber, NTV2Channel channel, ULWord bank); +ULWord GetLUTV2OutputBank(ULWord deviceNumber, NTV2Channel channel); + +ULWord ntv2_getRoundedUpTimeoutJiffies(ULWord timeOutMs); + +#endif // !REGISTERIO_H diff --git a/build_dependencies/aja/include/ajadriver/ntv2anc.h b/build_dependencies/aja/include/ajadriver/ntv2anc.h new file mode 100644 index 0000000..3492a91 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2anc.h @@ -0,0 +1,78 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2anc.h +// Purpose: Common RP188 +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2ANC_HEADER +#define NTV2ANC_HEADER + +#include "ntv2kona.h" + +bool SetupAncExtractor(Ntv2SystemContext* context, NTV2Channel channel); +bool EnableAncExtractor(Ntv2SystemContext* context, NTV2Channel channel, bool bEnable); +bool SetAncExtWriteParams(Ntv2SystemContext* context, NTV2Channel channel, ULWord frameNumber); +bool SetAncExtField2WriteParams(Ntv2SystemContext* context, NTV2Channel channel, ULWord frameNumber); +bool EnableAncExtHancY(Ntv2SystemContext* context, NTV2Channel channel, bool bEnable); +bool EnableAncExtHancC(Ntv2SystemContext* context, NTV2Channel channel, bool bEnable); +bool EnableAncExtVancY(Ntv2SystemContext* context, NTV2Channel channel, bool bEnable); +bool EnableAncExtVancC(Ntv2SystemContext* context, NTV2Channel channel, bool bEnable); +bool SetAncExtSDDemux(Ntv2SystemContext* context, NTV2Channel channel, bool bEnable); +bool SetAncExtProgressive(Ntv2SystemContext* context, NTV2Channel channel, bool bEnable); +bool SetAncExtSynchro(Ntv2SystemContext* context, NTV2Channel channel); +bool SetAncExtField1StartAddr(Ntv2SystemContext* context, NTV2Channel channel, ULWord addr); +bool SetAncExtLSBEnable(Ntv2SystemContext* context, NTV2Channel channel, bool bEnable); +bool SetAncExtField1StartAddr(Ntv2SystemContext* context, NTV2Channel channel, ULWord addr); +bool SetAncExtField1EndAddr(Ntv2SystemContext* context, NTV2Channel channel, ULWord addr); +bool SetAncExtField2StartAddr(Ntv2SystemContext* context, NTV2Channel channel, ULWord addr); +bool SetAncExtField2EndAddr(Ntv2SystemContext* context, NTV2Channel channel, ULWord addr); +bool SetAncExtField1CutoffLine(Ntv2SystemContext* context, NTV2Channel channel, ULWord lineNumber); +bool SetAncExtField2CutoffLine(Ntv2SystemContext* context, NTV2Channel channel, ULWord lineNumber); +bool IsAncExtOverrun(Ntv2SystemContext* context, NTV2Channel channel); +ULWord GetAncExtField1Bytes(Ntv2SystemContext* context, NTV2Channel channel); +bool IsAncExtField1Overrun(Ntv2SystemContext* context, NTV2Channel channel); +ULWord GetAncExtField2Bytes(Ntv2SystemContext* context, NTV2Channel channel); +bool IsAncExtField2Overrun(Ntv2SystemContext* context, NTV2Channel channel); +bool SetAncExtField1StartLine(Ntv2SystemContext* context, NTV2Channel channel, ULWord lineNumber); +bool SetAncExtField2StartLine(Ntv2SystemContext* context, NTV2Channel channel, ULWord lineNumber); +bool SetAncExtTotalFrameLines(Ntv2SystemContext* context, NTV2Channel channel, ULWord totalFrameLines); +bool SetAncExtFidLow(Ntv2SystemContext* context, NTV2Channel channel, ULWord lineNumber); +bool SetAncExtFidHi(Ntv2SystemContext* context, NTV2Channel channel, ULWord lineNumber); +bool SetAncExtField1AnalogStartLine(Ntv2SystemContext* context, NTV2Channel channel, ULWord lineNumber); +bool SetAncExtField2AnalogStartLine(Ntv2SystemContext* context, NTV2Channel channel, ULWord lineNumber); +bool SetAncExtField1AnalogYFilter(Ntv2SystemContext* context, NTV2Channel channel, ULWord lineFilter); +bool SetAncExtField2AnalogYFilter(Ntv2SystemContext* context, NTV2Channel channel, ULWord lineFilter); +bool SetAncExtField1AnalogCFilter(Ntv2SystemContext* context, NTV2Channel channel, ULWord lineFilter); +bool SetAncExtField2AnalogCFilter(Ntv2SystemContext* context, NTV2Channel channel, ULWord lineFilter); + +bool SetupAncInserter(Ntv2SystemContext* context, NTV2Channel channel); +bool EnableAncInserter(Ntv2SystemContext* context, NTV2Channel channel, bool bEnable); +bool SetAncInsReadParams(Ntv2SystemContext* context, NTV2Channel channel, ULWord frameNumber, ULWord field1Size); +bool SetAncInsReadField2Params(Ntv2SystemContext* context, NTV2Channel channel, ULWord frameNumber, ULWord field2Size); +bool SetAncInsField1Bytes(Ntv2SystemContext* context, NTV2Channel channel, ULWord numberOfBytes); +bool SetAncInsField2Bytes(Ntv2SystemContext* context, NTV2Channel channel, ULWord numberOfBytes); +bool EnableAncInsHancY(Ntv2SystemContext* context, NTV2Channel channel, bool bEnable); +bool EnableAncInsHancC(Ntv2SystemContext* context, NTV2Channel channel, bool bEnable); +bool EnableAncInsVancY(Ntv2SystemContext* context, NTV2Channel channel, bool bEnable); +bool EnableAncInsVancC(Ntv2SystemContext* context, NTV2Channel channel, bool bEnable); +bool SetAncInsProgressive(Ntv2SystemContext* context, NTV2Channel channel, bool isProgressive); +bool SetAncInsSDPacketSplit(Ntv2SystemContext* context, NTV2Channel channel, bool inEnable); +bool SetAncInsField1StartAddr(Ntv2SystemContext* context, NTV2Channel channel, ULWord startAddr); +bool SetAncInsField2StartAddr(Ntv2SystemContext* context, NTV2Channel channel, ULWord startAddr); +bool SetAncInsHancPixelDelay(Ntv2SystemContext* context, NTV2Channel channel, ULWord numberOfPixels); +bool SetAncInsVancPixelDelay(Ntv2SystemContext* context, NTV2Channel channel, ULWord numberOfPixels); +bool SetAncInsField1ActiveLine(Ntv2SystemContext* context, NTV2Channel channel, ULWord activeLineNumber); +bool SetAncInsField2ActiveLine(Ntv2SystemContext* context, NTV2Channel channel, ULWord activeLineNumber); +bool SetAncInsHActivePixels(Ntv2SystemContext* context, NTV2Channel channel, ULWord numberOfActiveLinePixels); +bool SetAncInsHTotalPixels(Ntv2SystemContext* context, NTV2Channel channel, ULWord numberOfLinePixels); +bool SetAncInsTotalLines(Ntv2SystemContext* context, NTV2Channel channel, ULWord numberOfLines); +bool SetAncInsFidHi(Ntv2SystemContext* context, NTV2Channel channel, ULWord lineNumber); +bool SetAncInsFidLow(Ntv2SystemContext* context, NTV2Channel channel, ULWord lineNumber); + +#endif + diff --git a/build_dependencies/aja/include/ajadriver/ntv2audio.h b/build_dependencies/aja/include/ajadriver/ntv2audio.h new file mode 100644 index 0000000..a369815 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2audio.h @@ -0,0 +1,57 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//======================================================================== +// +// ntv2audio.h +// +//========================================================================== + +#ifndef NTV2AUDIO_H +#define NTV2AUDIO_H + +#include "ntv2system.h" +#include "ntv2publicinterface.h" + +#define NTV2_AUDIOSAMPLESIZE (sizeof(uint32_t)) +#define NTV2_AUDIO_WRAPADDRESS 0xFF000 +#define NTV2_AUDIO_WRAPADDRESS_MEDIUM (0xFF000*2) +#define NTV2_AUDIO_WRAPADDRESS_BIG (0xFF000*4) +#define NTV2_AUDIO_WRAPADDRESS_BIGGER (0xFF000*8) // used with KiPro Mini 99 video buffers +#define NTV2_AUDIO_READBUFFEROFFSET 0x100000 +#define NTV2_AUDIO_READBUFFEROFFSET_MEDIUM (0x100000*2) +#define NTV2_AUDIO_READBUFFEROFFSET_BIG (0x100000*4) + +void StartAudioPlayback(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); +void StopAudioPlayback(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); +bool IsAudioPlaybackStopped(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); +bool IsAudioPlaying(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); +void PauseAudioPlayback(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); +void UnPauseAudioPlayback(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); +bool IsAudioPlaybackPaused(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); +void StartAudioCapture(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); +void StopAudioCapture(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); +bool IsAudioCaptureStopped(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); +uint32_t GetNumAudioChannels(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); +uint32_t oemAudioSampleAlign(Ntv2SystemContext* context, NTV2AudioSystem audioSystem, uint32_t ulReadSample); +uint32_t GetAudioLastOut(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); +uint32_t GetAudioLastIn(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); +uint32_t GetAudioSamplesPerFrame(Ntv2SystemContext* context, + NTV2AudioSystem audioSystem, + uint32_t cadenceFrame, + bool fieldMode); +NTV2AudioRate GetAudioRate(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); +uint32_t GetAudioSamplesPerSecond(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); +uint32_t GetAudioTransferInfo(Ntv2SystemContext* context, + NTV2AudioSystem audioSystem, + uint32_t currentOffset, + uint32_t numBytesToTransfer, + uint32_t* preWrapBytes, + uint32_t* postWrapBytes); +uint32_t GetAudioWrapAddress(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); +bool GetAudioBufferSize(Ntv2SystemContext* context, NTV2AudioSystem audioSystem, NTV2AudioBufferSize *value); +uint32_t GetAudioReadOffset(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); +uint32_t GetAudioFrameBufferNumber(Ntv2SystemContext* context, NTV2AudioSystem audioSystem); + +#endif diff --git a/build_dependencies/aja/include/ajadriver/ntv2autocirc.h b/build_dependencies/aja/include/ajadriver/ntv2autocirc.h new file mode 100644 index 0000000..47b8eb2 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2autocirc.h @@ -0,0 +1,219 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//======================================================================== +// +// ntv2dev_autocirc.h +// +//========================================================================== + +#ifndef NTV2AUTOCIRC_H +#define NTV2AUTOCIRC_H + +#include "ntv2system.h" +#include "ntv2publicinterface.h" +#include "ntv2rp188.h" + +#define NUM_CIRCULATORS 18 // number of 'channels' which have auto-circulate capability +#define NUM_CIRCULATE_FRAMES 64 + +#define ILLEGAL_CHANNELSPEC(channelSpec) (((unsigned)channelSpec > (unsigned)NTV2CROSSPOINT_INPUT8) || (channelSpec == NTV2CROSSPOINT_MATTE) || (channelSpec == NTV2CROSSPOINT_FGKEY)) + +#define NTV2_INVALID_FRAME 0xFFFFFFFF + +typedef struct { + NTV2ColorCorrectionMode mode; + uint32_t saturationValue; /// only used in 3way color correction mode + uint32_t ccLookupTables[NTV2_COLORCORRECTOR_TABLESIZE/4]; /// R,G,B lookup tables formated for hardware +} INTERNAL_COLOR_CORRECTION_STRUCT; + +typedef struct { + //! Processor RDTSC at time of play or record. + int64_t frameTime; + //! 48kHz clock in reg 28 extended to 64 bits + uint64_t audioClockTimeStamp; // Register 28 with Wrap Logic + //! The address that was used to transfer + uint32_t audioExpectedAddress; + //! For record - first position in buffer of audio (includes base offset) + uint32_t audioInStartAddress; // AudioInAddress at the time this Frame was stamped. + //! For record - end position (exclusive) in buffer of audio (includes base offset) + uint32_t audioInStopAddress; // AudioInAddress at the Frame AFTER this Frame was stamped. + //! For play - first position in buffer of audio + uint32_t audioOutStopAddress; // AudioOutAddress at the time this Frame was stamped. + //! For play - end position (exclusive) in buffer of audio + uint32_t audioOutStartAddress; // AudioOutAddress at the Frame AFTER this Frame was stamped. + uint32_t audioPreWrapBytes; // For DMA Transfer + uint32_t audioPostWrapBytes; + //! Total audio and video bytes transfered + uint32_t bytesRead; + /** The actaul start sample when this frame was started in VBI + * This may be used to check sync against audioInStartAddress (Play) or + * audioOutStartAddress (Record). In record it will always be equal, but + * in playback if the clocks drift or the user supplies non aligned + * audio sizes, then this will give the current difference from expected + * vs actual position. To be useful, play audio must be clocked in at + * the correct rate. + */ + uint32_t startSample; + //! Associated timecode (RP-188) + RP188_STRUCT rp188; + //! Valid counts from n..0 in the isr. Set to n when valid (n being the number of times (VBIs) to play this frame before advancing to the next. + // So, 0 indicates a not-ready frame, 1 indicates a normal ready frame, and >1 indicates a preroll condition. + int32_t validCount; // Used to throttle record and playback, See AutoCirculate Method in driver + //! Repeat is set to n at beginning of DMA. Moved to repeat on completion. + int32_t repeatCount; // Used to throttle record and playback, See AutoCirculate Method in driver + //! Opaque user variable + uint64_t hUser; // A user cookie returned by frame stamp + bool videoTransferPending; // p2p transfer in progress + uint32_t frameFlags; // p2p and field flags + NTV2FrameBufferFormat frameBufferFormat; + NTV2VideoFrameBufferOrientation frameBufferOrientation; + INTERNAL_COLOR_CORRECTION_STRUCT colorCorrectionInfo; + AutoCircVidProcInfo vidProcInfo; + CUSTOM_ANC_STRUCT customAncInfo; + NTV2RoutingTable xena2RoutingTable; + INTERNAL_TIMECODE_STRUCT internalTCArray; + INTERNAL_SDI_STATUS_STRUCT internalSDIStatusArray; + // Anc frame info + uint32_t ancTransferSize; + uint32_t ancField2TransferSize; + uint32_t auxData[NTV2_HDMIAuxMaxFrames*NTV2_HDMIAuxDataSize/4]; + uint32_t auxDataSize; +} INTERNAL_FRAME_STAMP_STRUCT; + +typedef struct { + Ntv2SystemContext* pSysCon; + void* pFunCon; + NTV2AutoCirculateState state; + NTV2Crosspoint channelSpec; + NTV2DMAEngine DMAEngine; + bool recording; + int32_t currentFrame; + int32_t startFrame; + int32_t endFrame; + int32_t activeFrame; + int32_t activeFrameRegister; + int32_t nextFrame; + bool circulateWithAudio; + bool circulateWithRP188; + bool circulateWithColorCorrection; + bool circulateWithVidProc; + bool circulateWithCustomAncData; + bool enableFbfChange; + bool enableFboChange; + int64_t startTimeStamp; + uint64_t startAudioClockTimeStamp; + uint32_t framesProcessed; + uint32_t droppedFrames; + uint32_t nextTransferFrame; + INTERNAL_FRAME_STAMP_STRUCT frameStamp[MAX_FRAMEBUFFERS]; + uint32_t nextAudioOutputAddress; + uint32_t audioStartSample; + uint32_t audioDropsRequired; + uint32_t audioDropsCompleted; + int64_t lastInterruptTime; + int64_t prevInterruptTime; + uint64_t lastAudioClockTimeStamp; + int64_t startTime; + bool circulateWithLTC; + NTV2AudioSystem audioSystem; + int32_t channelCount; + bool videoTransferPending; + bool startAudioNextFrame; + bool stopAudioNextFrame; + int64_t VBIRDTSC; + int64_t VBILastRDTSC; + uint32_t VBIAudioOut; + uint32_t transferFrame; + uint32_t audioTransferOffset; + uint32_t audioTransferSize; + uint32_t ancTransferOffset; + uint32_t ancField2TransferOffset; + uint32_t ancTransferSize; + uint32_t ancField2TransferSize; + bool circulateWithHDMIAux; + bool circulateWithFields; +} INTERNAL_AUTOCIRCULATE_STRUCT; + +typedef struct ntv2autocirc +{ + Ntv2SystemContext* pSysCon; + void* pFunCon; + NTV2DeviceID deviceID; + INTERNAL_AUTOCIRCULATE_STRUCT autoCirculate[NUM_CIRCULATORS]; + NTV2Channel ancInputChannel[NTV2_MAX_NUM_CHANNELS]; + NTV2_GlobalAudioPlaybackMode globalAudioPlaybackMode; + NTV2Crosspoint syncChannel1; + NTV2Crosspoint syncChannel2; + bool startAudioNextFrame; + bool stopAudioNextFrame; + bool bMultiChannel; +} NTV2AutoCirc; + +Ntv2Status AutoCirculateControl(NTV2AutoCirc* pAutoCirc, AUTOCIRCULATE_DATA* psControl); +Ntv2Status AutoCirculateInit(NTV2AutoCirc* pAutoCirc, + NTV2Crosspoint lChannelSpec, int32_t lStartFrameNum, + int32_t lEndFrameNum, NTV2AudioSystem lAudioSystem, + int32_t lChannelCount, bool bWithAudio, + bool bWithRP188, bool bFbfChange, + bool bFboChange , bool bWithColorCorrection, + bool bWithVidProc, bool bWithCustomAncData, + bool bWithLTC, bool bWithFields, + bool bWithHDMIAux); +Ntv2Status AutoCirculateStart(NTV2AutoCirc* pAutoCirc, NTV2Crosspoint channelSpec, int64_t startTime); +Ntv2Status AutoCirculateStop(NTV2AutoCirc* pAutoCirc, NTV2Crosspoint channelSpec); +Ntv2Status AutoCirculateAbort(NTV2AutoCirc* pAutoCirc, NTV2Crosspoint channelSpec); +Ntv2Status AutoCirculatePause(NTV2AutoCirc* pAutoCirc, NTV2Crosspoint channelSpec, bool bPlay, bool bClearDF); +Ntv2Status AutoCirculateFlush(NTV2AutoCirc* pAutoCirc, NTV2Crosspoint channelSpec, bool bClearDF); +Ntv2Status AutoCirculatePreroll(NTV2AutoCirc* pAutoCirc, NTV2Crosspoint channelSpec, int32_t lPrerollFrames); +Ntv2Status AutoCirculateSetActiveFrame(NTV2AutoCirc* pAutoCirc, NTV2Crosspoint channelSpec, int32_t lActiveFrame); +void AutoCirculateReset(NTV2AutoCirc* pAutoCirc, NTV2Crosspoint channelSpec); +Ntv2Status AutoCirculateGetStatus(NTV2AutoCirc* pAutoCirc, AUTOCIRCULATE_STATUS* pUserOutBuffer); +Ntv2Status AutoCirculateGetFrameStamp(NTV2AutoCirc* pAutoCirc, NTV2Crosspoint channelSpec, int32_t ulFrameNum, + FRAME_STAMP_STRUCT *pFrameStamp); +Ntv2Status AutoCirculateTransfer(NTV2AutoCirc* pAutoCirc, + AUTOCIRCULATE_TRANSFER* pTransferStruct); +Ntv2Status AutoCirclateAudioPlaybackMode(NTV2AutoCirc* pAutoCirc, + NTV2AudioSystem audioSystem, + NTV2_GlobalAudioPlaybackMode mode); +uint32_t AutoCirculateGetBufferLevel(INTERNAL_AUTOCIRCULATE_STRUCT* pAuto); +bool AutoCirculateFindNextAvailFrame(INTERNAL_AUTOCIRCULATE_STRUCT* pAuto); +void AutoBeginAutoCirculateTransfer(uint32_t frameNumber, + AUTOCIRCULATE_TRANSFER *pTransferStruct, + INTERNAL_AUTOCIRCULATE_STRUCT *pAuto); +void AutoCompleteAutoCirculateTransfer(uint32_t frameNumber, AUTOCIRCULATE_TRANSFER_STATUS *pUserOutBuffer, + INTERNAL_AUTOCIRCULATE_STRUCT *pAuto, + bool updateValid, bool transferPending); +void AutoCirculateMessage(NTV2AutoCirc* pAutoCirc, NTV2Crosspoint channelSpec, uint32_t frameNumber); +void AutoCirculateTransferFields(INTERNAL_AUTOCIRCULATE_STRUCT* pAuto, + AUTOCIRCULATE_TRANSFER* pTransfer, + uint32_t frameNumber, bool drop); + +bool AutoCirculate(NTV2AutoCirc* pAutoCirc, NTV2Crosspoint channelSpec, int32_t isrTimeStamp); +bool AutoIsAutoCirculateInterrupt(NTV2AutoCirc* pAutoCirc, NTV2Crosspoint channelSpec); +int32_t KAUTO_NEXTFRAME(int32_t __dwCurFrame_, INTERNAL_AUTOCIRCULATE_STRUCT* __pAuto_); +int32_t KAUTO_PREVFRAME(int32_t __dwCurFrame_, INTERNAL_AUTOCIRCULATE_STRUCT* __pAuto_); +void AutoCirculateSetupColorCorrector(NTV2AutoCirc* pAutoCirc, + NTV2Crosspoint channelSpec, + INTERNAL_COLOR_CORRECTION_STRUCT *ccInfo); +void AutoCirculateSetupXena2Routing(NTV2AutoCirc* pAutoCirc, NTV2RoutingTable* pXena2Routing); +void AutoCirculateWriteHDMIAux(NTV2AutoCirc* pAutoCirc, uint32_t* pAuxData, uint32_t auxDataSize); +bool AutoCirculateDmaAudioSetup(INTERNAL_AUTOCIRCULATE_STRUCT* pAuto); +bool AutoCirculateCanDoFieldMode(INTERNAL_AUTOCIRCULATE_STRUCT* pAuto); + +bool AutoDropSyncFrame(NTV2AutoCirc* pAutoCirc, NTV2Crosspoint channelSpec); +void AutoCirculateSetupVidProc(NTV2AutoCirc* pAutoCirc, + NTV2Crosspoint channelSpec, + AutoCircVidProcInfo* vidProcInfo); +void AutoCirculateTransferColorCorrectorInfo(NTV2AutoCirc* pAutoCirc, + INTERNAL_COLOR_CORRECTION_STRUCT* ccInternalInfo, + NTV2ColorCorrectionInfo* ccTransferInfo); +bool AutoCirculateP2PCopy(NTV2AutoCirc* pAutoCirc, + PAUTOCIRCULATE_P2P_STRUCT pDriverBuffer, + PAUTOCIRCULATE_P2P_STRUCT pUserBuffer, + bool bToDriver); +void AutoCopyFrameStampOldToNew(const FRAME_STAMP_STRUCT * pInOldStruct, FRAME_STAMP * pOutNewStruct); +bool AutoCirculateFrameStampImmediate(NTV2AutoCirc* pAutoCirc, FRAME_STAMP * pInOutFrameStamp); + +#endif diff --git a/build_dependencies/aja/include/ajadriver/ntv2autofunc.h b/build_dependencies/aja/include/ajadriver/ntv2autofunc.h new file mode 100644 index 0000000..33dd9ca --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2autofunc.h @@ -0,0 +1,58 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//======================================================================== +// +// ntv2autodma.h +// +//========================================================================== + +#ifndef NTV2AUTODMA_H + #define NTV2AUTODMA_H + + #include "ntv2system.h" + #include "ntv2publicinterface.h" + + // dma transfer parameters + typedef struct _autoDmaParams + { + bool toHost; // transfer to host + NTV2DMAEngine dmaEngine; // dma engine + NTV2Channel videoChannel; // video channel for frame size + void* pVidUserVa; // user video buffer + uint64_t videoBusAddress; // p2p video bus address + uint32_t videoBusSize; // p2p video bus size + uint64_t messageBusAddress; // p2p message bus address + uint32_t messageData; // p2p message data + uint32_t videoFrame; // card video frame + uint32_t vidNumBytes; // number of bytes per segment + uint32_t frameOffset; // card video offset + uint32_t vidUserPitch; // user buffer pitch + uint32_t vidFramePitch; // card frame pitch + uint32_t numSegments; // number of segments + void* pAudUserVa; // audio user buffer + NTV2AudioSystem audioSystem; // audio system target + uint32_t audNumBytes; // number of audio bytes + uint32_t audOffset; // card audio offset + void* pAncF1UserVa; // anc field 1 user buffer + uint32_t ancF1Frame; // anc field 1 frame + uint32_t ancF1NumBytes; // number of anc field 1 bytes + uint32_t ancF1Offset; // anc field 1 frame offset + void* pAncF2UserVa; // anc field 2 user buffer + uint32_t ancF2Frame; // anc field 2 frame + uint32_t ancF2NumBytes; // number of anc field 2 bytes + uint32_t ancF2Offset; // anc field 2 frame offset + } AUTO_DMA_PARAMS, *PAUTO_DMA_PARAMS; + + // STUBS + // Real device drivers and fake devices must implement: + Ntv2Status AutoDmaTransfer(void* pContext, PAUTO_DMA_PARAMS pDmaParams); + int64_t AutoGetAudioClock(void* pContext); + bool AutoBoardCanDoP2P(void* pContext); // P2P-related + uint64_t AutoGetFrameAperturePhysicalAddress(void* pContext); // P2P only + uint32_t AutoGetFrameApertureBaseSize(void* pContext); // P2P only + void AutoWriteFrameApertureOffset(void* pContext, uint32_t value); // P2P only + uint64_t AutoGetMessageAddress(void* pContext, NTV2Channel channel); // P2P only + +#endif // NTV2AUTODMA_H diff --git a/build_dependencies/aja/include/ajadriver/ntv2commonreg.h b/build_dependencies/aja/include/ajadriver/ntv2commonreg.h new file mode 100644 index 0000000..0b2dcd8 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2commonreg.h @@ -0,0 +1,189 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2commonreg.h +// Purpose: HDMI version 4 common register functions +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2HDMI4REG_HEADER +#define NTV2HDMI4REG_HEADER + +#include "ntv2system.h" +#include "ajatypes.h" + + +#define NTV2_EXPAND(x) x +#define NTV2_REG_ARGS(a1, a2, a3, a4, a5, a6, a7, a8, aN, ...) aN +#define NTV2_REG(reg, ...) \ + static const uint32_t reg[] = { NTV2_EXPAND(NTV2_REG_ARGS(__VA_ARGS__, 8, 7, 6, 5, 4, 3, 2, 1)), __VA_ARGS__ } +#define NTV2_FLD(field, size, shift) \ + static const uint32_t field = (((size) << 16) | (shift)) +#define NTV2_CON(con, value) enum { con = (value) } + +#define NTV2_REG_COUNT(reg) (reg[0]) +#define NTV2_REG_NUM(reg, index) (((index) < NTV2_REG_COUNT(reg))? reg[(index) + 1] : 0) + +#define NTV2_FLD_SIZE(field) ((field) >> 16) +#define NTV2_FLD_SHIFT(field) ((field) & 0xffff) +#define NTV2_FLD_MASK(field) ((((uint32_t)0x1 << NTV2_FLD_SIZE(field)) - 1) << NTV2_FLD_SHIFT(field)) +#define NTV2_FLD_GET(field, value) ((((uint32_t)value) & NTV2_FLD_MASK(field)) >> NTV2_FLD_SHIFT(field)) +#define NTV2_FLD_SET(field, value) ((((uint32_t)value) << NTV2_FLD_SHIFT(field)) & NTV2_FLD_MASK(field)) + +/* video standard */ +NTV2_CON(ntv2_video_standard_1080i, 0); +NTV2_CON(ntv2_video_standard_720p, 1); +NTV2_CON(ntv2_video_standard_525i, 2); +NTV2_CON(ntv2_video_standard_625i, 3); +NTV2_CON(ntv2_video_standard_1080p, 4); +NTV2_CON(ntv2_video_standard_2048x1556, 5); +NTV2_CON(ntv2_video_standard_2048x1080p, 6); +NTV2_CON(ntv2_video_standard_2048x1080i, 7); +NTV2_CON(ntv2_video_standard_3840x2160p, 8); +NTV2_CON(ntv2_video_standard_4096x2160p, 9); +NTV2_CON(ntv2_video_standard_3840_hfr, 10); +NTV2_CON(ntv2_video_standard_4096_hfr, 11); +NTV2_CON(ntv2_video_standard_7680, 12); +NTV2_CON(ntv2_video_standard_8192, 13); +NTV2_CON(ntv2_video_standard_3840i, 14); +NTV2_CON(ntv2_video_standard_4096i, 15); +NTV2_CON(ntv2_video_standard_none, 16); + +/* video frame rate */ +NTV2_CON(ntv2_frame_rate_none, 0); +NTV2_CON(ntv2_frame_rate_6000, 1); +NTV2_CON(ntv2_frame_rate_5994, 2); +NTV2_CON(ntv2_frame_rate_3000, 3); +NTV2_CON(ntv2_frame_rate_2997, 4); +NTV2_CON(ntv2_frame_rate_2500, 5); +NTV2_CON(ntv2_frame_rate_2400, 6); +NTV2_CON(ntv2_frame_rate_2398, 7); +NTV2_CON(ntv2_frame_rate_5000, 8); +NTV2_CON(ntv2_frame_rate_4800, 9); +NTV2_CON(ntv2_frame_rate_4795, 10); +NTV2_CON(ntv2_frame_rate_12000, 11); +NTV2_CON(ntv2_frame_rate_11988, 12); +NTV2_CON(ntv2_frame_rate_1500, 13); +NTV2_CON(ntv2_frame_rate_1400, 14); + +/* color space */ +NTV2_CON(ntv2_color_space_yuv422, 0); +NTV2_CON(ntv2_color_space_rgb444, 1); +NTV2_CON(ntv2_color_space_yuv444, 2); +NTV2_CON(ntv2_color_space_yuv420, 3); +NTV2_CON(ntv2_color_space_none, 4); + +/* color depth */ +NTV2_CON(ntv2_color_depth_8bit, 0); +NTV2_CON(ntv2_color_depth_10bit, 1); +NTV2_CON(ntv2_color_depth_12bit, 2); +NTV2_CON(ntv2_color_depth_none, 3); + +/* reference source */ +NTV2_CON(ntv2_ref_source_external, 0); +NTV2_CON(ntv2_ref_source_input_1, 1); +NTV2_CON(ntv2_ref_source_input_2, 2); +NTV2_CON(ntv2_ref_source_freerun, 3); +NTV2_CON(ntv2_ref_source_analog, 4); +NTV2_CON(ntv2_ref_source_hdmi, 5); +NTV2_CON(ntv2_ref_source_input_3, 6); +NTV2_CON(ntv2_ref_source_input_4, 7); +NTV2_CON(ntv2_ref_source_input_5, 8); +NTV2_CON(ntv2_ref_source_input_6, 9); +NTV2_CON(ntv2_ref_source_input_7, 10); +NTV2_CON(ntv2_ref_source_input_8, 11); +NTV2_CON(ntv2_ref_source_sfp1_ptp, 12); +NTV2_CON(ntv2_ref_source_sfp1_pcr, 13); +NTV2_CON(ntv2_ref_source_sfp2_ptp, 14); +NTV2_CON(ntv2_ref_source_sfp2_pcr, 15); + +/* reference standard */ +NTV2_CON(ntv2_ref_standard_unknown, 0); +NTV2_CON(ntv2_ref_standard_525, 1); +NTV2_CON(ntv2_ref_standard_625, 2); +NTV2_CON(ntv2_ref_standard_750, 3); +NTV2_CON(ntv2_ref_standard_1125, 4); + +/* aspect ratio */ +NTV2_CON(ntv2_aspect_ratio_unknown, 0); +NTV2_CON(ntv2_aspect_ratio_nodata, 1); +NTV2_CON(ntv2_aspect_ratio_4x3, 2); +NTV2_CON(ntv2_aspect_ratio_16x9, 3); + +/* colorimetry */ +NTV2_CON(ntv2_colorimetry_unknown, 0); +NTV2_CON(ntv2_colorimetry_nodata, 1); +NTV2_CON(ntv2_colorimetry_170m, 2); +NTV2_CON(ntv2_colorimetry_bt709, 3); +NTV2_CON(ntv2_colorimetry_xvycc_601, 4); +NTV2_CON(ntv2_colorimetry_xvycc_709, 5); +NTV2_CON(ntv2_colorimetry_adobe_601, 6); +NTV2_CON(ntv2_colorimetry_adobe_rgb, 7); +NTV2_CON(ntv2_colorimetry_bt2020_cl, 8); +NTV2_CON(ntv2_colorimetry_bt2020, 9); +NTV2_CON(ntv2_colorimetry_dcip3_d65, 10); + +/* quantization */ +NTV2_CON(ntv2_quantization_unknown, 0); +NTV2_CON(ntv2_quantization_default, 1); +NTV2_CON(ntv2_quantization_limited, 2); +NTV2_CON(ntv2_quantization_full, 3); + +/* hdr eotf */ +NTV2_CON(ntv2_hdr_eotf_sdr, 0); +NTV2_CON(ntv2_hdr_eotf_hdr, 1); +NTV2_CON(ntv2_hdr_eotf_st2084, 2); +NTV2_CON(ntv2_hdr_eotf_hlg, 3); + +/* audio rate */ +NTV2_CON(ntv2_audio_rate_48, 0); +NTV2_CON(ntv2_audio_rate_96, 1); +NTV2_CON(ntv2_audio_rate_192, 2); + +/* audio format */ +NTV2_CON(ntv2_audio_format_lpcm, 0); +NTV2_CON(ntv2_audio_format_dolby, 1); + + +uint32_t ntv2_reg_read(Ntv2SystemContext* context, const uint32_t *reg, uint32_t index); +void ntv2_reg_write(Ntv2SystemContext* context, const uint32_t *reg, uint32_t index, uint32_t data); +void ntv2_reg_rmw(Ntv2SystemContext* context, const uint32_t *reg, uint32_t index, uint32_t data, uint32_t mask); + +uint32_t ntv2_regnum_read(Ntv2SystemContext* context, uint32_t regnum); +void ntv2_regnum_write(Ntv2SystemContext* context, uint32_t regnum, uint32_t data); +void ntv2_regnum_rmw(Ntv2SystemContext* context, uint32_t regnum, uint32_t data, uint32_t mask); + +uint32_t ntv2_vreg_read(Ntv2SystemContext* context, const uint32_t *reg, uint32_t index); +void ntv2_vreg_write(Ntv2SystemContext* context, const uint32_t *reg, uint32_t index, uint32_t data); +void ntv2_vreg_rmw(Ntv2SystemContext* context, const uint32_t *reg, uint32_t index, uint32_t data, uint32_t mask); + +uint32_t ntv2_vregnum_read(Ntv2SystemContext* context, uint32_t regnum); +void ntv2_vregnum_write(Ntv2SystemContext* context, uint32_t regnum, uint32_t data); +void ntv2_vregnum_rmw(Ntv2SystemContext* context, uint32_t regnum, uint32_t data, uint32_t mask); + +const char* ntv2_video_standard_name(uint32_t standard); +const char* ntv2_frame_rate_name(uint32_t rate); +const char* ntv2_color_space_name(uint32_t color_space); +const char* ntv2_color_depth_name(uint32_t color_depth); +const char* ntv2_ref_source_name(uint32_t ref_source); +const char* ntv2_ref_standard_name(uint32_t ref_source); +const char* ntv2_hdr_eotf_name(uint32_t eotf); +const char* ntv2_audio_rate_name(uint32_t rate); +const char* ntv2_audio_format_name(uint32_t format); + +uint32_t ntv2_video_standard_width(uint32_t video_standard); +uint32_t ntv2_video_standard_height(uint32_t video_standard); +uint32_t ntv2_video_standard_lines(uint32_t video_standard); +bool ntv2_video_standard_progressive(uint32_t video_standard); + +uint32_t ntv2_frame_rate_duration(uint32_t frame_rate); +uint32_t ntv2_frame_rate_scale(uint32_t frame_rate); + +uint32_t ntv2_ref_standard_lines(uint32_t ref_lines); + +uint32_t ntv2_diff(uint32_t opa, uint32_t opb); + +#endif diff --git a/build_dependencies/aja/include/ajadriver/ntv2displayid.h b/build_dependencies/aja/include/ajadriver/ntv2displayid.h new file mode 100644 index 0000000..07f2b62 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2displayid.h @@ -0,0 +1,116 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2dispalyid.h +// Purpose: HDMI edid parser +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2_DISPLAYID_H +#define NTV2_DISPLAYID_H + +#include "ntv2system.h" + + +enum ntv2_displayid_protocol +{ + ntv2_displayid_protocol_unknown, + ntv2_displayid_protocol_dvi, /* no CEA-861 extension (therefore, no audio, RGB only) */ + ntv2_displayid_protocol_hdmiv1, /* adds CEA-861 extension rev 1, timing only */ + ntv2_displayid_protocol_hdmi, /* adds CEA-861 extension rev >1, audio, YCbCr and DeepColor options */ + ntv2_displayid_protocol_size +}; + +struct ntv2_displayid_video +{ + enum ntv2_displayid_protocol protocol; /* DVI vs HDMI */ + + bool underscan; /* true if sink device underscans IT video formats by default */ + bool ycbcr_444; /* true if sink device supports YCbCr 4:4:4 in addition to RGB */ + bool ycbcr_422; /* true if sink device supports YCbCr 4:2:2 in addition to RGB */ + bool ycbcr_420; /* true if sink device supports YCbCr 4:2:0 in addition to RGB */ + bool dc_48bit; /* true if sink device supports 48-bit (16 bits per component) RGB */ + bool dc_36bit; /* true if sink device supports 36-bit (12 bits per component) RGB */ + bool dc_30bit; /* true if sink device supports 30-bit (10 bits per component) RGB */ + bool dc_y444; /* true if the 48-bit, 36-bit, and 30-bit flags ALSO apply to YCbCr inputs */ + + uint32_t max_clock_freq; /* maximum TMDS clock frequency supported by sink device (MHz / 0 = unknown) */ + + bool graphics; /* true if sink device has special graphics processing */ + bool photo; /* true if sink device has special photo processing */ + bool cinema; /* true if sink device has special cinema processing */ + bool game; /* true if sink device has special game processing */ + + uint32_t video_latency; /* video latency (mSec / 0 = unknown) */ + uint32_t audio_latency; /* audio latency (mSec / 0 = unknown) */ + uint32_t int_video_latency; /* interlaced video latency (mSec / 0 = unknown) */ + uint32_t int_audio_latency; /* interlaced audio latency (mSec / 0 = unknown) */ + + bool quad_30; /* true if sink device supports 1920x2160 29.97/30 */ + bool quad_25; /* true if sink device supports 1920x2160 25 */ + bool quad_24; /* true if sink device supports 1920x2160 23.98/24 */ + bool four_24; /* true if sink device supports 2048x2160 24 */ + + uint32_t max_tmds_csc; /* maximum TMDS character rate supported above 340 Mcsc (0 = not supported) */ + + bool osd_disparity; /* true if sink supports receiving 3d osd displarity in the hf-vsif */ + bool dual_view; /* true if sink supports 3d dual view */ + bool indep_view; /* true if sink supports 3d independent view */ + bool lte_scramble; /* true if sink supports scrambling below 340 Mcsc */ + bool rr_capable; /* true if sink supports scdc read request */ + bool scdc_present; /* true if sink supports scdc */ + bool dc_30bit_420; /* true if sink supports 30 bit 420 */ + bool dc_36bit_420; /* true if sink supports 36 bit 420 */ + bool dc_48bit_420; /* true if sink supports 48 bit 420 */ +}; + +struct ntv2_displayid_audio +{ + enum ntv2_displayid_protocol protocol; /* DVI vs HDMI */ + + bool basic_audio; /* true if sink device supports basic audio */ + + uint32_t num_lpcm_channels; /* max number of channels from LPCM Short Audio Descriptors (if present) */ +}; + + +/** + * HDMI EDID register callback function + * + * Callback to obtain EDID register data. + * + * @param[in] pContext Callback context + * @param[in] blockNum Register block number + * @param[in] regNum Register number within the block + * @param[out] regVal Register value + * @return AJA_STATUS_SUCCESS if register read works + */ +typedef bool ntv2_displayid_callback(void* context, uint8_t block_num, uint8_t reg_num, uint8_t* reg_val); + + +struct ntv2_displayid +{ + struct ntv2_displayid_video video; + struct ntv2_displayid_audio audio; + ntv2_displayid_callback* callback; + void* context; +}; + + +#ifdef __cplusplus +extern "C" +{ +#endif + +void ntv2_displayid_config(struct ntv2_displayid* ntv2_did, ntv2_displayid_callback* callback, void* context); +void ntv2_displayid_clear(struct ntv2_displayid* ntv2_did); +bool ntv2_displayid_update(struct ntv2_displayid* ntv2_did); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/build_dependencies/aja/include/ajadriver/ntv2genlock.h b/build_dependencies/aja/include/ajadriver/ntv2genlock.h new file mode 100644 index 0000000..0e6bc1a --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2genlock.h @@ -0,0 +1,61 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2genlock.h +// Purpose: Genlock monitor +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2GENLOCK_HEADER +#define NTV2GENLOCK_HEADER + +#include "ntv2system.h" + +#define NTV2_GENLOCK_STRING_SIZE 80 + +enum ntv2_genlock_mode { + ntv2_genlock_mode_unknown, + ntv2_genlock_mode_zero, + ntv2_genlock_mode_ntsc_27mhz, + ntv2_genlock_mode_size +}; + +struct ntv2_genlock { + int index; + char name[NTV2_GENLOCK_STRING_SIZE]; + Ntv2SystemContext* system_context; + Ntv2SpinLock state_lock; + + Ntv2Thread monitor_task; + bool monitor_enable; + Ntv2Event monitor_event; + + uint32_t ref_source; + uint32_t gen_source; + bool ref_locked; + bool gen_locked; + uint32_t ref_lines; + uint32_t ref_rate; + + uint32_t gen_lines; + uint32_t gen_rate; + + uint8_t page_address; +}; + +struct ntv2_genlock *ntv2_genlock_open(Ntv2SystemContext* sys_con, + const char *name, int index); +void ntv2_genlock_close(struct ntv2_genlock *ntv2_gen); + +Ntv2Status ntv2_genlock_configure(struct ntv2_genlock *ntv2_gen); + +Ntv2Status ntv2_genlock_enable(struct ntv2_genlock *ntv2_gen); +Ntv2Status ntv2_genlock_disable(struct ntv2_genlock *ntv2_gen); + +Ntv2Status ntv2_genlock_program(struct ntv2_genlock *ntv2_gen, + enum ntv2_genlock_mode mode); + +#endif diff --git a/build_dependencies/aja/include/ajadriver/ntv2genregs.h b/build_dependencies/aja/include/ajadriver/ntv2genregs.h new file mode 100644 index 0000000..4c850ec --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2genregs.h @@ -0,0 +1,33124 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2genregs.h +// Purpose: Genlock register config +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2GENREGS_HEADER +#define NTV2GENREGS_HEADER + +#include "ntv2system.h" + +struct ntv2_genlock_data { + uint32_t addr; + uint32_t data; +}; + +/* + * Si5345 Rev D Configuration Register Export Header File + * + * This file represents a series of Silicon Labs Si5345 Rev D + * register writes that can be performed to load a single configuration + * on a device. It was created by a Silicon Labs ClockBuilder Pro + * export tool. + * + * Part: Si5345 Rev D + * Design ID: IO4K+43D + * Includes Pre/Post Download Control Register Writes: Yes + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2020-04-03 13:25:47 GMT-07:00 + * + * A complete design report corresponding to this export is included at the end + * of this header file. + * + */ + +static struct ntv2_genlock_data s_genlock_525_2997[] = +{ + + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x00 }, + { 0x002E, 0x48 }, + { 0x002F, 0x10 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0xED }, + { 0x0037, 0x0E }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x00 }, + { 0x0040, 0x04 }, + { 0x0041, 0x00 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0E }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xBF }, + { 0x005B, 0x47 }, + { 0x005C, 0x3D }, + { 0x005D, 0x01 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0x80 }, + { 0x0095, 0x00 }, + { 0x0096, 0x60 }, + { 0x0098, 0x40 }, + { 0x009A, 0x02 }, + { 0x009B, 0x40 }, + { 0x009D, 0x00 }, + { 0x009E, 0x40 }, + { 0x00A0, 0x00 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0xE4 }, + { 0x00AA, 0x31 }, + { 0x00AB, 0x00 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0x12 }, + { 0x00EB, 0x1A }, + { 0x00EC, 0x00 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x34 }, + { 0x0271, 0x33 }, + { 0x0272, 0x44 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0x0A }, + { 0x029E, 0x07 }, + { 0x029F, 0x00 }, + { 0x02A9, 0x99 }, + { 0x02AA, 0x09 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x12 }, + { 0x0509, 0x1D }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x07 }, + { 0x050D, 0x03 }, + { 0x050E, 0x19 }, + { 0x050F, 0x2D }, + { 0x0510, 0x09 }, + { 0x0511, 0x08 }, + { 0x0512, 0x07 }, + { 0x0513, 0x03 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0xF9 }, + { 0x051A, 0xA7 }, + { 0x051B, 0x01 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0xA0 }, + { 0x0521, 0x3B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x17 }, + { 0x052F, 0x19 }, + { 0x0531, 0x00 }, + { 0x0532, 0xC6 }, + { 0x0533, 0x9D }, + { 0x0534, 0x01 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x0E }, + { 0x053E, 0x06 }, + { 0x0589, 0xC6 }, + { 0x058A, 0x06 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x19 }, + { 0x059E, 0x2D }, + { 0x059F, 0x09 }, + { 0x05A0, 0x08 }, + { 0x05A1, 0x07 }, + { 0x05A2, 0x03 }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x0F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Design ID: IO4K+43D + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2020-04-03 13:25:46 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 15.7342657342657342... kHz [ 15 + 105/143 kHz ] + * [ (30/1.001)*525 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 15.7342657342657342... kHz [ 15 + 105/143 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 173659.2 [ 173659 + 1/5 ] + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 8.000 Hz + * Actual: 5.574 Hz + * Coefficients: + * BW0: 18 + * BW1: 29 + * BW2: 15 + * BW3: 15 + * BW4: 7 + * BW5: 3 + * Fastlock Bandwidth: + * Desired: 800.000 Hz + * Actual: 898.678 Hz + * Coefficients: + * BW0: 25 + * BW1: 45 + * BW2: 9 + * BW3: 8 + * BW4: 7 + * BW5: 3 + * Holdover Bandwidth: + * Desired: 800.000 Hz + * Actual: 898.678 Hz + * Coefficients: + * BW0: 25 + * BW1: 45 + * BW2: 9 + * BW3: 8 + * BW4: 7 + * BW5: 3 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 0 0x0 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 4168 0x1048 + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 3821 0x0EED + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 0 0x0 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 0 0x00 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 14 0xE + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 20793279 0x13D47BF + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 8 0x8 + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 6 0x6 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 4 0x4 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 4 0x4 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 0 0x0 + * 0x009E[7:4] LOL_SLW_SET_THR 4 0x4 + * 0x00A0[7:4] LOL_SLW_CLR_THR 0 0x0 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 12772 0x000031E4 + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 6674 0x00001A12 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 52 0x34 + * 0x0271[7:0] DESIGN_ID6 51 0x33 + * 0x0272[7:0] DESIGN_ID7 68 0x44 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 1802 0x0070A + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 2457 0x00999 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 18 0x12 + * 0x0509[5:0] BW1_PLL 29 0x1D + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 7 0x07 + * 0x050D[5:0] BW5_PLL 3 0x03 + * 0x050E[5:0] FASTLOCK_BW0_PLL 25 0x19 + * 0x050F[5:0] FASTLOCK_BW1_PLL 45 0x2D + * 0x0510[5:0] FASTLOCK_BW2_PLL 9 0x09 + * 0x0511[5:0] FASTLOCK_BW3_PLL 8 0x08 + * 0x0512[5:0] FASTLOCK_BW4_PLL 7 0x07 + * 0x0513[5:0] FASTLOCK_BW5_PLL 3 0x03 + * 0x0515[55:0] M_NUM 466162865405952 0x01A7F900000000 + * 0x051C[31:0] M_DEN 2684354560 0xA0000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 1 0x1 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 23 0x17 + * 0x052F[4:0] HOLD_HIST_DELAY 25 0x19 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 105926 0x019DC6 + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 14 0x0E + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 1734 0x06C6 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 25 0x19 + * 0x059E[5:0] HOLDEXIT_BW1 45 0x2D + * 0x059F[5:0] HOLDEXIT_BW2 9 0x09 + * 0x05A0[5:0] HOLDEXIT_BW3 8 0x08 + * 0x05A1[5:0] HOLDEXIT_BW4 7 0x07 + * 0x05A2[5:0] HOLDEXIT_BW5 3 0x03 + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 0 0x0 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +#if 0 +// # Si538x/4x Registers Script +// # +// # Part: Si5345 +// # Project File: C:\12GM_17.4\trunk\FPGA\Source\genlock\FormatFiles\12GM_NTSC_0vK.slabtimeproj +// # Design ID: 12GM_vJ +// # Includes Pre/Post Download Control Register Writes: Yes +// # Die Revision: B1 +// # Creator: ClockBuilder Pro v2.15 [2017-05-15] +// # Created On: 2019-03-26 11:08:50 GMT-07:00 +// Address,Data +static struct ntv2_genlock_data s_genlock_525_2997[] = +{ + // # + // # Start configuration preamble + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + // # End configuration preamble + // # + // # Delay 300 msec + // # Delay is worst case time for device to complete any calibration + // # that is running due to device state change previous to this script + // # being processed. + { 0x0000, 0x01 }, + // # + // # Start configuration registers + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x00 }, + { 0x002E, 0x82 }, + { 0x002F, 0xCB }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x48 }, + { 0x0037, 0x10 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x00 }, + { 0x0040, 0x04 }, + { 0x0041, 0x00 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xBF }, + { 0x005B, 0x47 }, + { 0x005C, 0x3D }, + { 0x005D, 0x01 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0x80 }, + { 0x0095, 0x00 }, + { 0x0096, 0x60 }, + { 0x0098, 0x40 }, + { 0x009A, 0x02 }, + { 0x009B, 0x40 }, + { 0x009D, 0x00 }, + { 0x009E, 0x40 }, + { 0x00A0, 0x00 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0xED }, + { 0x00AA, 0x24 }, + { 0x00AB, 0x00 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0x12 }, + { 0x00EB, 0x1A }, + { 0x00EC, 0x00 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x31 }, + { 0x026C, 0x32 }, + { 0x026D, 0x47 }, + { 0x026E, 0x4D }, + { 0x026F, 0x5F }, + { 0x0270, 0x76 }, + { 0x0271, 0x4A }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0x0A }, + { 0x029E, 0x07 }, + { 0x029F, 0x00 }, + { 0x02A9, 0x99 }, + { 0x02AA, 0x09 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x13 }, + { 0x0509, 0x1F }, + { 0x050A, 0x0F }, + { 0x050B, 0x0E }, + { 0x050C, 0x07 }, + { 0x050D, 0x03 }, + { 0x050E, 0x19 }, + { 0x050F, 0x2D }, + { 0x0510, 0x09 }, + { 0x0511, 0x08 }, + { 0x0512, 0x07 }, + { 0x0513, 0x03 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0xF9 }, + { 0x051A, 0xA7 }, + { 0x051B, 0x01 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0xA0 }, + { 0x0521, 0x3B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0xEF }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0xC6 }, + { 0x0533, 0x9D }, + { 0x0534, 0x01 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x0D }, + { 0x053E, 0x06 }, + { 0x0589, 0xC6 }, + { 0x058A, 0x06 }, + { 0x059B, 0xD8 }, + { 0x059D, 0x19 }, + { 0x059E, 0x2D }, + { 0x059F, 0x09 }, + { 0x05A0, 0x08 }, + { 0x05A1, 0x07 }, + { 0x05A2, 0x03 }, + { 0x05A6, 0x05 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0B44, 0x0F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x00 }, + { 0x0B48, 0x0F }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + //# End configuration registers + //# + //# Start configuration postamble + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + //# End configuration postamble + { 0x0000, 0x00 } +}; +#endif + +#if 0 +static struct ntv2_genlock_data s_genlock_525_2997[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0x48 }, + { 0x002F, 0x10 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0xED }, + { 0x0037, 0x0E }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x00 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xBF }, + { 0x005B, 0x47 }, + { 0x005C, 0x3D }, + { 0x005D, 0x01 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0x8D }, + { 0x00AA, 0x8C }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x10 }, + { 0x0509, 0x18 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x07 }, + { 0x050D, 0x07 }, + { 0x050E, 0x17 }, + { 0x050F, 0x28 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x07 }, + { 0x0513, 0x07 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0xF9 }, + { 0x051A, 0xA7 }, + { 0x051B, 0x01 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0xA0 }, + { 0x0521, 0x3B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0f }, // 0xE7 + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0xC6 }, + { 0x0533, 0x9D }, + { 0x0534, 0x01 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x11 }, + { 0x053E, 0x06 }, + { 0x0589, 0xC6 }, + { 0x058A, 0x06 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x17 }, + { 0x059E, 0x28 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x07 }, + { 0x05A2, 0x07 }, + { 0x05A6, 0x00 }, // 0x05 + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x0F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; +#endif +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_VIC6_720x480i59.94.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 15:58:16 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 15.7342657342657342... kHz [ 15 + 105/143 kHz ] + * [ (30/1.001)*525 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 15.7342657342657342... kHz [ 15 + 105/143 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 173659.2 [ 173659 + 1/5 ] + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 607.038 mHz + * Coefficients: + * BW0: 16 + * BW1: 24 + * BW2: 15 + * BW3: 15 + * BW4: 7 + * BW5: 7 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 99.189 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 7 + * BW5: 7 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 99.189 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 7 + * BW5: 7 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 4168 0x1048 + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 3821 0x0EED + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 0 0x00 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 20793279 0x13D47BF + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 298125 0x00048C8D + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 16 0x10 + * 0x0509[5:0] BW1_PLL 24 0x18 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 7 0x07 + * 0x050D[5:0] BW5_PLL 7 0x07 + * 0x050E[5:0] FASTLOCK_BW0_PLL 23 0x17 + * 0x050F[5:0] FASTLOCK_BW1_PLL 40 0x28 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 7 0x07 + * 0x0513[5:0] FASTLOCK_BW5_PLL 7 0x07 + * 0x0515[55:0] M_NUM 466162865405952 0x01A7F900000000 + * 0x051C[31:0] M_DEN 2684354560 0xA0000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 1 0x1 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 105926 0x019DC6 + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 17 0x11 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 1734 0x06C6 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 23 0x17 + * 0x059E[5:0] HOLDEXIT_BW1 40 0x28 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 7 0x07 + * 0x05A2[5:0] HOLDEXIT_BW5 7 0x07 + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 0 0x0 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_625_2500[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0x65 }, + { 0x002F, 0x10 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x08 }, + { 0x0037, 0x0F }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x00 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xB1 }, + { 0x005B, 0x13 }, + { 0x005C, 0x3B }, + { 0x005D, 0x01 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0x1C }, + { 0x00AA, 0x8E }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x10 }, + { 0x0509, 0x18 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x07 }, + { 0x050D, 0x07 }, + { 0x050E, 0x17 }, + { 0x050F, 0x28 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x07 }, + { 0x0513, 0x07 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0xF0 }, + { 0x051A, 0xAA }, + { 0x051B, 0x01 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0xA0 }, + { 0x0521, 0x3B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0xAB }, + { 0x0533, 0xA0 }, + { 0x0534, 0x01 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x11 }, + { 0x053E, 0x06 }, + { 0x0589, 0xD2 }, + { 0x058A, 0x06 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x17 }, + { 0x059E, 0x28 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x07 }, + { 0x05A2, 0x07 }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x0F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_NTV2_FORMAT_525_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:05:28 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 15.625 kHz [ 15 + 5/8 kHz ] + * [ (25)*625 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 15.625 kHz [ 15 + 5/8 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 174873.6 [ 174873 + 3/5 ] + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 602.746 mHz + * Coefficients: + * BW0: 16 + * BW1: 24 + * BW2: 15 + * BW3: 15 + * BW4: 7 + * BW5: 7 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 98.305 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 7 + * BW5: 7 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 98.305 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 7 + * BW5: 7 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 4197 0x1065 + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 3848 0x0F08 + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 0 0x00 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 20648881 0x13B13B1 + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 298524 0x00048E1C + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 16 0x10 + * 0x0509[5:0] BW1_PLL 24 0x18 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 7 0x07 + * 0x050D[5:0] BW5_PLL 7 0x07 + * 0x050E[5:0] FASTLOCK_BW0_PLL 23 0x17 + * 0x050F[5:0] FASTLOCK_BW1_PLL 40 0x28 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 7 0x07 + * 0x0513[5:0] FASTLOCK_BW5_PLL 7 0x07 + * 0x0515[55:0] M_NUM 469422745583616 0x01AAF000000000 + * 0x051C[31:0] M_DEN 2684354560 0xA0000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 1 0x1 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 106667 0x01A0AB + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 17 0x11 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 1746 0x06D2 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 23 0x17 + * 0x059E[5:0] HOLDEXIT_BW1 40 0x28 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 7 0x07 + * 0x05A2[5:0] HOLDEXIT_BW5 7 0x07 + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 0 0x0 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_750_5000[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0xD5 }, + { 0x002F, 0x06 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x44 }, + { 0x0037, 0x06 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x02 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xD0 }, + { 0x005B, 0x0B }, + { 0x005C, 0xBD }, + { 0x005D, 0x00 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0xBD }, + { 0x00AA, 0x68 }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x11 }, + { 0x0509, 0x19 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x07 }, + { 0x050E, 0x18 }, + { 0x050F, 0x29 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x07 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0x50 }, + { 0x051A, 0x8E }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0x80 }, + { 0x0521, 0x2B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0x9D }, + { 0x0533, 0xAD }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x12 }, + { 0x053E, 0x06 }, + { 0x0589, 0xD6 }, + { 0x058A, 0x02 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x18 }, + { 0x059E, 0x29 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x07 }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x2F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_750_6000.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:26:04 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 37.5 kHz [ 37 + 1/2 kHz ] + * [ (50)*750 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 37.5 kHz [ 37 + 1/2 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 72864 + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 725.888 mHz + * Coefficients: + * BW0: 17 + * BW1: 25 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 7 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 124.106 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 124.106 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 1749 0x06D5 + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 1604 0x0644 + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 2 0x02 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 12389328 0x0BD0BD0 + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 288957 0x000468BD + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 17 0x11 + * 0x0509[5:0] BW1_PLL 25 0x19 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 7 0x07 + * 0x050E[5:0] FASTLOCK_BW0_PLL 24 0x18 + * 0x050F[5:0] FASTLOCK_BW1_PLL 41 0x29 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 7 0x07 + * 0x0515[55:0] M_NUM 156474248527872 0x008E5000000000 + * 0x051C[31:0] M_DEN 2147483648 0x80000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 0 0x0 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 44445 0x00AD9D + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 18 0x12 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 726 0x02D6 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 24 0x18 + * 0x059E[5:0] HOLDEXIT_BW1 41 0x29 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 7 0x07 + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 1 0x1 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_750_5994[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0xB3 }, + { 0x002F, 0x05 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x3A }, + { 0x0037, 0x05 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x02 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xF6 }, + { 0x005B, 0xA0 }, + { 0x005C, 0xE2 }, + { 0x005D, 0x00 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0xBE }, + { 0x00AA, 0x49 }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x11 }, + { 0x0509, 0x1A }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x07 }, + { 0x050E, 0x17 }, + { 0x050F, 0x28 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x07 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0xF0 }, + { 0x0519, 0x7C }, + { 0x051A, 0xB9 }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0xC8 }, + { 0x0521, 0x3B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0xD3 }, + { 0x0533, 0x90 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x12 }, + { 0x053E, 0x06 }, + { 0x0589, 0x5D }, + { 0x058A, 0x02 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x17 }, + { 0x059E, 0x28 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x07 }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x0F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:19:47 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 44.9550449550449550... kHz [ 44 + 956/1001 kHz ] + * [ (60000/1001)*750 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 44.9550449550449550... kHz [ 44 + 956/1001 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 60780.72 [ 60780 + 18/25 ] + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 873.995 mHz + * Coefficients: + * BW0: 17 + * BW1: 26 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 7 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 64.779 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 64.779 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 1459 0x05B3 + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 1338 0x053A + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 2 0x02 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 14852342 0x0E2A0F6 + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 281022 0x000449BE + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 17 0x11 + * 0x0509[5:0] BW1_PLL 26 0x1A + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 7 0x07 + * 0x050E[5:0] FASTLOCK_BW0_PLL 23 0x17 + * 0x050F[5:0] FASTLOCK_BW1_PLL 40 0x28 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 7 0x07 + * 0x0515[55:0] M_NUM 203946253615104 0x00B97CF0000000 + * 0x051C[31:0] M_DEN 3355443200 0xC8000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 1 0x1 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 37075 0x0090D3 + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 18 0x12 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 605 0x025D + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 23 0x17 + * 0x059E[5:0] HOLDEXIT_BW1 40 0x28 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 7 0x07 + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 0 0x0 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_750_6000[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0xB2 }, + { 0x002F, 0x05 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x38 }, + { 0x0037, 0x05 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x02 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xFA }, + { 0x005B, 0xDA }, + { 0x005C, 0xE2 }, + { 0x005D, 0x00 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0x96 }, + { 0x00AA, 0x49 }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x11 }, + { 0x0509, 0x1A }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x07 }, + { 0x050E, 0x17 }, + { 0x050F, 0x28 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x07 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0x98 }, + { 0x051A, 0x76 }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0x80 }, + { 0x0521, 0x2B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0xAE }, + { 0x0533, 0x90 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x12 }, + { 0x053E, 0x06 }, + { 0x0589, 0x5C }, + { 0x058A, 0x02 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x17 }, + { 0x059E, 0x28 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x07 }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x2F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_750_6000.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:25:01 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 45 kHz + * [ (60)*750 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 45 kHz + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 60720 + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 874.892 mHz + * Coefficients: + * BW0: 17 + * BW1: 26 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 7 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 64.856 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 64.856 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 1458 0x05B2 + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 1336 0x0538 + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 2 0x02 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 14867194 0x0E2DAFA + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 280982 0x00044996 + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 17 0x11 + * 0x0509[5:0] BW1_PLL 26 0x1A + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 7 0x07 + * 0x050E[5:0] FASTLOCK_BW0_PLL 23 0x17 + * 0x050F[5:0] FASTLOCK_BW1_PLL 40 0x28 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 7 0x07 + * 0x0515[55:0] M_NUM 130395207106560 0x00769800000000 + * 0x051C[31:0] M_DEN 2147483648 0x80000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 0 0x0 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 37038 0x0090AE + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 18 0x12 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 604 0x025C + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 23 0x17 + * 0x059E[5:0] HOLDEXIT_BW1 40 0x28 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 7 0x07 + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 1 0x1 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_1125_2398[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0x80 }, + { 0x002F, 0x09 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0xB5 }, + { 0x0037, 0x08 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x01 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0x5A }, + { 0x005B, 0xF4 }, + { 0x005C, 0x0F }, + { 0x005D, 0x01 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0xB1 }, + { 0x00AA, 0xB1 }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x10 }, + { 0x0509, 0x18 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x03 }, + { 0x050D, 0x07 }, + { 0x050E, 0x17 }, + { 0x050F, 0x28 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x03 }, + { 0x0513, 0x07 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x40 }, + { 0x0519, 0x51 }, + { 0x051A, 0xF7 }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0xA0 }, + { 0x0521, 0x3B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0x5F }, + { 0x0533, 0xF1 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x12 }, + { 0x053E, 0x06 }, + { 0x0589, 0xF2 }, + { 0x058A, 0x03 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x17 }, + { 0x059E, 0x28 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x03 }, + { 0x05A2, 0x07 }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x0F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:34:13 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 26.9730269730269730... kHz [ 26 + 974/1001 kHz ] + * [ (24000/1001)*1125 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 26.9730269730269730... kHz [ 26 + 974/1001 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 101301.2 [ 101301 + 1/5 ] + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 518.932 mHz + * Coefficients: + * BW0: 16 + * BW1: 24 + * BW2: 15 + * BW3: 15 + * BW4: 3 + * BW5: 7 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 81.064 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 3 + * BW5: 7 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 81.064 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 3 + * BW5: 7 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 2432 0x0980 + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 2229 0x08B5 + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 1 0x01 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 17822810 0x10FF45A + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 307633 0x0004B1B1 + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 16 0x10 + * 0x0509[5:0] BW1_PLL 24 0x18 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 3 0x03 + * 0x050D[5:0] BW5_PLL 7 0x07 + * 0x050E[5:0] FASTLOCK_BW0_PLL 23 0x17 + * 0x050F[5:0] FASTLOCK_BW1_PLL 40 0x28 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 3 0x03 + * 0x0513[5:0] FASTLOCK_BW5_PLL 7 0x07 + * 0x0515[55:0] M_NUM 271928338153472 0x00F75140000000 + * 0x051C[31:0] M_DEN 2684354560 0xA0000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 1 0x1 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 61791 0x00F15F + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 18 0x12 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 1010 0x03F2 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 23 0x17 + * 0x059E[5:0] HOLDEXIT_BW1 40 0x28 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 3 0x03 + * 0x05A2[5:0] HOLDEXIT_BW5 7 0x07 + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 0 0x0 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_1125_2400[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0x7D }, + { 0x002F, 0x09 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0xB3 }, + { 0x0037, 0x08 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x01 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xF9 }, + { 0x005B, 0x39 }, + { 0x005C, 0x10 }, + { 0x005D, 0x01 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0x6E }, + { 0x00AA, 0xB1 }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x10 }, + { 0x0509, 0x18 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x03 }, + { 0x050D, 0x07 }, + { 0x050E, 0x17 }, + { 0x050F, 0x28 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x03 }, + { 0x0513, 0x07 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0xA8 }, + { 0x051A, 0xC5 }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0x80 }, + { 0x0521, 0x2B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0x21 }, + { 0x0533, 0xF1 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x12 }, + { 0x053E, 0x06 }, + { 0x0589, 0xF1 }, + { 0x058A, 0x03 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x17 }, + { 0x059E, 0x28 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x03 }, + { 0x05A2, 0x07 }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x2F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:39:11 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 27 kHz + * [ (24)*1125 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 27 kHz + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 101200 + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 519.459 mHz + * Coefficients: + * BW0: 16 + * BW1: 24 + * BW2: 15 + * BW3: 15 + * BW4: 3 + * BW5: 7 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 81.164 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 3 + * BW5: 7 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 81.164 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 3 + * BW5: 7 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 2429 0x097D + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 2227 0x08B3 + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 1 0x01 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 17840633 0x11039F9 + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 307566 0x0004B16E + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 16 0x10 + * 0x0509[5:0] BW1_PLL 24 0x18 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 3 0x03 + * 0x050D[5:0] BW5_PLL 7 0x07 + * 0x050E[5:0] FASTLOCK_BW0_PLL 23 0x17 + * 0x050F[5:0] FASTLOCK_BW1_PLL 40 0x28 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 3 0x03 + * 0x0513[5:0] FASTLOCK_BW5_PLL 7 0x07 + * 0x0515[55:0] M_NUM 217325345177600 0x00C5A800000000 + * 0x051C[31:0] M_DEN 2147483648 0x80000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 0 0x0 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 61729 0x00F121 + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 18 0x12 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 1009 0x03F1 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 23 0x17 + * 0x059E[5:0] HOLDEXIT_BW1 40 0x28 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 3 0x03 + * 0x05A2[5:0] HOLDEXIT_BW5 7 0x07 + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 1 0x1 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_1125_2500[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0x1C }, + { 0x002F, 0x09 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x5A }, + { 0x0037, 0x08 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x01 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xB9 }, + { 0x005B, 0x91 }, + { 0x005C, 0x1B }, + { 0x005D, 0x01 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0x0C }, + { 0x00AA, 0xA7 }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x10 }, + { 0x0509, 0x18 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x03 }, + { 0x050D, 0x07 }, + { 0x050E, 0x17 }, + { 0x050F, 0x28 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x03 }, + { 0x0513, 0x07 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0xC0 }, + { 0x051A, 0xBD }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0x80 }, + { 0x0521, 0x2B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0x7C }, + { 0x0533, 0xE7 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x12 }, + { 0x053E, 0x06 }, + { 0x0589, 0xC9 }, + { 0x058A, 0x03 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x17 }, + { 0x059E, 0x28 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x03 }, + { 0x05A2, 0x07 }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x2F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 17:04:16 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 28.125 kHz [ 28 + 1/8 kHz ] + * [ (25)*1125 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 28.125 kHz [ 28 + 1/8 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 97152 + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 541.456 mHz + * Coefficients: + * BW0: 16 + * BW1: 24 + * BW2: 15 + * BW3: 15 + * BW4: 3 + * BW5: 7 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 85.378 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 3 + * BW5: 7 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 85.378 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 3 + * BW5: 7 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 2332 0x091C + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 2138 0x085A + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 1 0x01 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 18583993 0x11B91B9 + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 304908 0x0004A70C + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 16 0x10 + * 0x0509[5:0] BW1_PLL 24 0x18 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 3 0x03 + * 0x050D[5:0] BW5_PLL 7 0x07 + * 0x050E[5:0] FASTLOCK_BW0_PLL 23 0x17 + * 0x050F[5:0] FASTLOCK_BW1_PLL 40 0x28 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 3 0x03 + * 0x0513[5:0] FASTLOCK_BW5_PLL 7 0x07 + * 0x0515[55:0] M_NUM 208632331370496 0x00BDC000000000 + * 0x051C[31:0] M_DEN 2147483648 0x80000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 0 0x0 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 59260 0x00E77C + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 18 0x12 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 969 0x03C9 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 23 0x17 + * 0x059E[5:0] HOLDEXIT_BW1 40 0x28 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 3 0x03 + * 0x05A2[5:0] HOLDEXIT_BW5 7 0x07 + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 1 0x1 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_1125_2997[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0x99 }, + { 0x002F, 0x07 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0xF7 }, + { 0x0037, 0x06 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x02 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xB8 }, + { 0x005B, 0xF8 }, + { 0x005C, 0xA9 }, + { 0x005D, 0x00 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0xB7 }, + { 0x00AA, 0x7D }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x11 }, + { 0x0509, 0x19 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x07 }, + { 0x050E, 0x18 }, + { 0x050F, 0x29 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x07 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x40 }, + { 0x0519, 0x51 }, + { 0x051A, 0xF7 }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0xC8 }, + { 0x0521, 0x3B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0x19 }, + { 0x0533, 0xC1 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x12 }, + { 0x053E, 0x06 }, + { 0x0589, 0x27 }, + { 0x058A, 0x03 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x18 }, + { 0x059E, 0x29 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x07 }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x0F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:36:10 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 33.7162837162837162... kHz [ 33 + 717/1001 kHz ] + * [ (30000/1001)*1125 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 33.7162837162837162... kHz [ 33 + 717/1001 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 81040.96 [ 81040 + 24/25 ] + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 651.210 mHz + * Coefficients: + * BW0: 17 + * BW1: 25 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 7 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 107.647 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 107.647 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 1945 0x0799 + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 1783 0x06F7 + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 2 0x02 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 11139256 0x0A9F8B8 + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 294327 0x00047DB7 + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 17 0x11 + * 0x0509[5:0] BW1_PLL 25 0x19 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 7 0x07 + * 0x050E[5:0] FASTLOCK_BW0_PLL 24 0x18 + * 0x050F[5:0] FASTLOCK_BW1_PLL 41 0x29 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 7 0x07 + * 0x0515[55:0] M_NUM 271928338153472 0x00F75140000000 + * 0x051C[31:0] M_DEN 3355443200 0xC8000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 1 0x1 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 49433 0x00C119 + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 18 0x12 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 807 0x0327 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 24 0x18 + * 0x059E[5:0] HOLDEXIT_BW1 41 0x29 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 7 0x07 + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 0 0x0 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_1125_3000[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0x98 }, + { 0x002F, 0x07 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0xF6 }, + { 0x0037, 0x06 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x02 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0x3B }, + { 0x005B, 0x24 }, + { 0x005C, 0xAA }, + { 0x005D, 0x00 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0x82 }, + { 0x00AA, 0x7D }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x11 }, + { 0x0509, 0x19 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x07 }, + { 0x050E, 0x18 }, + { 0x050F, 0x29 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x07 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0x20 }, + { 0x051A, 0x9E }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0x80 }, + { 0x0521, 0x2B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0xE7 }, + { 0x0533, 0xC0 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x12 }, + { 0x053E, 0x06 }, + { 0x0589, 0x27 }, + { 0x058A, 0x03 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x18 }, + { 0x059E, 0x29 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x07 }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x2F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:37:53 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 33.75 kHz [ 33 + 3/4 kHz ] + * [ (30)*1125 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 33.75 kHz [ 33 + 3/4 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 80960 + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 651.874 mHz + * Coefficients: + * BW0: 17 + * BW1: 25 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 7 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 107.789 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 107.789 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 1944 0x0798 + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 1782 0x06F6 + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 2 0x02 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 11150395 0x0AA243B + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 294274 0x00047D82 + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 17 0x11 + * 0x0509[5:0] BW1_PLL 25 0x19 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 7 0x07 + * 0x050E[5:0] FASTLOCK_BW0_PLL 24 0x18 + * 0x050F[5:0] FASTLOCK_BW1_PLL 41 0x29 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 7 0x07 + * 0x0515[55:0] M_NUM 173860276142080 0x009E2000000000 + * 0x051C[31:0] M_DEN 2147483648 0x80000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 0 0x0 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 49383 0x00C0E7 + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 18 0x12 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 807 0x0327 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 24 0x18 + * 0x059E[5:0] HOLDEXIT_BW1 41 0x29 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 7 0x07 + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 1 0x1 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_1125_4795[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0xC0 }, + { 0x002F, 0x04 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x5B }, + { 0x0037, 0x04 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x02 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0x5A }, + { 0x005B, 0xF4 }, + { 0x005C, 0x0F }, + { 0x005D, 0x01 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0xB3 }, + { 0x00AA, 0xB1 }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x10 }, + { 0x0509, 0x18 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x07 }, + { 0x050E, 0x17 }, + { 0x050F, 0x28 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x07 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0xA0 }, + { 0x0519, 0xA8 }, + { 0x051A, 0x7B }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0xA0 }, + { 0x0521, 0x3B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0xB0 }, + { 0x0533, 0x78 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x13 }, + { 0x053E, 0x06 }, + { 0x0589, 0xF8 }, + { 0x058A, 0x01 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x17 }, + { 0x059E, 0x28 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x07 }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x0F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:42:45 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 53.9460539460539460... kHz [ 53 + 947/1001 kHz ] + * [ (48000/1001)*1125 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 53.9460539460539460... kHz [ 53 + 947/1001 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 50650.6 [ 50650 + 3/5 ] + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 518.917 mHz + * Coefficients: + * BW0: 16 + * BW1: 24 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 7 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 80.752 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 80.752 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 1216 0x04C0 + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 1115 0x045B + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 2 0x02 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 17822810 0x10FF45A + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 307635 0x0004B1B3 + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 16 0x10 + * 0x0509[5:0] BW1_PLL 24 0x18 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 7 0x07 + * 0x050E[5:0] FASTLOCK_BW0_PLL 23 0x17 + * 0x050F[5:0] FASTLOCK_BW1_PLL 40 0x28 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 7 0x07 + * 0x0515[55:0] M_NUM 135964169076736 0x007BA8A0000000 + * 0x051C[31:0] M_DEN 2684354560 0xA0000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 1 0x1 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 30896 0x0078B0 + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 19 0x13 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 504 0x01F8 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 23 0x17 + * 0x059E[5:0] HOLDEXIT_BW1 40 0x28 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 7 0x07 + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 0 0x0 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_1125_4800[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0xBF }, + { 0x002F, 0x04 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x5A }, + { 0x0037, 0x04 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x02 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xF9 }, + { 0x005B, 0x39 }, + { 0x005C, 0x10 }, + { 0x005D, 0x01 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0x70 }, + { 0x00AA, 0xB1 }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x10 }, + { 0x0509, 0x18 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x07 }, + { 0x050E, 0x17 }, + { 0x050F, 0x28 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x07 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0xD4 }, + { 0x051A, 0x62 }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0x80 }, + { 0x0521, 0x2B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0x91 }, + { 0x0533, 0x78 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x13 }, + { 0x053E, 0x06 }, + { 0x0589, 0xF7 }, + { 0x058A, 0x01 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x17 }, + { 0x059E, 0x28 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x07 }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x2F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:41:23 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 54 kHz + * [ (48)*1125 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 54 kHz + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 50600 + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 519.444 mHz + * Coefficients: + * BW0: 16 + * BW1: 24 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 7 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 80.852 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 80.852 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 1215 0x04BF + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 1114 0x045A + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 2 0x02 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 17840633 0x11039F9 + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 307568 0x0004B170 + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 16 0x10 + * 0x0509[5:0] BW1_PLL 24 0x18 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 7 0x07 + * 0x050E[5:0] FASTLOCK_BW0_PLL 23 0x17 + * 0x050F[5:0] FASTLOCK_BW1_PLL 40 0x28 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 7 0x07 + * 0x0515[55:0] M_NUM 108662672588800 0x0062D400000000 + * 0x051C[31:0] M_DEN 2147483648 0x80000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 0 0x0 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 30865 0x007891 + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 19 0x13 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 503 0x01F7 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 23 0x17 + * 0x059E[5:0] HOLDEXIT_BW1 40 0x28 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 7 0x07 + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 1 0x1 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_1125_5000[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0x8E }, + { 0x002F, 0x04 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x2D }, + { 0x0037, 0x04 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x02 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xB9 }, + { 0x005B, 0x91 }, + { 0x005C, 0x1B }, + { 0x005D, 0x01 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0x0E }, + { 0x00AA, 0xA7 }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x10 }, + { 0x0509, 0x18 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x07 }, + { 0x050E, 0x17 }, + { 0x050F, 0x28 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x07 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0xE0 }, + { 0x051A, 0x5E }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0x80 }, + { 0x0521, 0x2B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0xBE }, + { 0x0533, 0x73 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x13 }, + { 0x053E, 0x06 }, + { 0x0589, 0xE3 }, + { 0x058A, 0x01 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x17 }, + { 0x059E, 0x28 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x07 }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x2F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:32:31 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 56.25 kHz [ 56 + 1/4 kHz ] + * [ (50)*1125 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 56.25 kHz [ 56 + 1/4 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 48576 + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 541.440 mHz + * Coefficients: + * BW0: 16 + * BW1: 24 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 7 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 85.050 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 85.050 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 1166 0x048E + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 1069 0x042D + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 2 0x02 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 18583993 0x11B91B9 + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 304910 0x0004A70E + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 16 0x10 + * 0x0509[5:0] BW1_PLL 24 0x18 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 7 0x07 + * 0x050E[5:0] FASTLOCK_BW0_PLL 23 0x17 + * 0x050F[5:0] FASTLOCK_BW1_PLL 40 0x28 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 7 0x07 + * 0x0515[55:0] M_NUM 104316165685248 0x005EE000000000 + * 0x051C[31:0] M_DEN 2147483648 0x80000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 0 0x0 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 29630 0x0073BE + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 19 0x13 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 483 0x01E3 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 23 0x17 + * 0x059E[5:0] HOLDEXIT_BW1 40 0x28 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 7 0x07 + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 1 0x1 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_1125_5994[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0xCD }, + { 0x002F, 0x03 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x7C }, + { 0x0037, 0x03 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x03 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xB8 }, + { 0x005B, 0xF8 }, + { 0x005C, 0xA9 }, + { 0x005D, 0x00 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0xB9 }, + { 0x00AA, 0x7D }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x11 }, + { 0x0509, 0x19 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x0F }, + { 0x050E, 0x18 }, + { 0x050F, 0x29 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x0F }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0xA0 }, + { 0x0519, 0xA8 }, + { 0x051A, 0x7B }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0xC8 }, + { 0x0521, 0x3B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0x8D }, + { 0x0533, 0x60 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x13 }, + { 0x053E, 0x06 }, + { 0x0589, 0x92 }, + { 0x058A, 0x01 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x18 }, + { 0x059E, 0x29 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x0F }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x0F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_NTV2_FORMAT_625_5000.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:12:49 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 67.4325674325674325... kHz [ 67 + 433/1001 kHz ] + * [ (60000/1001)*1125 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 67.4325674325674325... kHz [ 67 + 433/1001 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 40520.48 [ 40520 + 12/25 ] + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 651.191 mHz + * Coefficients: + * BW0: 17 + * BW1: 25 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 15 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 107.233 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 15 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 107.233 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 15 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 973 0x03CD + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 892 0x037C + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 3 0x03 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 11139256 0x0A9F8B8 + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 294329 0x00047DB9 + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 17 0x11 + * 0x0509[5:0] BW1_PLL 25 0x19 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 15 0x0F + * 0x050E[5:0] FASTLOCK_BW0_PLL 24 0x18 + * 0x050F[5:0] FASTLOCK_BW1_PLL 41 0x29 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 15 0x0F + * 0x0515[55:0] M_NUM 135964169076736 0x007BA8A0000000 + * 0x051C[31:0] M_DEN 3355443200 0xC8000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 1 0x1 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 24717 0x00608D + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 19 0x13 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 402 0x0192 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 24 0x18 + * 0x059E[5:0] HOLDEXIT_BW1 41 0x29 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 15 0x0F + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 0 0x0 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_1125_6000[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0xCC }, + { 0x002F, 0x03 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x7B }, + { 0x0037, 0x03 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x03 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0x3B }, + { 0x005B, 0x24 }, + { 0x005C, 0xAA }, + { 0x005D, 0x00 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0x84 }, + { 0x00AA, 0x7D }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x11 }, + { 0x0509, 0x19 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x0F }, + { 0x050E, 0x18 }, + { 0x050F, 0x29 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x0F }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0x10 }, + { 0x051A, 0x4F }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0x80 }, + { 0x0521, 0x2B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0x74 }, + { 0x0533, 0x60 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x13 }, + { 0x053E, 0x06 }, + { 0x0589, 0x92 }, + { 0x058A, 0x01 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x18 }, + { 0x059E, 0x29 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x0F }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x2F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:17:21 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 67.5 kHz [ 67 + 1/2 kHz ] + * [ (60)*1125 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 67.5 kHz [ 67 + 1/2 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 40480 + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 651.855 mHz + * Coefficients: + * BW0: 17 + * BW1: 25 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 15 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 107.374 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 15 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 107.374 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 15 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 972 0x03CC + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 891 0x037B + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 3 0x03 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 11150395 0x0AA243B + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 294276 0x00047D84 + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 17 0x11 + * 0x0509[5:0] BW1_PLL 25 0x19 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 15 0x0F + * 0x050E[5:0] FASTLOCK_BW0_PLL 24 0x18 + * 0x050F[5:0] FASTLOCK_BW1_PLL 41 0x29 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 15 0x0F + * 0x0515[55:0] M_NUM 86930138071040 0x004F1000000000 + * 0x051C[31:0] M_DEN 2147483648 0x80000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 0 0x0 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 24692 0x006074 + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 19 0x13 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 402 0x0192 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 24 0x18 + * 0x059E[5:0] HOLDEXIT_BW1 41 0x29 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 15 0x0F + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 1 0x1 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_2250_2398[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0xC0 }, + { 0x002F, 0x04 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x5B }, + { 0x0037, 0x04 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x02 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0x5A }, + { 0x005B, 0xF4 }, + { 0x005C, 0x0F }, + { 0x005D, 0x01 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0xB3 }, + { 0x00AA, 0xB1 }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x10 }, + { 0x0509, 0x18 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x07 }, + { 0x050E, 0x17 }, + { 0x050F, 0x28 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x07 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0xA0 }, + { 0x0519, 0xA8 }, + { 0x051A, 0x7B }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0xA0 }, + { 0x0521, 0x3B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0xB0 }, + { 0x0533, 0x78 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x13 }, + { 0x053E, 0x06 }, + { 0x0589, 0xF8 }, + { 0x058A, 0x01 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x17 }, + { 0x059E, 0x28 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x07 }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x0F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:52:56 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 53.9460539460539460... kHz [ 53 + 947/1001 kHz ] + * [ (24000/1001)*2250 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 53.9460539460539460... kHz [ 53 + 947/1001 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 50650.6 [ 50650 + 3/5 ] + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 518.917 mHz + * Coefficients: + * BW0: 16 + * BW1: 24 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 7 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 80.752 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 80.752 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 1216 0x04C0 + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 1115 0x045B + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 2 0x02 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 17822810 0x10FF45A + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 307635 0x0004B1B3 + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 16 0x10 + * 0x0509[5:0] BW1_PLL 24 0x18 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 7 0x07 + * 0x050E[5:0] FASTLOCK_BW0_PLL 23 0x17 + * 0x050F[5:0] FASTLOCK_BW1_PLL 40 0x28 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 7 0x07 + * 0x0515[55:0] M_NUM 135964169076736 0x007BA8A0000000 + * 0x051C[31:0] M_DEN 2684354560 0xA0000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 1 0x1 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 30896 0x0078B0 + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 19 0x13 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 504 0x01F8 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 23 0x17 + * 0x059E[5:0] HOLDEXIT_BW1 40 0x28 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 7 0x07 + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 0 0x0 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_2250_2400[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0xBF }, + { 0x002F, 0x04 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x5A }, + { 0x0037, 0x04 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x02 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xF9 }, + { 0x005B, 0x39 }, + { 0x005C, 0x10 }, + { 0x005D, 0x01 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0x70 }, + { 0x00AA, 0xB1 }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x10 }, + { 0x0509, 0x18 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x07 }, + { 0x050E, 0x17 }, + { 0x050F, 0x28 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x07 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0xD4 }, + { 0x051A, 0x62 }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0x80 }, + { 0x0521, 0x2B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0x91 }, + { 0x0533, 0x78 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x13 }, + { 0x053E, 0x06 }, + { 0x0589, 0xF7 }, + { 0x058A, 0x01 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x17 }, + { 0x059E, 0x28 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x07 }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x2F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:56:56 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 54 kHz + * [ (24)*2250 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 54 kHz + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 50600 + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 519.444 mHz + * Coefficients: + * BW0: 16 + * BW1: 24 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 7 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 80.852 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 80.852 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 1215 0x04BF + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 1114 0x045A + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 2 0x02 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 17840633 0x11039F9 + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 307568 0x0004B170 + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 16 0x10 + * 0x0509[5:0] BW1_PLL 24 0x18 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 7 0x07 + * 0x050E[5:0] FASTLOCK_BW0_PLL 23 0x17 + * 0x050F[5:0] FASTLOCK_BW1_PLL 40 0x28 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 7 0x07 + * 0x0515[55:0] M_NUM 108662672588800 0x0062D400000000 + * 0x051C[31:0] M_DEN 2147483648 0x80000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 0 0x0 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 30865 0x007891 + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 19 0x13 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 503 0x01F7 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 23 0x17 + * 0x059E[5:0] HOLDEXIT_BW1 40 0x28 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 7 0x07 + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 1 0x1 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_2250_2500[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0x8E }, + { 0x002F, 0x04 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x2D }, + { 0x0037, 0x04 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x02 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xB9 }, + { 0x005B, 0x91 }, + { 0x005C, 0x1B }, + { 0x005D, 0x01 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0x0E }, + { 0x00AA, 0xA7 }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x10 }, + { 0x0509, 0x18 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x07 }, + { 0x050E, 0x17 }, + { 0x050F, 0x28 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x07 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0xE0 }, + { 0x051A, 0x5E }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0x80 }, + { 0x0521, 0x2B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0xBE }, + { 0x0533, 0x73 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x13 }, + { 0x053E, 0x06 }, + { 0x0589, 0xE3 }, + { 0x058A, 0x01 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x17 }, + { 0x059E, 0x28 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x07 }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x2F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:58:32 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 56.25 kHz [ 56 + 1/4 kHz ] + * [ (25)*2250 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 56.25 kHz [ 56 + 1/4 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 48576 + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 541.440 mHz + * Coefficients: + * BW0: 16 + * BW1: 24 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 7 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 85.050 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 85.050 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 7 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 1166 0x048E + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 1069 0x042D + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 2 0x02 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 18583993 0x11B91B9 + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 304910 0x0004A70E + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 16 0x10 + * 0x0509[5:0] BW1_PLL 24 0x18 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 7 0x07 + * 0x050E[5:0] FASTLOCK_BW0_PLL 23 0x17 + * 0x050F[5:0] FASTLOCK_BW1_PLL 40 0x28 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 7 0x07 + * 0x0515[55:0] M_NUM 104316165685248 0x005EE000000000 + * 0x051C[31:0] M_DEN 2147483648 0x80000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 0 0x0 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 29630 0x0073BE + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 19 0x13 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 483 0x01E3 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 23 0x17 + * 0x059E[5:0] HOLDEXIT_BW1 40 0x28 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 7 0x07 + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 1 0x1 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_2250_2997[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0xCD }, + { 0x002F, 0x03 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x7C }, + { 0x0037, 0x03 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x03 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xB8 }, + { 0x005B, 0xF8 }, + { 0x005C, 0xA9 }, + { 0x005D, 0x00 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0xB9 }, + { 0x00AA, 0x7D }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x11 }, + { 0x0509, 0x19 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x0F }, + { 0x050E, 0x18 }, + { 0x050F, 0x29 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x0F }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0xA0 }, + { 0x0519, 0xA8 }, + { 0x051A, 0x7B }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0xC8 }, + { 0x0521, 0x3B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0x8D }, + { 0x0533, 0x60 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x13 }, + { 0x053E, 0x06 }, + { 0x0589, 0x92 }, + { 0x058A, 0x01 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x18 }, + { 0x059E, 0x29 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x0F }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x0F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:53:54 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 67.4325674325674325... kHz [ 67 + 433/1001 kHz ] + * [ (30000/1001)*2250 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 67.4325674325674325... kHz [ 67 + 433/1001 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 40520.48 [ 40520 + 12/25 ] + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 651.191 mHz + * Coefficients: + * BW0: 17 + * BW1: 25 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 15 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 107.233 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 15 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 107.233 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 15 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 973 0x03CD + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 892 0x037C + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 3 0x03 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 11139256 0x0A9F8B8 + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 294329 0x00047DB9 + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 17 0x11 + * 0x0509[5:0] BW1_PLL 25 0x19 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 15 0x0F + * 0x050E[5:0] FASTLOCK_BW0_PLL 24 0x18 + * 0x050F[5:0] FASTLOCK_BW1_PLL 41 0x29 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 15 0x0F + * 0x0515[55:0] M_NUM 135964169076736 0x007BA8A0000000 + * 0x051C[31:0] M_DEN 3355443200 0xC8000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 1 0x1 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 24717 0x00608D + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 19 0x13 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 402 0x0192 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 24 0x18 + * 0x059E[5:0] HOLDEXIT_BW1 41 0x29 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 15 0x0F + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 0 0x0 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_2250_3000[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0xCC }, + { 0x002F, 0x03 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x7B }, + { 0x0037, 0x03 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x03 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0x3B }, + { 0x005B, 0x24 }, + { 0x005C, 0xAA }, + { 0x005D, 0x00 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0x84 }, + { 0x00AA, 0x7D }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x11 }, + { 0x0509, 0x19 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x0F }, + { 0x050E, 0x18 }, + { 0x050F, 0x29 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x0F }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0x10 }, + { 0x051A, 0x4F }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0x80 }, + { 0x0521, 0x2B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0x74 }, + { 0x0533, 0x60 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x13 }, + { 0x053E, 0x06 }, + { 0x0589, 0x92 }, + { 0x058A, 0x01 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x18 }, + { 0x059E, 0x29 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x0F }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x2F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:59:12 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 67.5 kHz [ 67 + 1/2 kHz ] + * [ (30)*2250 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 67.5 kHz [ 67 + 1/2 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 40480 + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 651.855 mHz + * Coefficients: + * BW0: 17 + * BW1: 25 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 15 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 107.374 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 15 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 107.374 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 15 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 972 0x03CC + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 891 0x037B + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 3 0x03 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 11150395 0x0AA243B + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 294276 0x00047D84 + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 17 0x11 + * 0x0509[5:0] BW1_PLL 25 0x19 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 15 0x0F + * 0x050E[5:0] FASTLOCK_BW0_PLL 24 0x18 + * 0x050F[5:0] FASTLOCK_BW1_PLL 41 0x29 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 15 0x0F + * 0x0515[55:0] M_NUM 86930138071040 0x004F1000000000 + * 0x051C[31:0] M_DEN 2147483648 0x80000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 0 0x0 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 24692 0x006074 + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 19 0x13 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 402 0x0192 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 24 0x18 + * 0x059E[5:0] HOLDEXIT_BW1 41 0x29 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 15 0x0F + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 1 0x1 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_2250_4795[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0x60 }, + { 0x002F, 0x02 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x2E }, + { 0x0037, 0x02 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x03 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0x5A }, + { 0x005B, 0xF4 }, + { 0x005C, 0x0F }, + { 0x005D, 0x01 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0xB4 }, + { 0x00AA, 0xB1 }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x10 }, + { 0x0509, 0x18 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x0F }, + { 0x050E, 0x17 }, + { 0x050F, 0x28 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x0F }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x50 }, + { 0x0519, 0xD4 }, + { 0x051A, 0x3D }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0xA0 }, + { 0x0521, 0x3B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0x58 }, + { 0x0533, 0x3C }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x14 }, + { 0x053E, 0x06 }, + { 0x0589, 0xFA }, + { 0x058A, 0x00 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x17 }, + { 0x059E, 0x28 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x0F }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x0F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:55:04 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 107.8921078921078921... kHz [ 107 + 893/1001 kHz ] + * [ (48000/1001)*2250 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 107.8921078921078921... kHz [ 107 + 893/1001 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 25325.3 [ 25325 + 3/10 ] + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 518.909 mHz + * Coefficients: + * BW0: 16 + * BW1: 24 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 15 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 80.597 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 15 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 80.597 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 15 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 608 0x0260 + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 558 0x022E + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 3 0x03 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 17822810 0x10FF45A + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 307636 0x0004B1B4 + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 16 0x10 + * 0x0509[5:0] BW1_PLL 24 0x18 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 15 0x0F + * 0x050E[5:0] FASTLOCK_BW0_PLL 23 0x17 + * 0x050F[5:0] FASTLOCK_BW1_PLL 40 0x28 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 15 0x0F + * 0x0515[55:0] M_NUM 67982084538368 0x003DD450000000 + * 0x051C[31:0] M_DEN 2684354560 0xA0000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 1 0x1 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 15448 0x003C58 + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 20 0x14 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 250 0x00FA + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 23 0x17 + * 0x059E[5:0] HOLDEXIT_BW1 40 0x28 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 15 0x0F + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 0 0x0 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_2250_4800[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0x60 }, + { 0x002F, 0x02 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x2D }, + { 0x0037, 0x02 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x03 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xF9 }, + { 0x005B, 0x39 }, + { 0x005C, 0x10 }, + { 0x005D, 0x01 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0x71 }, + { 0x00AA, 0xB1 }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x10 }, + { 0x0509, 0x18 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x0F }, + { 0x050E, 0x17 }, + { 0x050F, 0x28 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x0F }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0x6A }, + { 0x051A, 0x31 }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0x80 }, + { 0x0521, 0x2B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0x49 }, + { 0x0533, 0x3C }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x14 }, + { 0x053E, 0x06 }, + { 0x0589, 0xFA }, + { 0x058A, 0x00 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x17 }, + { 0x059E, 0x28 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x0F }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x2F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 17:00:10 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 108 kHz + * [ (48)*2250 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 108 kHz + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 25300 + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 519.436 mHz + * Coefficients: + * BW0: 16 + * BW1: 24 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 15 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 80.697 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 15 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 80.697 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 15 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 608 0x0260 + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 557 0x022D + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 3 0x03 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 17840633 0x11039F9 + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 307569 0x0004B171 + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 16 0x10 + * 0x0509[5:0] BW1_PLL 24 0x18 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 15 0x0F + * 0x050E[5:0] FASTLOCK_BW0_PLL 23 0x17 + * 0x050F[5:0] FASTLOCK_BW1_PLL 40 0x28 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 15 0x0F + * 0x0515[55:0] M_NUM 54331336294400 0x00316A00000000 + * 0x051C[31:0] M_DEN 2147483648 0x80000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 0 0x0 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 15433 0x003C49 + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 20 0x14 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 250 0x00FA + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 23 0x17 + * 0x059E[5:0] HOLDEXIT_BW1 40 0x28 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 15 0x0F + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 1 0x1 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_2250_5000[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0x47 }, + { 0x002F, 0x02 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x17 }, + { 0x0037, 0x02 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x03 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xB9 }, + { 0x005B, 0x91 }, + { 0x005C, 0x1B }, + { 0x005D, 0x01 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0x0F }, + { 0x00AA, 0xA7 }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x10 }, + { 0x0509, 0x18 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x0F }, + { 0x050E, 0x17 }, + { 0x050F, 0x28 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x0F }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0x70 }, + { 0x051A, 0x2F }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0x80 }, + { 0x0521, 0x2B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0xDF }, + { 0x0533, 0x39 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x14 }, + { 0x053E, 0x06 }, + { 0x0589, 0xF0 }, + { 0x058A, 0x00 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x17 }, + { 0x059E, 0x28 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x0F }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x2F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 17:02:04 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 112.5 kHz [ 112 + 1/2 kHz ] + * [ (50)*2250 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 112.5 kHz [ 112 + 1/2 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 24288 + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 541.432 mHz + * Coefficients: + * BW0: 16 + * BW1: 24 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 15 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 84.887 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 15 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 84.887 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 15 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 583 0x0247 + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 535 0x0217 + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 3 0x03 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 18583993 0x11B91B9 + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 304911 0x0004A70F + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 16 0x10 + * 0x0509[5:0] BW1_PLL 24 0x18 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 15 0x0F + * 0x050E[5:0] FASTLOCK_BW0_PLL 23 0x17 + * 0x050F[5:0] FASTLOCK_BW1_PLL 40 0x28 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 15 0x0F + * 0x0515[55:0] M_NUM 52158082842624 0x002F7000000000 + * 0x051C[31:0] M_DEN 2147483648 0x80000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 0 0x0 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 14815 0x0039DF + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 20 0x14 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 240 0x00F0 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 23 0x17 + * 0x059E[5:0] HOLDEXIT_BW1 40 0x28 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 15 0x0F + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 1 0x1 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_2250_5994[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0xE7 }, + { 0x002F, 0x01 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0xBE }, + { 0x0037, 0x01 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x04 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0xB8 }, + { 0x005B, 0xF8 }, + { 0x005C, 0xA9 }, + { 0x005D, 0x00 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0xB9 }, + { 0x00AA, 0x7D }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x11 }, + { 0x0509, 0x19 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x1F }, + { 0x050E, 0x18 }, + { 0x050F, 0x29 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x1F }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x50 }, + { 0x0519, 0xD4 }, + { 0x051A, 0x3D }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0xC8 }, + { 0x0521, 0x3B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0x47 }, + { 0x0533, 0x30 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x14 }, + { 0x053E, 0x06 }, + { 0x0589, 0xC8 }, + { 0x058A, 0x00 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x18 }, + { 0x059E, 0x29 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x1F }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x0F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 16:56:00 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 134.8651348651348651... kHz [ 134 + 866/1001 kHz ] + * [ (60000/1001)*2250 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 134.8651348651348651... kHz [ 134 + 866/1001 kHz ] + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 20260.24 [ 20260 + 6/25 ] + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 651.181 mHz + * Coefficients: + * BW0: 17 + * BW1: 25 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 31 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 107.028 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 31 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 107.028 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 31 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 487 0x01E7 + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 446 0x01BE + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 4 0x04 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 11139256 0x0A9F8B8 + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 294329 0x00047DB9 + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 17 0x11 + * 0x0509[5:0] BW1_PLL 25 0x19 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 31 0x1F + * 0x050E[5:0] FASTLOCK_BW0_PLL 24 0x18 + * 0x050F[5:0] FASTLOCK_BW1_PLL 41 0x29 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 31 0x1F + * 0x0515[55:0] M_NUM 67982084538368 0x003DD450000000 + * 0x051C[31:0] M_DEN 3355443200 0xC8000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 1 0x1 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 12359 0x003047 + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 20 0x14 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 200 0x00C8 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 24 0x18 + * 0x059E[5:0] HOLDEXIT_BW1 41 0x29 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 31 0x1F + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 0 0x0 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_2250_6000[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xFF }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x01 }, + { 0x002D, 0x02 }, + { 0x002E, 0xE6 }, + { 0x002F, 0x01 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0xBE }, + { 0x0037, 0x01 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x01 }, + { 0x0040, 0x04 }, + { 0x0041, 0x04 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x00 }, + { 0x0050, 0x0F }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x01 }, + { 0x005A, 0x3B }, + { 0x005B, 0x24 }, + { 0x005C, 0xAA }, + { 0x005D, 0x00 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0x84 }, + { 0x00AA, 0x7D }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x28 }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x02 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x01 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x01 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x29 }, + { 0x0126, 0x01 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x28 }, + { 0x012B, 0x01 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x28 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x2A }, + { 0x013A, 0x01 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x28 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x0A }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x01 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x02 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x49 }, + { 0x026C, 0x4F }, + { 0x026D, 0x34 }, + { 0x026E, 0x4B }, + { 0x026F, 0x2B }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x60 }, + { 0x0310, 0x53 }, + { 0x0311, 0x2E }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x80 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0xE0 }, + { 0x031B, 0x3D }, + { 0x031C, 0x0B }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x80 }, + { 0x0321, 0xBB }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x11 }, + { 0x0509, 0x19 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x01 }, + { 0x050D, 0x1F }, + { 0x050E, 0x18 }, + { 0x050F, 0x29 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x01 }, + { 0x0513, 0x1F }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0x88 }, + { 0x051A, 0x27 }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0x80 }, + { 0x0521, 0x2B }, + { 0x052A, 0x01 }, + { 0x052B, 0x01 }, + { 0x052C, 0x0F }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0x3A }, + { 0x0533, 0x30 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x14 }, + { 0x053E, 0x06 }, + { 0x0589, 0xC7 }, + { 0x058A, 0x00 }, + { 0x059B, 0xF8 }, + { 0x059D, 0x18 }, + { 0x059E, 0x29 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x01 }, + { 0x05A2, 0x1F }, + { 0x05A6, 0x00 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x31 }, + { 0x094A, 0x01 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x07 }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x07 }, + { 0x0A14, 0x00 }, + { 0x0A1A, 0x00 }, + { 0x0A20, 0x00 }, + { 0x0A26, 0x00 }, + { 0x0A2C, 0x00 }, + { 0x0B44, 0x2F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x0E }, + { 0x0B48, 0x0E }, + { 0x0B4A, 0x18 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: C:\XilinxProjects\flint_tr051017\genlock\FormatFiles\IO4K+_1125_5994.slabtimeproj + * Design ID: IO4K+ + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2017-08-24 17:01:00 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 148.5 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 135 kHz + * [ (60)*2250 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: Unused + * IN3: Unused + * + * Outputs: + * OUT0: 27 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT3: Unused + * OUT4: Unused + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: Unused + * OUT7: Unused + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT9: Unused + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 135 kHz + * Fms0 = 594 MHz + * Fms1 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms2 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = Unused + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 20240 + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT0: 27 MHz + * OUT2: 148.5 MHz [ 148 + 1/2 MHz ] + * N1: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N2: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT8: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N3: + * Unused + * N4: + * Unused + * + * R dividers: + * R0 = 22 + * R1 = Unused + * R2 = 4 + * R3 = Unused + * R4 = Unused + * R5 = 6 + * R6 = Unused + * R7 = Unused + * R8 = 6 + * R9 = Unused + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 651.845 mHz + * Coefficients: + * BW0: 17 + * BW1: 25 + * BW2: 15 + * BW3: 15 + * BW4: 1 + * BW5: 31 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 107.169 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 31 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 107.169 Hz + * Coefficients: + * BW0: 24 + * BW1: 41 + * BW2: 12 + * BW3: 11 + * BW4: 1 + * BW5: 31 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 °C + * Airflow: None + * + * Total Power: 808 mW, On Chip Power: 784 mW, Tj: 87 °C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 147.9 mA 266 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO1 Unused + * VDDO2 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO3 Unused + * VDDO4 Unused + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 Unused + * VDDO7 Unused + * VDDO8 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO9 Unused + * -------- -------- + * Total 327.2 mA 808 mW + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 °C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- ----------------- ----------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 15 0xF + * 0x0018[7:4] OOF_INTR_MSK 15 0xF + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 1 0x1 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 0 0x0 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 486 0x01E6 + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 0 0x0000 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 446 0x01BE + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 0 0x0000 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 1 0x1 + * 0x003F[7:4] FAST_OOF_EN 0 0x0 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 4 0x04 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 0 0x00 + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 0 0x00 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 0 0x00 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 0 0x0 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0050[3:0] OOF_ON_LOS 15 0xF + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 0 0x0 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 0 0x0 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 0 0x0 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 11150395 0x0AA243B + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 0 0x0000000 + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 294276 0x00047D84 + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 0 0x0 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 0 0x0 + * 0x0112[1] OUT2_OE 1 0x1 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 1 0x1 + * 0x0117[1] OUT3_OE 0 0x0 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 1 0x1 + * 0x011C[1] OUT4_OE 0 0x0 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 1 0x1 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 1 0x1 + * 0x0126[1] OUT6_OE 0 0x0 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 0 0x0 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 1 0x1 + * 0x012B[1] OUT7_OE 0 0x0 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 0 0x0 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 2 0x2 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 1 0x1 + * 0x013A[1] OUT9_OE 0 0x0 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 0 0x0 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 0 0x000000000000 + * 0x0222[31:0] P2_DEN 0 0x00000000 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 10 0x00000A + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 1 0x000001 + * 0x0253[23:0] R3_REG 0 0x000000 + * 0x0256[23:0] R4_REG 0 0x000000 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 0 0x000000 + * 0x025F[23:0] R7_REG 0 0x000000 + * 0x0262[23:0] R8_REG 2 0x000002 + * 0x0268[23:0] R9_REG 0 0x000000 + * 0x026B[7:0] DESIGN_ID0 73 0x49 + * 0x026C[7:0] DESIGN_ID1 79 0x4F + * 0x026D[7:0] DESIGN_ID2 52 0x34 + * 0x026E[7:0] DESIGN_ID3 75 0x4B + * 0x026F[7:0] DESIGN_ID4 43 0x2B + * 0x0270[7:0] DESIGN_ID5 0 0x00 + * 0x0271[7:0] DESIGN_ID6 0 0x00 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 198967296000 0x02E53600000 + * 0x0313[31:0] N1_DEN 2147483648 0x80000000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 48282730496 0x00B3DE00000 + * 0x031E[31:0] N2_DEN 3145728000 0xBB800000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 0 0x00000000000 + * 0x0329[31:0] N3_DEN 0 0x00000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 0 0x00000000000 + * 0x0334[31:0] N4_DEN 0 0x00000000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 17 0x11 + * 0x0509[5:0] BW1_PLL 25 0x19 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 1 0x01 + * 0x050D[5:0] BW5_PLL 31 0x1F + * 0x050E[5:0] FASTLOCK_BW0_PLL 24 0x18 + * 0x050F[5:0] FASTLOCK_BW1_PLL 41 0x29 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 1 0x01 + * 0x0513[5:0] FASTLOCK_BW5_PLL 31 0x1F + * 0x0515[55:0] M_NUM 43465069035520 0x00278800000000 + * 0x051C[31:0] M_DEN 2147483648 0x80000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 0 0x0 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 1 0x1 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 0 0x0 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 12346 0x00303A + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 20 0x14 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 199 0x00C7 + * 0x059B[4] HOLD_PRESERVE_HIST 1 0x1 + * 0x059B[5] HOLD_FRZ_WITH_INTONLY 1 0x1 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 24 0x18 + * 0x059E[5:0] HOLDEXIT_BW1 41 0x29 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 1 0x01 + * 0x05A2[5:0] HOLDEXIT_BW5 31 0x1F + * 0x05A6[2:0] RAMP_STEP_SIZE 0 0x0 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 1 0x1 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 1 0x1 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 7 0x07 + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 7 0x07 + * 0x0A14[3] N0_HIGH_FREQ 0 0x0 + * 0x0A1A[3] N1_HIGH_FREQ 0 0x0 + * 0x0A20[3] N2_HIGH_FREQ 0 0x0 + * 0x0A26[3] N3_HIGH_FREQ 0 0x0 + * 0x0A2C[3] N4_HIGH_FREQ 0 0x0 + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 1 0x1 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 14 0x0E + * 0x0B48[4:0] OOF_DIV_CLK_DIS 14 0x0E + * 0x0B4A[4:0] N_CLK_DIS 24 0x18 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + + +static struct ntv2_genlock_data s_genlock_ntsc_27mhz[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x64 }, + { 0x0016, 0x02 }, + { 0x0017, 0xFC }, + { 0x0018, 0xBB }, + { 0x0019, 0xDF }, + { 0x001A, 0xDF }, + { 0x002B, 0x02 }, + { 0x002C, 0x05 }, + { 0x002D, 0x12 }, + { 0x002E, 0x48 }, + { 0x002F, 0x10 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x23 }, + { 0x0033, 0x1B }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0xED }, + { 0x0037, 0x0E }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x23 }, + { 0x003B, 0x1B }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x45 }, + { 0x0040, 0x04 }, + { 0x0041, 0x00 }, + { 0x0042, 0x00 }, + { 0x0043, 0x0B }, + { 0x0044, 0x00 }, + { 0x0045, 0x0C }, + { 0x0046, 0x96 }, + { 0x0047, 0x00 }, + { 0x0048, 0x32 }, + { 0x0049, 0x00 }, + { 0x004A, 0x4B }, + { 0x004B, 0x00 }, + { 0x004C, 0x32 }, + { 0x004D, 0x00 }, + { 0x004E, 0x05 }, + { 0x004F, 0x05 }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x03 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x03 }, + { 0x0058, 0x00 }, + { 0x0059, 0x11 }, + { 0x005A, 0xBF }, + { 0x005B, 0x47 }, + { 0x005C, 0x3D }, + { 0x005D, 0x01 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x9D }, + { 0x0063, 0xD8 }, + { 0x0064, 0x09 }, + { 0x0065, 0x01 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x02 }, + { 0x0093, 0xA0 }, + { 0x0095, 0x00 }, + { 0x0096, 0x90 }, + { 0x0098, 0x70 }, + { 0x009A, 0x02 }, + { 0x009B, 0x50 }, + { 0x009D, 0x04 }, + { 0x009E, 0x60 }, + { 0x00A0, 0x30 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0x8D }, + { 0x00AA, 0x8C }, + { 0x00AB, 0x04 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x21 }, + { 0x00EA, 0xD1 }, + { 0x00EB, 0xB1 }, + { 0x00EC, 0x03 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x01 }, + { 0x0108, 0x02 }, + { 0x0109, 0x09 }, + { 0x010A, 0x3B }, + { 0x010B, 0x2A }, + { 0x010D, 0x01 }, + { 0x010E, 0x09 }, + { 0x010F, 0x3B }, + { 0x0110, 0x28 }, + { 0x0112, 0x01 }, + { 0x0113, 0x09 }, + { 0x0114, 0x3B }, + { 0x0115, 0x28 }, + { 0x0117, 0x02 }, + { 0x0118, 0x09 }, + { 0x0119, 0x3B }, + { 0x011A, 0x28 }, + { 0x011C, 0x02 }, + { 0x011D, 0x09 }, + { 0x011E, 0x3B }, + { 0x011F, 0x28 }, + { 0x0121, 0x02 }, + { 0x0122, 0x09 }, + { 0x0123, 0x3B }, + { 0x0124, 0x2B }, + { 0x0126, 0x02 }, + { 0x0127, 0x09 }, + { 0x0128, 0x3B }, + { 0x0129, 0x29 }, + { 0x012B, 0x02 }, + { 0x012C, 0x09 }, + { 0x012D, 0x3B }, + { 0x012E, 0x29 }, + { 0x0130, 0x02 }, + { 0x0131, 0x09 }, + { 0x0132, 0x3B }, + { 0x0133, 0x28 }, + { 0x013A, 0x02 }, + { 0x013B, 0x09 }, + { 0x013C, 0x3B }, + { 0x013D, 0x2C }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x40 }, + { 0x0142, 0xFF }, + { 0x0206, 0x00 }, + { 0x0208, 0x01 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x01 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0xB4 }, + { 0x021D, 0x06 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x01 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x0B }, + { 0x0232, 0x0B }, + { 0x0233, 0x0B }, + { 0x0234, 0x0B }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x78 }, + { 0x0239, 0xD5 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0xD0 }, + { 0x024A, 0x01 }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x00 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x01 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x01 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x02 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x02 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x02 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x0A }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x03 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x31 }, + { 0x026C, 0x32 }, + { 0x026D, 0x47 }, + { 0x026E, 0x4D }, + { 0x026F, 0x5F }, + { 0x0270, 0x76 }, + { 0x0271, 0x45 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x02 }, + { 0x0299, 0x02 }, + { 0x029D, 0xF5 }, + { 0x029E, 0x0E }, + { 0x029F, 0x00 }, + { 0x02A9, 0x66 }, + { 0x02AA, 0x26 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0xFF }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x80 }, + { 0x0306, 0x0B }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x80 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0xE0 }, + { 0x0310, 0x3D }, + { 0x0311, 0x0B }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x80 }, + { 0x0316, 0xBB }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0x00 }, + { 0x031B, 0xAF }, + { 0x031C, 0x1A }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x00 }, + { 0x0321, 0xC8 }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x60 }, + { 0x0326, 0x53 }, + { 0x0327, 0x2E }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x80 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0xC0 }, + { 0x0331, 0xAB }, + { 0x0332, 0x06 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x40 }, + { 0x0337, 0x9C }, + { 0x0338, 0x00 }, + { 0x0339, 0x1F }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x01 }, + { 0x0508, 0x10 }, + { 0x0509, 0x18 }, + { 0x050A, 0x0F }, + { 0x050B, 0x0F }, + { 0x050C, 0x07 }, + { 0x050D, 0x07 }, + { 0x050E, 0x17 }, + { 0x050F, 0x28 }, + { 0x0510, 0x0C }, + { 0x0511, 0x0B }, + { 0x0512, 0x07 }, + { 0x0513, 0x07 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0xF9 }, + { 0x051A, 0xA7 }, + { 0x051B, 0x01 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0xA0 }, + { 0x0521, 0x3B }, + { 0x052A, 0x00 }, + { 0x052B, 0x01 }, + { 0x052C, 0xEF }, + { 0x052D, 0x03 }, + { 0x052E, 0x15 }, + { 0x052F, 0x14 }, + { 0x0531, 0x00 }, + { 0x0532, 0xC6 }, + { 0x0533, 0x9D }, + { 0x0534, 0x01 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x02 }, + { 0x053B, 0x03 }, + { 0x053C, 0x00 }, + { 0x053D, 0x11 }, + { 0x053E, 0x06 }, + { 0x0589, 0xC6 }, + { 0x058A, 0x06 }, + { 0x059B, 0xD8 }, + { 0x059D, 0x17 }, + { 0x059E, 0x28 }, + { 0x059F, 0x0C }, + { 0x05A0, 0x0B }, + { 0x05A1, 0x07 }, + { 0x05A2, 0x07 }, + { 0x05A6, 0x05 }, + { 0x0802, 0x35 }, + { 0x0803, 0x05 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x03 }, + { 0x0943, 0x00 }, + { 0x0949, 0x35 }, + { 0x094A, 0x05 }, + { 0x094E, 0x49 }, + { 0x094F, 0x02 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x1F }, + { 0x0A04, 0x01 }, + { 0x0A05, 0x1F }, + { 0x0B44, 0x0F }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x00 }, + { 0x0B48, 0x0A }, + { 0x0B4A, 0x00 }, + { 0x0B57, 0xF9 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: E:\Projects\Kona_5\Firmware\Genlock\Wedge_NTSC_27MHz_0vF.slabtimeproj + * Design ID: 12GM_vE + * Created By: ClockBuilder Pro v2.15 [2017-05-15] + * Timestamp: 2018-10-19 14:30:22 GMT-07:00 + * + * Design Notes + * ============ + * assumes NTSC HSYNC (pulsed) input = (30/1.001)*525 + * + * Design Rule Check + * ================= + * Errors: + * - No errors + * + * Warnings: + * - Pulsed LVCMOS input buffer mode has been selected. This mode has non-standard input voltage logic thresholds: 0.33 V for Vil (max) and 0.49 V for Vih (min). Select this mode only if your input clock has a duty cycle significantly less or more than 50%. Refer to the device datasheet for the exact threshold voltage specifications and the input attenuator circuit (DC coupled Pulsed LVCMOS) in the Family Reference Manual. + * + * Device Grade + * ============ + * Maximum Output Frequency: 156.25 MHz + * Frequency Synthesis Mode: Fractional + * Minimum Base OPN: Si5345B + * Actual Base OPN: Si5345B + * + * Base Output Clock Supported Frequency Synthesis Modes + * OPN Grade Frequency Range (Typical Jitter) + * --------- ------------------- -------------------------------------------- + * Si5345A 100 Hz to 1.028 GHz Integer (< 100 fs) and fractional (< 150 fs) + * Si5345B 100 Hz to 350 MHz " + * Si5345C 100 Hz to 1.028 GHz Integer only (< 100 fs) + * Si5345D 100 Hz to 350 MHz " + * + * Design + * ====== + * Host Interface: + * I/O Power Supply: VDD (Core) + * SPI Mode: 4-Wire + * I2C Address Range: 100d to 103d / 0x64 to 0x67 (selected via A0/A1 pins) + * + * XA/XB: + * 52 MHz (XO - External Oscillator) + * + * Inputs: + * IN0: 15.7342657342657342... kHz [ 15 + 105/143 kHz ] + * [ (30/1.001)*525 ] + * Pulsed LVCMOS + * IN1: Unused + * IN2: 27 MHz + * Standard + * IN3: Unused + * + * Outputs: + * OUT0: 100 MHz + * Enabled, LVDS 2.5 V + * OUT1: Unused + * OUT2: Unused + * OUT3: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT4: 148.5 MHz [ 148 + 1/2 MHz ] + * Enabled, LVDS 2.5 V + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * Enabled, LVDS 2.5 V + * OUT6: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT7: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * [ 148.5/1.001 MHz ] + * Enabled, LVDS 2.5 V + * OUT8: 27 MHz + * Enabled, LVDS 2.5 V + * OUT9: 156.25 MHz [ 156 + 1/4 MHz ] + * Enabled, LVDS 2.5 V + * + * Frequency Plan + * ============== + * Priority: maximize the number of low jitter outputs + * + * Fvco = 13.662 GHz [ 13 + 331/500 GHz ] + * Fpfd = 15.7342657342657342... kHz [ 15 + 105/143 kHz ] + * Fms0 = 594 MHz + * Fms1 = 890.1098901098901098... MHz [ 890 + 10/91 MHz ] + * Fms2 = 400 MHz + * Fms3 = 147.456 MHz [ 147 + 57/125 MHz ] + * Fms4 = 1.25 GHz [ 1 + 1/4 GHz ] + * + * P dividers: + * P0 = 1 + * P1 = Unused + * P2 = 1716 + * P3 = Unused + * Pxaxb = 1 + * + * MXAXB = 262.7307692307692307... [ 262 + 19/26 ] + * M = 173659.2 [ 173659 + 1/5 ] + * N dividers: + * N0: + * Value: 23 + * Skew: 0.000 s + * OUT3: 148.5 MHz [ 148 + 1/2 MHz ] + * OUT4: 148.5 MHz [ 148 + 1/2 MHz ] + * OUT8: 27 MHz + * N1: + * Value: 15.3486666666666666... [ 15 + 523/1500 ] + * Skew: 0.000 s + * OUT6: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * OUT7: 148.3516483516483516... MHz [ 148 + 32/91 MHz ] + * N2: + * Value: 34.155 [ 34 + 31/200 ] + * Skew: 0.000 s + * OUT0: 100 MHz + * N3: + * Value: 92.6513671875 [ 92 + 667/1024 ] + * Skew: 0.000 s + * OUT5: 24.576 MHz [ 24 + 72/125 MHz ] + * N4: + * Value: 10.9296 [ 10 + 581/625 ] + * Skew: 0.000 s + * OUT9: 156.25 MHz [ 156 + 1/4 MHz ] + * + * R dividers: + * R0 = 4 + * R1 = Unused + * R2 = Unused + * R3 = 4 + * R4 = 4 + * R5 = 6 + * R6 = 6 + * R7 = 6 + * R8 = 22 + * R9 = 8 + * + * Nominal Bandwidth: + * Desired: 1.000 Hz + * Actual: 607.038 mHz + * Coefficients: + * BW0: 16 + * BW1: 24 + * BW2: 15 + * BW3: 15 + * BW4: 7 + * BW5: 7 + * Fastlock Bandwidth: + * Desired: 100.000 Hz + * Actual: 99.189 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 7 + * BW5: 7 + * Holdover Bandwidth: + * Desired: 100.000 Hz + * Actual: 99.189 Hz + * Coefficients: + * BW0: 23 + * BW1: 40 + * BW2: 12 + * BW3: 11 + * BW4: 7 + * BW5: 7 + * + * Dividers listed above show effective values. These values are translated to register settings by ClockBuilder Pro. For the actual register values, see below. Refer to the Family Reference Manual for information on registers related to frequency plan. + * + * Digitally Controlled Oscillator (DCO) + * ===================================== + * Mode: Register Direct Write + * + * N0: DCO Disabled + * + * N1: DCO Disabled + * + * N2: DCO Disabled + * + * N3: DCO Disabled + * + * N4: DCO Disabled + * + * Estimated Power & Junction Temperature + * ====================================== + * Assumptions: + * + * Revision: D + * VDD: 1.8 V + * Ta: 70 ?C + * Airflow: None + * + * Total Power: 1.125 W, On Chip Power: 1.077 W, Tj: 94 ?C + * + * Frequency Format Voltage Current Power + * ----------------- ------ -------- -------- -------- + * VDD 1.8 V 235.8 mA 424 mW + * VDDA 3.3 V 117.4 mA 387 mW + * VDDO0 100 MHz LVDS 2.5 V 15.6 mA 39 mW + * VDDO1 Unused + * VDDO2 Unused + * VDDO3 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO4 148.5 MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO5 24.576 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO6 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO7 148.351648... MHz LVDS 2.5 V 15.9 mA 40 mW + * VDDO8 27 MHz LVDS 2.5 V 15.1 mA 38 mW + * VDDO9 156.25 MHz LVDS 2.5 V 15.9 mA 40 mW + * -------- -------- + * Total 478.3 mA 1.125 W + * + * Note: + * + * -Total power includes on- and off-chip power. This is a typical value and estimate only. + * -Use an EVB for a more exact power measurement + * -On-chip power excludes power dissipated in external terminations. + * -Tj is junction temperature. Tj must be less than 125 ?C (on Si5345 Revision D) for device to comply with datasheet specifications. + * + * Settings + * ======== + * + * Location Setting Name Decimal Value Hex Value + * ------------ --------------------- --------------- ---------------- + * 0x000B[6:0] I2C_ADDR 100 0x64 + * 0x0016[1] LOL_ON_HOLD 1 0x1 + * 0x0017[0] SYSINCAL_INTR_MSK 0 0x0 + * 0x0017[1] LOSXAXB_INTR_MSK 0 0x0 + * 0x0017[5] SMB_TMOUT_INTR_MSK 1 0x1 + * 0x0018[3:0] LOS_INTR_MSK 11 0xB + * 0x0018[7:4] OOF_INTR_MSK 11 0xB + * 0x0019[1] LOL_INTR_MSK 1 0x1 + * 0x0019[5] HOLD_INTR_MSK 0 0x0 + * 0x001A[5] CAL_INTR_MSK 0 0x0 + * 0x002B[3] SPI_3WIRE 0 0x0 + * 0x002B[5] AUTO_NDIV_UPDATE 0 0x0 + * 0x002C[3:0] LOS_EN 5 0x5 + * 0x002C[4] LOSXAXB_DIS 0 0x0 + * 0x002D[1:0] LOS0_VAL_TIME 2 0x2 + * 0x002D[3:2] LOS1_VAL_TIME 0 0x0 + * 0x002D[5:4] LOS2_VAL_TIME 1 0x1 + * 0x002D[7:6] LOS3_VAL_TIME 0 0x0 + * 0x002E[15:0] LOS0_TRG_THR 4168 0x1048 + * 0x0030[15:0] LOS1_TRG_THR 0 0x0000 + * 0x0032[15:0] LOS2_TRG_THR 6947 0x1B23 + * 0x0034[15:0] LOS3_TRG_THR 0 0x0000 + * 0x0036[15:0] LOS0_CLR_THR 3821 0x0EED + * 0x0038[15:0] LOS1_CLR_THR 0 0x0000 + * 0x003A[15:0] LOS2_CLR_THR 6947 0x1B23 + * 0x003C[15:0] LOS3_CLR_THR 0 0x0000 + * 0x003F[3:0] OOF_EN 5 0x5 + * 0x003F[7:4] FAST_OOF_EN 4 0x4 + * 0x0040[2:0] OOF_REF_SEL 4 0x4 + * 0x0041[4:0] OOF0_DIV_SEL 0 0x00 + * 0x0042[4:0] OOF1_DIV_SEL 0 0x00 + * 0x0043[4:0] OOF2_DIV_SEL 11 0x0B + * 0x0044[4:0] OOF3_DIV_SEL 0 0x00 + * 0x0045[4:0] OOFXO_DIV_SEL 12 0x0C + * 0x0046[7:0] OOF0_SET_THR 150 0x96 + * 0x0047[7:0] OOF1_SET_THR 0 0x00 + * 0x0048[7:0] OOF2_SET_THR 50 0x32 + * 0x0049[7:0] OOF3_SET_THR 0 0x00 + * 0x004A[7:0] OOF0_CLR_THR 75 0x4B + * 0x004B[7:0] OOF1_CLR_THR 0 0x00 + * 0x004C[7:0] OOF2_CLR_THR 50 0x32 + * 0x004D[7:0] OOF3_CLR_THR 0 0x00 + * 0x004E[2:0] OOF0_DETWIN_SEL 5 0x5 + * 0x004E[6:4] OOF1_DETWIN_SEL 0 0x0 + * 0x004F[2:0] OOF2_DETWIN_SEL 5 0x5 + * 0x004F[6:4] OOF3_DETWIN_SEL 0 0x0 + * 0x0051[3:0] FAST_OOF0_SET_THR 0 0x0 + * 0x0052[3:0] FAST_OOF1_SET_THR 0 0x0 + * 0x0053[3:0] FAST_OOF2_SET_THR 3 0x3 + * 0x0054[3:0] FAST_OOF3_SET_THR 0 0x0 + * 0x0055[3:0] FAST_OOF0_CLR_THR 0 0x0 + * 0x0056[3:0] FAST_OOF1_CLR_THR 0 0x0 + * 0x0057[3:0] FAST_OOF2_CLR_THR 3 0x3 + * 0x0058[3:0] FAST_OOF3_CLR_THR 0 0x0 + * 0x0059[1:0] FAST_OOF0_DETWIN_SEL 1 0x1 + * 0x0059[3:2] FAST_OOF1_DETWIN_SEL 0 0x0 + * 0x0059[5:4] FAST_OOF2_DETWIN_SEL 1 0x1 + * 0x0059[7:6] FAST_OOF3_DETWIN_SEL 0 0x0 + * 0x005A[25:0] OOF0_RATIO_REF 20793279 0x13D47BF + * 0x005E[25:0] OOF1_RATIO_REF 0 0x0000000 + * 0x0062[25:0] OOF2_RATIO_REF 17422493 0x109D89D + * 0x0066[25:0] OOF3_RATIO_REF 0 0x0000000 + * 0x0092[1] LOL_FST_EN 1 0x1 + * 0x0093[7:4] LOL_FST_DETWIN_SEL 10 0xA + * 0x0095[3:2] LOL_FST_VALWIN_SEL 0 0x0 + * 0x0096[7:4] LOL_FST_SET_THR_SEL 9 0x9 + * 0x0098[7:4] LOL_FST_CLR_THR_SEL 7 0x7 + * 0x009A[1] LOL_SLOW_EN_PLL 1 0x1 + * 0x009B[7:4] LOL_SLW_DETWIN_SEL 5 0x5 + * 0x009D[3:2] LOL_SLW_VALWIN_SEL 1 0x1 + * 0x009E[7:4] LOL_SLW_SET_THR 6 0x6 + * 0x00A0[7:4] LOL_SLW_CLR_THR 3 0x3 + * 0x00A2[1] LOL_TIMER_EN 0 0x0 + * 0x00A9[28:0] LOL_CLR_DELAY_DIV256 298125 0x00048C8D + * 0x00E5[5] FASTLOCK_EXTEND_EN 1 0x1 + * 0x00EA[28:0] FASTLOCK_EXTEND 242129 0x0003B1D1 + * 0x0102[0] OUTALL_DISABLE_LOW 1 0x1 + * 0x0108[0] OUT0_PDN 0 0x0 + * 0x0108[1] OUT0_OE 1 0x1 + * 0x0108[2] OUT0_RDIV_FORCE2 0 0x0 + * 0x0109[2:0] OUT0_FORMAT 1 0x1 + * 0x0109[3] OUT0_SYNC_EN 1 0x1 + * 0x0109[5:4] OUT0_DIS_STATE 0 0x0 + * 0x0109[7:6] OUT0_CMOS_DRV 0 0x0 + * 0x010A[3:0] OUT0_CM 11 0xB + * 0x010A[6:4] OUT0_AMPL 3 0x3 + * 0x010B[2:0] OUT0_MUX_SEL 2 0x2 + * 0x010B[5:4] OUT0_VDD_SEL 2 0x2 + * 0x010B[3] OUT0_VDD_SEL_EN 1 0x1 + * 0x010B[7:6] OUT0_INV 0 0x0 + * 0x010D[0] OUT1_PDN 1 0x1 + * 0x010D[1] OUT1_OE 0 0x0 + * 0x010D[2] OUT1_RDIV_FORCE2 0 0x0 + * 0x010E[2:0] OUT1_FORMAT 1 0x1 + * 0x010E[3] OUT1_SYNC_EN 1 0x1 + * 0x010E[5:4] OUT1_DIS_STATE 0 0x0 + * 0x010E[7:6] OUT1_CMOS_DRV 0 0x0 + * 0x010F[3:0] OUT1_CM 11 0xB + * 0x010F[6:4] OUT1_AMPL 3 0x3 + * 0x0110[2:0] OUT1_MUX_SEL 0 0x0 + * 0x0110[5:4] OUT1_VDD_SEL 2 0x2 + * 0x0110[3] OUT1_VDD_SEL_EN 1 0x1 + * 0x0110[7:6] OUT1_INV 0 0x0 + * 0x0112[0] OUT2_PDN 1 0x1 + * 0x0112[1] OUT2_OE 0 0x0 + * 0x0112[2] OUT2_RDIV_FORCE2 0 0x0 + * 0x0113[2:0] OUT2_FORMAT 1 0x1 + * 0x0113[3] OUT2_SYNC_EN 1 0x1 + * 0x0113[5:4] OUT2_DIS_STATE 0 0x0 + * 0x0113[7:6] OUT2_CMOS_DRV 0 0x0 + * 0x0114[3:0] OUT2_CM 11 0xB + * 0x0114[6:4] OUT2_AMPL 3 0x3 + * 0x0115[2:0] OUT2_MUX_SEL 0 0x0 + * 0x0115[5:4] OUT2_VDD_SEL 2 0x2 + * 0x0115[3] OUT2_VDD_SEL_EN 1 0x1 + * 0x0115[7:6] OUT2_INV 0 0x0 + * 0x0117[0] OUT3_PDN 0 0x0 + * 0x0117[1] OUT3_OE 1 0x1 + * 0x0117[2] OUT3_RDIV_FORCE2 0 0x0 + * 0x0118[2:0] OUT3_FORMAT 1 0x1 + * 0x0118[3] OUT3_SYNC_EN 1 0x1 + * 0x0118[5:4] OUT3_DIS_STATE 0 0x0 + * 0x0118[7:6] OUT3_CMOS_DRV 0 0x0 + * 0x0119[3:0] OUT3_CM 11 0xB + * 0x0119[6:4] OUT3_AMPL 3 0x3 + * 0x011A[2:0] OUT3_MUX_SEL 0 0x0 + * 0x011A[5:4] OUT3_VDD_SEL 2 0x2 + * 0x011A[3] OUT3_VDD_SEL_EN 1 0x1 + * 0x011A[7:6] OUT3_INV 0 0x0 + * 0x011C[0] OUT4_PDN 0 0x0 + * 0x011C[1] OUT4_OE 1 0x1 + * 0x011C[2] OUT4_RDIV_FORCE2 0 0x0 + * 0x011D[2:0] OUT4_FORMAT 1 0x1 + * 0x011D[3] OUT4_SYNC_EN 1 0x1 + * 0x011D[5:4] OUT4_DIS_STATE 0 0x0 + * 0x011D[7:6] OUT4_CMOS_DRV 0 0x0 + * 0x011E[3:0] OUT4_CM 11 0xB + * 0x011E[6:4] OUT4_AMPL 3 0x3 + * 0x011F[2:0] OUT4_MUX_SEL 0 0x0 + * 0x011F[5:4] OUT4_VDD_SEL 2 0x2 + * 0x011F[3] OUT4_VDD_SEL_EN 1 0x1 + * 0x011F[7:6] OUT4_INV 0 0x0 + * 0x0121[0] OUT5_PDN 0 0x0 + * 0x0121[1] OUT5_OE 1 0x1 + * 0x0121[2] OUT5_RDIV_FORCE2 0 0x0 + * 0x0122[2:0] OUT5_FORMAT 1 0x1 + * 0x0122[3] OUT5_SYNC_EN 1 0x1 + * 0x0122[5:4] OUT5_DIS_STATE 0 0x0 + * 0x0122[7:6] OUT5_CMOS_DRV 0 0x0 + * 0x0123[3:0] OUT5_CM 11 0xB + * 0x0123[6:4] OUT5_AMPL 3 0x3 + * 0x0124[2:0] OUT5_MUX_SEL 3 0x3 + * 0x0124[5:4] OUT5_VDD_SEL 2 0x2 + * 0x0124[3] OUT5_VDD_SEL_EN 1 0x1 + * 0x0124[7:6] OUT5_INV 0 0x0 + * 0x0126[0] OUT6_PDN 0 0x0 + * 0x0126[1] OUT6_OE 1 0x1 + * 0x0126[2] OUT6_RDIV_FORCE2 0 0x0 + * 0x0127[2:0] OUT6_FORMAT 1 0x1 + * 0x0127[3] OUT6_SYNC_EN 1 0x1 + * 0x0127[5:4] OUT6_DIS_STATE 0 0x0 + * 0x0127[7:6] OUT6_CMOS_DRV 0 0x0 + * 0x0128[3:0] OUT6_CM 11 0xB + * 0x0128[6:4] OUT6_AMPL 3 0x3 + * 0x0129[2:0] OUT6_MUX_SEL 1 0x1 + * 0x0129[5:4] OUT6_VDD_SEL 2 0x2 + * 0x0129[3] OUT6_VDD_SEL_EN 1 0x1 + * 0x0129[7:6] OUT6_INV 0 0x0 + * 0x012B[0] OUT7_PDN 0 0x0 + * 0x012B[1] OUT7_OE 1 0x1 + * 0x012B[2] OUT7_RDIV_FORCE2 0 0x0 + * 0x012C[2:0] OUT7_FORMAT 1 0x1 + * 0x012C[3] OUT7_SYNC_EN 1 0x1 + * 0x012C[5:4] OUT7_DIS_STATE 0 0x0 + * 0x012C[7:6] OUT7_CMOS_DRV 0 0x0 + * 0x012D[3:0] OUT7_CM 11 0xB + * 0x012D[6:4] OUT7_AMPL 3 0x3 + * 0x012E[2:0] OUT7_MUX_SEL 1 0x1 + * 0x012E[5:4] OUT7_VDD_SEL 2 0x2 + * 0x012E[3] OUT7_VDD_SEL_EN 1 0x1 + * 0x012E[7:6] OUT7_INV 0 0x0 + * 0x0130[0] OUT8_PDN 0 0x0 + * 0x0130[1] OUT8_OE 1 0x1 + * 0x0130[2] OUT8_RDIV_FORCE2 0 0x0 + * 0x0131[2:0] OUT8_FORMAT 1 0x1 + * 0x0131[3] OUT8_SYNC_EN 1 0x1 + * 0x0131[5:4] OUT8_DIS_STATE 0 0x0 + * 0x0131[7:6] OUT8_CMOS_DRV 0 0x0 + * 0x0132[3:0] OUT8_CM 11 0xB + * 0x0132[6:4] OUT8_AMPL 3 0x3 + * 0x0133[2:0] OUT8_MUX_SEL 0 0x0 + * 0x0133[5:4] OUT8_VDD_SEL 2 0x2 + * 0x0133[3] OUT8_VDD_SEL_EN 1 0x1 + * 0x0133[7:6] OUT8_INV 0 0x0 + * 0x013A[0] OUT9_PDN 0 0x0 + * 0x013A[1] OUT9_OE 1 0x1 + * 0x013A[2] OUT9_RDIV_FORCE2 0 0x0 + * 0x013B[2:0] OUT9_FORMAT 1 0x1 + * 0x013B[3] OUT9_SYNC_EN 1 0x1 + * 0x013B[5:4] OUT9_DIS_STATE 0 0x0 + * 0x013B[7:6] OUT9_CMOS_DRV 0 0x0 + * 0x013C[3:0] OUT9_CM 11 0xB + * 0x013C[6:4] OUT9_AMPL 3 0x3 + * 0x013D[2:0] OUT9_MUX_SEL 4 0x4 + * 0x013D[5:4] OUT9_VDD_SEL 2 0x2 + * 0x013D[3] OUT9_VDD_SEL_EN 1 0x1 + * 0x013D[7:6] OUT9_INV 0 0x0 + * 0x013F[11:0] OUTX_ALWAYS_ON 0 0x000 + * 0x0141[1] OUT_DIS_MSK 0 0x0 + * 0x0141[5] OUT_DIS_LOL_MSK 0 0x0 + * 0x0141[6] OUT_DIS_LOSXAXB_MSK 1 0x1 + * 0x0141[7] OUT_DIS_MSK_LOS_PFD 0 0x0 + * 0x0142[1] OUT_DIS_MSK_LOL 1 0x1 + * 0x0142[5] OUT_DIS_MSK_HOLD 1 0x1 + * 0x0206[1:0] PXAXB 0 0x0 + * 0x0208[47:0] P0_NUM 1 0x000000000001 + * 0x020E[31:0] P0_DEN 1 0x00000001 + * 0x0212[47:0] P1_NUM 0 0x000000000000 + * 0x0218[31:0] P1_DEN 0 0x00000000 + * 0x021C[47:0] P2_NUM 1716 0x0000000006B4 + * 0x0222[31:0] P2_DEN 1 0x00000001 + * 0x0226[47:0] P3_NUM 0 0x000000000000 + * 0x022C[31:0] P3_DEN 0 0x00000000 + * 0x0231[3:0] P0_FRACN_MODE 11 0xB + * 0x0231[4] P0_FRACN_EN 0 0x0 + * 0x0232[3:0] P1_FRACN_MODE 11 0xB + * 0x0232[4] P1_FRACN_EN 0 0x0 + * 0x0233[3:0] P2_FRACN_MODE 11 0xB + * 0x0233[4] P2_FRACN_EN 0 0x0 + * 0x0234[3:0] P3_FRACN_MODE 11 0xB + * 0x0234[4] P3_FRACN_EN 0 0x0 + * 0x0235[43:0] MXAXB_NUM 916841299968 0x0D578000000 + * 0x023B[31:0] MXAXB_DEN 3489660928 0xD0000000 + * 0x024A[23:0] R0_REG 1 0x000001 + * 0x024D[23:0] R1_REG 0 0x000000 + * 0x0250[23:0] R2_REG 0 0x000000 + * 0x0253[23:0] R3_REG 1 0x000001 + * 0x0256[23:0] R4_REG 1 0x000001 + * 0x0259[23:0] R5_REG 2 0x000002 + * 0x025C[23:0] R6_REG 2 0x000002 + * 0x025F[23:0] R7_REG 2 0x000002 + * 0x0262[23:0] R8_REG 10 0x00000A + * 0x0268[23:0] R9_REG 3 0x000003 + * 0x026B[7:0] DESIGN_ID0 49 0x31 + * 0x026C[7:0] DESIGN_ID1 50 0x32 + * 0x026D[7:0] DESIGN_ID2 71 0x47 + * 0x026E[7:0] DESIGN_ID3 77 0x4D + * 0x026F[7:0] DESIGN_ID4 95 0x5F + * 0x0270[7:0] DESIGN_ID5 118 0x76 + * 0x0271[7:0] DESIGN_ID6 69 0x45 + * 0x0272[7:0] DESIGN_ID7 0 0x00 + * 0x0294[7:4] FASTLOCK_EXTEND_SCL 8 0x8 + * 0x0296[1] LOL_SLW_VALWIN_SELX 0 0x0 + * 0x0297[1] FASTLOCK_DLY_ONSW_EN 1 0x1 + * 0x0299[1] FASTLOCK_DLY_ONLOL_EN 1 0x1 + * 0x029D[19:0] FASTLOCK_DLY_ONLOL 3829 0x00EF5 + * 0x02A9[19:0] FASTLOCK_DLY_ONSW 9830 0x02666 + * 0x02B7[3:2] LOL_NOSIG_TIME 3 0x3 + * 0x0302[43:0] N0_NUM 49392123904 0x00B80000000 + * 0x0308[31:0] N0_DEN 2147483648 0x80000000 + * 0x030C[0] N0_UPDATE 0 0x0 + * 0x030D[43:0] N1_NUM 48282730496 0x00B3DE00000 + * 0x0313[31:0] N1_DEN 3145728000 0xBB800000 + * 0x0317[0] N1_UPDATE 0 0x0 + * 0x0318[43:0] N2_NUM 114605162496 0x01AAF000000 + * 0x031E[31:0] N2_DEN 3355443200 0xC8000000 + * 0x0322[0] N2_UPDATE 0 0x0 + * 0x0323[43:0] N3_NUM 198967296000 0x02E53600000 + * 0x0329[31:0] N3_DEN 2147483648 0x80000000 + * 0x032D[0] N3_UPDATE 0 0x0 + * 0x032E[43:0] N4_NUM 28651290624 0x006ABC00000 + * 0x0334[31:0] N4_DEN 2621440000 0x9C400000 + * 0x0338[0] N4_UPDATE 0 0x0 + * 0x0338[1] N_UPDATE 0 0x0 + * 0x0339[4:0] N_FSTEP_MSK 31 0x1F + * 0x033B[43:0] N0_FSTEPW 0 0x00000000000 + * 0x0341[43:0] N1_FSTEPW 0 0x00000000000 + * 0x0347[43:0] N2_FSTEPW 0 0x00000000000 + * 0x034D[43:0] N3_FSTEPW 0 0x00000000000 + * 0x0353[43:0] N4_FSTEPW 0 0x00000000000 + * 0x0359[15:0] N0_DELAY 0 0x0000 + * 0x035B[15:0] N1_DELAY 0 0x0000 + * 0x035D[15:0] N2_DELAY 0 0x0000 + * 0x035F[15:0] N3_DELAY 0 0x0000 + * 0x0361[15:0] N4_DELAY 0 0x0000 + * 0x0487[0] ZDM_EN 0 0x0 + * 0x0487[2:1] ZDM_IN_SEL 0 0x0 + * 0x0487[4] ZDM_AUTOSW_EN 0 0x0 + * 0x0502[4] ADD_DIV256 0 0x0 + * 0x0508[5:0] BW0_PLL 16 0x10 + * 0x0509[5:0] BW1_PLL 24 0x18 + * 0x050A[5:0] BW2_PLL 15 0x0F + * 0x050B[5:0] BW3_PLL 15 0x0F + * 0x050C[5:0] BW4_PLL 7 0x07 + * 0x050D[5:0] BW5_PLL 7 0x07 + * 0x050E[5:0] FASTLOCK_BW0_PLL 23 0x17 + * 0x050F[5:0] FASTLOCK_BW1_PLL 40 0x28 + * 0x0510[5:0] FASTLOCK_BW2_PLL 12 0x0C + * 0x0511[5:0] FASTLOCK_BW3_PLL 11 0x0B + * 0x0512[5:0] FASTLOCK_BW4_PLL 7 0x07 + * 0x0513[5:0] FASTLOCK_BW5_PLL 7 0x07 + * 0x0515[55:0] M_NUM 466162865405952 0x01A7F900000000 + * 0x051C[31:0] M_DEN 2684354560 0xA0000000 + * 0x0521[3:0] M_FRAC_MODE 11 0xB + * 0x0521[4] M_FRAC_EN 1 0x1 + * 0x0521[5] PLL_OUT_RATE_SEL 1 0x1 + * 0x052A[0] IN_SEL_REGCTRL 0 0x0 + * 0x052A[3:1] IN_SEL 0 0x0 + * 0x052B[0] FASTLOCK_AUTO_EN 1 0x1 + * 0x052B[1] FASTLOCK_MAN 0 0x0 + * 0x052C[0] HOLD_EN 1 0x1 + * 0x052C[3] HOLD_RAMP_BYP 1 0x1 + * 0x052C[4] HOLDEXIT_BW_SEL1 0 0x0 + * 0x052C[7:5] RAMP_STEP_INTERVAL 7 0x7 + * 0x052D[1] HOLD_RAMPBYP_NOHIST 1 0x1 + * 0x052E[4:0] HOLD_HIST_LEN 21 0x15 + * 0x052F[4:0] HOLD_HIST_DELAY 20 0x14 + * 0x0531[4:0] HOLD_REF_COUNT_FRC 0 0x00 + * 0x0532[23:0] HOLD_15M_CYC_COUNT 105926 0x019DC6 + * 0x0535[0] FORCE_HOLD 0 0x0 + * 0x0536[1:0] CLK_SWITCH_MODE 0 0x0 + * 0x0536[2] HSW_EN 0 0x0 + * 0x0537[3:0] IN_LOS_MSK 0 0x0 + * 0x0537[7:4] IN_OOF_MSK 0 0x0 + * 0x0538[2:0] IN0_PRIORITY 0 0x0 + * 0x0538[6:4] IN1_PRIORITY 0 0x0 + * 0x0539[2:0] IN2_PRIORITY 0 0x0 + * 0x0539[6:4] IN3_PRIORITY 0 0x0 + * 0x053A[1:0] HSW_MODE 2 0x2 + * 0x053A[3:2] HSW_PHMEAS_CTRL 0 0x0 + * 0x053B[9:0] HSW_PHMEAS_THR 3 0x003 + * 0x053D[4:0] HSW_COARSE_PM_LEN 17 0x11 + * 0x053E[4:0] HSW_COARSE_PM_DLY 6 0x06 + * 0x0589[12:0] CAP_SHORT_DELAY 1734 0x06C6 + * 0x059B[6] HOLDEXIT_BW_SEL0 1 0x1 + * 0x059B[7] HOLDEXIT_STD_BO 1 0x1 + * 0x059D[5:0] HOLDEXIT_BW0 23 0x17 + * 0x059E[5:0] HOLDEXIT_BW1 40 0x28 + * 0x059F[5:0] HOLDEXIT_BW2 12 0x0C + * 0x05A0[5:0] HOLDEXIT_BW3 11 0x0B + * 0x05A1[5:0] HOLDEXIT_BW4 7 0x07 + * 0x05A2[5:0] HOLDEXIT_BW5 7 0x07 + * 0x05A6[2:0] RAMP_STEP_SIZE 5 0x5 + * 0x05A6[3] RAMP_SWITCH_EN 0 0x0 + * 0x0802[15:0] FIXREGSA0 1333 0x0535 + * 0x0804[7:0] FIXREGSD0 0 0x00 + * 0x0805[15:0] FIXREGSA1 0 0x0000 + * 0x0807[7:0] FIXREGSD1 0 0x00 + * 0x0808[15:0] FIXREGSA2 0 0x0000 + * 0x080A[7:0] FIXREGSD2 0 0x00 + * 0x080B[15:0] FIXREGSA3 0 0x0000 + * 0x080D[7:0] FIXREGSD3 0 0x00 + * 0x080E[15:0] FIXREGSA4 0 0x0000 + * 0x0810[7:0] FIXREGSD4 0 0x00 + * 0x0811[15:0] FIXREGSA5 0 0x0000 + * 0x0813[7:0] FIXREGSD5 0 0x00 + * 0x0814[15:0] FIXREGSA6 0 0x0000 + * 0x0816[7:0] FIXREGSD6 0 0x00 + * 0x0817[15:0] FIXREGSA7 0 0x0000 + * 0x0819[7:0] FIXREGSD7 0 0x00 + * 0x081A[15:0] FIXREGSA8 0 0x0000 + * 0x081C[7:0] FIXREGSD8 0 0x00 + * 0x081D[15:0] FIXREGSA9 0 0x0000 + * 0x081F[7:0] FIXREGSD9 0 0x00 + * 0x0820[15:0] FIXREGSA10 0 0x0000 + * 0x0822[7:0] FIXREGSD10 0 0x00 + * 0x0823[15:0] FIXREGSA11 0 0x0000 + * 0x0825[7:0] FIXREGSD11 0 0x00 + * 0x0826[15:0] FIXREGSA12 0 0x0000 + * 0x0828[7:0] FIXREGSD12 0 0x00 + * 0x0829[15:0] FIXREGSA13 0 0x0000 + * 0x082B[7:0] FIXREGSD13 0 0x00 + * 0x082C[15:0] FIXREGSA14 0 0x0000 + * 0x082E[7:0] FIXREGSD14 0 0x00 + * 0x082F[15:0] FIXREGSA15 0 0x0000 + * 0x0831[7:0] FIXREGSD15 0 0x00 + * 0x0832[15:0] FIXREGSA16 0 0x0000 + * 0x0834[7:0] FIXREGSD16 0 0x00 + * 0x0835[15:0] FIXREGSA17 0 0x0000 + * 0x0837[7:0] FIXREGSD17 0 0x00 + * 0x0838[15:0] FIXREGSA18 0 0x0000 + * 0x083A[7:0] FIXREGSD18 0 0x00 + * 0x083B[15:0] FIXREGSA19 0 0x0000 + * 0x083D[7:0] FIXREGSD19 0 0x00 + * 0x083E[15:0] FIXREGSA20 0 0x0000 + * 0x0840[7:0] FIXREGSD20 0 0x00 + * 0x0841[15:0] FIXREGSA21 0 0x0000 + * 0x0843[7:0] FIXREGSD21 0 0x00 + * 0x0844[15:0] FIXREGSA22 0 0x0000 + * 0x0846[7:0] FIXREGSD22 0 0x00 + * 0x0847[15:0] FIXREGSA23 0 0x0000 + * 0x0849[7:0] FIXREGSD23 0 0x00 + * 0x084A[15:0] FIXREGSA24 0 0x0000 + * 0x084C[7:0] FIXREGSD24 0 0x00 + * 0x084D[15:0] FIXREGSA25 0 0x0000 + * 0x084F[7:0] FIXREGSD25 0 0x00 + * 0x0850[15:0] FIXREGSA26 0 0x0000 + * 0x0852[7:0] FIXREGSD26 0 0x00 + * 0x0853[15:0] FIXREGSA27 0 0x0000 + * 0x0855[7:0] FIXREGSD27 0 0x00 + * 0x0856[15:0] FIXREGSA28 0 0x0000 + * 0x0858[7:0] FIXREGSD28 0 0x00 + * 0x0859[15:0] FIXREGSA29 0 0x0000 + * 0x085B[7:0] FIXREGSD29 0 0x00 + * 0x085C[15:0] FIXREGSA30 0 0x0000 + * 0x085E[7:0] FIXREGSD30 0 0x00 + * 0x085F[15:0] FIXREGSA31 0 0x0000 + * 0x0861[7:0] FIXREGSD31 0 0x00 + * 0x090E[0] XAXB_EXTCLK_EN 1 0x1 + * 0x0943[0] IO_VDD_SEL 0 0x0 + * 0x0949[3:0] IN_EN 5 0x5 + * 0x0949[7:4] IN_PULSED_CMOS_EN 3 0x3 + * 0x094A[3:0] INX_TO_PFD_EN 5 0x5 + * 0x094E[11:0] REFCLK_HYS_SEL 585 0x249 + * 0x095E[0] MXAXB_INTEGER 0 0x0 + * 0x0A02[4:0] N_ADD_0P5 0 0x00 + * 0x0A03[4:0] N_CLK_TO_OUTX_EN 31 0x1F + * 0x0A04[4:0] N_PIBYP 1 0x01 + * 0x0A05[4:0] N_PDNB 31 0x1F + * 0x0B44[3:0] PDIV_FRACN_CLK_DIS 15 0xF + * 0x0B44[5] FRACN_CLK_DIS_PLL 0 0x0 + * 0x0B46[3:0] LOS_CLK_DIS 0 0x0 + * 0x0B47[4:0] OOF_CLK_DIS 0 0x00 + * 0x0B48[4:0] OOF_DIV_CLK_DIS 10 0x0A + * 0x0B4A[4:0] N_CLK_DIS 0 0x00 + * 0x0B57[11:0] VCO_RESET_CALCODE 249 0x0F9 + * + * + */ + +static struct ntv2_genlock_data s_genlock_zero[] = +{ + /* Start configuration preamble */ + { 0x0B24, 0xC0 }, + { 0x0B25, 0x00 }, + { 0x0540, 0x01 }, + /* End configuration preamble */ + + /* Delay 300 msec */ + /* Delay is worst case time for device to complete any calibration */ + /* that is running due to device state change previous to this script */ + /* being processed. */ + { 0x0000, 0x01 }, + + /* Start configuration registers */ + { 0x000B, 0x00 }, + { 0x0016, 0x00 }, + { 0x0017, 0x00 }, + { 0x0018, 0x00 }, + { 0x0019, 0x00 }, + { 0x001A, 0x00 }, + { 0x002B, 0x00 }, + { 0x002C, 0x00 }, + { 0x002D, 0x00 }, + { 0x002E, 0x00 }, + { 0x002F, 0x00 }, + { 0x0030, 0x00 }, + { 0x0031, 0x00 }, + { 0x0032, 0x00 }, + { 0x0033, 0x00 }, + { 0x0034, 0x00 }, + { 0x0035, 0x00 }, + { 0x0036, 0x00 }, + { 0x0037, 0x00 }, + { 0x0038, 0x00 }, + { 0x0039, 0x00 }, + { 0x003A, 0x00 }, + { 0x003B, 0x00 }, + { 0x003C, 0x00 }, + { 0x003D, 0x00 }, + { 0x003F, 0x00 }, + { 0x0040, 0x00 }, + { 0x0041, 0x00 }, + { 0x0042, 0x00 }, + { 0x0043, 0x00 }, + { 0x0044, 0x00 }, + { 0x0045, 0x00 }, + { 0x0046, 0x00 }, + { 0x0047, 0x00 }, + { 0x0048, 0x00 }, + { 0x0049, 0x00 }, + { 0x004A, 0x00 }, + { 0x004B, 0x00 }, + { 0x004C, 0x00 }, + { 0x004D, 0x00 }, + { 0x004E, 0x00 }, + { 0x004F, 0x00 }, + { 0x0051, 0x00 }, + { 0x0052, 0x00 }, + { 0x0053, 0x00 }, + { 0x0054, 0x00 }, + { 0x0055, 0x00 }, + { 0x0056, 0x00 }, + { 0x0057, 0x00 }, + { 0x0058, 0x00 }, + { 0x0059, 0x00 }, + { 0x005A, 0x00 }, + { 0x005B, 0x00 }, + { 0x005C, 0x00 }, + { 0x005D, 0x00 }, + { 0x005E, 0x00 }, + { 0x005F, 0x00 }, + { 0x0060, 0x00 }, + { 0x0061, 0x00 }, + { 0x0062, 0x00 }, + { 0x0063, 0x00 }, + { 0x0064, 0x00 }, + { 0x0065, 0x00 }, + { 0x0066, 0x00 }, + { 0x0067, 0x00 }, + { 0x0068, 0x00 }, + { 0x0069, 0x00 }, + { 0x0092, 0x00 }, + { 0x0093, 0x00 }, + { 0x0095, 0x00 }, + { 0x0096, 0x00 }, + { 0x0098, 0x00 }, + { 0x009A, 0x00 }, + { 0x009B, 0x00 }, + { 0x009D, 0x00 }, + { 0x009E, 0x00 }, + { 0x00A0, 0x00 }, + { 0x00A2, 0x00 }, + { 0x00A9, 0x00 }, + { 0x00AA, 0x00 }, + { 0x00AB, 0x00 }, + { 0x00AC, 0x00 }, + { 0x00E5, 0x00 }, + { 0x00EA, 0x00 }, + { 0x00EB, 0x00 }, + { 0x00EC, 0x00 }, + { 0x00ED, 0x00 }, + { 0x0102, 0x00 }, + { 0x0108, 0x00 }, + { 0x0109, 0x00 }, + { 0x010A, 0x00 }, + { 0x010B, 0x00 }, + { 0x010D, 0x00 }, + { 0x010E, 0x00 }, + { 0x010F, 0x00 }, + { 0x0110, 0x00 }, + { 0x0112, 0x00 }, + { 0x0113, 0x00 }, + { 0x0114, 0x00 }, + { 0x0115, 0x00 }, + { 0x0117, 0x00 }, + { 0x0118, 0x00 }, + { 0x0119, 0x00 }, + { 0x011A, 0x00 }, + { 0x011C, 0x00 }, + { 0x011D, 0x00 }, + { 0x011E, 0x00 }, + { 0x011F, 0x00 }, + { 0x0121, 0x00 }, + { 0x0122, 0x00 }, + { 0x0123, 0x00 }, + { 0x0124, 0x00 }, + { 0x0126, 0x00 }, + { 0x0127, 0x00 }, + { 0x0128, 0x00 }, + { 0x0129, 0x00 }, + { 0x012B, 0x00 }, + { 0x012C, 0x00 }, + { 0x012D, 0x00 }, + { 0x012E, 0x00 }, + { 0x0130, 0x00 }, + { 0x0131, 0x00 }, + { 0x0132, 0x00 }, + { 0x0133, 0x00 }, + { 0x013A, 0x00 }, + { 0x013B, 0x00 }, + { 0x013C, 0x00 }, + { 0x013D, 0x00 }, + { 0x013F, 0x00 }, + { 0x0140, 0x00 }, + { 0x0141, 0x00 }, + { 0x0142, 0x00 }, + { 0x0206, 0x00 }, + { 0x0208, 0x00 }, + { 0x0209, 0x00 }, + { 0x020A, 0x00 }, + { 0x020B, 0x00 }, + { 0x020C, 0x00 }, + { 0x020D, 0x00 }, + { 0x020E, 0x00 }, + { 0x020F, 0x00 }, + { 0x0210, 0x00 }, + { 0x0211, 0x00 }, + { 0x0212, 0x00 }, + { 0x0213, 0x00 }, + { 0x0214, 0x00 }, + { 0x0215, 0x00 }, + { 0x0216, 0x00 }, + { 0x0217, 0x00 }, + { 0x0218, 0x00 }, + { 0x0219, 0x00 }, + { 0x021A, 0x00 }, + { 0x021B, 0x00 }, + { 0x021C, 0x00 }, + { 0x021D, 0x00 }, + { 0x021E, 0x00 }, + { 0x021F, 0x00 }, + { 0x0220, 0x00 }, + { 0x0221, 0x00 }, + { 0x0222, 0x00 }, + { 0x0223, 0x00 }, + { 0x0224, 0x00 }, + { 0x0225, 0x00 }, + { 0x0226, 0x00 }, + { 0x0227, 0x00 }, + { 0x0228, 0x00 }, + { 0x0229, 0x00 }, + { 0x022A, 0x00 }, + { 0x022B, 0x00 }, + { 0x022C, 0x00 }, + { 0x022D, 0x00 }, + { 0x022E, 0x00 }, + { 0x022F, 0x00 }, + { 0x0231, 0x00 }, + { 0x0232, 0x00 }, + { 0x0233, 0x00 }, + { 0x0234, 0x00 }, + { 0x0235, 0x00 }, + { 0x0236, 0x00 }, + { 0x0237, 0x00 }, + { 0x0238, 0x00 }, + { 0x0239, 0x00 }, + { 0x023A, 0x00 }, + { 0x023B, 0x00 }, + { 0x023C, 0x00 }, + { 0x023D, 0x00 }, + { 0x023E, 0x00 }, + { 0x024A, 0x00 }, + { 0x024B, 0x00 }, + { 0x024C, 0x00 }, + { 0x024D, 0x00 }, + { 0x024E, 0x00 }, + { 0x024F, 0x00 }, + { 0x0250, 0x00 }, + { 0x0251, 0x00 }, + { 0x0252, 0x00 }, + { 0x0253, 0x00 }, + { 0x0254, 0x00 }, + { 0x0255, 0x00 }, + { 0x0256, 0x00 }, + { 0x0257, 0x00 }, + { 0x0258, 0x00 }, + { 0x0259, 0x00 }, + { 0x025A, 0x00 }, + { 0x025B, 0x00 }, + { 0x025C, 0x00 }, + { 0x025D, 0x00 }, + { 0x025E, 0x00 }, + { 0x025F, 0x00 }, + { 0x0260, 0x00 }, + { 0x0261, 0x00 }, + { 0x0262, 0x00 }, + { 0x0263, 0x00 }, + { 0x0264, 0x00 }, + { 0x0268, 0x00 }, + { 0x0269, 0x00 }, + { 0x026A, 0x00 }, + { 0x026B, 0x00 }, + { 0x026C, 0x00 }, + { 0x026D, 0x00 }, + { 0x026E, 0x00 }, + { 0x026F, 0x00 }, + { 0x0270, 0x00 }, + { 0x0271, 0x00 }, + { 0x0272, 0x00 }, + { 0x0294, 0x80 }, + { 0x0296, 0x00 }, + { 0x0297, 0x00 }, + { 0x0299, 0x00 }, + { 0x029D, 0x00 }, + { 0x029E, 0x00 }, + { 0x029F, 0x00 }, + { 0x02A9, 0x00 }, + { 0x02AA, 0x00 }, + { 0x02AB, 0x00 }, + { 0x02B7, 0x00 }, + { 0x0302, 0x00 }, + { 0x0303, 0x00 }, + { 0x0304, 0x00 }, + { 0x0305, 0x00 }, + { 0x0306, 0x00 }, + { 0x0307, 0x00 }, + { 0x0308, 0x00 }, + { 0x0309, 0x00 }, + { 0x030A, 0x00 }, + { 0x030B, 0x00 }, + { 0x030C, 0x00 }, + { 0x030D, 0x00 }, + { 0x030E, 0x00 }, + { 0x030F, 0x00 }, + { 0x0310, 0x00 }, + { 0x0311, 0x00 }, + { 0x0312, 0x00 }, + { 0x0313, 0x00 }, + { 0x0314, 0x00 }, + { 0x0315, 0x00 }, + { 0x0316, 0x00 }, + { 0x0317, 0x00 }, + { 0x0318, 0x00 }, + { 0x0319, 0x00 }, + { 0x031A, 0x00 }, + { 0x031B, 0x00 }, + { 0x031C, 0x00 }, + { 0x031D, 0x00 }, + { 0x031E, 0x00 }, + { 0x031F, 0x00 }, + { 0x0320, 0x00 }, + { 0x0321, 0x00 }, + { 0x0322, 0x00 }, + { 0x0323, 0x00 }, + { 0x0324, 0x00 }, + { 0x0325, 0x00 }, + { 0x0326, 0x00 }, + { 0x0327, 0x00 }, + { 0x0328, 0x00 }, + { 0x0329, 0x00 }, + { 0x032A, 0x00 }, + { 0x032B, 0x00 }, + { 0x032C, 0x00 }, + { 0x032D, 0x00 }, + { 0x032E, 0x00 }, + { 0x032F, 0x00 }, + { 0x0330, 0x00 }, + { 0x0331, 0x00 }, + { 0x0332, 0x00 }, + { 0x0333, 0x00 }, + { 0x0334, 0x00 }, + { 0x0335, 0x00 }, + { 0x0336, 0x00 }, + { 0x0337, 0x00 }, + { 0x0338, 0x00 }, + { 0x0339, 0x00 }, + { 0x033B, 0x00 }, + { 0x033C, 0x00 }, + { 0x033D, 0x00 }, + { 0x033E, 0x00 }, + { 0x033F, 0x00 }, + { 0x0340, 0x00 }, + { 0x0341, 0x00 }, + { 0x0342, 0x00 }, + { 0x0343, 0x00 }, + { 0x0344, 0x00 }, + { 0x0345, 0x00 }, + { 0x0346, 0x00 }, + { 0x0347, 0x00 }, + { 0x0348, 0x00 }, + { 0x0349, 0x00 }, + { 0x034A, 0x00 }, + { 0x034B, 0x00 }, + { 0x034C, 0x00 }, + { 0x034D, 0x00 }, + { 0x034E, 0x00 }, + { 0x034F, 0x00 }, + { 0x0350, 0x00 }, + { 0x0351, 0x00 }, + { 0x0352, 0x00 }, + { 0x0353, 0x00 }, + { 0x0354, 0x00 }, + { 0x0355, 0x00 }, + { 0x0356, 0x00 }, + { 0x0357, 0x00 }, + { 0x0358, 0x00 }, + { 0x0359, 0x00 }, + { 0x035A, 0x00 }, + { 0x035B, 0x00 }, + { 0x035C, 0x00 }, + { 0x035D, 0x00 }, + { 0x035E, 0x00 }, + { 0x035F, 0x00 }, + { 0x0360, 0x00 }, + { 0x0361, 0x00 }, + { 0x0362, 0x00 }, + { 0x0487, 0x00 }, + { 0x0502, 0x00 }, + { 0x0508, 0x00 }, + { 0x0509, 0x00 }, + { 0x050A, 0x00 }, + { 0x050B, 0x00 }, + { 0x050C, 0x00 }, + { 0x050D, 0x00 }, + { 0x050E, 0x00 }, + { 0x050F, 0x00 }, + { 0x0510, 0x00 }, + { 0x0511, 0x00 }, + { 0x0512, 0x00 }, + { 0x0513, 0x00 }, + { 0x0515, 0x00 }, + { 0x0516, 0x00 }, + { 0x0517, 0x00 }, + { 0x0518, 0x00 }, + { 0x0519, 0x00 }, + { 0x051A, 0x00 }, + { 0x051B, 0x00 }, + { 0x051C, 0x00 }, + { 0x051D, 0x00 }, + { 0x051E, 0x00 }, + { 0x051F, 0x00 }, + { 0x0521, 0x00 }, + { 0x052A, 0x00 }, + { 0x052B, 0x00 }, + { 0x052C, 0x00 }, + { 0x052D, 0x00 }, + { 0x052E, 0x00 }, + { 0x052F, 0x00 }, + { 0x0531, 0x00 }, + { 0x0532, 0x00 }, + { 0x0533, 0x00 }, + { 0x0534, 0x00 }, + { 0x0535, 0x00 }, + { 0x0536, 0x00 }, + { 0x0537, 0x00 }, + { 0x0538, 0x00 }, + { 0x0539, 0x00 }, + { 0x053A, 0x00 }, + { 0x053B, 0x00 }, + { 0x053C, 0x00 }, + { 0x053D, 0x00 }, + { 0x053E, 0x00 }, + { 0x0589, 0x00 }, + { 0x058A, 0x00 }, + { 0x059B, 0x00 }, + { 0x059D, 0x00 }, + { 0x059E, 0x00 }, + { 0x059F, 0x00 }, + { 0x05A0, 0x00 }, + { 0x05A1, 0x00 }, + { 0x05A2, 0x00 }, + { 0x05A6, 0x00 }, + { 0x0802, 0x00 }, + { 0x0803, 0x00 }, + { 0x0804, 0x00 }, + { 0x0805, 0x00 }, + { 0x0806, 0x00 }, + { 0x0807, 0x00 }, + { 0x0808, 0x00 }, + { 0x0809, 0x00 }, + { 0x080A, 0x00 }, + { 0x080B, 0x00 }, + { 0x080C, 0x00 }, + { 0x080D, 0x00 }, + { 0x080E, 0x00 }, + { 0x080F, 0x00 }, + { 0x0810, 0x00 }, + { 0x0811, 0x00 }, + { 0x0812, 0x00 }, + { 0x0813, 0x00 }, + { 0x0814, 0x00 }, + { 0x0815, 0x00 }, + { 0x0816, 0x00 }, + { 0x0817, 0x00 }, + { 0x0818, 0x00 }, + { 0x0819, 0x00 }, + { 0x081A, 0x00 }, + { 0x081B, 0x00 }, + { 0x081C, 0x00 }, + { 0x081D, 0x00 }, + { 0x081E, 0x00 }, + { 0x081F, 0x00 }, + { 0x0820, 0x00 }, + { 0x0821, 0x00 }, + { 0x0822, 0x00 }, + { 0x0823, 0x00 }, + { 0x0824, 0x00 }, + { 0x0825, 0x00 }, + { 0x0826, 0x00 }, + { 0x0827, 0x00 }, + { 0x0828, 0x00 }, + { 0x0829, 0x00 }, + { 0x082A, 0x00 }, + { 0x082B, 0x00 }, + { 0x082C, 0x00 }, + { 0x082D, 0x00 }, + { 0x082E, 0x00 }, + { 0x082F, 0x00 }, + { 0x0830, 0x00 }, + { 0x0831, 0x00 }, + { 0x0832, 0x00 }, + { 0x0833, 0x00 }, + { 0x0834, 0x00 }, + { 0x0835, 0x00 }, + { 0x0836, 0x00 }, + { 0x0837, 0x00 }, + { 0x0838, 0x00 }, + { 0x0839, 0x00 }, + { 0x083A, 0x00 }, + { 0x083B, 0x00 }, + { 0x083C, 0x00 }, + { 0x083D, 0x00 }, + { 0x083E, 0x00 }, + { 0x083F, 0x00 }, + { 0x0840, 0x00 }, + { 0x0841, 0x00 }, + { 0x0842, 0x00 }, + { 0x0843, 0x00 }, + { 0x0844, 0x00 }, + { 0x0845, 0x00 }, + { 0x0846, 0x00 }, + { 0x0847, 0x00 }, + { 0x0848, 0x00 }, + { 0x0849, 0x00 }, + { 0x084A, 0x00 }, + { 0x084B, 0x00 }, + { 0x084C, 0x00 }, + { 0x084D, 0x00 }, + { 0x084E, 0x00 }, + { 0x084F, 0x00 }, + { 0x0850, 0x00 }, + { 0x0851, 0x00 }, + { 0x0852, 0x00 }, + { 0x0853, 0x00 }, + { 0x0854, 0x00 }, + { 0x0855, 0x00 }, + { 0x0856, 0x00 }, + { 0x0857, 0x00 }, + { 0x0858, 0x00 }, + { 0x0859, 0x00 }, + { 0x085A, 0x00 }, + { 0x085B, 0x00 }, + { 0x085C, 0x00 }, + { 0x085D, 0x00 }, + { 0x085E, 0x00 }, + { 0x085F, 0x00 }, + { 0x0860, 0x00 }, + { 0x0861, 0x00 }, + { 0x090E, 0x00 }, + { 0x0943, 0x00 }, + { 0x0949, 0x00 }, + { 0x094A, 0x00 }, + { 0x094E, 0x00 }, + { 0x094F, 0x00 }, + { 0x095E, 0x00 }, + { 0x0A02, 0x00 }, + { 0x0A03, 0x00 }, + { 0x0A04, 0x00 }, + { 0x0A05, 0x00 }, + { 0x0B44, 0x00 }, + { 0x0B46, 0x00 }, + { 0x0B47, 0x00 }, + { 0x0B48, 0x00 }, + { 0x0B4A, 0x00 }, + { 0x0B57, 0x00 }, + { 0x0B58, 0x00 }, + /* End configuration registers */ + + /* Start configuration postamble */ + { 0x0514, 0x01 }, + { 0x001C, 0x01 }, + { 0x0540, 0x00 }, + { 0x0B24, 0xC3 }, + { 0x0B25, 0x02 }, + /* End configuration postamble */ + + { 0x0000, 0x00 } +}; + +/* + * Design Report + * + * Overview + * ======== + * Part: Si5345 Rev D + * Project File: edit + * Design ID: zeros + * Created By: ClockBuilder Pro v2.16.1 [2017-07-19] + * Timestamp: 2018-10-22 + * + * Design Notes + * ============ + * test configuration that programs all zeros + */ + +#endif + diff --git a/build_dependencies/aja/include/ajadriver/ntv2hdmiedid.h b/build_dependencies/aja/include/ajadriver/ntv2hdmiedid.h new file mode 100644 index 0000000..5ca7f2a --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2hdmiedid.h @@ -0,0 +1,55 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2hdmiedid.h +// Purpose: HDMI edid repository +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2HDMIEDID_HEADER +#define NTV2HDMIEDID_HEADER + +#include "ntv2system.h" + +#define NTV2_HDMIEDID_SIZE 256 +#define NTV2_HDMIEDID_STRING_SIZE 80 + +enum ntv2_edid_type { + ntv2_edid_type_unknown, + ntv2_edid_type_konahdmi_20, + ntv2_edid_type_konahdmi_13, + ntv2_edid_type_corvidhbr, + ntv2_edid_type_io4k, + ntv2_edid_type_io4kplus, + ntv2_edid_type_iox3, + ntv2_edid_type_size +}; + +struct ntv2_hdmiedid { + int index; + char name[NTV2_HDMIEDID_STRING_SIZE]; + Ntv2SystemContext* system_context; + + enum ntv2_edid_type edid_type; + int port_index; + + uint8_t edid_data[NTV2_HDMIEDID_SIZE]; + uint32_t edid_size; +}; + +struct ntv2_hdmiedid *ntv2_hdmiedid_open(Ntv2SystemContext* sys_con, + const char *name, int index); +void ntv2_hdmiedid_close(struct ntv2_hdmiedid *ntv2_hed); + +Ntv2Status ntv2_hdmiedid_configure(struct ntv2_hdmiedid *ntv2_hed, + enum ntv2_edid_type type, + int port_index); + +uint8_t *ntv2_hdmi_get_edid_data(struct ntv2_hdmiedid *ntv2_hed); +uint32_t ntv2_hdmi_get_edid_size(struct ntv2_hdmiedid *ntv2_hed); + +#endif + diff --git a/build_dependencies/aja/include/ajadriver/ntv2hdmiin.h b/build_dependencies/aja/include/ajadriver/ntv2hdmiin.h new file mode 100644 index 0000000..8d44551 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2hdmiin.h @@ -0,0 +1,111 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +/////////////////////////////////////////////////////////////// +// +// NTV2 Linux v2.6 Device Driver for AJA devices. +// +//////////////////////////////////////////////////////////// +// +// Filename: ntv2hdmiin.h +// Purpose: Header Kona2/Xena2 specific functions. +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2HDMIIN_HEADER +#define NTV2HDMIIN_HEADER + +#include "ntv2system.h" +#include "ntv2hdmiedid.h" + +#define NTV2_STRING_SIZE 80 + + +struct ntv2_hdmiin_format { + uint32_t video_standard; + uint32_t frame_rate; + uint32_t frame_flags; + uint32_t pixel_flags; +}; + +struct ntv2_hdmiin { + int index; + char name[NTV2_STRING_SIZE]; + Ntv2SystemContext* system_context; + struct ntv2_hdmiedid* edid; + Ntv2SpinLock state_lock; + Ntv2Thread monitor_task; + bool monitor_enable; + Ntv2Event monitor_event; + + uint8_t i2c_device; + uint8_t i2c_hpa_default; + uint8_t i2c_color_default; + uint32_t i2c_reset_count; + uint32_t lock_error_count; + + struct ntv2_hdmiin_format dvi_format; + struct ntv2_hdmiin_format hdmi_format; + struct ntv2_hdmiin_format video_format; + + uint32_t relock_reports; + bool hdmi_mode; + bool hdcp_mode; + bool derep_mode; + bool uhd_mode; + bool interlaced_mode; + bool pixel_double_mode; + bool yuv_mode; + bool deep_color_10bit; + bool deep_color_12bit; + bool prefer_yuv; + bool prefer_rgb; + uint32_t horizontal_tol; + uint32_t vertical_tol; + + bool cable_present; + bool clock_present; + bool input_locked; + bool avi_packet_present; + bool vsi_packet_present; + + uint32_t h_active_pixels; + uint32_t h_total_pixels; + uint32_t h_front_porch_pixels; + uint32_t h_sync_pixels; + uint32_t h_back_porch_pixels; + uint32_t v_total_lines0; + uint32_t v_total_lines1; + uint32_t v_active_lines0; + uint32_t v_active_lines1; + uint32_t v_sync_lines0; + uint32_t v_sync_lines1; + uint32_t v_front_porch_lines0; + uint32_t v_front_porch_lines1; + uint32_t v_back_porch_lines0; + uint32_t v_back_porch_lines1; + uint32_t v_frequency; + uint32_t tmds_frequency; + + uint32_t color_space; + uint32_t color_depth; + uint32_t aspect_ratio; + uint32_t colorimetry; + uint32_t quantization; +}; + +struct ntv2_hdmiin *ntv2_hdmiin_open(Ntv2SystemContext* sys_con, + const char *name, int index); +void ntv2_hdmiin_close(struct ntv2_hdmiin *ntv2_hin); + +Ntv2Status ntv2_hdmiin_configure(struct ntv2_hdmiin *ntv2_hin, + enum ntv2_edid_type edid_type, int port_index); + +Ntv2Status ntv2_hdmiin_enable(struct ntv2_hdmiin *ntv2_hin); +Ntv2Status ntv2_hdmiin_disable(struct ntv2_hdmiin *ntv2_hin); + +void ntv2_hdmiin_set_active(struct ntv2_hdmiin *ntv2_hin, bool active); + +#endif + diff --git a/build_dependencies/aja/include/ajadriver/ntv2hdmiin4.h b/build_dependencies/aja/include/ajadriver/ntv2hdmiin4.h new file mode 100644 index 0000000..28ae3fd --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2hdmiin4.h @@ -0,0 +1,75 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2hdmiin4.h +// Purpose: HDMI input monitor version 4 +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2HDMIIN4_HEADER +#define NTV2HDMIIN4_HEADER + +#include "ntv2system.h" +#include "ntv2hdmiedid.h" + +#define NTV2_HDMIIN4_STRING_SIZE 80 + + +struct ntv2_hdmiin4 { + int index; + char name[NTV2_HDMIIN4_STRING_SIZE]; + Ntv2SystemContext* system_context; + struct ntv2_hdmiedid* edid; + Ntv2SpinLock state_lock; + + Ntv2Thread monitor_task; + bool monitor_enable; + Ntv2Event monitor_event; + + uint32_t horizontal_tol; + uint32_t vertical_tol; + + uint32_t video_control; + uint32_t video_detect0; + uint32_t video_detect1; + uint32_t video_detect2; + uint32_t video_detect3; + uint32_t video_detect4; + uint32_t video_detect5; + uint32_t video_detect6; + uint32_t video_detect7; + uint32_t tmds_rate; + + bool input_locked; + bool hdmi_mode; + uint32_t video_standard; + uint32_t frame_rate; + uint32_t color_space; + uint32_t color_depth; + uint32_t aspect_ratio; + uint32_t colorimetry; + uint32_t quantization; + + bool audio_swap; + bool audio_resample; + + uint32_t format_clock_count; + uint32_t format_raster_count; +}; + +struct ntv2_hdmiin4 *ntv2_hdmiin4_open(Ntv2SystemContext* sys_con, + const char *name, int index); +void ntv2_hdmiin4_close(struct ntv2_hdmiin4 *ntv2_hin); + +Ntv2Status ntv2_hdmiin4_configure(struct ntv2_hdmiin4 *ntv2_hin, + enum ntv2_edid_type edid_type, + int port_index); + +Ntv2Status ntv2_hdmiin4_enable(struct ntv2_hdmiin4 *ntv2_hin); +Ntv2Status ntv2_hdmiin4_disable(struct ntv2_hdmiin4 *ntv2_hin); + +#endif + diff --git a/build_dependencies/aja/include/ajadriver/ntv2hdmiout4.h b/build_dependencies/aja/include/ajadriver/ntv2hdmiout4.h new file mode 100644 index 0000000..fb28779 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2hdmiout4.h @@ -0,0 +1,113 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2hdmiout4.h +// Purpose: HDMI output monitor version 4 +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2HDMIOUT4_HEADER +#define NTV2HDMIOUT4_HEADER + +#include "ntv2system.h" +#include "ntv2displayid.h" + +#define NTV2_HDMIOUT4_STRING_SIZE 80 + +struct ntv2_hdmiout4 { + int index; + char name[NTV2_HDMIOUT4_STRING_SIZE]; + Ntv2SystemContext* system_context; + Ntv2SpinLock state_lock; + + Ntv2Thread monitor_task; + bool monitor_enable; + Ntv2Event monitor_event; + + struct ntv2_displayid edid; + + uint32_t hot_plug_count; + uint32_t hdmi_config; + uint32_t hdmi_source; + uint32_t hdmi_control; + uint32_t hdmi_hdr; + + uint32_t hdr_green_primary; + uint32_t hdr_blue_primary; + uint32_t hdr_red_primary; + uint32_t hdr_white_point; + uint32_t hdr_master_luminance; + uint32_t hdr_light_level; + uint32_t hdr_control; + + bool hdmi_mode; + bool scdc_mode; + bool scdc_active; + bool output_enable; + bool sink_present; + bool force_hpd; + + bool force_config; + bool prefer_420; + bool hdr_enable; + bool dolby_vision; + bool crop_enable; + bool full_range; + bool sd_wide; + uint32_t video_standard; + uint32_t frame_rate; + uint32_t color_space; + uint32_t color_depth; + + uint32_t audio_input; + bool audio_upper; + bool audio_swap; + uint32_t audio_channels; + uint32_t audio_select; + uint32_t audio_rate; + uint32_t audio_format; + + uint8_t avi_vic; + uint8_t hdmi_vic; + + uint32_t scdc_sink_scramble; + uint32_t scdc_sink_clock; + uint32_t scdc_sink_valid_ch0; + uint32_t scdc_sink_valid_ch1; + uint32_t scdc_sink_valid_ch2; + uint32_t scdc_sink_error_ch0; + uint32_t scdc_sink_error_ch1; + uint32_t scdc_sink_error_ch2; + + char* vendor_name; + char* product_name; +}; + +#ifdef __cplusplus +extern "C" +{ +#endif + +struct ntv2_hdmiout4 *ntv2_hdmiout4_open(Ntv2SystemContext* sys_con, + const char *name, int index); +void ntv2_hdmiout4_close(struct ntv2_hdmiout4 *ntv2_hout); + + Ntv2Status ntv2_hdmiout4_configure(struct ntv2_hdmiout4 *ntv2_hout); + +Ntv2Status ntv2_hdmiout4_enable(struct ntv2_hdmiout4 *ntv2_hout); +Ntv2Status ntv2_hdmiout4_disable(struct ntv2_hdmiout4 *ntv2_hout); + +Ntv2Status ntv2_hdmiout4_write_info_frame(struct ntv2_hdmiout4 *ntv2_hout, + uint32_t size, + uint8_t *data); +Ntv2Status ntv2_hdmiout4_clear_info_frames(struct ntv2_hdmiout4 *ntv2_hout); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/build_dependencies/aja/include/ajadriver/ntv2hin4reg.h b/build_dependencies/aja/include/ajadriver/ntv2hin4reg.h new file mode 100644 index 0000000..a358b6c --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2hin4reg.h @@ -0,0 +1,313 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2hin4reg.h +// Purpose: HDMI input monitor version 4 +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2_HIN4REG_H +#define NTV2_HIN4REG_H + +#include "ntv2commonreg.h" +#include "ntv2virtualregisters.h" + +/* hdmi input status */ +NTV2_REG(ntv2_reg_hdmiin_input_status, 126, 0x1d15, 0x2515); /* hdmi input status register */ + NTV2_FLD(ntv2_fld_hdmiin_locked, 1, 0); + NTV2_FLD(ntv2_fld_hdmiin_stable, 1, 1); + NTV2_FLD(ntv2_fld_hdmiin_rgb, 1, 2); + NTV2_FLD(ntv2_fld_hdmiin_deep_color, 1, 3); + NTV2_FLD(ntv2_fld_hdmiin_video_code, 6, 4); /* ntv2 video standard v2 */ + NTV2_FLD(ntv2_fld_hdmiin_lhi_ycbcr_mode, 1, 10); + NTV2_FLD(ntv2_fld_hdmiin_lhi_10bit_mode, 1, 11); + NTV2_FLD(ntv2_fld_hdmiin_audio_2ch, 1, 12); /* 2 audio channels (vs 8) */ + NTV2_FLD(ntv2_fld_hdmiin_progressive, 1, 13); + NTV2_FLD(ntv2_fld_hdmiin_video_sd, 1, 14); /* video pixel clock sd (not hd or 3g) */ + NTV2_FLD(ntv2_fld_hdmiin_video_74_25, 1, 15); /* not used */ + NTV2_FLD(ntv2_fld_hdmiin_audio_rate, 4, 16); + NTV2_FLD(ntv2_fld_hdmiin_audio_word_length, 4, 20); + NTV2_FLD(ntv2_fld_hdmiin_video_format, 3, 24); /* really ntv2 standard */ + NTV2_FLD(ntv2_fld_hdmiin_dvi, 1, 27); /* input dvi (vs hdmi) */ + NTV2_FLD(ntv2_fld_hdmiin_video_rate, 4, 28); /* ntv2 video rate */ + +/* hdmi control */ +NTV2_REG(ntv2_reg_hdmi_control, 127, 0x1d16, 0x2516); /* hdmi audio status register */ + NTV2_FLD(ntv2_fld_hdmiout_force_config, 1, 1); /* force output config (ignore edid) */ + NTV2_FLD(ntv2_fld_hdmiin_audio_pair, 2, 2); /* hdmi input audio pair select */ + NTV2_FLD(ntv2_fld_hdmiin_rate_convert_enable, 1, 4); /* hdmi input audio sample rate converter enable */ + NTV2_FLD(ntv2_fld_hdmiin_channel34_swap_disable, 1, 5); /* hdmi input audio channel 3/4 swap disable */ + NTV2_FLD(ntv2_fld_hdmiout_channel34_swap_disable, 1, 6); /* hdmi output audio channel 3/4 swap disable */ + NTV2_FLD(ntv2_fld_hdmiout_prefer_420, 1, 7); /* hdmi output prefer 4K/UHD 420 */ + NTV2_FLD(ntv2_fld_hdmiout_audio_format, 2, 8); /* hdmi output audio format */ + NTV2_FLD(ntv2_fld_hdmiin_color_depth, 2, 12); /* hdmi input bit depth */ + NTV2_FLD(ntv2_fld_hdmiin_color_space, 2, 14); /* hdmi input color space */ + NTV2_FLD(ntv2_fld_hdmi_polarity, 4, 16); /* hdmi polarity? */ + NTV2_FLD(ntv2_fld_hdmiout_source_select, 4, 20); /* output audio source select */ + NTV2_FLD(ntv2_fld_hdmiout_crop_enable, 1, 24); /* crop 2k -> hd 4k -> uhd */ + NTV2_FLD(ntv2_fld_hdmiout_force_hpd, 1, 25); /* force hpd */ + NTV2_FLD(ntv2_fld_hdmiout_deep_12bit, 1, 26); /* deep color 12 bit */ + NTV2_FLD(ntv2_fld_hdmi_debug, 1, 27); /* debug output enable */ + NTV2_FLD(ntv2_fld_hdmi_disable_update, 1, 28); /* disable update loop */ + NTV2_FLD(ntv2_fld_hdmiout_channel_select, 2, 29); /* output audio channel select */ + NTV2_FLD(ntv2_fld_hdmi_protocol, 1, 30); /* hdmi protocol? */ + NTV2_FLD(ntv2_fld_hdmiin_full_range, 1, 31); /* hdmi input quantization full range */ + +NTV2_REG(ntv2_reg_hdmiin4_auxdata, 0x1c00, 0x1c00, 0x2400); /* hdmi aux data */ + NTV2_CON(ntv2_con_auxdata_size, 8); /* aux data register length */ + NTV2_CON(ntv2_con_auxdata_count, 32); /* number of aux data slots */ + NTV2_CON(ntv2_con_header_type_nodata, 0x00); /* aux header type */ + NTV2_CON(ntv2_con_header_type_vendor_specific, 0x81); + NTV2_CON(ntv2_con_header_type_video_info, 0x82); + NTV2_CON(ntv2_con_header_type_source_product, 0x83); + NTV2_CON(ntv2_con_header_type_audio_info, 0x84); + NTV2_CON(ntv2_con_header_type_drm_info, 0x87); + +NTV2_REG(ntv2_reg_hdmiin4_videocontrol, 0x1d00, 0x1d00, 0x2500); /* hdmi control/status */ + NTV2_FLD(ntv2_fld_hdmiin4_videocontrol_scrambledetect, 1, 0); /* scdc 2.0 scramble detect */ + NTV2_CON(ntv2_con_hdmiin4_scrambledetect_false, 0x0); /* scramble not detected */ + NTV2_CON(ntv2_con_hdmiin4_scrambledetect_true, 0x1); /* scramble detected */ + NTV2_FLD(ntv2_fld_hdmiin4_videocontrol_descramblemode, 1, 1); /* scdc 2.0 descamble mode */ + NTV2_CON(ntv2_con_hdmiin4_descramblemode_disable, 0x0); /* descramble disable */ + NTV2_CON(ntv2_con_hdmiin4_descramblemode_enable, 0x1); /* descramble enable */ + NTV2_FLD(ntv2_fld_hdmiin4_videocontrol_scdcratedetect, 1, 2); /* scdc hdmi receive > 3.4 gbps */ + NTV2_CON(ntv2_con_hdmiin4_scdcratedetect_low, 0x0); /* scdc hdmi receive rate < 3.4 gbps */ + NTV2_CON(ntv2_con_hdmiin4_scdcratedetect_high, 0x1); /* scdc hdmi receive rate > 3.4 gbps */ + NTV2_FLD(ntv2_fld_hdmiin4_videocontrol_scdcratemode, 1, 3); /* scdc hdmi mode > 3.4 gbps */ + NTV2_CON(ntv2_con_hdmiin4_scdcratemode_low, 0x0); /* scdc hdmi mode rate < 3.4 gbps */ + NTV2_CON(ntv2_con_hdmiin4_scdcratemode_high, 0x1); /* scdc hdmi mode rate > 3.4 gbps */ + NTV2_FLD(ntv2_fld_hdmiin4_videocontrol_420mode, 1, 5); /* 420 mode */ + NTV2_CON(ntv2_con_hdmiin4_420mode_disable, 0x0); /* 420 disable */ + NTV2_CON(ntv2_con_hdmiin4_420mode_enable, 0x1); /* 420 enable */ + NTV2_FLD(ntv2_fld_hdmiin4_videocontrol_pixelsperclock, 3, 8); /* pixels per clock */ + NTV2_FLD(ntv2_fld_hdmiin4_videocontrol_hsyncdivide, 1, 12); /* hsync divide mode */ + NTV2_CON(ntv2_con_hdmiin4_hsyncdivide_none, 0x0); /* no hsync divide */ + NTV2_CON(ntv2_con_hdmiin4_hsyncdivide_2, 0x1); /* divide hsync by 2 */ + NTV2_FLD(ntv2_fld_hdmiin4_videocontrol_audioswapmode, 1, 13); /* audio channel 34 swap */ + NTV2_CON(ntv2_con_hdmiin4_audioswapmode_enable, 0x0); /* swap */ + NTV2_CON(ntv2_con_hdmiin4_audioswapmode_disable, 0x1); /* no swap */ + NTV2_FLD(ntv2_fld_hdmiin4_videocontrol_audioresamplemode, 1, 14); /* audio resample mode */ + NTV2_CON(ntv2_con_hdmiin4_audioresamplemode_enable, 0x0); /* enable */ + NTV2_CON(ntv2_con_hdmiin4_audioresamplemode_disable, 0x1); /* disable */ + NTV2_FLD(ntv2_fld_hdmiin4_videocontrol_linerate, 5, 16); /* line rate */ + NTV2_CON(ntv2_con_hdmiin4_linerate_none, 0x0); /* undetected */ + NTV2_CON(ntv2_con_hdmiin4_linerate_5940mhz, 0x1); /* 5940 mhz 8 bit */ + NTV2_CON(ntv2_con_hdmiin4_linerate_2970mhz, 0x2); /* 2970 mhz 8 bit */ + NTV2_CON(ntv2_con_hdmiin4_linerate_1485mhz, 0x3); /* 1485 mhz 8 bit */ + NTV2_CON(ntv2_con_hdmiin4_linerate_742mhz, 0x4); /* 742 mhz 8 bit */ + NTV2_CON(ntv2_con_hdmiin4_linerate_270mhz, 0x5); /* 270 mhz 8 bit */ + NTV2_CON(ntv2_con_hdmiin4_linerate_3712mhz, 0x6); /* 3712 mhz 10 bit */ + NTV2_CON(ntv2_con_hdmiin4_linerate_1856mhz, 0x7); /* 1856 mhz 10 bit */ + NTV2_CON(ntv2_con_hdmiin4_linerate_928mhz, 0x8); /* 928 mhz 10 bit */ + NTV2_CON(ntv2_con_hdmiin4_linerate_337mhz, 0x9); /* 337 mhz 10 bit */ + NTV2_CON(ntv2_con_hdmiin4_linerate_4455mhz, 0xa); /* 4455 mhz 12 bit */ + NTV2_CON(ntv2_con_hdmiin4_linerate_2227mhz, 0xb); /* 2227 mhz 12 bit */ + NTV2_CON(ntv2_con_hdmiin4_linerate_1113mhz, 0xc); /* 1113 mhz 12 bit */ + NTV2_CON(ntv2_con_hdmiin4_linerate_405mhz, 0xd); /* 405 mhz 12 bit */ + NTV2_CON(ntv2_con_hdmiin4_linerate_556mhz, 0xe); /* 556 mhz */ + NTV2_CON(ntv2_con_hdmiin4_linerate_540mhz, 0xf); /* 540 mhz */ + NTV2_CON(ntv2_con_hdmiin4_linerate_250mhz, 0x10); /* 250 mhz */ + NTV2_FLD(ntv2_fld_hdmiin4_videocontrol_deserializerlock, 3, 24); /* deserializers lock state */ + NTV2_FLD(ntv2_fld_hdmiin4_videocontrol_inputlock, 1, 27); /* input lock state */ + NTV2_FLD(ntv2_fld_hdmiin4_videocontrol_hdmi5vdetect, 1, 28); /* hdmi detect state */ + NTV2_FLD(ntv2_fld_hdmiin4_videocontrol_hotplugmode, 1, 29); /* hot plug mode */ + NTV2_CON(ntv2_con_hdmiin4_hotplugmode_disable, 0x0); /* disable edid */ + NTV2_CON(ntv2_con_hdmiin4_hotplugmode_enable, 0x1); /* enable edid */ + NTV2_FLD(ntv2_fld_hdmiin4_videocontrol_resetdone, 1, 30); /* rx reset done */ + NTV2_FLD(ntv2_fld_hdmiin4_videocontrol_reset, 1, 31); /* rx reset */ + +NTV2_REG(ntv2_reg_hdmiin4_videodetect0, 0x1d01, 0x1d01, 0x2501); /* video detect 0 register */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect0_colordepth, 2, 0); /* color depth */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect0_colorspace, 2, 2); /* color space */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect0_scanmode, 1, 4); /* video scan mode */ + NTV2_CON(ntv2_con_hdmiin4_scanmode_interlaced, 0x0); /* interlaced */ + NTV2_CON(ntv2_con_hdmiin4_scanmode_progressive, 0x1); /* progressive */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect0_interfacemode, 1, 5); /* interface mode */ + NTV2_CON(ntv2_con_hdmiin4_interfacemode_hdmi, 0x0); /* hdmi */ + NTV2_CON(ntv2_con_hdmiin4_interfacemode_dvi, 0x1); /* dvi */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect0_syncpolarity, 1, 6); /* sync polarity */ + NTV2_CON(ntv2_con_hdmiin4_syncpolarity_activelow, 0x0); /* active low */ + NTV2_CON(ntv2_con_hdmiin4_syncpolarity_activehigh, 0x1); /* active high */ + +NTV2_REG(ntv2_reg_hdmiin4_videodetect1, 0x1d02, 0x1d02, 0x2502); /* video detect 1 register */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect1_hsyncstart, 16, 0); /* horizontal sync start */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect1_hsyncend, 16, 16); /* horizontal sync end */ + +NTV2_REG(ntv2_reg_hdmiin4_videodetect2, 0x1d03, 0x1d03, 0x2503); /* video detect 2 register */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect2_hdestart, 16, 0); /* horizontal de start */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect2_htotal, 16, 16); /* horizontal total */ + +NTV2_REG(ntv2_reg_hdmiin4_videodetect3, 0x1d04, 0x1d04, 0x2504); /* video detect 3 register */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect3_vtransf1, 16, 0); /* vertical transistion field 1 */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect3_vtransf2, 16, 16); /* vertical transistion field 2 */ + +NTV2_REG(ntv2_reg_hdmiin4_videodetect4, 0x1d05, 0x1d05, 0x2505); /* video detect 4 register */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect4_vsyncstartf1, 16, 0); /* vertical sync start field 1 */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect4_vsyncendf1, 16, 16); /* virtical sync end field 1 */ + +NTV2_REG(ntv2_reg_hdmiin4_videodetect5, 0x1d06, 0x1d06, 0x2506); /* video detect 5 register */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect5_vdestartf1, 16, 0); /* vertical de start field 1 */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect5_vdestartf2, 16, 16); /* vertical de start field 2 */ + +NTV2_REG(ntv2_reg_hdmiin4_videodetect6, 0x1d07, 0x1d07, 0x2507); /* video detect 6 register */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect6_vsyncstartf2, 16, 0); /* vertical sync start field 2 */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect6_vsyncendf2, 16, 16); /* virtical sync end field 2 */ + +NTV2_REG(ntv2_reg_hdmiin4_videodetect7, 0x1d08, 0x1d08, 0x2508); /* video detect 7 register */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect7_vtotalf1, 16, 0); /* vertical total field 1 */ + NTV2_FLD(ntv2_fld_hdmiin4_videodetect7_vtotalf2, 16, 16); /* vertical total field 2 */ + +NTV2_REG(ntv2_reg_hdmiin4_auxcontrol, 0x1d09, 0x1d09, 0x2509); /* video detect 9 register */ + NTV2_FLD(ntv2_fld_hdmiin4_auxcontrol_auxactive, 1, 0); /* aux data active bank */ + NTV2_CON(ntv2_con_hdmiin4_auxactive_bank0, 0x0); /* bank 0 */ + NTV2_CON(ntv2_con_hdmiin4_auxactive_bank1, 0x1); /* bank 1 */ + NTV2_FLD(ntv2_fld_hdmiin4_auxcontrol_auxread, 1, 1); /* aux data read bank */ + NTV2_CON(ntv2_con_hdmiin4_auxread_bank0, 0x0); /* bank 0 */ + NTV2_CON(ntv2_con_hdmiin4_auxread_bank1, 0x1); /* bank 1 */ + NTV2_FLD(ntv2_fld_hdmiin4_auxcontrol_auxwrite, 1, 2); /* aux data write bank */ + NTV2_CON(ntv2_con_hdmiin4_auxwrite_bank0, 0x0); /* bank 0 */ + NTV2_CON(ntv2_con_hdmiin4_auxwrite_bank1, 0x1); /* bank 1 */ + NTV2_FLD(ntv2_fld_hdmiin4_auxcontrol_bank0count, 8, 8); /* aux bank 0 packet count */ + NTV2_FLD(ntv2_fld_hdmiin4_auxcontrol_bank1count, 8, 16); /* aux bank 1 packet count */ + +NTV2_REG(ntv2_reg_hdmiin4_receiverstatus, 0x1d0a, 0x1d0a, 0x250a); /* rx status */ + NTV2_FLD(ntv2_fld_hdmiin4_receiverstatus_errorcount, 24, 0); /* rx error count */ + +NTV2_REG(ntv2_reg_hdmiin4_auxpacketignore0, 0x1d0b, 0x1d0b, 0x250b); /* aux packet ignore 0 */ +NTV2_REG(ntv2_reg_hdmiin4_auxpacketignore1, 0x1d0c, 0x1d0c, 0x250c); /* aux packet ignore 1 */ +NTV2_REG(ntv2_reg_hdmiin4_auxpacketignore2, 0x1d0d, 0x1d0d, 0x250d); /* aux packet ignore 2 */ +NTV2_REG(ntv2_reg_hdmiin4_auxpacketignore3, 0x1d0e, 0x1d0e, 0x250e); /* aux packet ignore 3 */ + +NTV2_REG(ntv2_reg_hdmiin4_redrivercontrol, 0x1d0f, 0x1d0f, 0x250f); /* hdmi redriver control */ + NTV2_FLD(ntv2_fld_hdmiin4_redrivercontrol_power, 1, 0); /* power */ + NTV2_CON(ntv2_con_hdmiin4_power_disable, 0x0); /* power disable */ + NTV2_CON(ntv2_con_hdmiin4_power_enable, 0x1); /* power enable */ + NTV2_FLD(ntv2_fld_hdmiin4_redrivercontrol_pinmode, 1, 1); /* pin mode */ + NTV2_CON(ntv2_con_hdmiin4_pinmode_disable, 0x0); /* pin disable */ + NTV2_CON(ntv2_con_hdmiin4_pinmode_enable, 0x1); /* pin enable */ + NTV2_FLD(ntv2_fld_hdmiin4_redrivercontrol_vodrange, 1, 2); /* differential voltage range */ + NTV2_CON(ntv2_con_hdmiin4_vodrange_low, 0x0); /* voltage swing low */ + NTV2_CON(ntv2_con_hdmiin4_vodrange_high, 0x1); /* voltage swing high */ + NTV2_FLD(ntv2_fld_hdmiin4_redrivercontrol_deemphasis, 2, 4); /* deemphasis */ + NTV2_CON(ntv2_con_hdmiin4_deemphasis_0d0db, 0x0); /* 0 db */ + NTV2_CON(ntv2_con_hdmiin4_deemphasis_3d5db, 0x1); /* 3.5 db */ + NTV2_CON(ntv2_con_hdmiin4_deemphasis_6d0db, 0x2); /* 6 db */ + NTV2_CON(ntv2_con_hdmiin4_deemphasis_9d5db, 0x3); /* 9.5 db */ + NTV2_FLD(ntv2_fld_hdmiin4_redrivercontrol_preemphasis, 2, 8); /* preemphasis */ + NTV2_CON(ntv2_con_hdmiin4_preemphasis_0d0db, 0x0); /* 0 db */ + NTV2_CON(ntv2_con_hdmiin4_preemphasis_1d6db, 0x1); /* 1.6 db */ + NTV2_CON(ntv2_con_hdmiin4_preemphasis_3d5db, 0x2); /* 3.5 db */ + NTV2_CON(ntv2_con_hdmiin4_preemphasis_6d0db, 0x3); /* 6 db */ + NTV2_FLD(ntv2_fld_hdmiin4_redrivercontrol_boost, 4, 12); /* boost */ + NTV2_CON(ntv2_con_hdmiin4_boost_00d25db, 0x0); /* 0.25 db */ + NTV2_CON(ntv2_con_hdmiin4_boost_00d80db, 0x1); /* 0.80 db */ + NTV2_CON(ntv2_con_hdmiin4_boost_01d10db, 0x2); /* 1.1 db */ + NTV2_CON(ntv2_con_hdmiin4_boost_02d20db, 0x3); /* 2.2 db */ + NTV2_CON(ntv2_con_hdmiin4_boost_04d10db, 0x4); /* 4.1 db */ + NTV2_CON(ntv2_con_hdmiin4_boost_07d10db, 0x5); /* 7.1 db */ + NTV2_CON(ntv2_con_hdmiin4_boost_09d00db, 0x6); /* 9.0 db */ + NTV2_CON(ntv2_con_hdmiin4_boost_10d30db, 0x7); /* 10.3 db */ + NTV2_CON(ntv2_con_hdmiin4_boost_11d80db, 0x8); /* 11.8 db */ + NTV2_CON(ntv2_con_hdmiin4_boost_13d90db, 0x9); /* 13.9 db */ + NTV2_CON(ntv2_con_hdmiin4_boost_15d30db, 0xa); /* 15.3 db */ + NTV2_CON(ntv2_con_hdmiin4_boost_16d90db, 0xb); /* 16.9 db */ + NTV2_CON(ntv2_con_hdmiin4_boost_17d90db, 0xc); /* 17.9 db */ + NTV2_CON(ntv2_con_hdmiin4_boost_19d20db, 0xd); /* 19.2 db */ + NTV2_CON(ntv2_con_hdmiin4_boost_20d50db, 0xe); /* 20.5 db */ + NTV2_CON(ntv2_con_hdmiin4_boost_22d20db, 0xf); /* 22.2 db */ + +NTV2_REG(ntv2_reg_hdmiin4_refclockfrequency, 0x1d10, 0x1d10, 0x2510); /* reference clock frequency */ +NTV2_REG(ntv2_reg_hdmiin4_tmdsclockfrequency, 0x1d11, 0x1d11, 0x2511); /* tmds clock frequency */ +NTV2_REG(ntv2_reg_hdmiin4_rxclockfrequency, 0x1d12, 0x1d12, 0x2512); /* rx clock frequency */ + +NTV2_REG(ntv2_reg_hdmiin4_rxoversampling, 0x1d13, 0x1d13, 0x2513); /* rx oversampling */ + NTV2_FLD(ntv2_fld_hdmiin4_rxoversampling_ratiofraction, 10, 0); /* oversampling ratio fraction */ + NTV2_FLD(ntv2_fld_hdmiin4_rxoversampling_ratiointeger, 4, 10); /* oversampling ratio integer */ + NTV2_FLD(ntv2_fld_hdmiin4_rxoversampling_mode, 2, 16); /* oversampling mode */ + NTV2_CON(ntv2_con_hdmiin4_mode_none, 0x0); /* no oversampling */ + NTV2_CON(ntv2_con_hdmiin4_mode_asynchronous, 0x1); /* asynchronous oversampling */ + NTV2_CON(ntv2_con_hdmiin4_mode_synchronous, 0x2); /* synchronous oversampling */ + +NTV2_REG(ntv2_kona_reg_hdmiin4_edid, 0x1d1d, 0x1d1d, 0x251d); + NTV2_FLD(ntv2_kona_fld_hdmiin4_edid_write_data, 8, 0); + NTV2_FLD(ntv2_kona_fld_hdmiin4_edid_read_data, 8, 8); + NTV2_FLD(ntv2_kona_fld_hdmiin4_edid_address, 8, 16); + NTV2_FLD(ntv2_kona_fld_hdmiin4_edid_write_enable, 1, 24); + NTV2_FLD(ntv2_kona_fld_hdmiin4_edid_busy, 1, 25); + +NTV2_REG(ntv2_reg_hdmiin4_croplocation, 0x1d1e, 0x1d1e, 0x251e); /* crop location */ + NTV2_FLD(ntv2_fld_hdmiin4_croplocation_start, 16, 0); /* crop start location */ + NTV2_FLD(ntv2_fld_hdmiin4_croplocation_end, 16, 16); /* crop end location */ + +NTV2_REG(ntv2_reg_hdmiin4_pixelcontrol, 0x1d1f, 0x1d1f, 0x251f); /* pixel control */ + NTV2_FLD(ntv2_fld_hdmiin4_pixelcontrol_lineinterleave, 1, 0); /* line interleave */ + NTV2_CON(ntv2_con_hdmiin4_lineinterleave_disable, 0x0); /* disable */ + NTV2_CON(ntv2_con_hdmiin4_lineinterleave_enable, 0x1); /* enable */ + NTV2_FLD(ntv2_fld_hdmiin4_pixelcontrol_pixelinterleave, 1, 1); /* pixel interleave */ + NTV2_CON(ntv2_con_hdmiin4_pixelinterleave_disable, 0x0); /* disable */ + NTV2_CON(ntv2_con_hdmiin4_pixelinterleave_enable, 0x1); /* enable */ + NTV2_FLD(ntv2_fld_hdmiin4_pixelcontrol_420convert, 1, 2); /* 420 to 422 conversion */ + NTV2_CON(ntv2_con_hdmiin4_420convert_disable, 0x0); /* disable */ + NTV2_CON(ntv2_con_hdmiin4_420convert_enable, 0x1); /* enable */ + NTV2_FLD(ntv2_fld_hdmiin4_pixelcontrol_cropmode, 1, 3); /* crop mode */ + NTV2_CON(ntv2_con_hdmiin4_cropmode_disable, 0x0); /* disable */ + NTV2_CON(ntv2_con_hdmiin4_cropmode_enable, 0x1); /* enable */ + NTV2_FLD(ntv2_fld_hdmiin4_pixelcontrol_hlinefilter, 1, 4); /* horizontal line filter mode */ + NTV2_CON(ntv2_con_hdmiin4_hlinefilter_disable, 0x0); /* disable */ + NTV2_CON(ntv2_con_hdmiin4_hlinefilter_enable, 0x1); /* enable */ + NTV2_FLD(ntv2_fld_hdmiin4_pixelcontrol_clockratio, 4, 8); /* core clock to data clock ratio */ + +NTV2_REG(ntv2_vreg_hdmiin4_avi_info, kVRegHDMIInAviInfo1, + kVRegHDMIInAviInfo1, + kVRegHDMIInAviInfo2); /* avi info data */ + + NTV2_FLD(ntv2_fld_hdmiin4_colorimetry, 4, 0); /* colorimetry */ + NTV2_FLD(ntv2_fld_hdmiin4_dolby_vision, 1, 4); /* dolby vision detected */ + +NTV2_REG(ntv2_vreg_hdmiin4_drm_info, kVRegHDMIInDrmInfo1, + kVRegHDMIInDrmInfo1, + kVRegHDMIInDrmInfo2); /* drm info data */ + NTV2_FLD(ntv2_fld_hdmiin4_drm_present, 1, 0); /* drm info frame present */ + NTV2_FLD(ntv2_fld_hdmiin4_drm_eotf, 4, 8); /* electro optical transfer function */ + NTV2_FLD(ntv2_fld_hdmiin4_drm_metadata_id, 4, 12); /* metadata descriptor id */ + +NTV2_REG(ntv2_vreg_hdmiin4_drm_green, kVRegHDMIInDrmGreenPrimary1, + kVRegHDMIInDrmGreenPrimary1, + kVRegHDMIInDrmGreenPrimary2); /* drm green primary */ + NTV2_FLD(ntv2_fld_hdmiin4_drm_green_x, 16, 0); /* green primary x */ + NTV2_FLD(ntv2_fld_hdmiin4_drm_green_y, 16, 16); /* green primary y */ + +NTV2_REG(ntv2_vreg_hdmiin4_drm_blue, kVRegHDMIInDrmBluePrimary1, + kVRegHDMIInDrmBluePrimary1, + kVRegHDMIInDrmBluePrimary2); /* drm blue primary */ + NTV2_FLD(ntv2_fld_hdmiin4_drm_blue_x, 16, 0); /* blue primary x */ + NTV2_FLD(ntv2_fld_hdmiin4_drm_blue_y, 16, 16); /* blue primary y */ + +NTV2_REG(ntv2_vreg_hdmiin4_drm_red, kVRegHDMIInDrmRedPrimary1, + kVRegHDMIInDrmRedPrimary1, + kVRegHDMIInDrmRedPrimary2); /* drm red primary */ + NTV2_FLD(ntv2_fld_hdmiin4_drm_red_x, 16, 0); /* red primary x */ + NTV2_FLD(ntv2_fld_hdmiin4_drm_red_y, 16, 16); /* red primary y */ + +NTV2_REG(ntv2_vreg_hdmiin4_drm_white, kVRegHDMIInDrmWhitePoint1, + kVRegHDMIInDrmWhitePoint1, + kVRegHDMIInDrmWhitePoint2); /* drm white point */ + NTV2_FLD(ntv2_fld_hdmiin4_drm_white_x, 16, 0); /* white point x */ + NTV2_FLD(ntv2_fld_hdmiin4_drm_white_y, 16, 16); /* white point y */ + +NTV2_REG(ntv2_vreg_hdmiin4_drm_luma, kVRegHDMIInDrmMasteringLuminence1, + kVRegHDMIInDrmMasteringLuminence1, + kVRegHDMIInDrmMasteringLuminence2); /* drm luminence level */ + NTV2_FLD(ntv2_fld_hdmiin4_drm_luma_max, 16, 0); /* luminence max */ + NTV2_FLD(ntv2_fld_hdmiin4_drm_luma_min, 16, 16); /* luminence min */ + +NTV2_REG(ntv2_vreg_hdmiin4_drm_light, kVRegHDMIInDrmLightLevel1, + kVRegHDMIInDrmLightLevel1, + kVRegHDMIInDrmLightLevel2); /* drm light level */ + NTV2_FLD(ntv2_fld_hdmiin4_drm_light_content_max, 16, 0); /* light level content max */ + NTV2_FLD(ntv2_fld_hdmiin4_drm_light_average_max, 16, 16); /* light level average max */ + +#endif diff --git a/build_dependencies/aja/include/ajadriver/ntv2hinreg.h b/build_dependencies/aja/include/ajadriver/ntv2hinreg.h new file mode 100644 index 0000000..1d6a04e --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2hinreg.h @@ -0,0 +1,740 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +#ifndef NTV2_HINREG_H +#define NTV2_HINREG_H + +#include "ntv2commonreg.h" + + +/* video frame flags */ +NTV2_CON(ntv2_kona_frame_none, 0x00000000); +NTV2_CON(ntv2_kona_frame_picture_progressive, 0x00000001); /* picture progressive */ +NTV2_CON(ntv2_kona_frame_picture_interlaced, 0x00000002); /* picture interlaced */ +NTV2_CON(ntv2_kona_frame_transport_progressive, 0x00000004); /* transport progressive */ +NTV2_CON(ntv2_kona_frame_transport_interlaced, 0x00000008); /* transport interlaced */ +NTV2_CON(ntv2_kona_frame_sd, 0x00000010); /* clock sd */ +NTV2_CON(ntv2_kona_frame_hd, 0x00000020); /* clock hd */ +NTV2_CON(ntv2_kona_frame_3g, 0x00000040); /* clock 3g */ +NTV2_CON(ntv2_kona_frame_3ga, 0x00000100); /* sdi transport 3ga */ +NTV2_CON(ntv2_kona_frame_3gb, 0x00000200); /* sdi transport 3gb */ +NTV2_CON(ntv2_kona_frame_dual_link, 0x00000400); /* sdi transport smpte 372 4444 */ +NTV2_CON(ntv2_kona_frame_line_interleaved, 0x00000800); /* sdi transport smpte 372 >30 fps */ +NTV2_CON(ntv2_kona_frame_square_division, 0x00001000); /* transport square division */ +NTV2_CON(ntv2_kona_frame_sample_interleaved, 0x00002000); /* transport sample interleaved */ +NTV2_CON(ntv2_kona_frame_4x3, 0x00100000); /* 4x3 aspect */ +NTV2_CON(ntv2_kona_frame_16x9, 0x00200000); /* 16x9 aspect */ + +/* video pixel flags */ +NTV2_CON(ntv2_kona_pixel_none, 0x00000000); +NTV2_CON(ntv2_kona_pixel_yuv, 0x00000001); /* yuv color space */ +NTV2_CON(ntv2_kona_pixel_rgb, 0x00000002); /* rgb color space */ +NTV2_CON(ntv2_kona_pixel_full, 0x00000004); /* full range black - white */ +NTV2_CON(ntv2_kona_pixel_smpte, 0x00000008); /* smpte range black - white */ +NTV2_CON(ntv2_kona_pixel_rec601, 0x00000010); /* rec 601 color standard */ +NTV2_CON(ntv2_kona_pixel_rec709, 0x00000020); /* rec 709 color standard */ +NTV2_CON(ntv2_kona_pixel_rec2020, 0x00000040); /* rec 2020 color standard */ +NTV2_CON(ntv2_kona_pixel_adobe, 0x00000080); /* adobe color standard */ +NTV2_CON(ntv2_kona_pixel_420, 0x00000100); /* 420 component format */ +NTV2_CON(ntv2_kona_pixel_422, 0x00000200); /* 422 component format */ +NTV2_CON(ntv2_kona_pixel_444, 0x00000400); /* 444 component format */ +NTV2_CON(ntv2_kona_pixel_4444, 0x00000800); /* 4444 component format */ +NTV2_CON(ntv2_kona_pixel_4224, 0x00001000); /* 4224 component format */ +NTV2_CON(ntv2_kona_pixel_8bit, 0x00010000); /* 8 bit component resolution */ +NTV2_CON(ntv2_kona_pixel_10bit, 0x00020000); /* 10 bit component resolution */ +NTV2_CON(ntv2_kona_pixel_12bit, 0x00040000); /* 12 bit component resolution */ +NTV2_CON(ntv2_kona_pixel_16bit, 0x00080000); /* 16 bit component resolution */ + +/* hdmi input status */ +NTV2_REG(ntv2_kona_reg_hdmiin_input_status, 126, 0x2c13, 0x3013); /* hdmi input status register */ + NTV2_FLD(ntv2_kona_fld_hdmiin_locked, 1, 0); + NTV2_FLD(ntv2_kona_fld_hdmiin_stable, 1, 1); + NTV2_FLD(ntv2_kona_fld_hdmiin_rgb, 1, 2); + NTV2_FLD(ntv2_kona_fld_hdmiin_deep_color, 1, 3); + NTV2_FLD(ntv2_kona_fld_hdmiin_video_code, 6, 4); /* ntv2 video standard v2 */ + NTV2_FLD(ntv2_kona_fld_hdmiin_lhi_ycbcr_mode, 1, 10); + NTV2_FLD(ntv2_kona_fld_hdmiin_lhi_10bit_mode, 1, 11); + NTV2_FLD(ntv2_kona_fld_hdmiin_audio_2ch, 1, 12); /* 2 audio channels (vs 8) */ + NTV2_FLD(ntv2_kona_fld_hdmiin_progressive, 1, 13); + NTV2_FLD(ntv2_kona_fld_hdmiin_video_sd, 1, 14); /* video pixel clock sd (not hd or 3g) */ + NTV2_FLD(ntv2_kona_fld_hdmiin_video_74_25, 1, 15); /* not used */ + NTV2_FLD(ntv2_kona_fld_hdmiin_audio_rate, 4, 16); + NTV2_FLD(ntv2_kona_fld_hdmiin_audio_word_length, 4, 20); + NTV2_FLD(ntv2_kona_fld_hdmiin_video_format, 3, 24); /* really ntv2 standard */ + NTV2_FLD(ntv2_kona_fld_hdmiin_dvi, 1, 27); /* input dvi (vs hdmi) */ + NTV2_FLD(ntv2_kona_fld_hdmiin_video_rate, 4, 28); /* ntv2 video rate */ + +/* hdmi control */ +NTV2_REG(ntv2_reg_hdmi_control, 127, 0x2c14, 0x3014); /* hdmi audio status register */ + NTV2_FLD(ntv2_kona_fld_hdmiout_force_config, 1, 1); /* force output config (ignore edid) */ + NTV2_FLD(ntv2_kona_fld_hdmiin_audio_pair, 2, 2); /* hdmi input audio pair select */ + NTV2_FLD(ntv2_kona_fld_hdmiin_rate_convert_enable, 1, 4); /* hdmi input audio sample rate converter enable */ + NTV2_FLD(ntv2_kona_fld_hdmiin_channel34_swap_disable, 1, 5); /* hdmi input audio channel 3/4 swap disable */ + NTV2_FLD(ntv2_kona_fld_hdmiout_channel34_swap_disable, 1, 6); /* hdmi output audio channel 3/4 swap disable */ + NTV2_FLD(ntv2_kona_fld_hdmiout_prefer_420, 1, 7); /* hdmi output prefer 4K/UHD 420 */ + NTV2_FLD(ntv2_kona_fld_hdmiout_audio_format, 2, 8); /* hdmi output audio format */ + NTV2_FLD(ntv2_kona_fld_hdmiin_color_depth, 2, 12); /* hdmi input bit depth */ + NTV2_FLD(ntv2_kona_fld_hdmiin_color_space, 2, 14); /* hdmi input color space */ + NTV2_FLD(ntv2_kona_fld_hdmi_polarity, 4, 16); /* hdmi polarity? */ + NTV2_FLD(ntv2_kona_fld_hdmiout_source_select, 4, 20); /* output audio source select */ + NTV2_FLD(ntv2_kona_fld_hdmiout_crop_enable, 1, 24); /* crop 2k -> hd 4k -> uhd */ + NTV2_FLD(ntv2_kona_fld_hdmiout_force_hpd, 1, 25); /* force hpd */ + NTV2_FLD(ntv2_kona_fld_hdmiout_deep_12bit, 1, 26); /* deep color 12 bit */ + NTV2_FLD(ntv2_kona_fld_hdmi_debug, 1, 27); /* debug output enable */ + NTV2_FLD(ntv2_kona_fld_hdmi_disable_update, 1, 28); /* disable update loop */ + NTV2_FLD(ntv2_kona_fld_hdmiout_channel_select, 2, 29); /* output audio channel select */ + NTV2_FLD(ntv2_kona_fld_hdmi_protocol, 1, 30); /* hdmi protocol? */ + NTV2_FLD(ntv2_kona_fld_hdmiin_full_range, 1, 31); /* hdmi input quantization full range */ + +/* hdmi input video mode */ +NTV2_CON(ntv2_kona_hdmiin_video_mode_hdsdi, 0x0); /* hd-sdi */ +NTV2_CON(ntv2_kona_hdmiin_video_mode_sdsdi, 0x1); /* sd_sdi */ +NTV2_CON(ntv2_kona_hdmiin_video_mode_3gsdi, 0x2); /* 3g-sdi */ + +/* hdmi input video map */ +NTV2_CON(ntv2_kona_hdmiin_video_map_422_10bit, 0x0); /* yuv 422 10 bit */ +NTV2_CON(ntv2_kona_hdmiin_video_map_444_10bit, 0x1); /* yuv/rgb 444 10 bit */ + +/* hdmi input video standard */ +NTV2_CON(ntv2_kona_hdmiin_video_standard_1080i, 0x0); /* 1080i */ +NTV2_CON(ntv2_kona_hdmiin_video_standard_720p, 0x1); /* 720p */ +NTV2_CON(ntv2_kona_hdmiin_video_standard_525i, 0x2); /* 525i */ +NTV2_CON(ntv2_kona_hdmiin_video_standard_625i, 0x3); /* 625i */ +NTV2_CON(ntv2_kona_hdmiin_video_standard_1080p, 0x4); /* 1080p */ +NTV2_CON(ntv2_kona_hdmiin_video_standard_4k, 0x5); /* 4K */ +NTV2_CON(ntv2_kona_hdmiin_video_standard_2205p, 0x6); /* 3D frame packed mode */ +NTV2_CON(ntv2_kona_hdmiin_video_standard_none, 0x7); /* undefined */ + +/* hdmi input frame rate */ +NTV2_CON(ntv2_kona_hdmiin_frame_rate_none, 0x0); /* undefined */ +NTV2_CON(ntv2_kona_hdmiin_frame_rate_6000, 0x1); /* 60.00 */ +NTV2_CON(ntv2_kona_hdmiin_frame_rate_5994, 0x2); /* 59.94 */ +NTV2_CON(ntv2_kona_hdmiin_frame_rate_3000, 0x3); /* 30.00 */ +NTV2_CON(ntv2_kona_hdmiin_frame_rate_2997, 0x4); /* 29.97 */ +NTV2_CON(ntv2_kona_hdmiin_frame_rate_2500, 0x5); /* 25.00 */ +NTV2_CON(ntv2_kona_hdmiin_frame_rate_2400, 0x6); /* 24.00 */ +NTV2_CON(ntv2_kona_hdmiin_frame_rate_2398, 0x7); /* 23.98 */ +NTV2_CON(ntv2_kona_hdmiin_frame_rate_5000, 0x8); /* 50.00 */ + +/* hdmi 3d structure */ +NTV2_CON(ntv2_kona_hdmiin_3d_frame_packing, 0x0); /* 0000 frame packing */ +NTV2_CON(ntv2_kona_hdmiin_3d_field_alternative, 0x1); /* 0001 field alternative */ +NTV2_CON(ntv2_kona_hdmiin_3d_line_alternative, 0x2); /* 0010 line alternative */ +NTV2_CON(ntv2_kona_hdmiin_3d_side_by_side_full, 0x3); /* 0011 side by side full */ +NTV2_CON(ntv2_kona_hdmiin_3d_l_depth, 0x4); /* 0100 L + depth */ +NTV2_CON(ntv2_kona_hdmiin_3d_l_d_g, 0x5); /* 0101 L + depth + graphics -depth */ +NTV2_CON(ntv2_kona_hdmiin_3d_top_bottom, 0x6); /* 0110 top bottom */ +NTV2_CON(ntv2_kona_hdmiin_3d_side_by_side_half, 0x8); /* 1000 side by side half */ + +/* hdmi input control */ +NTV2_REG(ntv2_kona_reg_hdmiin_i2c_control, 360, 0x2c00, 0x3000); /* hdmi input i2c control register */ + NTV2_FLD(ntv2_kona_fld_hdmiin_subaddress, 8, 0); /* i2c subaddress (8-bit register on device) */ + NTV2_FLD(ntv2_kona_fld_hdmiin_device_address, 7, 8); /* i2c device address (hdmiin_addr) */ + NTV2_FLD(ntv2_kona_fld_hdmiin_read_disable, 1, 16); /* i2c read disable bit */ + NTV2_FLD(ntv2_kona_fld_hdmiin_write_busy, 1, 20); /* i2c write busy bit */ + NTV2_FLD(ntv2_kona_fld_hdmiin_i2c_error, 1, 21); /* i2c error bit */ + NTV2_FLD(ntv2_kona_fld_hdmiin_i2c_busy, 1, 22); /* i2c busy bit */ + NTV2_FLD(ntv2_kona_fld_hdmiin_i2c_reset, 1, 24); /* i2c reset bit */ + NTV2_FLD(ntv2_kona_fld_hdmiin_ram_data_ready, 1, 28); /* i2c ram data ready bit */ + +NTV2_REG(ntv2_kona_reg_hdmiin_i2c_data, 361, 0x2c01, 0x3001); /* hdmi input data register */ + NTV2_FLD(ntv2_kona_fld_hdmiin_data_out, 8, 0); /* i2c data to write to selected subaddress */ + NTV2_FLD(ntv2_kona_fld_hdmiin_data_in, 8, 8); /* i2c data read from selected subaddress */ + +NTV2_REG(ntv2_kona_reg_hdmiin_video_setup, 362, 0x2c02, 0x3002); /* hdmi input video setup regiser */ + NTV2_FLD(ntv2_kona_fld_hdmiin_video_mode, 2, 0); /* video mode (hdmiin_video_mode) */ + NTV2_FLD(ntv2_kona_fld_hdmiin_video_map, 2, 2); /* video map (hdmiin_video_map) */ + NTV2_FLD(ntv2_kona_fld_hdmiin_video_420, 1, 4); /* 420 video input */ + NTV2_FLD(ntv2_kona_fld_hdmiin_video_standard, 3, 8); /* video standard select (hdmiin_video_standard) */ + NTV2_FLD(ntv2_kona_fld_hdmiin_frame_rate, 4, 16); /* frame rate select (Hz) (hdmiin_frame_rate) */ + NTV2_FLD(ntv2_kona_fld_hdmiin_3d_structure, 4, 20); /* 3D frame structure (hdmi_3d) */ + NTV2_FLD(ntv2_kona_fld_hdmiin_video_4k, 1, 28); /* 4K video input */ + NTV2_FLD(ntv2_kona_fld_hdmiin_video_progressive, 1, 29); /* progressive video input */ + NTV2_FLD(ntv2_kona_fld_hdmiin_video_3d, 1, 30); /* 3D video input */ + NTV2_FLD(ntv2_kona_fld_hdmiin_3d_frame_pack_enable, 1, 31); /* enable special 3D frame-packed mode */ + +NTV2_REG(ntv2_kona_reg_hdmiin_hsync_duration, 363, 0x2c03, 0x3003); /* hdmi input horizontal sync and back porch regiser */ +NTV2_REG(ntv2_kona_reg_hdmiin_h_active, 364, 0x2c04, 0x3004); /* hdmi input horizontal active regiser */ +NTV2_REG(ntv2_kona_reg_hdmiin_vsync_duration_fld1, 365, 0x2c05, 0x3005); /* hdmi input vertical sync and back porch regiser, field 1 */ +NTV2_REG(ntv2_kona_reg_hdmiin_vsync_duration_fld2, 366, 0x2c06, 0x3006); /* hdmi input vertical sync and back porch regiser, field 2 */ +NTV2_REG(ntv2_kona_reg_hdmiin_v_active_fld1, 367, 0x2c07, 0x3007); /* hdmi input vertical active regiser, field 1 */ +NTV2_REG(ntv2_kona_reg_hdmiin_v_active_fld2, 368, 0x2c08, 0x3008); /* hdmi input vertical active regiser, field 2 */ + +NTV2_REG(ntv2_kona_reg_hdmiin_video_status, 369, 0x2c09, 0x3009); /* hdmi input video status regiser 1 */ + NTV2_FLD(ntv2_kona_fld_hdmiin_det_frame_rate, 4, 0); /* detected frame rate (hdmiin_frame_rate) */ + NTV2_FLD(ntv2_kona_fld_hdmiin_det_video_standard, 3, 8); /* detected video standard (hdmiin_video_standard) */ + NTV2_FLD(ntv2_kona_fld_hdmiin_ident_valid, 1, 16); /* identification valid */ + NTV2_FLD(ntv2_kona_fld_hdmiin_hv_locked, 1, 17); /* HV Locked */ + NTV2_FLD(ntv2_kona_fld_hdmiin_hd_74mhz, 1, 18); /* HD 74.xx vs 27 Mhz clock */ + NTV2_FLD(ntv2_kona_fld_hdmiin_det_progressive, 1, 19); /* detected progressive */ + +NTV2_REG(ntv2_kona_reg_hdmiin_horizontal_data, 370, 0x2c0a, 0x300a); /* hdmi input H pixel data */ + NTV2_FLD(ntv2_kona_fld_hdmiin_h_total_pixels, 16, 0); /* H total pixels per line */ + NTV2_FLD(ntv2_kona_fld_hdmiin_h_active_pixels, 16, 16); /* H active pixels per line */ + +NTV2_REG(ntv2_kona_reg_hdmiin_hblank_data0, 371, 0x2c0b, 0x300b); /* hdmi input H blanking data */ + NTV2_FLD(ntv2_kona_fld_hdmiin_h_front_porch_pixels, 16, 0); /* H front porch pixels */ + NTV2_FLD(ntv2_kona_fld_hdmiin_h_back_porch_pixels, 16, 16); /* H back porch pixels */ + +NTV2_REG(ntv2_kona_reg_hdmiin_hblank_data1, 372, 0x2c0c, 0x300c); /* hdmi input H Blanking data */ + NTV2_FLD(ntv2_kona_fld_hdmiin_hsync_pixels, 16, 0); /* H sync pixels */ + NTV2_FLD(ntv2_kona_fld_hdmiin_hblank_pixels, 16, 16); /* H blank pixels */ + +NTV2_REG(ntv2_kona_reg_hdmiin_vertical_data_fld1, 373, 0x2c0c, 0x300d); /* hdmi input field 1 V data */ +NTV2_REG(ntv2_kona_reg_hdmiin_vertical_data_fld2, 374, 0x2c0e, 0x300e); /* hdmi input field 2 V data */ + NTV2_FLD(ntv2_kona_fld_hdmiin_v_total_lines, 16, 0); /* V total lines field 1,2 */ + NTV2_FLD(ntv2_kona_fld_hdmiin_v_active_lines, 16, 16); /* V active lines field 1,2 */ + +NTV2_REG(ntv2_kona_reg_hdmiin_color_depth, 375, 0x2c0f, 0x300f); /* hdmi input color depth */ + NTV2_FLD(ntv2_kona_fld_hdmiin_deep_color_detect, 1, 6); /* detected deep color */ + +/* i2c register / value data */ +struct ntv2_reg_value { + uint8_t address; + uint8_t value; +}; + +/* hdmi i2c device addresses */ +static const uint8_t device_io_bank = 0x4c; /* hdmi chip io register bank */ +static const uint8_t device_hdmi_bank = 0x34; /* hdmi chip hdmi register bank */ +static const uint8_t device_cec_bank = 0x40; /* hdmi chip cec register bank */ +static const uint8_t device_cp_bank = 0x22; /* hdmi chip cp register bank */ +static const uint8_t device_repeater_bank = 0x32; /* hdmi chip repeater register bank */ +static const uint8_t device_edid_bank = 0x36; /* hdmi chip edid register bank */ +static const uint8_t device_dpll_bank = 0x26; /* hdmi chip dpll register bank */ +static const uint8_t device_info_bank = 0x3e; /* hdmi chip info frame register bank */ + +static const uint8_t device_subaddress_all = 0xff; + +/* hdmi i2c data registers and bit masks */ +static const uint8_t packet_detect_reg = 0x60; +static const uint8_t packet_detect_avi_mask = 0x01; +static const uint8_t packet_detect_vsi_mask = 0x10; + +static const uint8_t clock_detect_reg = 0x6a; +static const uint8_t clock_tmdsa_present_mask = 0x10; +static const uint8_t clock_tmdsa_lock_mask = 0x40; +static const uint8_t clock_sync_lock_mask = 0x02; +static const uint8_t clock_regen_lock_mask = 0x01; + +static const uint8_t tmds_lock_detect_reg = 0x6b; +static const uint8_t tmds_lock_detect_mask = 0x40; + +static const uint8_t tmds_lock_clear_reg = 0x6c; +static const uint8_t tmds_lock_clear_mask = 0x40; + +static const uint8_t cable_detect_reg = 0x6f; +static const uint8_t cable_detect_mask = 0x01; + +static const uint8_t tmds_frequency_detect_reg = 0x83; +static const uint8_t tmds_frequency_detect_mask = 0x02; + +static const uint8_t tmds_frequency_clear_reg = 0x85; +static const uint8_t tmds_frequency_clear_mask = 0x02; + +static const uint8_t io_color_reg = 0x02; +static const uint8_t io_color_space_mask = 0x06; + +static const uint8_t hdmi_hpa_reg = 0x6c; +static const uint8_t hdmi_hpa_manual_mask = 0x01; + +static const uint8_t hdmi_mode_reg = 0x05; +static const uint8_t hdmi_mode_mask = 0x80; +static const uint8_t hdmi_encrypted_mask = 0x40; + +static const uint8_t deep_color_mode_reg = 0x0b; +static const uint8_t deep_color_10bit_mask = 0x40; +static const uint8_t deep_color_12bit_mask = 0x80; + +static const uint8_t derep_mode_reg = 0x41; +static const uint8_t derep_mode_mask = 0x1f; + +static const uint8_t defilter_lock_detect_reg = 0x07; +static const uint8_t defilter_locked_mask = 0x20; +static const uint8_t vfilter_locked_mask = 0x80; + +static const uint8_t interlaced_detect_reg = 0x0b; +static const uint8_t interlaced_mask = 0x20; + +static const uint8_t tristate_reg = 0x15; +static const uint8_t tristate_disable_outputs = 0x9e; +static const uint8_t tristate_enable_outputs = 0x80; + +static const uint8_t vsi_infoframe_packet_id = 0xec; +static const uint8_t vsi_infoframe_version = 0xed; +static const uint8_t vsi_infoframe_length = 0xee; +static const uint8_t vsi_infoframe_checksum = 0x54; +static const uint8_t vsi_infoframe_byte1 = 0x55; + +static const uint8_t vsi_video_format_mask4 = 0xe0; +static const uint8_t vsi_video_format_shift4 = 0x05; +static const uint8_t vsi_3d_structure_mask5 = 0xf0; +static const uint8_t vsi_3d_structure_shift5 = 0x04; + +static const uint8_t avi_infoframe_packet_id = 0xe0; +static const uint8_t avi_infoframe_version = 0xe1; +static const uint8_t avi_infoframe_length = 0xe2; +static const uint8_t avi_infoframe_checksum = 0x00; +static const uint8_t avi_infoframe_byte1 = 0x01; + +static const uint8_t avi_scan_data_mask1 = 0x03; +static const uint8_t avi_scan_data_shift1 = 0x00; +static const uint8_t avi_bar_data_mask1 = 0x0c; +static const uint8_t avi_bar_data_shift1 = 0x02; +static const uint8_t avi_active_format_mask1 = 0x10; +static const uint8_t avi_active_format_shift1 = 0x04; +static const uint8_t avi_color_component_mask1 = 0x60; +static const uint8_t avi_color_component_shift1 = 0x05; +static const uint8_t avi_active_aspect_mask2 = 0x0f; +static const uint8_t avi_active_aspect_shift2 = 0x00; +static const uint8_t avi_frame_aspect_ratio_mask2 = 0x30; +static const uint8_t avi_frame_aspect_ratio_shift2 = 0x04; +static const uint8_t avi_colorimetry_mask2 = 0xc0; +static const uint8_t avi_colorimetry_shift2 = 0x06; +static const uint8_t avi_nonuniform_scaling_mask3 = 0x03; +static const uint8_t avi_nonuniform_scaling_shift3 = 0x00; +static const uint8_t avi_quantization_range_mask3 = 0x0c; +static const uint8_t avi_quantization_range_shift3 = 0x02; +static const uint8_t avi_extended_colorimetry_mask3 = 0x70; +static const uint8_t avi_extended_colorimetry_shift3 = 0x04; +static const uint8_t avi_it_content_mask3 = 0x80; +static const uint8_t avi_it_content_shift3 = 0x07; +static const uint8_t avi_vic_mask4 = 0x7f; +static const uint8_t avi_vic_shift4 = 0x00; +static const uint8_t avi_pixel_repetition_mask5 = 0x0f; +static const uint8_t avi_pixel_repetition_shift5 = 0x00; +static const uint8_t avi_it_content_type_mask5 = 0x30; +static const uint8_t avi_it_content_type_shift5 = 0x04; +static const uint8_t avi_ycc_quant_range_mask5 = 0xc0; +static const uint8_t avi_ycc_quant_range_shift5 = 0x06; + +/* info frame data values */ +static const uint8_t vsi_packet_id = 0x81; +static const uint8_t vsi_version = 0x01; + +static const uint8_t vsi_format_none = 0x00; +static const uint8_t vsi_format_extended = 0x01; +static const uint8_t vsi_format_3d = 0x02; + +static const uint8_t vsi_vic_reserved = 0x00; +static const uint8_t vsi_vic_3840x2160_30 = 0x01; +static const uint8_t vsi_vic_3840x2160_25 = 0x02; +static const uint8_t vsi_vic_3840x2160_24 = 0x03; +static const uint8_t vsi_vic_4096x2160_24 = 0x04; + +static const uint8_t avi_packet_id = 0x82; +static const uint8_t avi_version = 0x02; + +static const uint8_t avi_scan_nodata = 0x00; +static const uint8_t avi_scan_ovderscanned = 0x01; +static const uint8_t avi_scan_underscanned = 0x02; +static const uint8_t avi_scan_future = 0x03; + +static const uint8_t avi_bar_nodata = 0x00; +static const uint8_t avi_bar_vertical = 0x01; +static const uint8_t avi_bar_horizontal = 0x02; +static const uint8_t avi_bar_both = 0x03; + +static const uint8_t avi_color_comp_rgb = 0x00; +static const uint8_t avi_color_comp_422 = 0x01; +static const uint8_t avi_color_comp_444 = 0x02; +static const uint8_t avi_color_comp_420 = 0x03; + +static const uint8_t avi_frame_aspect_nodata = 0x00; +static const uint8_t avi_frame_aspect_4x3 = 0x01; +static const uint8_t avi_frame_aspect_16x9 = 0x02; +static const uint8_t avi_frame_aspect_future = 0x03; + +static const uint8_t avi_colorimetry_nodata = 0x00; +static const uint8_t avi_colorimetry_smpte170m = 0x01; +static const uint8_t avi_colorimetry_itu_r709 = 0x02; +static const uint8_t avi_colorimetry_extended = 0x03; + +static const uint8_t avi_active_aspect_nodata = 0x00; +static const uint8_t avi_active_aspect_reserved = 0x01; +static const uint8_t avi_active_aspect_box_16x9_top = 0x02; +static const uint8_t avi_active_aspect_box_14x9_top = 0x03; +static const uint8_t avi_active_aspect_box_16x9_cen = 0x04; +static const uint8_t avi_active_aspect_coded_frame = 0x08; +static const uint8_t avi_active_aspect_4x3_cen = 0x09; +static const uint8_t avi_active_aspect_16x9_cen = 0x0a; +static const uint8_t avi_active_aspect_14x9_cen = 0x0b; +static const uint8_t avi_active_aspect_4x3_cen_14x9 = 0x0d; +static const uint8_t avi_active_aspect_16x9_cen_14x9 = 0x0e; +static const uint8_t avi_active_aspect_16x9_cen_4x3 = 0x0f; + +static const uint8_t avi_nonuniform_scaling_nodata = 0x00; +static const uint8_t avi_nonuniform_scaling_horiz = 0x01; +static const uint8_t avi_nonuniform_scaling_vert = 0x02; +static const uint8_t avi_nonuniform_scaling_both = 0x03; + +static const uint8_t avi_rgb_quant_range_default = 0x00; +static const uint8_t avi_rgb_quant_range_limited = 0x01; +static const uint8_t avi_rgb_quant_range_full = 0x02; +static const uint8_t avi_rgb_quant_range_reserved = 0x03; + +static const uint8_t avi_ext_colorimetry_xv_ycc601 = 0x00; +static const uint8_t avi_ext_colorimetry_xv_ycc709 = 0x01; +static const uint8_t avi_ext_colorimetry_s_ycc601 = 0x02; +static const uint8_t avi_ext_colorimetry_adobe_601 = 0x03; +static const uint8_t avi_ext_colorimetry_adobe_rgb = 0x04; +static const uint8_t avi_ext_colorimetry_ycc2020 = 0x05; +static const uint8_t avi_ext_colorimetry_rgb2020 = 0x06; +static const uint8_t avi_ext_colorimetry_reserved = 0x07; + +static const uint8_t avi_it_type_graphics = 0x00; +static const uint8_t avi_it_type_photo = 0x01; +static const uint8_t avi_it_type_cinema = 0x02; +static const uint8_t avi_it_type_game = 0x03; + +static const uint8_t avi_ycc_quant_range_limited = 0x00; +static const uint8_t avi_ycc_quant_range_full = 0x01; +static const uint8_t avi_ycc_quant_range_reserved = 0x02; +static const uint8_t avi_ycc_quant_range_reserved1 = 0x03; + +/* Establish register bank mappings. Note that the actual I2C bus addresses end up */ +/* being right shifted by 1 from the addresses used here and in the chip docs. */ +static struct ntv2_reg_value init_io0[] = +{ + { 0xf4, 0x80 }, /* CEC Map Registers, I2C Address = 80 */ + { 0xf5, 0x7C }, /* Info Frame Map Registers, I2C Address = 7C */ + { 0xf8, 0x4c }, /* DPLL Map Registers, I2C Address = 4C */ + { 0xf9, 0x64 }, /* Repeater Map Registers, I2C Address = 64 */ + { 0xfa, 0x6c }, /* EDID Map Registers, I2C Address = 6C */ + { 0xfb, 0x68 }, /* HDMI Map Registers, I2C Address = 68 */ + { 0xfd, 0x44 } /* CP Map Registers, I2C Address = 44 */ +}; +static int init_io0_size = sizeof(init_io0) / sizeof(struct ntv2_reg_value); + +static struct ntv2_reg_value init_hdmi1[] = +/* HDMI Register - I2C address = 0x68 */ +/* ADI Recommended write */ +{ + { 0xC0, 0x03 }, /* Recommended ADI write, documentation from script */ + { 0x4C, 0x44 }, /* %%%%% Set NEW_VS_PARAM (improves vertical filter locking) */ + + /* %%%%% "Recommended writes" added 7/14/14 */ + { 0x03, 0x98 }, + { 0x10, 0xA5 }, + { 0x45, 0x04 }, + { 0x3D, 0x10 }, + { 0x3e, 0x69 }, + { 0x3F, 0x46 }, + { 0x4E, 0xFE }, + { 0x4f, 0x08 }, + { 0x50, 0x00 }, + { 0x57, 0xa3 }, + { 0x58, 0x07 }, + { 0x93, 0x03 }, + { 0x5A, 0x80 }, + +//> { 0x6C, 0x14 }, /* Auto-assert HPD 100ms after (EDID active & cable detect) */ + { 0x6C, 0x54 }, /* Auto-assert HPD 100ms after (EDID active & cable detect) */ + { 0x0d, 0x02 } /* Set TMDS frequency change tolerance to 2MHz */ +}; +static int init_hdmi1_size = sizeof(init_hdmi1) / sizeof(struct ntv2_reg_value); + +static struct ntv2_reg_value init_io2_non4k[] = +/* IO registers - I2C address = 0x98 */ +{ + { 0x00, 0x02 }, /* ADI Recommended Write */ + { 0x01, 0x06 }, /* ADI Recommended Write */ + { 0x02, 0xf2 }, /* %%%%% INP_COLOR_SPACE[3:0], Address 0x02[7:4] = 1111 */ + /* 1111: Input color space depends on color space reported by HDMI block */ + /* ALT_GAMMA, Address 0x02[3] */ + /* 0 (default) No conversion */ + /* 1 YUV601 to YUV709 conversion if input is YUV601, YUV709 to YUV601 conversion if input is YUV709 */ + /* OP_656_RANGE, IO, Address 0x02[2] */ + /* 0 (default) Enables full output range (0 to 255) */ + /* 1 Enables limited output range (16 to 235) */ + /* RGB_OUT, IO, Address 0x02[1] */ + /* 0 (default) YPbPr color space output */ + /* 1 RGB color space output */ + /* ALT_DATA_SAT, IO, Address 0x02[0] */ + /* 0 (default) Data saturator enabled or disabled according to OP_656_RANGE setting */ + /* 1 Reverses OP_656_RANGE decision to enable or disable the data saturator */ + { 0x03, 0x42 }, /* 36 Bit SDR Mode, RGB, Non-4K mode */ + /* Register changes to 0x54 for 4K mode */ + { 0x04, 0x00 }, /* OP_CH_SEL[2:0], Address 0x04[7:5] = 000 P[35:24] Y/G, P[23:12] U/CrCb/B, P[11:0] V/R */ + /* XTAL_FREQ_SEL[1:0], Address 0x04[2:1] = 00, 27 Mhz */ + /* 4K mode requires 0x62 */ + { 0x05, 0x38 }, /* F_OUT_SEL, IO, Address 0x05[4], Select DE or FIELD signal to be output on the DE pin */ + /* 0 (default) Selects DE output on DE pin */ + /* 1 Selects FIELD output on DE pin */ + /* DATA_BLANK_EN, IO, Address 0x05[3], A control to blank data during video blanking sections */ + /* 0 Do not blank data during horizontal and vertical blanking periods */ + /* 1 (default) Blank data during horizontal and vertical blanking periods */ + /* AVCODE_INSERT_EN, IO, Address 0x05[2], Select AV code insertion into the data stream */ + /* 0 Does not insert AV codes into data stream */ + /* 1 (default) Inserts AV codes into data stream */ + /* REPL_AV_CODE, IO, Address 0x05[1], duplicate AV codes and insertion on all output stream data channels */ + /* 0 (default) Outputs complete SAV/EAV codes on all channels, Channel A, Channel B, and Channel C */ + /* 1 Spreads AV code across three channels, Channel B and C contain the first two ten bit words, 0x3FF and 0x000 */ + /* Channel A contains the final two 10-bit words 0x00 and 0xXYZ */ + /* OP_SWAP_CB_CR, IO, Address 0x05[0], Controls the swapping of Cr and Cb data on the pixel buses */ + /* 0 (default) Outputs Cr and Cb as per OP_FORMAT_SEL */ + /* 1 Inverts the order of Cb and Cr in the interleaved data stream */ + { 0x06, 0xa6 }, /* VS_OUT_SEL, Address 0x06[7], Select the VSync or FIELD signal to be output on the VS/FIELD/ALSB pin */ + /* 0 Selects FIELD output on VS/FIELD/ALSB pin */ + /* 1 (default) Selects VSync output on VS/FIELD/ALSB pin */ + /* INV_F_POL, Address 0x06[3], controls polarity of the DE signal */ + /* 0 (default) Negative FIELD/DE polarity */ + /* 1 Positive FIELD/DE polarity */ + /* INV_VS_POL, IO, Address 0x06[2] Controls polarity of the VS/FIELD/ALSB signal */ + /* 0 (default) Negative polarity VS/FIELD/ALSB */ + /* 1 Positive polarity VS/FIELD/ALSB */ + /* INV_HS_POL, Address 0x06[1], Controls polarity of the HS signal */ + /* 0 (default) Negative polarity HS */ + /* 1 Positive polarity HS */ + /* INV_LLC_POL, Address 0x06[0], Controls the polarity of the LLC */ + /* 0 (default) Does not invert LLC */ + /* 1 Inverts LLC */ + { 0x0c, 0x42 }, /* Power up part */ + { 0x14, 0x3F }, /* DR_STR[1:0], IO, Address 0x14[5:4] */ + /* 00 Reserved */ + /* 01 Medium low (2 */ + /* 10 (default) Medium high (3 */ + /* 11 High (4 */ + /* DR_STR_CLK[1:0], IO, Address 0x14[3:2] */ + /* 00 Reserved */ + /* 01 Medium low (2 for LLC up to 60 MHz */ + /* 10 (default) Medium high (3 for LLC from 44 MHz to 105 MHz */ + /* 11 High (4 for LLC greater than 100 MHz */ + /* DR_STR_SYNC[1:0], IO, Address 0x14[1:0] */ + /* 00 Reserved */ + /* 01 Medium low (2 */ + /* 10 (default) Medium high (3 */ + /* 11 High (4 */ + { 0x15, 0x80 }, /* Disable Tristate of Pins */ +/*!! { 0x19, 0xC0 }, %%%%% LLC DLL phase */ + { 0x20, 0x04 }, /* HPA_MAN_VALUE_A, IO, Address 0x20[7] */ + /* A manual control for the value of HPA on Port A, Valid only if HPA_MANUAL is set to 1 */ + /* 0 - 0 V applied to HPA_A pin */ + /* 1 (default) High level applied to HPA_A pin */ + /* HPA_MAN_VALUE_B, IO, Address 0x20[6] */ + /* A manual control for the value of HPB on Port A, Valid only if HPA_MANUAL is set to 1 */ + /* 0 - 0 V applied to HPA_B pin */ + /* 1 (default) High level applied to HPA_B pin */ + /* HPA_TRISTATE_A, IO, Address 0x20[3] Tristates HPA output pin for Port A */ + /* 0 (default) HPA_A pin active */ + /* 1 Tristates HPA_A pin */ + /* HPA_TRISTATE_B, IO, Address 0x20[2] Tristates HPA output pin for Port B */ + /* 0 (default) HPA_B pin active */ + /* 1 Tristates HPA_B pin */ + { 0x33, 0x40 }, /* LLC DLL MUX enable */ + { 0xdd, 0x00 }, /* Normal LLC frequency = 0x00 for non-4K modes */ + /* LLC Half frequence = 0xA0 for 4K modes */ + { 0xE7, 0x00 }, /* default: ADI Recommended Write per PCN 15_0178 */ + { 0x6e, 0x40 }, /* %%%%% TMDSPLL_LCK_A_MB1 enable to catch PLL loss of lock (enables INT1) */ + { 0x86, 0x02 } /* %%%%% NEW_TMDS_FREQ_MB1 enable to catch frequency changes */ +}; +static int init_io2_non4k_size = sizeof(init_io2_non4k) / sizeof(struct ntv2_reg_value); + +static struct ntv2_reg_value init_io2_4k[] = +/* IO registers - I2C address = 0x98 */ +{ +// { 0x00, 0x02 }, /* ADI Recommended Write */ +// { 0x01, 0x06 }, /* ADI Recommended Write */ + + { 0x00, 0x19 }, /* ADI Recommended Write per PCN 15_0178 */ + { 0x01, 0x05 }, /* ADI Recommended Write per PCN 15_0178 */ + + { 0x02, 0xf2 }, /* INP_COLOR_SPACE[3:0], Address 0x02[7:4] = 1111 */ + /* 1111: Input color space depends on color space reported by HDMI block */ + /* ALT_GAMMA, Address 0x02[3] */ + /* 0 (default) No conversion */ + /* 1 YUV601 to YUV709 conversion if input is YUV601, YUV709 to YUV601 conversion if input is YUV709 */ + /* OP_656_RANGE, IO, Address 0x02[2] */ + /* 0 (default) Enables full output range (0 to 255) */ + /* 1 Enables limited output range (16 to 235) */ + /* RGB_OUT, IO, Address 0x02[1] */ + /* 0 (default) YPbPr color space output */ + /* 1 RGB color space output */ + /* ALT_DATA_SAT, IO, Address 0x02[0] */ + /* 0 (default) Data saturator enabled or disabled according to OP_656_RANGE setting */ + /* 1 Reverses OP_656_RANGE decision to enable or disable the data saturator */ + { 0x03, 0x54 }, /* 36 Bit SDR Mode, RGB, Non-4K mode */ + /* Register changes to 0x54 for 4K mode */ + { 0x04, 0x62 }, /* OP_CH_SEL[2:0], Address 0x04[7:5] = 000 P[35:24] Y/G, P[23:12] U/CrCb/B, P[11:0] V/R */ + /* XTAL_FREQ_SEL[1:0], Address 0x04[2:1] = 00, 27 Mhz */ + /* 4K mode requires 0x62 */ + { 0x05, 0x38 }, /* F_OUT_SEL, IO, Address 0x05[4], Select DE or FIELD signal to be output on the DE pin */ + /* 0 (default) Selects DE output on DE pin */ + /* 1 Selects FIELD output on DE pin */ + /* DATA_BLANK_EN, IO, Address 0x05[3], A control to blank data during video blanking sections */ + /* 0 Do not blank data during horizontal and vertical blanking periods */ + /* 1 (default) Blank data during horizontal and vertical blanking periods */ + /* AVCODE_INSERT_EN, IO, Address 0x05[2], Select AV code insertion into the data stream */ + /* 0 Does not insert AV codes into data stream */ + /* 1 (default) Inserts AV codes into data stream */ + /* REPL_AV_CODE, IO, Address 0x05[1], duplicate AV codes and insertion on all output stream data channels */ + /* 0 (default) Outputs complete SAV/EAV codes on all channels, Channel A, Channel B, and Channel C */ + /* 1 Spreads AV code across three channels, Channel B and C contain the first two ten bit words, 0x3FF and 0x000 */ + /* Channel A contains the final two 10-bit words 0x00 and 0xXYZ */ + /* OP_SWAP_CB_CR, IO, Address 0x05[0], Controls the swapping of Cr and Cb data on the pixel buses */ + /* 0 (default) Outputs Cr and Cb as per OP_FORMAT_SEL */ + /* 1 Inverts the order of Cb and Cr in the interleaved data stream */ + { 0x06, 0xa6 }, /* VS_OUT_SEL, Address 0x06[7], Select the VSync or FIELD signal to be output on the VS/FIELD/ALSB pin */ + /* 0 Selects FIELD output on VS/FIELD/ALSB pin */ + /* 1 (default) Selects VSync output on VS/FIELD/ALSB pin */ + /* INV_F_POL, Address 0x06[3], controls polarity of the DE signal */ + /* 0 (default) Negative FIELD/DE polarity */ + /* 1 Positive FIELD/DE polarity */ + /* INV_VS_POL, IO, Address 0x06[2] Controls polarity of the VS/FIELD/ALSB signal */ + /* 0 (default) Negative polarity VS/FIELD/ALSB */ + /* 1 Positive polarity VS/FIELD/ALSB */ + /* INV_HS_POL, Address 0x06[1], Controls polarity of the HS signal */ + /* 0 (default) Negative polarity HS */ + /* 1 Positive polarity HS */ + /* INV_LLC_POL, Address 0x06[0], Controls the polarity of the LLC */ + /* 0 (default) Does not invert LLC */ + /* 1 Inverts LLC */ + { 0x0c, 0x42 }, /* Power up part */ + { 0x14, 0x3F }, /* DR_STR[1:0], IO, Address 0x14[5:4] */ + /* 00 Reserved */ + /* 01 Medium low (2 */ + /* 10 (default) Medium high (3 */ + /* 11 High (4 */ + /* DR_STR_CLK[1:0], IO, Address 0x14[3:2] */ + /* 00 Reserved */ + /* 01 Medium low (2 for LLC up to 60 MHz */ + /* 10 (default) Medium high (3 for LLC from 44 MHz to 105 MHz */ + /* 11 High (4 for LLC greater than 100 MHz */ + /* DR_STR_SYNC[1:0], IO, Address 0x14[1:0] */ + /* 00 Reserved */ + /* 01 Medium low (2 */ + /* 10 (default) Medium high (3 */ + /* 11 High (4 */ + { 0x15, 0x80 }, /* Disable Tristate of Pins */ +/*!! { 0x19, 0x80 }, %%%%% LLC DLL phase */ + { 0x33, 0x40 }, /* LLC DLL MUX enable */ +// { 0xdd, 0xA0 } /* Normal LLC frequency = 0x00 for non-4K modes */ + /* LLC Half frequence = 0xA0 for 4K modes */ + + { 0xdd, 0x00 }, /* ADI Recommended Write per PCN 15_0178 */ + { 0xE7, 0x04 } /* ADI Recommended Write per PCN 15_0178 */ +}; +static int init_io2_4k_size = sizeof(init_io2_4k) / sizeof(struct ntv2_reg_value); + +static struct ntv2_reg_value init_cp3[] = +/* %%%%% CP Register - I2C address = 0x44 */ +{ + { 0xba, 0x00 }, /* No HDMI FreeRun */ + { 0x6c, 0x00 }, /* CP clamp disable */ + { 0x69, 0x10 }, + { 0x68, 0x00 } +}; +static int init_cp3_size = sizeof(init_cp3) / sizeof(struct ntv2_reg_value); + +static struct ntv2_reg_value init_rep4[] = +/* Repeater Map Registers - I2C address = 0x64 */ +{ + { 0x40, 0x81 }, /* BCAPS */ + { 0x74, 0x03 } /* Enable EDID */ +}; +static int init_rep4_size = sizeof(init_rep4) / sizeof(struct ntv2_reg_value); + +static struct ntv2_reg_value init_dpll5_non4k[] = +/* DPLL Registers - I2C address = 0x4C */ +{ + { 0xb5, 0x01 }, /* Setting MCLK to 256Fs */ + { 0xc3, 0x00 }, /* ADI Recommended Settings (NormFreq) */ + { 0xcf, 0x00 }, /* ADI Recommended Settings (NormFreq) */ + { 0xdb, 0x00 } /* default: ADI Recommended Write per PCN 15_0178 */ +}; +static int init_dpll5_non4k_size = sizeof(init_dpll5_non4k) / sizeof(struct ntv2_reg_value); + +static struct ntv2_reg_value init_dpll5_4k[] = +/* DPLL Registers - I2C address = 0x4C */ +{ + { 0xb5, 0x01 }, /* Setting MCLK to 256Fs */ + { 0xc3, 0x80 }, /* ADI Recommended Settings (NormFreq) */ + { 0xcf, 0x03 }, /* ADI Recommended Settings (NormFreq) */ + { 0xdb, 0x80 } /* ADI Recommended Write per PCN 15_0178 */ +}; +static int init_dpll5_4k_size = sizeof(init_dpll5_4k) / sizeof(struct ntv2_reg_value); + +static struct ntv2_reg_value init_hdmi6[] = +/* HDMI Registers - I2C address = 0x68 */ +{ + { 0x00, 0x00 }, /* BG_MEAS_PORT_SEL[2:0], Addr 68 (HDMI), Address 0x00[5:3] */ + /* 000 (default) Port A */ + /* 001 Port B */ + { 0x01, 0x01 }, /* TERM_AUTO, Address 0x01[0] */ + /* This bit allows the user to select automatic or manual control of clock termination */ + /* If automatic mode termination is enabled, then termination on the port HDMI_PORT_SELECT[1:0] is enabled */ + /* 0 (default) Disable termination automatic control */ + /* 1 Enable termination automatic control */ + { 0x02, 0x01 }, /* EN_BG_PORT_A, Address 0x02[0] */ + /* 0 (default) Port disabled, unless selected with HDMI_PORT_SELECT[2:0] */ + /* 1 Port enabled in background mode */ + /* EN_BG_PORT_B, Address 0x02[1] */ + /* 0 (default) Port disabled, unless selected with HDMI_PORT_SELECT[2:0] */ + /* 1 Port enabled in background mode */ + { 0x03, 0x58 }, /* I2SOUTMODE[1:0], Address 0x03[6:5] */ + /* 00 (default) I2S mode */ + /* 01 Right justified */ + /* 10 Left justified */ + /* 11 Raw SPDIF (IEC60958) mode */ + /* I2SBITWIDTH[4:0], Address 0x03[4:0] */ + /* 11000 24 bits */ + { 0x14, 0x31 }, /* Audio mute triggers: turn off MT_MSK_PARITY_ERROR and also */ + { 0x15, 0xff }, /* turn off bits 7,6,3,2 in r14 which are undocumented */ + { 0x16, 0xff }, /* but must be 1 per defaults; this fixes iOS audio input. */ +//> { 0x6c, 0x01 }, /* HPA_MANUAL, Address 0x6C[0] */ + { 0x6c, 0x54 }, /* HPA_MANUAL, Address 0x6C[0] */ + /* Manual control enable for the HPA output pins */ + /* Manual control is determined by the HPA_MAN_VALUE_A */ + /* 1 HPA takes its value from HPA_MAN_VALUE_A */ + { 0x3e, 0x69 }, + { 0x3f, 0x46 }, + { 0x4e, 0x7e }, + { 0x4f, 0x42 }, + { 0x57, 0xa3 }, + { 0x58, 0x07 }, + { 0x83, 0xfc }, /* CLOCK_TERMB_DISABLE, Address 0x83[1] */ + /* Disable clock termination on Port B, Can be used when TERM_AUTO set to 0 */ + /* 0 Enable Termination Port B */ + /* 1 (default) Disable Termination Port B */ + /* CLOCK_TERMA_DISABLE, Address 0x83[0] */ + /* Disable clock termination on Port A, Can be used when TERM_AUTO set to 0 */ + /* 0 Enable Termination Port A */ + /* 1 (default) Disable Termination Port A */ + /* Note - TERM_AUTO, Address 0x01[0] set to 1 which overrides this bit */ + + /* Required for TMDS frequency 27Mhz and below */ + + { 0x89, 0x03 }, + { 0x84, 0x03 }, + + { 0x85, 0x11 }, /* ADI Recommended Write */ + { 0x9C, 0x80 }, /* ADI Recommended Write */ + { 0x9C, 0xC0 }, /* ADI Recommended Write */ + { 0x9C, 0x00 }, /* ADI Recommended Write */ + { 0x85, 0x11 }, /* ADI Recommended Write */ + { 0x86, 0x9B }, /* ADI Recommended Write */ + { 0x9b, 0x03 } +}; +static int init_hdmi6_size = sizeof(init_hdmi6) / sizeof(struct ntv2_reg_value); + +static struct ntv2_reg_value init_hdmi8[] = +/* HDMI Registers - I2C address = 0x68 */ +{ + { 0x6c, 0x54 } /* HPA_MANUAL, Address 0x6C[0] */ + /* 0 (default)HPA takes its value based on HPA_AUTO_INT_EDID */ + /* HPA_AUTO_INT_EDID[1:0],Address 0x6C[2:1] */ + /* HPA_AUTO_INT_EDID[1:0] */ + /* 10 */ + /* HPA of an HDMI port asserted high after two conditions met */ + /* 1. Internal EDID is active for that port */ + /* 2. Delayed version of cable detect signal CABLE_DET_X_RAW for that port is high */ + /* HPA of an HDMI port immediately deasserted after either of these two conditions are met: */ + /* 1. Internal EDID is de-activated for that port */ + /* 2. Cable detect signal CABLE_DET_X_RAW for that port is low */ + /* HPA of a specific HDMI port deasserted low immediately after internal E-EDID is de-activated */ +}; +static int init_hdmi8_size = sizeof(init_hdmi8) / sizeof(struct ntv2_reg_value); + + +#endif diff --git a/build_dependencies/aja/include/ajadriver/ntv2hout4reg.h b/build_dependencies/aja/include/ajadriver/ntv2hout4reg.h new file mode 100644 index 0000000..835c7b2 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2hout4reg.h @@ -0,0 +1,377 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2hout4reg.h +// Purpose: HDMI output monitor version 4 +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2_HOUT4REG_H +#define NTV2_HOUT4REG_H + +#include "ntv2commonreg.h" +#include "ntv2virtualregisters.h" +#include "ntv2enums.h" + + +/* control and status */ +NTV2_REG(ntv2_reg_control_status, 48); /* control status */ + NTV2_FLD(ntv2_fld_control_reference_source, 4, 24); /* hardware reference source */ + NTV2_FLD(ntv2_fld_control_reference_present, 1, 30); /* reference source present */ + NTV2_FLD(ntv2_fld_control_genlock_locked, 1, 31); /* genlock locked */ + +/* hdmi output configuration register */ +NTV2_REG(ntv2_reg_hdmiout_output_config, 125); /* hdmi output config */ + NTV2_FLD(ntv2_fld_hdmiout_video_standard, 4, 0); /* video standard */ + NTV2_FLD(ntv2_fld_hdmiout_audio_group_select, 1, 5); /* audio upper group select */ + NTV2_FLD(ntv2_fld_hdmiout_tx_bypass, 1, 7); /* v2 tx bypass? */ + NTV2_FLD(ntv2_fld_hdmiout_rgb, 1, 8); /* rgb color space (not yuv) */ + NTV2_FLD(ntv2_fld_hdmiout_frame_rate, 4, 9); /* frame rate */ + NTV2_FLD(ntv2_fld_hdmiout_progressive, 1, 13); /* progressive? */ + NTV2_FLD(ntv2_fld_hdmiout_deep_color, 1, 14); /* 10 bit deep color (not 8 bit) */ + NTV2_FLD(ntv2_fld_hdmiout_yuv_444, 1, 15); /* yuv 444 mode */ + NTV2_FLD(ntv2_fld_hdmiout_audio_format, 2, 16); /* hdmi output audio format */ + NTV2_FLD(ntv2_fld_hdmiout_sampling, 2, 18); /* sampling? */ + NTV2_FLD(ntv2_fld_hdmiout_vobd, 2, 20); /* hardware bit depth */ + NTV2_FLD(ntv2_fld_hdmiout_source_rgb, 1, 23); /* source is rgb? */ + NTV2_FLD(ntv2_fld_hdmiout_power_down, 1, 25); /* power down? */ + NTV2_FLD(ntv2_fld_hdmiout_tx_enable, 1, 26); /* io4K tx enable */ + NTV2_FLD(ntv2_fld_hdmiout_rx_enable, 1, 27); /* io4K rx enable */ + NTV2_FLD(ntv2_fld_hdmiout_full_range, 1, 28); /* full range rgb (not smpte) */ + NTV2_FLD(ntv2_fld_hdmiout_audio_8ch, 1, 29); /* 8 audio channels (not 2) */ + NTV2_FLD(ntv2_fld_hdmiout_dvi, 1, 30); /* dvi mode (vs hdmi) */ + +/* hdmi input status */ +NTV2_REG(ntv2_reg_hdmiin_input_status, 126); /* hdmi input status register */ + NTV2_FLD(ntv2_fld_hdmiin_locked, 1, 0); + NTV2_FLD(ntv2_fld_hdmiin_stable, 1, 1); + NTV2_FLD(ntv2_fld_hdmiin_rgb, 1, 2); + NTV2_FLD(ntv2_fld_hdmiin_deep_color, 1, 3); + NTV2_FLD(ntv2_fld_hdmiin_video_code, 6, 4); /* ntv2 video standard v2 */ + NTV2_FLD(ntv2_fld_hdmiin_lhi_ycbcr_mode, 1, 10); + NTV2_FLD(ntv2_fld_hdmiin_lhi_10bit_mode, 1, 11); + NTV2_FLD(ntv2_fld_hdmiin_audio_2ch, 1, 12); /* 2 audio channels (vs 8) */ + NTV2_FLD(ntv2_fld_hdmiin_progressive, 1, 13); + NTV2_FLD(ntv2_fld_hdmiin_video_sd, 1, 14); /* video pixel clock sd (not hd or 3g) */ + NTV2_FLD(ntv2_fld_hdmiin_video_74_25, 1, 15); /* not used */ + NTV2_FLD(ntv2_fld_hdmiin_audio_rate, 4, 16); + NTV2_FLD(ntv2_fld_hdmiin_audio_word_length, 4, 20); + NTV2_FLD(ntv2_fld_hdmiin_video_format, 3, 24); /* really ntv2 standard */ + NTV2_FLD(ntv2_fld_hdmiin_dvi, 1, 27); /* input dvi (vs hdmi) */ + NTV2_FLD(ntv2_fld_hdmiin_video_rate, 4, 28); /* ntv2 video rate */ + +/* hdmi control */ +NTV2_REG(ntv2_reg_hdmi_control, 127); /* hdmi audio status register */ + NTV2_FLD(ntv2_fld_hdmiout_force_config, 1, 1); /* force output config (ignore edid) */ + NTV2_FLD(ntv2_fld_hdmiin_audio_pair, 2, 2); /* hdmi input audio pair select */ + NTV2_FLD(ntv2_fld_hdmiin_rate_convert_enable, 1, 4); /* hdmi input audio sample rate converter enable */ + NTV2_FLD(ntv2_fld_hdmiin_channel34_swap_disable, 1, 5); /* hdmi input audio channel 3/4 swap disable */ + NTV2_FLD(ntv2_fld_hdmiout_channel34_swap_disable, 1, 6); /* hdmi output audio channel 3/4 swap disable */ + NTV2_FLD(ntv2_fld_hdmiout_prefer_420, 1, 7); /* hdmi output prefer 4K/UHD 420 */ + NTV2_FLD(ntv2_fld_hdmiin_color_depth, 2, 12); /* hdmi input bit depth */ + NTV2_FLD(ntv2_fld_hdmiin_color_space, 2, 14); /* hdmi input color space */ + NTV2_FLD(ntv2_fld_hdmiout_audio_rate, 2, 16); /* audio rate */ + NTV2_FLD(ntv2_fld_hdmiout_source_select, 4, 20); /* output audio source select */ + NTV2_FLD(ntv2_fld_hdmiout_crop_enable, 1, 24); /* crop 2k -> hd 4k -> uhd */ + NTV2_FLD(ntv2_fld_hdmiout_force_hpd, 1, 25); /* force hpd */ + NTV2_FLD(ntv2_fld_hdmiout_deep_12bit, 1, 26); /* deep color 12 bit */ + NTV2_FLD(ntv2_fld_hdmi_debug, 1, 27); /* debug output enable */ + NTV2_FLD(ntv2_fld_hdmi_disable_update, 1, 28); /* disable update loop */ + NTV2_FLD(ntv2_fld_hdmiout_channel_select, 2, 29); /* output audio channel select */ + NTV2_FLD(ntv2_fld_hdmi_protocol, 1, 30); /* hdmi protocol? */ + NTV2_FLD(ntv2_fld_hdmiin_full_range, 1, 31); /* hdmi input quantization full range */ + + NTV2_REG(ntv2_reg_hdmi_output_status1, kVRegHDMIOutStatus1); /* hdmi otuput status */ + NTV2_FLD(ntv2_fld_hdmiout_status_video_standard, 4, 0); /* video standard */ + NTV2_FLD(ntv2_fld_hdmiout_status_frame_rate, 4, 4); /* video frame rate */ + NTV2_FLD(ntv2_fld_hdmiout_status_bit_depth, 4, 8); /* video bit depth */ + NTV2_FLD(ntv2_fld_hdmiout_status_color_rgb, 1, 12); /* video color rgb */ + NTV2_FLD(ntv2_fld_hdmiout_status_range_full, 1, 13); /* video range full */ + NTV2_FLD(ntv2_fld_hdmiout_status_pixel_420, 1, 14); /* video pixel 420 */ + NTV2_FLD(ntv2_fld_hdmiout_status_protocol, 1, 15); /* dvi mode (vs hdmi) */ + NTV2_FLD(ntv2_fld_hdmiout_status_audio_format, 4, 16); /* audio format */ + NTV2_FLD(ntv2_fld_hdmiout_status_audio_rate, 4, 20); /* audio rate */ + NTV2_FLD(ntv2_fld_hdmiout_status_audio_channels, 4, 24); /* audio channels */ + +/* hdmi source register */ +NTV2_REG(ntv2_reg_hdmiout_cross_group6, 141); /* crosspoint group 6 */ + NTV2_FLD(ntv2_fld_hdmiout_hdmi_source, 7, 16); /* hdmi source */ + NTV2_FLD(ntv2_fld_hdmiout_hdmi_rgb, 1, 23); /* rgb color space (not yuv) */ + +// hdr parameters +NTV2_REG(ntv2_reg_hdr_green_primary, 330); /* hdr green primary register */ + NTV2_FLD(ntv2_fld_hdr_primary_x, 16, 0); /* rgb primary x value */ + NTV2_FLD(ntv2_fld_hdr_primary_y, 16, 16); /* rgb primary y value */ +NTV2_REG(ntv2_reg_hdr_blue_primary, 331); /* hdr blue primary register */ +NTV2_REG(ntv2_reg_hdr_red_primary, 332); /* hdr red primary register */ + +NTV2_REG(ntv2_reg_hdr_white_point, 333); /* hdr white point register */ + NTV2_FLD(ntv2_fld_hdr_white_point_x, 16, 0); /* white point x value */ + NTV2_FLD(ntv2_fld_hdr_white_point_y, 16, 16); /* white point y value */ +NTV2_REG(ntv2_reg_hdr_master_luminance, 334); /* hdr mastering luminance register */ + NTV2_FLD(ntv2_fld_hdr_luminance_max, 16, 0); /* luminance maximun value */ + NTV2_FLD(ntv2_fld_hdr_luminance_min, 16, 16); /* luminance minimum value */ +NTV2_REG(ntv2_reg_hdr_light_level, 335); /* hdr light level register */ + NTV2_FLD(ntv2_fld_hdr_content_light_max, 16, 0); /* content light level maximun value */ + NTV2_FLD(ntv2_fld_hdr_frame_average_max, 16, 16); /* franme average level maximum value */ + +/* hdr control */ +NTV2_REG(ntv2_reg_hdr_control, 336); /* hdr control register */ + NTV2_FLD(ntv2_fld_hdr_constant_luminance, 1, 0); /* constant luminance */ + NTV2_FLD(ntv2_fld_hdr_dci_colorimetry, 1, 5); /* dci colorimetry */ + NTV2_FLD(ntv2_fld_hdr_dolby_vision_enable, 1, 6); /* dolby vision enable */ + NTV2_FLD(ntv2_fld_hdr_enable, 1, 7); /* hdr enable */ + NTV2_FLD(ntv2_fld_hdr_transfer_function, 8, 16); /* electro optical transfer function */ + NTV2_FLD(ntv2_fld_hdr_metadata_id, 8, 24); /* metadata descriptor id */ + +/* hdmi output control registers */ +NTV2_REG(ntv2_reg_hdmiout4_videocontrol, 0x1d40); /* hdmi control/status */ + NTV2_FLD(ntv2_fld_hdmiout4_videocontrol_scrambleMode, 1, 1); /* scdc 2.0 scramble mode */ + NTV2_CON(ntv2_con_hdmiout4_scramblemode_disable, 0x0); /* scramble disable */ + NTV2_CON(ntv2_con_hdmiout4_scramblemode_enable, 0x1); /* scramble enable */ + NTV2_FLD(ntv2_fld_hdmiout4_videocontrol_tranceivermode, 1, 3); /* transceiver mode */ + NTV2_CON(ntv2_con_hdmiout4_tranceivermode_disable, 0x0); /* tranceiver disable */ + NTV2_CON(ntv2_con_hdmiout4_tranceivermode_enable, 0x1); /* tranceiver enable */ + NTV2_FLD(ntv2_fld_hdmiout4_videocontrol_420mode, 1, 5); /* 420 mode */ + NTV2_CON(ntv2_con_hdmiout4_420mode_disable, 0x0); /* 420 disable */ + NTV2_CON(ntv2_con_hdmiout4_420mode_enable, 0x1); /* 420 enable */ + NTV2_FLD(ntv2_fld_hdmiout4_videocontrol_pixelsperclock, 3, 8); /* pixels per clock */ + NTV2_FLD(ntv2_fld_hdmiout4_videocontrol_pixelreplicate, 1, 11); /* pixel replicate */ + NTV2_CON(ntv2_con_hdmiout4_pixelreplicate_disable, 0x0); /* replicate disable */ + NTV2_CON(ntv2_con_hdmiout4_pixelreplicate_enable, 0x1); /* replicate enable */ + NTV2_FLD(ntv2_fld_hdmiout4_videocontrol_replicatefactor, 4, 12); /* pixels replicate factor */ + NTV2_FLD(ntv2_fld_hdmiout4_videocontrol_linerate, 5, 16); /* line rate */ + NTV2_CON(ntv2_con_hdmiout4_linerate_none, 0x0); /* undetected */ + NTV2_CON(ntv2_con_hdmiout4_linerate_5940mhz, 0x1); /* 5940 mhz 8 bit */ + NTV2_CON(ntv2_con_hdmiout4_linerate_2970mhz, 0x2); /* 2970 mhz 8 bit */ + NTV2_CON(ntv2_con_hdmiout4_linerate_1485mhz, 0x3); /* 1485 mhz 8 bit */ + NTV2_CON(ntv2_con_hdmiout4_linerate_742mhz, 0x4); /* 742 mhz 8 bit */ + NTV2_CON(ntv2_con_hdmiout4_linerate_270mhz, 0x5); /* 270 mhz 8 bit */ + NTV2_CON(ntv2_con_hdmiout4_linerate_3712mhz, 0x6); /* 3712 mhz 10 bit */ + NTV2_CON(ntv2_con_hdmiout4_linerate_1856mhz, 0x7); /* 1856 mhz 10 bit */ + NTV2_CON(ntv2_con_hdmiout4_linerate_928mhz, 0x8); /* 928 mhz 10 bit */ + NTV2_CON(ntv2_con_hdmiout4_linerate_337mhz, 0x9); /* 337 mhz 10 bit */ + NTV2_CON(ntv2_con_hdmiout4_linerate_4455mhz, 0xa); /* 4455 mhz 12 bit */ + NTV2_CON(ntv2_con_hdmiout4_linerate_2227mhz, 0xb); /* 2227 mhz 12 bit */ + NTV2_CON(ntv2_con_hdmiout4_linerate_1113mhz, 0xc); /* 1113 mhz 12 bit */ + NTV2_CON(ntv2_con_hdmiout4_linerate_405mhz, 0xd); /* 405 mhz 12 bit */ + NTV2_CON(ntv2_con_hdmiout4_linerate_556mhz, 0xe); /* 556 mhz */ + NTV2_CON(ntv2_con_hdmiout4_linerate_540mhz, 0xf); /* 540 mhz */ + NTV2_CON(ntv2_con_hdmiout4_linerate_250mhz, 0x10); /* 250 mhz */ + NTV2_FLD(ntv2_fld_hdmiout4_videocontrol_audiomode, 1, 26); /* audio mode */ + NTV2_CON(ntv2_con_hdmiout4_audiomode_disable, 0x0); /* audio disable */ + NTV2_CON(ntv2_con_hdmiout4_audiomode_enable, 0x1); /* audio enable */ + NTV2_FLD(ntv2_fld_hdmiout4_videocontrol_txlockstate, 1, 27); /* tx lock state */ + NTV2_CON(ntv2_con_hdmiout4_txlockstate_unlocked, 0x0); /* tx unlocked */ + NTV2_CON(ntv2_con_hdmiout4_txlockstate_locked, 0x1); /* tx locked */ + NTV2_FLD(ntv2_fld_hdmiout4_videocontrol_txconfigmode, 1, 28); /* tx configuration mode */ + NTV2_CON(ntv2_con_hdmiout4_txconfigmode_active, 0x0); /* tx config active */ + NTV2_CON(ntv2_con_hdmiout4_txconfigmode_valid, 0x1); /* tx config valid */ + NTV2_FLD(ntv2_fld_hdmiout4_videocontrol_sinkpresent, 1, 29); /* sink present */ + NTV2_FLD(ntv2_fld_hdmiout4_videocontrol_resetdone, 1, 30); /* rx reset done */ + NTV2_FLD(ntv2_fld_hdmiout4_videocontrol_reset, 1, 31); /* rx reset */ + +NTV2_REG(ntv2_reg_hdmiout4_videosetup0, 0x1d41); /* video setup 0 register */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup0_colordepth, 2, 0); /* color depth */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup0_colorspace, 2, 2); /* color space */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup0_scanmode, 1, 4); /* video scan mode */ + NTV2_CON(ntv2_con_hdmiout4_scanmode_interlaced, 0x0); /* interlaced */ + NTV2_CON(ntv2_con_hdmiout4_scanmode_progressive, 0x1); /* progressive */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup0_interfacemode, 1, 5); /* interface mode */ + NTV2_CON(ntv2_con_hdmiout4_interfacemode_hdmi, 0x0); /* hdmi */ + NTV2_CON(ntv2_con_hdmiout4_interfacemode_dvi, 0x1); /* dvi */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup0_syncpolarity, 1, 6); /* sync polarity */ + NTV2_CON(ntv2_con_hdmiout4_syncpolarity_activelow, 0x0); /* active low */ + NTV2_CON(ntv2_con_hdmiout4_syncpolarity_activehigh, 0x1); /* active high */ + +NTV2_REG(ntv2_reg_hdmiout4_videosetup1, 0x1d42); /* video setup 1 register */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup1_hsyncstart, 16, 0); /* horizontal sync start */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup1_hsyncend, 16, 16); /* horizontal sync end */ + +NTV2_REG(ntv2_reg_hdmiout4_videosetup2, 0x1d43); /* video setup 2 register */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup2_hdestart, 16, 0); /* horizontal de start */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup2_htotal, 16, 16); /* horizontal total */ + +NTV2_REG(ntv2_reg_hdmiout4_videosetup3, 0x1d44); /* video setup 3 register */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup3_vtransf1, 16, 0); /* vertical transistion field 1 */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup3_vtransf2, 16, 16); /* vertical transistion field 2 */ + +NTV2_REG(ntv2_reg_hdmiout4_videosetup4, 0x1d45); /* video setup 4 register */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup4_vsyncstartf1, 16, 0); /* vertical sync start field 1 */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup4_vsyncendf1, 16, 16); /* virtical sync end field 1 */ + +NTV2_REG(ntv2_reg_hdmiout4_videosetup5, 0x1d46); /* video setup 5 register */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup5_vdestartf1, 16, 0); /* vertical de start field 1 */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup5_vdestartf2, 16, 16); /* vertical de start field 2 */ + +NTV2_REG(ntv2_reg_hdmiout4_videosetup6, 0x1d47); /* video setup 6 register */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup6_vsyncstartf2, 16, 0); /* vertical sync start field 2 */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup6_vsyncendf2, 16, 16); /* virtical sync end field 2 */ + +NTV2_REG(ntv2_reg_hdmiout4_videosetup7, 0x1d48); /* video setup 7 register */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup7_vtotalf1, 16, 0); /* vertical total field 1 */ + NTV2_FLD(ntv2_fld_hdmiout4_videosetup7_vtotalf2, 16, 16); /* vertical total field 2 */ + +NTV2_REG(ntv2_reg_hdmiout4_auxcontrol, 0x1d49); /* aux data control */ + NTV2_FLD(ntv2_fld_hdmiout4_auxcontrol_auxdata, 8, 0); /* aux data */ + NTV2_FLD(ntv2_fld_hdmiout4_auxcontrol_auxaddress, 11, 8); /* aux address */ + NTV2_FLD(ntv2_fld_hdmiout4_auxcontrol_auxwrite, 1, 20); /* aux write */ + +NTV2_REG(ntv2_reg_hdmiout4_audiocontrol, 0x1d4b); /* audio data control */ + NTV2_FLD(ntv2_fld_hdmiout4_audiocontrol_source, 4, 0); /* source */ + NTV2_FLD(ntv2_fld_hdmiout4_audiocontrol_group_select, 1, 4); /* upper/lower 8 source channels */ + NTV2_CON(ntv2_con_hdmiout4_group_select_lower, 0x0); /* lower 8 channels */ + NTV2_CON(ntv2_con_hdmiout4_group_select_upper, 0x1); /* upper 8 channels */ + NTV2_FLD(ntv2_fld_hdmiout4_audiocontrol_num_channels, 1, 5); /* 8/2 channel output */ + NTV2_CON(ntv2_con_hdmiout4_num_channels_2, 0x0); /* 2 channel audio */ + NTV2_CON(ntv2_con_hdmiout4_num_channels_8, 0x1); /* 8 channel audio */ + NTV2_FLD(ntv2_fld_hdmiout4_audiocontrol_audioswapmode, 1, 6); /* audio channel 3/4 swap */ + NTV2_CON(ntv2_con_hdmiout4_audioswapmode_enable, 0x0); /* swap */ + NTV2_CON(ntv2_con_hdmiout4_audioswapmode_disable, 0x1); /* no swap */ + NTV2_FLD(ntv2_fld_hdmiout4_audiocontrol_channel_select, 2, 8); /* 2 channel select */ + NTV2_FLD(ntv2_fld_hdmiout4_audiocontrol_audio_format, 2, 12); /* encode format */ + NTV2_CON(ntv2_con_hdmiout4_audio_format_lpcm, 0x0); /* lpcm data */ + NTV2_CON(ntv2_con_hdmiout4_audio_format_dolby, 0x1); /* dolby encoded data */ + NTV2_FLD(ntv2_fld_hdmiout4_audiocontrol_audio_rate, 2, 14); /* sample rate */ + NTV2_CON(ntv2_con_hdmiout4_audio_rate_48, 0x0); /* 48 khz */ + NTV2_CON(ntv2_con_hdmiout4_audio_rate_96, 0x1); /* 96 khz */ + NTV2_CON(ntv2_con_hdmiout4_audio_rate_192, 0x2); /* 192 khz */ + + +NTV2_REG(ntv2_reg_hdmiout4_redrivercontrol, 0x1d4f); /* hdmi redriver control */ + NTV2_FLD(ntv2_fld_hdmiout4_redrivercontrol_power, 1, 0); /* power */ + NTV2_CON(ntv2_con_hdmiout4_power_disable, 0x0); /* power disable */ + NTV2_CON(ntv2_con_hdmiout4_power_enable, 0x1); /* power enable */ + NTV2_FLD(ntv2_fld_hdmiout4_redrivercontrol_pinmode, 1, 1); /* pin mode */ + NTV2_CON(ntv2_con_hdmiout4_pinmode_disable, 0x0); /* pin disable */ + NTV2_CON(ntv2_con_hdmiout4_pinmode_enable, 0x1); /* pin enable */ + NTV2_FLD(ntv2_fld_hdmiout4_redrivercontrol_vodrange, 1, 2); /* differential voltage range */ + NTV2_CON(ntv2_con_hdmiout4_vodrange_low, 0x0); /* voltage swing low */ + NTV2_CON(ntv2_con_hdmiout4_vodrange_high, 0x1); /* voltage swing high */ + NTV2_FLD(ntv2_fld_hdmiout4_redrivercontrol_deemphasis, 2, 4); /* deemphasis */ + NTV2_CON(ntv2_con_hdmiout4_deemphasis_0d0db, 0x0); /* 0 db */ + NTV2_CON(ntv2_con_hdmiout4_deemphasis_3d5db, 0x1); /* 3.5 db */ + NTV2_CON(ntv2_con_hdmiout4_deemphasis_6d0db, 0x2); /* 6 db */ + NTV2_CON(ntv2_con_hdmiout4_deemphasis_9d5db, 0x3); /* 9.5 db */ + NTV2_FLD(ntv2_fld_hdmiout4_redrivercontrol_preemphasis, 2, 8); /* preemphasis */ + NTV2_CON(ntv2_con_hdmiout4_preemphasis_0d0db, 0x0); /* 0 db */ + NTV2_CON(ntv2_con_hdmiout4_preemphasis_1d6db, 0x1); /* 1.6 db */ + NTV2_CON(ntv2_con_hdmiout4_preemphasis_3d5db, 0x2); /* 3.5 db */ + NTV2_CON(ntv2_con_hdmiout4_preemphasis_6d0db, 0x3); /* 6 db */ + NTV2_FLD(ntv2_fld_hdmiout4_redrivercontrol_boost, 4, 12); /* boost */ + NTV2_CON(ntv2_con_hdmiout4_boost_00d25db, 0x0); /* 0.25 db */ + NTV2_CON(ntv2_con_hdmiout4_boost_00d80db, 0x1); /* 0.80 db */ + NTV2_CON(ntv2_con_hdmiout4_boost_01d10db, 0x2); /* 1.1 db */ + NTV2_CON(ntv2_con_hdmiout4_boost_02d20db, 0x3); /* 2.2 db */ + NTV2_CON(ntv2_con_hdmiout4_boost_04d10db, 0x4); /* 4.1 db */ + NTV2_CON(ntv2_con_hdmiout4_boost_07d10db, 0x5); /* 7.1 db */ + NTV2_CON(ntv2_con_hdmiout4_boost_09d00db, 0x6); /* 9.0 db */ + NTV2_CON(ntv2_con_hdmiout4_boost_10d30db, 0x7); /* 10.3 db */ + NTV2_CON(ntv2_con_hdmiout4_boost_11d80db, 0x8); /* 11.8 db */ + NTV2_CON(ntv2_con_hdmiout4_boost_13d90db, 0x9); /* 13.9 db */ + NTV2_CON(ntv2_con_hdmiout4_boost_15d30db, 0xa); /* 15.3 db */ + NTV2_CON(ntv2_con_hdmiout4_boost_16d90db, 0xb); /* 16.9 db */ + NTV2_CON(ntv2_con_hdmiout4_boost_17d90db, 0xc); /* 17.9 db */ + NTV2_CON(ntv2_con_hdmiout4_boost_19d20db, 0xd); /* 19.2 db */ + NTV2_CON(ntv2_con_hdmiout4_boost_20d50db, 0xe); /* 20.5 db */ + NTV2_CON(ntv2_con_hdmiout4_boost_22d20db, 0xf); /* 22.2 db */ + +NTV2_REG(ntv2_reg_hdmiout4_refclockfrequency, 0x1d50); /* reference clock frequency */ +NTV2_REG(ntv2_reg_hdmiout4_tmdsclockfrequency, 0x1d51); /* tmds clock frequency */ +NTV2_REG(ntv2_reg_hdmiout4_txclockfrequency, 0x1d52); /* tx clock frequency */ +NTV2_REG(ntv2_reg_hdmiout4_fpllclockfrequency, 0x1d53); /* fpll clock frequency */ + +NTV2_REG(ntv2_reg_hdmiout4_audio_cts1, 0x1d54); /* audio clock cts 1 */ +NTV2_REG(ntv2_reg_hdmiout4_audio_cts2, 0x1d55); /* audio clock cts 2 */ +NTV2_REG(ntv2_reg_hdmiout4_audio_cts3, 0x1d56); /* audio clock cts 3 */ +NTV2_REG(ntv2_reg_hdmiout4_audio_cts4, 0x1d57); /* audio clock cts 4 */ +NTV2_REG(ntv2_reg_hdmiout4_audio_n, 0x1d58); /* audio clock n */ + +NTV2_REG(ntv2_reg_hdmiout4_croplocation, 0x1d5e); /* crop location */ + NTV2_FLD(ntv2_fld_hdmiout4_croplocation_start, 16, 0); /* crop start location */ + NTV2_FLD(ntv2_fld_hdmiout4_croplocation_end, 16, 16); /* crop end location */ + +NTV2_REG(ntv2_reg_hdmiout4_pixelcontrol, 0x1d5f); /* pixel control */ + NTV2_FLD(ntv2_fld_hdmiout4_pixelcontrol_lineinterleave, 1, 0); /* line interleave */ + NTV2_CON(ntv2_con_hdmiout4_lineinterleave_disable, 0x0); /* disable */ + NTV2_CON(ntv2_con_hdmiout4_lineinterleave_enable, 0x1); /* enable */ + NTV2_FLD(ntv2_fld_hdmiout4_pixelcontrol_pixelinterleave, 1, 1); /* pixel interleave */ + NTV2_CON(ntv2_con_hdmiout4_pixelinterleave_disable, 0x0); /* disable */ + NTV2_CON(ntv2_con_hdmiout4_pixelinterleave_enable, 0x1); /* enable */ + NTV2_FLD(ntv2_fld_hdmiout4_pixelcontrol_420convert, 1, 2); /* 420 to 422 conversion */ + NTV2_CON(ntv2_con_hdmiout4_420convert_disable, 0x0); /* disable */ + NTV2_CON(ntv2_con_hdmiout4_420convert_enable, 0x1); /* enable */ + NTV2_FLD(ntv2_fld_hdmiout4_pixelcontrol_cropmode, 1, 3); /* crop mode */ + NTV2_CON(ntv2_con_hdmiout4_cropmode_disable, 0x0); /* disable */ + NTV2_CON(ntv2_con_hdmiout4_cropmode_enable, 0x1); /* enable */ + +NTV2_REG(ntv2_reg_hdmiout4_i2ccontrol, 0x1d60); /* i2c control */ + NTV2_FLD(ntv2_fld_hdmiout4_i2ccontrol_writedata, 8, 0); /* write data */ + NTV2_FLD(ntv2_fld_hdmiout4_i2ccontrol_subaddress, 8, 8); /* i2c sub-address */ + NTV2_FLD(ntv2_fld_hdmiout4_i2ccontrol_devaddress, 7, 16); /* i2c device address */ + NTV2_FLD(ntv2_fld_hdmiout4_i2ccontrol_read, 1, 23); /* read (not write) */ + NTV2_FLD(ntv2_fld_hdmiout4_i2ccontrol_readdata, 8, 24); /* read data */ + +NTV2_REG(ntv2_reg_hdmiout4_i2cedid, 0x1d61); /* edid read control */ + NTV2_FLD(ntv2_fld_hdmiout4_i2cedid_subaddress, 8, 0); /* edid sub-address */ + NTV2_FLD(ntv2_fld_hdmiout4_i2cedid_readdata, 8, 8); /* read data */ + NTV2_FLD(ntv2_fld_hdmiout4_i2cedid_update, 1, 16); /* trigger edid update */ + NTV2_FLD(ntv2_fld_hdmiout4_i2cedid_done, 1, 17); /* i2c engine done */ + NTV2_FLD(ntv2_fld_hdmiout4_i2cedid_present, 1, 27); /* sink present */ + NTV2_FLD(ntv2_fld_hdmiout4_i2cedid_hotplugcount, 4, 28); /* hot plug count */ + +/* hdmi output scdc i2c registers */ +NTV2_CON(ntv2_dev_hdmiout4_sink, 0x54); /* sink device address */ + +NTV2_CON(ntv2_reg_hdmiout4_sinkversion, 0x01); /* sink version */ +NTV2_CON(ntv2_reg_hdmiout4_sourceversion, 0x02); /* source version */ + +NTV2_CON(ntv2_reg_hdmiout4_updateflags0, 0x10); /* update flags */ + NTV2_FLD(ntv2_fld_hdmiout4_updateflags0_statusupdate, 1, 0); /* status flags register has changed */ + NTV2_FLD(ntv2_fld_hdmiout4_updateflags0_cedupdate, 1, 1); /* character error detection update */ + NTV2_FLD(ntv2_fld_hdmiout4_updateflags0_rrtest, 1, 2); /* read request test ack */ +NTV2_CON(ntv2_reg_hdmiout4_updateflags1, 0x11); /* update flags */ + +NTV2_CON(ntv2_reg_hdmiout4_tmdsconfig, 0x20); /* tmds configuration */ + NTV2_FLD(ntv2_fld_hdmiout4_tmdsconfig_scamblemode, 1, 0); /* sink scamble mode */ + NTV2_CON(ntv2_con_hdmiout4_scamblemode_disable, 0x0); /* disable */ + NTV2_CON(ntv2_con_hdmiout4_scamblemode_enable, 0x1); /* enable */ + NTV2_FLD(ntv2_fld_hdmiout4_tmdsconfig_clockratio, 1, 1); /* tmds bit clock ratio */ + NTV2_CON(ntv2_con_hdmiout4_clockratio_10, 0x0); /* 1/10 */ + NTV2_CON(ntv2_con_hdmiout4_clockratio_40, 0x1); /* 1/40 */ +NTV2_CON(ntv2_reg_hdmiout4_scamblerstatus, 0x21); /* scrambler status */ + NTV2_FLD(ntv2_fld_hdmiout4_scamblerstatus_scrambledetect, 1, 0); /* sink detects scrambling */ + +NTV2_CON(ntv2_reg_hdmiout4_scdcconfig, 0x30); /* scdc config */ + NTV2_FLD(ntv2_fld_hdmiout4_scdcconfig_readmode, 1, 0); /* read request mode */ + NTV2_CON(ntv2_con_hdmiout4_readmode_poll, 0x0); /* source polls */ + NTV2_CON(ntv2_con_hdmiout4_readmode_request, 0x1); /* source uses read requests */ + +NTV2_CON(ntv2_reg_hdmiout4_scdcstatus0, 0x40); /* scdc status 0 */ + NTV2_FLD(ntv2_fld_hdmiout4_scdcstatus0_clockdetect, 1, 0); /* clock detected */ + NTV2_FLD(ntv2_fld_hdmiout4_scdcstatus0_ch0lock, 1, 1); /* channel 0 locked */ + NTV2_FLD(ntv2_fld_hdmiout4_scdcstatus0_ch1lock, 1, 2); /* channel 1 locked */ + NTV2_FLD(ntv2_fld_hdmiout4_scdcstatus0_ch2lock, 1, 3); /* channel 2 locked */ +NTV2_CON(ntv2_reg_hdmiout4_scdcstatus1, 0x41); /* scdc status 1 */ + +NTV2_CON(ntv2_reg_hdmiout4_ch0errorlow, 0x50); /* channel 0 error count low */ + NTV2_FLD(ntv2_fld_hdmiout4_ch0errorlow_count, 8, 0); /* count */ +NTV2_CON(ntv2_reg_hdmiout4_ch0errorhigh, 0x51); /* channel 0 error count high */ + NTV2_FLD(ntv2_fld_hdmiout4_ch0errorhigh_count, 7, 0); /* count */ + NTV2_FLD(ntv2_fld_hdmiout4_ch0errorhigh_valid, 1, 7); /* valid */ +NTV2_CON(ntv2_reg_hdmiout4_ch1errorlow, 0x52); /* channel 1 error count low */ + NTV2_FLD(ntv2_fld_hdmiout4_ch1errorlow_count, 8, 0); /* count */ +NTV2_CON(ntv2_reg_hdmiout4_ch1errorhigh, 0x53); /* channel 1 error count high */ + NTV2_FLD(ntv2_fld_hdmiout4_ch1errorhigh_count, 7, 0); /* count */ + NTV2_FLD(ntv2_fld_hdmiout4_ch1errorhigh_valid, 1, 7); /* valid */ +NTV2_CON(ntv2_reg_hdmiout4_ch2errorlow, 0x54); /* channel 2 error count low */ + NTV2_FLD(ntv2_fld_hdmiout4_ch2errorlow_count, 8, 0); /* count */ +NTV2_CON(ntv2_reg_hdmiout4_ch2errorhigh, 0x55); /* channel 3 error count high */ + NTV2_FLD(ntv2_fld_hdmiout4_ch2errorhigh_count, 7, 0); /* count */ + NTV2_FLD(ntv2_fld_hdmiout4_ch2errorhigh_valid, 1, 7); /* valid */ +NTV2_CON(ntv2_reg_hdmiout4_errorchecksum, 0x55); /* checksum of all channel errors */ + +#endif diff --git a/build_dependencies/aja/include/ajadriver/ntv2infoframe.h b/build_dependencies/aja/include/ajadriver/ntv2infoframe.h new file mode 100644 index 0000000..16a4cea --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2infoframe.h @@ -0,0 +1,54 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2infoframe.h +// Purpose: HDMI info frame parser +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2_INFOFRAME_H +#define NTV2_INFOFRAME_H + +#include "ntv2system.h" + +struct ntv2_avi_info_data { + uint32_t video_standard; + uint32_t frame_rate; + uint32_t color_space; + uint32_t aspect_ratio; + uint32_t colorimetry; + uint32_t quantization; +}; + +struct ntv2_drm_info_data { + uint32_t eotf; + uint32_t metadata_id; + uint32_t primary_x0; + uint32_t primary_y0; + uint32_t primary_x1; + uint32_t primary_y1; + uint32_t primary_x2; + uint32_t primary_y2; + uint32_t white_point_x; + uint32_t white_point_y; + uint32_t luminance_max; + uint32_t luminance_min; + uint32_t content_level_max; + uint32_t frameavr_level_max; +}; + +struct ntv2_vsp_info_data { + uint32_t hdmi_video_format; + uint32_t hdmi_vic; + uint32_t dolby_vision; +}; + + +bool ntv2_aux_to_avi_info(uint32_t *aux_data, uint32_t aux_size, struct ntv2_avi_info_data *avi_data); +bool ntv2_aux_to_drm_info(uint32_t *aux_data, uint32_t aux_size, struct ntv2_drm_info_data *drm_data); +bool ntv2_aux_to_vsp_info(uint32_t *aux_data, uint32_t aux_size, struct ntv2_vsp_info_data *vsp_data); + +#endif diff --git a/build_dependencies/aja/include/ajadriver/ntv2kona.h b/build_dependencies/aja/include/ajadriver/ntv2kona.h new file mode 100644 index 0000000..d3cdd7d --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2kona.h @@ -0,0 +1,145 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2kona.h +// Purpose: Common configuration and status +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2KONA_HEADER +#define NTV2KONA_HEADER + +#include "ntv2system.h" +#include "ntv2devicefeatures.h" +#include "ntv2xpt.h" +#include "ntv2vpid.h" +#include "ntv2rp188.h" +#include "ntv2anc.h" + + +/////////////////////// +//board format routines +NTV2VideoFormat GetBoardVideoFormat(Ntv2SystemContext* context, NTV2Channel channel); +NTV2Standard GetStandard(Ntv2SystemContext* context, NTV2Channel channel); +NTV2FrameGeometry GetFrameGeometry(Ntv2SystemContext* context, NTV2Channel channel); +NTV2FrameRate GetFrameRate(Ntv2SystemContext* context, NTV2Channel channel); +bool IsProgressiveStandard(Ntv2SystemContext* context, NTV2Channel channel); +bool GetSmpte372(Ntv2SystemContext* context, NTV2Channel channel); +bool GetQuadFrameEnable(Ntv2SystemContext* context, NTV2Channel channel); +bool Get4kSquaresEnable (Ntv2SystemContext* context, NTV2Channel channel); +bool Get425FrameEnable (Ntv2SystemContext* context, NTV2Channel channel); +bool Get12GTSIFrameEnable (Ntv2SystemContext* context, NTV2Channel channel); +bool GetQuadQuadFrameEnable(Ntv2SystemContext* context, NTV2Channel channel); +bool GetQuadQuadSquaresEnable(Ntv2SystemContext* context, NTV2Channel channel); +bool IsMultiFormatActive (Ntv2SystemContext* context); +bool GetEnable4KDCPSFOutMode(Ntv2SystemContext* context); +NTV2FrameBufferFormat GetFrameBufferFormat(Ntv2SystemContext* context, NTV2Channel channel); +void SetFrameBufferFormat(Ntv2SystemContext* context, NTV2Channel channel, NTV2FrameBufferFormat value); +NTV2VideoFrameBufferOrientation GetFrameBufferOrientation(Ntv2SystemContext* context, NTV2Channel channel); +void SetFrameBufferOrientation(Ntv2SystemContext* context, NTV2Channel channel, NTV2VideoFrameBufferOrientation value); +bool GetConverterOutStandard(Ntv2SystemContext* context, NTV2Standard* value); +bool ReadFSHDRRegValues(Ntv2SystemContext* context, NTV2Channel channel, HDRDriverValues* hdrRegValues); + +/////////////////////// +NTV2Mode GetMode(Ntv2SystemContext* context, NTV2Channel channel); +void SetMode(Ntv2SystemContext* context, NTV2Channel channel, NTV2Mode value); +uint32_t GetOutputFrame(Ntv2SystemContext* context, NTV2Channel channel); +void SetOutputFrame(Ntv2SystemContext* context, NTV2Channel channel, uint32_t value); +uint32_t GetInputFrame(Ntv2SystemContext* context, NTV2Channel channel); +void SetInputFrame(Ntv2SystemContext* context, NTV2Channel channel, uint32_t value); +uint32_t GetPCIAccessFrame(Ntv2SystemContext* context, NTV2Channel channel); +void SetPCIAccessFrame(Ntv2SystemContext* context, NTV2Channel channel, uint32_t value); +bool Get2piCSC(Ntv2SystemContext* context, NTV2Channel channel); +bool Set2piCSC(Ntv2SystemContext* context, NTV2Channel channel, bool enable); +NTV2FrameBufferFormat GetDualLink5PixelFormat(Ntv2SystemContext* context); +void SetDualLink5PixelFormat(Ntv2SystemContext* context, NTV2FrameBufferFormat value); +ULWord GetHWFrameBufferSize(Ntv2SystemContext* context, NTV2Channel channel); +ULWord GetFrameBufferSize(Ntv2SystemContext* context, NTV2Channel channel); + +/////////////////////// +bool FieldDenotesStartOfFrame(Ntv2SystemContext* context, NTV2Crosspoint channelSpec); +bool IsFieldID0(Ntv2SystemContext* context, NTV2Crosspoint xpt); + + +/////////////////////// +//sdi routines +bool SetVideoOutputStandard(Ntv2SystemContext* context, NTV2Channel channel); +bool SetSDIOutStandard(Ntv2SystemContext* context, NTV2Channel channel, NTV2Standard value); +bool SetSDIOut_2Kx1080Enable(Ntv2SystemContext* context, NTV2Channel channel, bool enable); +bool GetSDIOut3GEnable(Ntv2SystemContext* context, NTV2Channel channel, bool* enable); +bool SetSDIOut3GEnable(Ntv2SystemContext* context, NTV2Channel channel, bool enable); +bool GetSDIOut3GbEnable(Ntv2SystemContext* context, NTV2Channel channel, bool* enable); +bool SetSDIOut3GbEnable(Ntv2SystemContext* context, NTV2Channel channel, bool enable); +bool GetSDIOut6GEnable(Ntv2SystemContext* context, NTV2Channel channel, bool* enable); +bool SetSDIOut6GEnable(Ntv2SystemContext* context, NTV2Channel channel, bool enable); +bool GetSDIOut12GEnable(Ntv2SystemContext* context, NTV2Channel channel, bool* enable); +bool SetSDIOut12GEnable(Ntv2SystemContext* context, NTV2Channel channel, bool enable); +bool GetSDIOutRGBLevelAConversion(Ntv2SystemContext* context, NTV2Channel channel, bool* enable); +bool GetSDIOutLevelAtoLevelBConversion(Ntv2SystemContext* context, NTV2Channel channel, bool* enable); +bool GetSDIInLevelBtoLevelAConversion(Ntv2SystemContext* context, NTV2Channel channel, bool* enable); +bool GetSDIIn6GEnable(Ntv2SystemContext* context, NTV2Channel channel); +bool GetSDIIn12GEnable(Ntv2SystemContext* context, NTV2Channel channel); + + +/////////////////////// +//hdmi routines +bool SetLHiHDMIOutputStandard(Ntv2SystemContext* context); +bool SetHDMIOutputStandard(Ntv2SystemContext* context); +bool SetHDMIV2LevelBEnable(Ntv2SystemContext* context, bool enable); +bool SetMultiRasterInputStandard(Ntv2SystemContext* context, NTV2Standard mrStandard, NTV2Channel mrChannel); +bool SetEnableMultiRasterCapture(Ntv2SystemContext* context, bool bEnable); +bool HasMultiRasterWidget(Ntv2SystemContext* context); +bool IsMultiRasterEnabled(Ntv2SystemContext* context); + +/////////////////////// +//hdr routines +bool EnableHDMIHDR(Ntv2SystemContext* context, bool inEnableHDMIHDR); +bool GetEnableHDMIHDR(Ntv2SystemContext* context); +bool SetHDRData(Ntv2SystemContext* context, HDRDriverValues inRegisterValues); +bool GetHDRData(Ntv2SystemContext* context, HDRDriverValues* inRegisterValues); + +/////////////////////// +//analog routines +bool SetLHiAnalogOutputStandard(Ntv2SystemContext* context); + +/////////////////////// +//converter routines +bool GetK2ConverterOutFormat(Ntv2SystemContext* context, NTV2VideoFormat* format); + +/////////////////////// +//input routines +bool GetSourceVideoFormat(Ntv2SystemContext* context, NTV2VideoFormat* format, NTV2OutputXptID crosspoint, bool* quadMode, bool* quadQuadMode, HDRDriverValues* hdrRegValues); +NTV2VideoFormat GetInputVideoFormat(Ntv2SystemContext* context, NTV2Channel channel); +NTV2VideoFormat GetHDMIInputVideoFormat(Ntv2SystemContext* context); +NTV2VideoFormat GetAnalogInputVideoFormat(Ntv2SystemContext* context); + +/////////////////////// +//interrupt routines +bool UpdateAudioMixerGainFromRotaryEncoder(Ntv2SystemContext* context); + +/////////////////////// +//util routines +ULWord IsScanGeometry2Kx1080(NTV2ScanGeometry scanGeometry); +bool IsVideoFormat2Kx1080(NTV2VideoFormat videoFormat); +NTV2Crosspoint GetNTV2CrosspointChannelForIndex(ULWord index); +ULWord GetIndexForNTV2CrosspointChannel(NTV2Crosspoint channel); +NTV2Crosspoint GetNTV2CrosspointInputForIndex(ULWord index); +ULWord GetIndexForNTV2CrosspointInput(NTV2Crosspoint channel); +NTV2Crosspoint GetNTV2CrosspointForIndex(ULWord index); +ULWord GetIndexForNTV2Crosspoint(NTV2Crosspoint channel); +NTV2Channel GetNTV2ChannelForNTV2Crosspoint(NTV2Crosspoint crosspoint); +NTV2VideoFormat GetVideoFormatFromState(NTV2Standard standard, NTV2FrameRate frameRate, ULWord is2Kx1080, ULWord smpte372Enabled); +NTV2Standard GetNTV2StandardFromVideoFormat(NTV2VideoFormat videoFormat); +NTV2FrameRate GetNTV2FrameRateFromVideoFormat(NTV2VideoFormat videoFormat); +NTV2Channel GetOutXptChannel(NTV2OutputCrosspointID inXpt, bool multiFormatActive); +NTV2Standard GetStandardFromScanGeometry(NTV2ScanGeometry scanGeometry, ULWord progressive); +NTV2VideoFormat GetQuadSizedVideoFormat(NTV2VideoFormat videoFormat); +NTV2VideoFormat Get12GVideoFormat(NTV2VideoFormat videoFormat); +NTV2VideoFormat GetQuadQuadSizedVideoFormat(NTV2VideoFormat videoFormat); +NTV2VideoFormat GetHDSizedVideoFormat(NTV2VideoFormat videoFormat); +bool HDRIsChanging(HDRDriverValues inCurrentHDR, HDRDriverValues inNewHDR); + +#endif diff --git a/build_dependencies/aja/include/ajadriver/ntv2mcap.h b/build_dependencies/aja/include/ajadriver/ntv2mcap.h new file mode 100644 index 0000000..519ffa8 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2mcap.h @@ -0,0 +1,84 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2mcap.h +// Purpose: Xilinx bitfile loading +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2MCAP_HEADER +#define NTV2MCAP_HEADER + +#include "ntv2system.h" + +/* mcap register map */ +#define MCAP_EXT_CAP_HEADER 0x00 +#define MCAP_VEND_SPEC_HEADER 0x04 +#define MCAP_FPGA_JTAG_ID 0x08 +#define MCAP_FPGA_BIT_VERSION 0x0C +#define MCAP_STATUS 0x10 +#define MCAP_CONTROL 0x14 +#define MCAP_DATA 0x18 +#define MCAP_READ_DATA_0 0x1C +#define MCAP_READ_DATA_1 0x20 +#define MCAP_READ_DATA_2 0x24 +#define MCAP_READ_DATA_3 0x28 + +/* mcap control register bit map */ +#define MCAP_CTRL_CONFIG_ENABLE_MASK (1 << 0) +#define MCAP_CTRL_READ_ENABLE_MASK (1 << 1) +#define MCAP_CTRL_CONFIG_RESET_MASK (1 << 4) +#define MCAP_CTRL_MODULE_RESET_MASK (1 << 5) +#define MCAP_CTRL_PCI_REQUEST_MASK (1 << 8) +#define MCAP_CTRL_BAR_ENABLE_MASK (1 << 12) +#define MCAP_CTRL_WRITE_ENABLE_MASK (1 << 16) + +/* mcap status register bit map */ +#define MCAP_STS_ERR_MASK (1 << 0) +#define MCAP_STS_EOS_MASK (1 << 1) +#define MCAP_STS_REG_READ_CMP_MASK (1 << 4) +#define MCAP_STS_REG_READ_COUNT_MASK (7 << 5) +#define MCAP_STS_REG_READ_COUNT_SHIFT (5) +#define MCAP_STS_FIFO_OVERFLOW_MASK (1 << 8) +#define MCAP_STS_FIFO_OCCUPANCY_MASK (15 << 12) +#define MCAP_STS_FIFO_OCCUPANCY_SHIFT (12) +#define MCAP_STS_CONFIG_RELEASE_MASK (1 << 24) + +/* mcap pci extended capability id */ +#define MCAP_EXT_CAP_ID 0xB + +/* mcap timeout counts */ +#define MCAP_EOS_RETRY_COUNT 10 +#define MCAP_EOS_LOOP_COUNT 100 + +/* mcap bit data fill */ +#define MCAP_NOOP_VAL 0x2000000 + +#define NTV2_MCAP_STRING_SIZE 80 + + +struct ntv2_mcap { + char name[NTV2_MCAP_STRING_SIZE]; + Ntv2SystemContext* system_context; + int32_t reg_base; + bool fragment; +}; + +struct ntv2_mcap *ntv2_mcap_open(Ntv2SystemContext *sys_con, const char *name); +void ntv2_mcap_close(struct ntv2_mcap *ntv2_mc); + +Ntv2Status ntv2_mcap_configure(struct ntv2_mcap *ntv2_mc); + +Ntv2Status ntv2_mcap_config_reset(struct ntv2_mcap *ntv2_mc); +Ntv2Status ntv2_mcap_module_reset(struct ntv2_mcap *ntv2_mc); +Ntv2Status ntv2_mcap_full_reset(struct ntv2_mcap *ntv2_mc); + +Ntv2Status ntv2_mcap_write_bitstream(struct ntv2_mcap *ntv2_mc, void* data, + uint32_t bytes, bool fragment, bool swap); + +Ntv2Status ntv2_mcap_read_register(struct ntv2_mcap *ntv2_mc, uint32_t offset, uint32_t* data); + +#endif diff --git a/build_dependencies/aja/include/ajadriver/ntv2pciconfig.h b/build_dependencies/aja/include/ajadriver/ntv2pciconfig.h new file mode 100644 index 0000000..a0db6f3 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2pciconfig.h @@ -0,0 +1,22 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2pciconfig.h +// Purpose: PCI configuration space utility +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2PCICONFIG_HEADER +#define NTV2PCICONFIG_HEADER + +#include "ntv2system.h" + +int32_t ntv2PciFindCapability(Ntv2SystemContext* pSysCon, uint32_t cap_id); +int32_t ntv2PciFindExtCapability(Ntv2SystemContext* pSysCon, uint32_t ext_id); +uint32_t ntv2ReadPciMaxReadRequestSize(Ntv2SystemContext* pSysCon); +Ntv2Status ntv2WritePciMaxReadRequestSize(Ntv2SystemContext* pSysCon, uint32_t reqSize); + +#endif diff --git a/build_dependencies/aja/include/ajadriver/ntv2rp188.h b/build_dependencies/aja/include/ajadriver/ntv2rp188.h new file mode 100644 index 0000000..909cb1d --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2rp188.h @@ -0,0 +1,69 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2rp188.h +// Purpose: Common RP188 +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2RP188_HEADER +#define NTV2RP188_HEADER + +#include "ntv2kona.h" + +typedef struct { + RP188_STRUCT TCInOut1; + RP188_STRUCT TCInOut2; + RP188_STRUCT TCInOut3; + RP188_STRUCT TCInOut4; + RP188_STRUCT LTCEmbedded1; + RP188_STRUCT LTCAnalog1; + RP188_STRUCT LTCEmbedded2; + RP188_STRUCT LTCAnalog2; + RP188_STRUCT TCInOut5; + RP188_STRUCT TCInOut6; + RP188_STRUCT TCInOut7; + RP188_STRUCT TCInOut8; + RP188_STRUCT LTCEmbedded3; + RP188_STRUCT LTCEmbedded4; + RP188_STRUCT LTCEmbedded5; + RP188_STRUCT LTCEmbedded6; + RP188_STRUCT LTCEmbedded7; + RP188_STRUCT LTCEmbedded8; + RP188_STRUCT TCInOut1_2; + RP188_STRUCT TCInOut2_2; + RP188_STRUCT TCInOut3_2; + RP188_STRUCT TCInOut4_2; + RP188_STRUCT TCInOut5_2; + RP188_STRUCT TCInOut6_2; + RP188_STRUCT TCInOut7_2; + RP188_STRUCT TCInOut8_2; +} INTERNAL_TIMECODE_STRUCT; + +typedef struct { + NTV2SDIInputStatus SDIStatus1; + NTV2SDIInputStatus SDIStatus2; + NTV2SDIInputStatus SDIStatus3; + NTV2SDIInputStatus SDIStatus4; + NTV2SDIInputStatus SDIStatus5; + NTV2SDIInputStatus SDIStatus6; + NTV2SDIInputStatus SDIStatus7; + NTV2SDIInputStatus SDIStatus8; +} INTERNAL_SDI_STATUS_STRUCT; + +bool InitRP188(Ntv2SystemContext* context); +extern bool CopyRP188HardwareToFrameStampTCArray(Ntv2SystemContext* context, INTERNAL_TIMECODE_STRUCT* tcStruct); +bool CopyFrameStampTCArrayToHardware(Ntv2SystemContext* context, INTERNAL_TIMECODE_STRUCT* acFrameStampTCArray); +bool CopyNTV2TimeCodeArrayToFrameStampTCArray(INTERNAL_TIMECODE_STRUCT * tcStruct, NTV2_RP188 * pInTCArray, ULWord inMaxBytes); +bool CopyFrameStampTCArrayToNTV2TimeCodeArray(INTERNAL_TIMECODE_STRUCT * tcStruct, NTV2_RP188 * pOutTCArray, ULWord inMaxBytes); +void SetRP188Mode(Ntv2SystemContext* context, NTV2Channel channel, NTV2_RP188Mode value); +bool GetReceivedTCForChannel(Ntv2SystemContext* context, NTV2Channel channel, RP188_STRUCT* LTCIn, RP188_STRUCT* VITC1In, RP188_STRUCT* VITC2In); +bool GetReceivedAnalogLTC(Ntv2SystemContext* context, RP188_STRUCT* LTCAnalog1In, RP188_STRUCT* LTCAnalog2In); +bool CopyFrameStampSDIStatusArrayToNTV2SDIStatusArray(INTERNAL_SDI_STATUS_STRUCT * tcStruct, NTV2SDIInputStatus * pOutTCArray, ULWord inMaxBytes); +bool CopySDIStatusHardwareToFrameStampSDIStatusArray(Ntv2SystemContext* context, INTERNAL_SDI_STATUS_STRUCT* sdiStruct); +bool CopyFrameRP188ToHardware(Ntv2SystemContext* context, RP188_STRUCT* rp188); +#endif + diff --git a/build_dependencies/aja/include/ajadriver/ntv2setup.h b/build_dependencies/aja/include/ajadriver/ntv2setup.h new file mode 100644 index 0000000..e3de1ab --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2setup.h @@ -0,0 +1,36 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2setup.h +// Purpose: Monitor and setup outputs, vpid and other stuff +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2SETUP_HEADER +#define NTV2SETUP_HEADER + +#include "ntv2system.h" + +#define NTV2_SETUP_STRING_SIZE 80 + +struct ntv2_setup { + int index; + char name[NTV2_SETUP_STRING_SIZE]; + Ntv2SystemContext* system_context; + Ntv2SpinLock state_lock; + + Ntv2Thread monitor_task; + bool monitor_enable; + Ntv2Event monitor_event; +}; + +struct ntv2_setup *ntv2_setup_open(Ntv2SystemContext* sys_con, const char *name); +void ntv2_setup_close(struct ntv2_setup *ntv2_setterupper); +Ntv2Status ntv2_setup_configure(struct ntv2_setup *ntv2_setterupper); +Ntv2Status ntv2_setup_enable(struct ntv2_setup *ntv2_setterupper); +Ntv2Status ntv2_setup_disable(struct ntv2_setup *ntv2_setterupper); + +#endif diff --git a/build_dependencies/aja/include/ajadriver/ntv2system.h b/build_dependencies/aja/include/ajadriver/ntv2system.h new file mode 100644 index 0000000..7afb1d7 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2system.h @@ -0,0 +1,569 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +/////////////////////////////////////////////////////////////// +// +// Device Driver for AJA OEM devices. +// +//////////////////////////////////////////////////////////// +// +// Filename: ntv2system.h +// Purpose: NTV2 system function abstraction +// Notes: +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2SYSTEM_H +#define NTV2SYSTEM_H + +#define NTV2_MEMORY_ALIGN_DEFAULT 64 +#define NTV2_MEMORY_ALIGN_MAX 4096 + +#if defined(AJAVirtual) + + #include + #include + #include + #include + #include + #include + + #include "ajatypes.h" + + // virtual return codes + + typedef int Ntv2Status; + + #define NTV2_STATUS_SUCCESS (0) + #define NTV2_STATUS_FAIL (-1) + #define NTV2_STATUS_NO_DEVICE (-2) + #define NTV2_STATUS_BAD_STATE (-3) + #define NTV2_STATUS_BAD_PARAMETER (-4) + #define NTV2_STATUS_NO_MEMORY (-5) + #define NTV2_STATUS_BUSY (-6) + #define NTV2_STATUS_IO_ERROR (-7) + #define NTV2_STATUS_TIMEOUT (-8) + #define NTV2_STATUS_NO_RESOURCES (-9) + + // virtual try/catch + + #define NTV2_TRY if (true) + #define NTV2_CATCH if (false) + + // virtual system context + + typedef struct ntv2_system_context + { + } Ntv2SystemContext; + + // virtual register abstraction + + typedef void* Ntv2Register; + + //MRBILL #define ntv2WriteRegister32(reg, value) + //MRBILL #define ntv2ReadRegister32(reg) + + // virtual message abstraction + + #define ntv2Message(string, ...) printf(string, __VA_ARGS__) + + // virtual spinlock abstraction + + typedef struct ntv2_spinlock + { + } Ntv2SpinLock; + + // virtual interrupt lock abstraction + + typedef struct ntv2_interrupt_lock + { + } Ntv2InterruptLock; + + // virtual memory abstraction + + typedef void* Ntv2DmaAddress; + typedef struct ntv2_dma_memory + { + void* pAddress; + Ntv2DmaAddress dmaAddress; + uint32_t size; + } Ntv2DmaMemory; + + // virtual user buffer abstraction + + typedef struct ntv2_user_buffer + { + void* pAddress; + uint32_t size; + bool write; + } Ntv2UserBuffer; + + // virtual dpc task abstraction + + typedef unsigned long Ntv2DpcData; + typedef void Ntv2DpcTask(Ntv2DpcData data); + + typedef struct ntv2_dpc + { + } Ntv2Dpc; + + // virtual event abstraction + + typedef struct ntv2_event + { + } Ntv2Event; + + // virtual semaphore abstraction + + typedef struct ntv2_semaphore + { + } Ntv2Semaphore; + + // virtual thread abstraction + + typedef void Ntv2ThreadTask(void* pContext); + typedef struct ntv2_thread + { + const char* pName; + Ntv2ThreadTask* pFunc; + void* pContext; + bool run; + } Ntv2Thread; + +//endif // defined(AJAVirtual) +#elif defined(MSWindows) + + #define NO_STRICT + #include + #include + #include + + #pragma warning(disable:4201) + #include + #pragma warning(default:4201) + + //#define NTSTRSAFE_LIB + #include + #include + + #if !defined (__cplusplus) + typedef unsigned char bool; + #define true 1 + #define false 0 + #endif + + #include "ajatypes.h" + #include "ntv2publicinterface.h" + + // windows return codes + + typedef NTSTATUS Ntv2Status; + + #define NTV2_STATUS_SUCCESS (STATUS_SUCCESS) + #define NTV2_STATUS_FAIL (STATUS_UNSUCCESSFUL) + #define NTV2_STATUS_NO_DEVICE (STATUS_NO_SUCH_DEVICE) + #define NTV2_STATUS_BAD_STATE (STATUS_INVALID_DEVICE_STATE) + #define NTV2_STATUS_BAD_PARAMETER (STATUS_INVALID_PARAMETER) + #define NTV2_STATUS_NO_MEMORY (STATUS_NO_MEMORY) + #define NTV2_STATUS_BUSY (STATUS_DEVICE_BUSY) + #define NTV2_STATUS_IO_ERROR (STATUS_IO_DEVICE_ERROR) + #define NTV2_STATUS_TIMEOUT (STATUS_IO_TIMEOUT) + #define NTV2_STATUS_NO_RESOURCES (STATUS_INSUFFICIENT_RESOURCES) + + // windows system context + typedef struct ntv2_system_context + { + uint32_t devNum; // device number + WDFDRIVER wdfDriver; // wdf driver + WDFDEVICE wdfDevice; // wdf device + WDFINTERRUPT wdfInterrupt; // wdf interrupt + WDFDMAENABLER wdfDmaEnabler; // wdf dma enabler + ULONG busNumber; // device pci bus number + BUS_INTERFACE_STANDARD BusInterface; // windows bus interface + PBUS_INTERFACE_STANDARD pBusInterface; // bus interface pointer + } Ntv2SystemContext; + + // windows register abstraction + + typedef uint8_t* Ntv2Register; + + #define ntv2WriteRegister32(reg, value) WRITE_REGISTER_ULONG((ULONG*)(reg), (ULONG)(value)) + #define ntv2ReadRegister32(reg) READ_REGISTER_ULONG((ULONG*)(reg)) + + // windows message abstraction + + #define ntv2Message(string, ...) DbgPrint(string, __VA_ARGS__) + + // windows spinlock abstraction + + typedef struct ntv2_spinlock + { + KSPIN_LOCK lock; + KIRQL irql; + } Ntv2SpinLock; + + // windows interrupt lock abstraction + + typedef struct ntv2_interrupt_lock + { + WDFINTERRUPT wdfInterrupt; + bool locked; + } Ntv2InterruptLock; + + // windows memory abstraction + + typedef int64_t Ntv2DmaAddress; + typedef struct ntv2_dma_memory + { + WDFCOMMONBUFFER wdfCommonBuffer; + PVOID pAddress; + Ntv2DmaAddress dmaAddress; + uint32_t size; + } Ntv2DmaMemory; + + // windows user buffer abstraction + + typedef struct ntv2_user_buffer + { + PVOID pAddress; + uint32_t size; + bool write; + } Ntv2UserBuffer; + + // windows dpc task abstraction + + typedef uint64_t Ntv2DpcData; + typedef void Ntv2DpcTask(Ntv2DpcData data); + + typedef struct ntv2_dpc + { + WDFDPC wdfDpc; + } Ntv2Dpc; + + // windows event abstraction + + typedef struct ntv2_event + { + KEVENT event; + } Ntv2Event; + + // windows semaphore abstraction + + typedef struct ntv2_semaphore + { + KSEMAPHORE semaphore; + } Ntv2Semaphore; + + // windows thread abstraction + + typedef void Ntv2ThreadTask(void* pContext); + typedef struct ntv2_thread + { + PKTHREAD pTask; + const char *pName; + Ntv2ThreadTask* pFunc; + void *pContext; + bool run; + } Ntv2Thread; + +//endif // defined(MSWindows) +#elif defined(AJAMac) + + #include "ajatypes.h" + #if defined(NTV2_BUILDING_DRIVER) + #include + #include + #include "MacLog.h" + #endif + + // Mac return codes + typedef IOReturn Ntv2Status; + #define NTV2_STATUS_SUCCESS (kIOReturnSuccess) + #define NTV2_STATUS_FAIL (kIOReturnError) + #define NTV2_STATUS_NO_DEVICE (kIOReturnNoDevice) + #define NTV2_STATUS_BAD_STATE (kIOReturnInvalid) + #define NTV2_STATUS_BAD_PARAMETER (kIOReturnBadArgument) + #define NTV2_STATUS_NO_MEMORY (kIOReturnNoMemory) + #define NTV2_STATUS_BUSY (kIOReturnBusy) + #define NTV2_STATUS_IO_ERROR (kIOReturnIPCError) + #define NTV2_STATUS_TIMEOUT (kIOReturnTimeout) + #define NTV2_STATUS_NO_RESOURCES (kIOReturnNoResources) + + // windows message abstraction + + #define ntv2Message(string, ...) DebugLog(string, __VA_ARGS__) + + // Mac system context + + typedef void* ntv2_mac_driver_ref; + + typedef struct ntv2_system_context + { + ntv2_mac_driver_ref macDriverRef; + } Ntv2SystemContext; + + // Mac register abstraction + + typedef uint8_t* Ntv2Register; + + // Mac spinlock abstraction + //class IOSimpleLock; + typedef struct ntv2_spinlock + { + IOSimpleLock* lock; + } Ntv2SpinLock; + + // Mac event abstraction + //class IORecursiveLock; + typedef struct ntv2_event + { + IORecursiveLock* pRecursiveLock; + bool flag; + } Ntv2Event; + + + // Mac thread abstraction + + typedef void Ntv2ThreadTask(void* pContext); + typedef struct ntv2_thread + { + thread_t pTask; + const char *pName; + Ntv2ThreadTask* pFunc; + void *pContext; + bool run; + } Ntv2Thread; + +//endif // defined(AJAMac) +#elif defined(AJALinux) + + // linux system headers + + #if defined(CONFIG_SMP) + #define __SMP__ + #endif + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #include "ajatypes.h" + + // linux return codes + + typedef int Ntv2Status; + + #define NTV2_STATUS_SUCCESS (0) + #define NTV2_STATUS_FAIL (-EAGAIN) + #define NTV2_STATUS_NO_DEVICE (-ENODEV) + #define NTV2_STATUS_BAD_STATE (-EPERM) + #define NTV2_STATUS_BAD_PARAMETER (-EINVAL) + #define NTV2_STATUS_NO_MEMORY (-ENOMEM) + #define NTV2_STATUS_BUSY (-EBUSY) + #define NTV2_STATUS_IO_ERROR (-EIO) + #define NTV2_STATUS_TIMEOUT (-ETIME) + #define NTV2_STATUS_NO_RESOURCES (-ENOMEM) + + // linux system context + + typedef struct ntv2_system_context + { + uint32_t devNum; // device number + struct pci_dev* pDevice; // linux pci device + uint32_t busNumber; // pci bus number + } Ntv2SystemContext; + + // linux register abstraction + + typedef void __iomem* Ntv2Register; + + #define ntv2WriteRegister32(reg, value) iowrite32((uint32_t)(value), (void*)(reg)) + #define ntv2ReadRegister32(reg) ioread32((void*)(reg)) + + // linux message abstraction + + #define ntv2Message(string, ...) printk(KERN_ALERT string, __VA_ARGS__) + + // linux spinlock abstraction + + typedef struct ntv2_spinlock + { + spinlock_t lock; + } Ntv2SpinLock; + + // linux interrupt lock abstraction + + typedef struct ntv2_interrupt_lock + { + spinlock_t lock; + unsigned long flags; + } Ntv2InterruptLock; + + // linux memory abstraction + + typedef dma_addr_t Ntv2DmaAddress; + typedef struct ntv2_dma_memory + { + struct pci_dev* pDevice; + void* pAddress; + Ntv2DmaAddress dmaAddress; + uint32_t size; + } Ntv2DmaMemory; + + // linux user buffer abstraction + + typedef struct ntv2_user_buffer + { + void* pAddress; + uint32_t size; + bool write; + } Ntv2UserBuffer; + + // linux dpc task abstraction + + typedef unsigned long Ntv2DpcData; + typedef void Ntv2DpcTask(Ntv2DpcData data); + + typedef struct ntv2_dpc + { + struct tasklet_struct tasklet; + } Ntv2Dpc; + + // linux event abstraction + + typedef struct ntv2_event + { + wait_queue_head_t event; + bool flag; + } Ntv2Event; + + // linux semaphore abstraction + + typedef struct ntv2_semaphore + { + struct semaphore semaphore; + } Ntv2Semaphore; + + // linux thread abstraction + + typedef void Ntv2ThreadTask(void* pContext); + typedef struct ntv2_thread + { + const char* pName; + struct task_struct* pTask; + Ntv2ThreadTask* pFunc; + void* pContext; + bool run; + } Ntv2Thread; + +#endif // defined(AJALinux) + +#if defined (AJAMac) + // Mac register read/write + uint32_t ntv2ReadRegister32(Ntv2SystemContext* context, uint32_t regNum); + void ntv2WriteRegister32(Ntv2SystemContext* context, uint32_t regNum, uint32_t regValue); +#endif + +uint32_t ntv2ReadRegister(Ntv2SystemContext* context, uint32_t regnNum); +bool ntv2ReadRegisterMS(Ntv2SystemContext* context, uint32_t regnum, uint32_t* data, uint32_t regMask, uint32_t regShift); +bool ntv2WriteRegister(Ntv2SystemContext* context, uint32_t regnum, uint32_t data); +bool ntv2WriteRegisterMS(Ntv2SystemContext* context, uint32_t regnum, uint32_t data, uint32_t regMask, uint32_t regShift); +uint32_t ntv2ReadVirtualRegister(Ntv2SystemContext* context, uint32_t regNum); +bool ntv2WriteVirtualRegister(Ntv2SystemContext* context, uint32_t regNum, uint32_t data); + +// spinlock functions + +bool ntv2SpinLockOpen(Ntv2SpinLock* pSpinLock, Ntv2SystemContext* pSysCon); +void ntv2SpinLockClose(Ntv2SpinLock* pSpinLock); +void ntv2SpinLockAcquire(Ntv2SpinLock* pSpinLock); +void ntv2SpinLockRelease(Ntv2SpinLock* pSpinLock); + +// memory functions + +void* ntv2MemoryAlloc(uint32_t size); +void ntv2MemoryFree(void* pAddress, uint32_t size); + +// event functions + +bool ntv2EventOpen(Ntv2Event* pEvent, Ntv2SystemContext* pSysCon); +void ntv2EventClose(Ntv2Event* pEvent); +void ntv2EventSignal(Ntv2Event* pEvent); +void ntv2EventClear(Ntv2Event* pEvent); +bool ntv2EventWaitForSignal(Ntv2Event* pEvent, int64_t timeout, bool alert); + +// sleep function + +void ntv2TimeSleep(int64_t microseconds); + +// kernel thread + +bool ntv2ThreadOpen(Ntv2Thread* pThread, Ntv2SystemContext* pSysCon, const char* pName); +void ntv2ThreadClose(Ntv2Thread* pThread); +bool ntv2ThreadRun(Ntv2Thread* pThread, Ntv2ThreadTask* pTask, void* pContext); +void ntv2ThreadStop(Ntv2Thread* pThread); +const char* ntv2ThreadGetName(Ntv2Thread* pThread); +bool ntv2ThreadShouldStop(Ntv2Thread* pThread); +void ntv2ThreadExit(Ntv2Thread* pThread); + +// pci configuration space +Ntv2Status ntv2ReadPciConfig(Ntv2SystemContext* pSysCon, void* pData, int32_t offset, int32_t size); +Ntv2Status ntv2WritePciConfig(Ntv2SystemContext* pSysCon, void* pData, int32_t offset, int32_t size); + +#if defined(MSWindows) || defined(AJALinux) || defined(AJAVirtual) + + // interrupt lock functions + + bool ntv2InterruptLockOpen(Ntv2InterruptLock* pInterruptLock, Ntv2SystemContext* pSysCon); + void ntv2InterruptLockClose(Ntv2InterruptLock* pInterruptLock); + void ntv2InterruptLockAcquire(Ntv2InterruptLock* pInterruptLock); + void ntv2InterruptLockRelease(Ntv2InterruptLock* pInterruptLock); + + // dma functions + bool ntv2DmaMemoryAlloc(Ntv2DmaMemory* pDmaMemory, Ntv2SystemContext* pSysCon, uint32_t size); + void ntv2DmaMemoryFree(Ntv2DmaMemory* pDmaMemory); + void* ntv2DmaMemoryVirtual(Ntv2DmaMemory* pDmaMemory); + Ntv2DmaAddress ntv2DmaMemoryPhysical(Ntv2DmaMemory* pDmaMemory); + uint32_t ntv2DmaMemorySize(Ntv2DmaMemory* pDmaMemory); + + // user buffer functions + + bool ntv2UserBufferPrepare(Ntv2UserBuffer* pUserBuffer, Ntv2SystemContext* pSysCon, uint64_t address, uint32_t size, bool write); + void ntv2UserBufferRelease(Ntv2UserBuffer* pUserBuffer); + bool ntv2UserBufferCopyTo(Ntv2UserBuffer* pDstBuffer, uint32_t dstOffset, void* pSrcAddress, uint32_t size); + bool ntv2UserBufferCopyFrom(Ntv2UserBuffer* pSrcBuffer, uint32_t srcOffset, void* pDstAddress, uint32_t size); + + // dpc task functions + + bool ntv2DpcOpen(Ntv2Dpc* pDpc, Ntv2SystemContext* pSysCon, Ntv2DpcTask* pDpcTask, Ntv2DpcData dpcData); + void ntv2DpcClose(Ntv2Dpc* pDpc); + void ntv2DpcSchedule(Ntv2Dpc* pDpc); + + // semaphore functions + + bool ntv2SemaphoreOpen(Ntv2Semaphore* pSemaphore, Ntv2SystemContext* pSysCon, uint32_t count); + void ntv2SemaphoreClose(Ntv2Semaphore* pSemaphore); + bool ntv2SemaphoreDown(Ntv2Semaphore* pSemaphore, int64_t timeout); + void ntv2SemaphoreUp(Ntv2Semaphore* pSemaphore); + + // time functions + + int64_t ntv2TimeCounter(void); + int64_t ntv2TimeFrequency(void); + int64_t ntv2Time100ns(void); +#endif // defined(MSWindows) || defined(AJALinux) + +#endif // NTV2SYSTEM_H diff --git a/build_dependencies/aja/include/ajadriver/ntv2video.h b/build_dependencies/aja/include/ajadriver/ntv2video.h new file mode 100644 index 0000000..d6eb493 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2video.h @@ -0,0 +1,38 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//======================================================================== +// +// ntv2video.h +// +//========================================================================== + +#ifndef NTV2VIDEO_H +#define NTV2VIDEO_H + +#include "ntv2system.h" +#include "ntv2publicinterface.h" + +void SetRegisterWritemode(Ntv2SystemContext* context, NTV2RegisterWriteMode value, NTV2Channel channel); + +int64_t GetFramePeriod(Ntv2SystemContext* context, NTV2Channel channel); + +void SetColorCorrectionHostAccessBank(Ntv2SystemContext* context, NTV2ColorCorrectionHostAccessBank value); +NTV2ColorCorrectionHostAccessBank GetColorCorrectionHostAccessBank(Ntv2SystemContext* context, NTV2Channel channel); +void SetColorCorrectionSaturation(Ntv2SystemContext* context, NTV2Channel channel, uint32_t value); +uint32_t GetColorCorrectionSaturation(Ntv2SystemContext* context, NTV2Channel channel); +void SetColorCorrectionOutputBank(Ntv2SystemContext* context, NTV2Channel channel, uint32_t bank); +uint32_t GetColorCorrectionOutputBank(Ntv2SystemContext* context, NTV2Channel channel); +void SetLUTV2HostAccessBank(Ntv2SystemContext* context, NTV2ColorCorrectionHostAccessBank value); +void SetLUTV2OutputBank(Ntv2SystemContext* context, NTV2Channel channel, uint32_t bank); +uint32_t GetLUTV2OutputBank(Ntv2SystemContext* context, NTV2Channel channel); +void SetColorCorrectionMode(Ntv2SystemContext* context, NTV2Channel channel, NTV2ColorCorrectionMode mode); +NTV2ColorCorrectionMode GetColorCorrectionMode(Ntv2SystemContext* context, NTV2Channel channel); + +void SetForegroundVideoCrosspoint(Ntv2SystemContext* context, NTV2Crosspoint crosspoint); +void SetForegroundKeyCrosspoint(Ntv2SystemContext* context, NTV2Crosspoint crosspoint); +void SetBackgroundVideoCrosspoint(Ntv2SystemContext* context, NTV2Crosspoint crosspoint); +void SetBackgroundKeyCrosspoint(Ntv2SystemContext* context, NTV2Crosspoint crosspoint); + +#endif diff --git a/build_dependencies/aja/include/ajadriver/ntv2vpid.h b/build_dependencies/aja/include/ajadriver/ntv2vpid.h new file mode 100644 index 0000000..bde48d3 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2vpid.h @@ -0,0 +1,34 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2vpid.h +// Purpose: Common VPID +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2VPID_HEADER +#define NTV2VPID_HEADER + +#include "ntv2system.h" +#include "ntv2vpidfromspec.h" +#include "ntv2xptlookup.h" +#include "ntv2kona.h" + +VPIDChannel GetChannelFrom425XPT(ULWord index); + +bool ReadSDIInVPID(Ntv2SystemContext* context, NTV2Channel channel, ULWord* valueA, ULWord* valueB); + +bool SetSDIOutVPID(Ntv2SystemContext* context, NTV2Channel channel, ULWord valueA, ULWord valueB); + +bool AdjustFor4KDC(Ntv2SystemContext* context, VPIDControl* pControl); + +bool FindVPID(Ntv2SystemContext* context, NTV2OutputXptID startingXpt, VPIDControl* pControl); + +bool SetVPIDOutput(Ntv2SystemContext* context, NTV2Channel channel); + + +#endif + diff --git a/build_dependencies/aja/include/ajadriver/ntv2xpt.h b/build_dependencies/aja/include/ajadriver/ntv2xpt.h new file mode 100644 index 0000000..4b88777 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2xpt.h @@ -0,0 +1,41 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +//////////////////////////////////////////////////////////// +// +// Filename: ntv2xpt.h +// Purpose: Common XPT +// +/////////////////////////////////////////////////////////////// + +#ifndef NTV2XPT_HEADER +#define NTV2XPT_HEADER + +#include "ntv2system.h" +#include "ntv2xptlookup.h" +#include "ntv2kona.h" + + +bool FindSDIOutputSource(Ntv2SystemContext* context, NTV2OutputXptID* source, NTV2Channel channel); +bool FindAnalogOutputSource(Ntv2SystemContext* context, NTV2OutputXptID* source); +bool FindHDMIOutputSource(Ntv2SystemContext* context, NTV2OutputXptID* source, NTV2Channel channel); + +bool FindCrosspointSource(Ntv2SystemContext* context, NTV2OutputXptID* source, NTV2OutputXptID crosspoint); +NTV2XptLookupEntry GetCrosspointIDInput(NTV2OutputXptID crosspointID); + +bool GetXptSDIOutInputSelect(Ntv2SystemContext* context, NTV2Channel channel, NTV2OutputXptID* value); +bool GetXptSDIOutDS2InputSelect(Ntv2SystemContext* context, NTV2Channel channel, NTV2OutputXptID* value); +bool SetXptSDIOutInputSelect(Ntv2SystemContext* context, NTV2Channel channel, NTV2OutputXptID value); +bool GetXptConversionModInputSelect(Ntv2SystemContext* context, NTV2OutputXptID* value); +bool GetXptDuallinkInInputSelect(Ntv2SystemContext* context, NTV2Channel channel, NTV2OutputXptID* value); +bool GetXptAnalogOutInputSelect(Ntv2SystemContext* context, NTV2OutputXptID* value); +bool GetXptFrameBuffer1InputSelect(Ntv2SystemContext* context, NTV2OutputXptID* value); +bool GetXptFrameBuffer2InputSelect(Ntv2SystemContext* context, NTV2OutputXptID* value); +bool GetXptHDMIOutInputSelect(Ntv2SystemContext* context, NTV2OutputXptID* value); +bool GetXptHDMIOutQ2InputSelect(Ntv2SystemContext* context, NTV2OutputXptID* value); +bool GetXptHDMIOutQ3InputSelect(Ntv2SystemContext* context, NTV2OutputXptID* value); +bool GetXptHDMIOutQ4InputSelect(Ntv2SystemContext* context, NTV2OutputXptID* value); +bool GetXptMultiLinkOutInputSelect(Ntv2SystemContext* context, NTV2Channel channel, NTV2OutputXptID* value); + +#endif diff --git a/build_dependencies/aja/include/ajadriver/ntv2xptlookup.h b/build_dependencies/aja/include/ajadriver/ntv2xptlookup.h new file mode 100644 index 0000000..4356540 --- /dev/null +++ b/build_dependencies/aja/include/ajadriver/ntv2xptlookup.h @@ -0,0 +1,77 @@ +/* + * SPDX-License-Identifier: MIT + * Copyright (C) 2004 - 2021 AJA Video Systems, Inc. + */ +#ifndef NTV2_XPT_LOOKUP_H +#define NTV2_XPT_LOOKUP_H + +typedef struct +{ + ULWord registerNumber; + ULWord registerMask; + UByte registerShift; +} NTV2XptLookupEntry; + +#define XPT_SDI_IN_1 (0x0700) +#define XPT_SDI_IN_2 (0x0701) +#define XPT_SDI_IN_3 (0x0702) +#define XPT_SDI_IN_4 (0x0703) +#define XPT_SDI_IN_5 (0x0704) +#define XPT_SDI_IN_6 (0x0705) +#define XPT_SDI_IN_7 (0x0706) +#define XPT_SDI_IN_8 (0x0707) + +#define XPT_SDI_IN_1_DS2 (0x0708) +#define XPT_SDI_IN_2_DS2 (0x0709) +#define XPT_SDI_IN_3_DS2 (0x070A) +#define XPT_SDI_IN_4_DS2 (0x070B) +#define XPT_SDI_IN_5_DS2 (0x070C) +#define XPT_SDI_IN_6_DS2 (0x070D) +#define XPT_SDI_IN_7_DS2 (0x070E) +#define XPT_SDI_IN_8_DS2 (0x070F) + +#define XPT_FB_YUV_1 (0x0600) +#define XPT_FB_YUV_2 (0x0601) +#define XPT_FB_YUV_3 (0x0602) +#define XPT_FB_YUV_4 (0x0603) +#define XPT_FB_YUV_5 (0x0604) +#define XPT_FB_YUV_6 (0x0605) +#define XPT_FB_YUV_7 (0x0606) +#define XPT_FB_YUV_8 (0x0607) + +#define XPT_FB_RGB_1 (0x0608) +#define XPT_FB_RGB_2 (0x0609) +#define XPT_FB_RGB_3 (0x060A) +#define XPT_FB_RGB_4 (0x060B) +#define XPT_FB_RGB_5 (0x060C) +#define XPT_FB_RGB_6 (0x060D) +#define XPT_FB_RGB_7 (0x060E) +#define XPT_FB_RGB_8 (0x060F) + +#define XPT_FB_425_YUV_1 (0x0610) +#define XPT_FB_425_YUV_2 (0x0611) +#define XPT_FB_425_YUV_3 (0x0612) +#define XPT_FB_425_YUV_4 (0x0613) +#define XPT_FB_425_YUV_5 (0x0614) +#define XPT_FB_425_YUV_6 (0x0615) +#define XPT_FB_425_YUV_7 (0x0616) +#define XPT_FB_425_YUV_8 (0x0617) + +#define XPT_FB_425_RGB_1 (0x0618) +#define XPT_FB_425_RGB_2 (0x0619) +#define XPT_FB_425_RGB_3 (0x061A) +#define XPT_FB_425_RGB_4 (0x061B) +#define XPT_FB_425_RGB_5 (0x061C) +#define XPT_FB_425_RGB_6 (0x061D) +#define XPT_FB_425_RGB_7 (0x061E) +#define XPT_FB_425_RGB_8 (0x061F) + +#define XPT_HDMI_IN (0x0500) +#define XPT_HDMI_IN_Q2 (0x0501) +#define XPT_HDMI_IN_Q3 (0x0502) +#define XPT_HDMI_IN_Q4 (0x0503) +#define XPT_ANALOG_IN (0x0400) +#define XPT_4K_DC (0x0300) + +#endif // NTV2_XPT_LOOKUP_H + diff --git a/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata.h b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata.h new file mode 100644 index 0000000..54b3035 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata.h @@ -0,0 +1,1542 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ancillarydata.h + @brief Declares the AJAAncillaryData class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. +**/ + +#ifndef AJA_ANCILLARYDATA_H +#define AJA_ANCILLARYDATA_H + +#include "ajatypes.h" +#include "ntv2enums.h" +#include "ajaexport.h" +#include "ntv2publicinterface.h" +#include "ajabase/common/common.h" +#include +#include + + +// Default Packet IDs used when building "analog" packets +// NOTE: There's NO guarantee that the Anc Extractor hardware will use these codes - nor does the +// Anc Inserter hardware care. To determine if a given packet is "analog" or "digital", check +// the appropriate flag in the packet header. This is just to have all the locally (software) +// built "analog" IDs come from a single location. +const uint8_t AJAAncillaryData_AnalogDID = 0x00; +const uint8_t AJAAncillaryData_AnalogSID = 0x00; + + +typedef std::pair AJAAncillaryDIDSIDPair; ///< @brief A DID/SID pair, typically used as an indexing key. +typedef uint16_t AJAAncPktDIDSID; ///< @brief Packet DID/SID pair: DID (MS 8 bits) and SID (LS 8 bits) +#define ToAJAAncPktDIDSID(_d_,_s_) (uint16_t((_d_) << 8) | uint16_t(_s_)) +#define FromAJAAncPktDIDSID(_k_,_d_,_s_) (_d_) = uint8_t(((_k_) & 0xFF00) >> 8); (_d_) = uint8_t(_k_ & 0x00FF); + +/** + @brief Writes a human-readable rendition of the given AJAAncillaryDIDSIDPair into the given output stream. + @param inOutStream Specifies the output stream to be written. + @param[in] inData Specifies the AJAAncillaryDIDSIDPair to be rendered into the output stream. + @return A non-constant reference to the specified output stream. +**/ +AJAExport std::ostream & operator << (std::ostream & inOutStream, const AJAAncillaryDIDSIDPair & inData); + + +/** + @brief Identifies the ancillary data types that are known to this module. +**/ +enum AJAAncillaryDataType +{ + AJAAncillaryDataType_Unknown, ///< @brief Includes data that is valid, but we don't recognize + + AJAAncillaryDataType_Smpte2016_3, ///< @brief SMPTE 2016-3 VANC Aspect Format Description (AFD) metadata + AJAAncillaryDataType_Timecode_ATC, ///< @brief SMPTE 12-M Ancillary Timecode (formerly known as "RP-188") + AJAAncillaryDataType_Timecode_VITC, ///< @brief SMPTE 12-M Vertical Interval Timecode (aka "VITC") + AJAAncillaryDataType_Cea708, ///< @brief CEA708 (SMPTE 334) HD Closed Captioning + AJAAncillaryDataType_Cea608_Vanc, ///< @brief CEA608 SD Closed Captioning (SMPTE 334 VANC packet) + AJAAncillaryDataType_Cea608_Line21, ///< @brief CEA608 SD Closed Captioning ("Line 21" waveform) + AJAAncillaryDataType_Smpte352, ///< @brief SMPTE 352 "Payload ID" + AJAAncillaryDataType_Smpte2051, ///< @brief SMPTE 2051 "Two Frame Marker" + AJAAncillaryDataType_FrameStatusInfo524D, ///< @brief Frame Status Information, such as Active Frame flag + AJAAncillaryDataType_FrameStatusInfo5251, ///< @brief Frame Status Information, such as Active Frame flag + AJAAncillaryDataType_HDR_SDR, + AJAAncillaryDataType_HDR_HDR10, + AJAAncillaryDataType_HDR_HLG, + AJAAncillaryDataType_Size +}; + +#define IS_VALID_AJAAncillaryDataType(_x_) ((_x_) >= AJAAncillaryDataType_Unknown && (_x_) < AJAAncillaryDataType_Size) +#define IS_KNOWN_AJAAncillaryDataType(_x_) ((_x_) > AJAAncillaryDataType_Unknown && (_x_) < AJAAncillaryDataType_Size) + +/** + @return A string containing a human-readable representation of the given AJAAncillaryDataType value (or empty if not possible). + @param[in] inValue Specifies the AJAAncillaryDataType value to be converted. + @param[in] inCompact If true (the default), returns the compact representation; otherwise use the longer symbolic format. +**/ +AJAExport const std::string & AJAAncillaryDataTypeToString (const AJAAncillaryDataType inValue, const bool inCompact = true); + + + +/** + @brief Identifies which link of a video stream the ancillary data is associated with. +**/ +enum AJAAncillaryDataLink +{ + AJAAncillaryDataLink_A, ///< @brief The ancillary data is associated with Link A of the video stream. + AJAAncillaryDataLink_B, ///< @brief The ancillary data is associated with Link B of the video stream. + AJAAncillaryDataLink_LeftEye = AJAAncillaryDataLink_A, ///< @brief The ancillary data is associated with the Left Eye stereoscopic video stream. + AJAAncillaryDataLink_RightEye = AJAAncillaryDataLink_B, ///< @brief The ancillary data is associated with the Right Eye stereoscopic video stream. + AJAAncillaryDataLink_Unknown, ///< @brief It is not known which link of the video stream the ancillary data is associated with. + AJAAncillaryDataLink_Size +}; + +#define IS_VALID_AJAAncillaryDataLink(_x_) ((_x_) >= AJAAncillaryDataLink_A && (_x_) < AJAAncillaryDataLink_Unknown) + +/** + @return A string containing a human-readable representation of the given AJAAncillaryDataLink value (or empty if not possible). + @param[in] inValue Specifies the AJAAncillaryDataLink value to be converted. + @param[in] inCompact If true (the default), returns the compact representation; otherwise use the longer symbolic format. +**/ +AJAExport const std::string & AJAAncillaryDataLinkToString (const AJAAncillaryDataLink inValue, const bool inCompact = true); + + + +/** + @brief Identifies which data stream the ancillary data is associated with. +**/ +enum AJAAncillaryDataStream +{ + AJAAncillaryDataStream_1, ///< @brief The ancillary data is associated with DS1 of the video stream (Link A). + AJAAncillaryDataStream_2, ///< @brief The ancillary data is associated with DS2 of the video stream (Link A). + AJAAncillaryDataStream_3, ///< @brief The ancillary data is associated with DS3 of the video stream (Link B). + AJAAncillaryDataStream_4, ///< @brief The ancillary data is associated with DS4 of the video stream (Link B). + AJAAncillaryDataStream_Unknown, ///< @brief It is not known which data stream the ancillary data is associated with. + AJAAncillaryDataStream_Size +}; + +#define IS_VALID_AJAAncillaryDataStream(_x_) ((_x_) >= AJAAncillaryDataStream_1 && (_x_) < AJAAncillaryDataStream_Unknown) +#define IS_LINKA_AJAAncillaryDataStream(_x_) ((_x_) == AJAAncillaryDataStream_1) +#define IS_LINKB_AJAAncillaryDataStream(_x_) ((_x_) == AJAAncillaryDataStream_2) + +/** + @return A string containing a human-readable representation of the given AJAAncillaryDataStream value (or empty if not possible). + @param[in] inValue Specifies the AJAAncillaryDataStream value to be converted. + @param[in] inCompact If true (the default), returns the compact representation; otherwise use the longer symbolic format. +**/ +AJAExport const std::string & AJAAncillaryDataStreamToString (const AJAAncillaryDataStream inValue, const bool inCompact = true); + + +/** + @brief Identifies which component of a video stream in which the ancillary data is placed or found. +**/ +enum AJAAncillaryDataChannel +{ + AJAAncillaryDataChannel_C, ///< @brief The ancillary data is associated with the chrominance (C) channel of the video stream. + AJAAncillaryDataChannel_Both = AJAAncillaryDataChannel_C, ///< @brief SD ONLY -- The ancillary data is associated with both the chroma and luma channels. + AJAAncillaryDataChannel_Y, ///< @brief The ancillary data is associated with the luminance (Y) channel of the video stream. + AJAAncillaryDataChannel_Unknown, ///< @brief It is not known which channel of the video stream the ancillary data is associated with. + AJAAncillaryDataChannel_Size +}; +typedef AJAAncillaryDataChannel AJAAncillaryDataVideoStream; + +#define IS_VALID_AJAAncillaryDataChannel(_x_) ((_x_) >= AJAAncillaryDataChannel_C && (_x_) < AJAAncillaryDataChannel_Unknown) +#define IS_VALID_AJAAncillaryDataVideoStream(_x_) (IS_VALID_AJAAncillaryDataChannel(_x_)) +#define AJAAncillaryDataVideoStream_C AJAAncillaryDataChannel_C +#define AJAAncillaryDataVideoStream_Y AJAAncillaryDataChannel_Y +#define AJAAncillaryDataVideoStream_Unknown AJAAncillaryDataChannel_Unknown +#define AJAAncillaryDataVideoStream_Size AJAAncillaryDataChannel_Size + +/** + @return A string containing a human-readable representation of the given AJAAncillaryDataChannel value (or empty if not possible). + @param[in] inValue Specifies the AJAAncillaryDataChannel value to be converted. + @param[in] inCompact If true (the default), returns the compact representation; otherwise use the longer symbolic format. +**/ +AJAExport const std::string & AJAAncillaryDataChannelToString (const AJAAncillaryDataChannel inValue, const bool inCompact = true); +AJAExport inline const std::string & AJAAncillaryDataVideoStreamToString (const AJAAncillaryDataVideoStream inValue, const bool inCompact = true) {return AJAAncillaryDataChannelToString(inValue,inCompact);} + + +/** + @brief Specifies which channel of a video stream in which to look for Anc data. +**/ +enum AncChannelSearchSelect +{ + AncChannelSearch_Y, ///< @brief Only look in luma samples + AncChannelSearch_C, ///< @brief Only look in chroma samples + AncChannelSearch_Both, ///< @brief Look both luma and chroma samples (SD only) + AncChannelSearch_Invalid ///< @brief Invalid +}; + +#define IS_VALID_AncChannelSearchSelect(_x_) ((_x_) >= AncChannelSearch_Y && (_x_) < AncChannelSearch_Invalid) + +/** + @return A string containing a human-readable representation of the given AncChannelSearchSelect value (or empty if not possible). + @param[in] inSelect Specifies the AncChannelSearchSelect value to be converted. + @param[in] inCompact If true (the default), returns the compact representation; otherwise returns the longer symbolic format. +**/ +AJAExport std::string AncChannelSearchSelectToString (const AncChannelSearchSelect inSelect, const bool inCompact = true); + + +/** + @brief Identified the raster section of a video stream that contains the ancillary data. + Deprecated in favor of Horizontal Offset -- ::AJAAncDataHorizOffset_AnyVanc and + ::AJAAncDataHorizOffset_AnyHanc +**/ +enum AJAAncillaryDataSpace +{ + AJAAncillaryDataSpace_VANC, ///< @brief Ancillary data found between SAV and EAV (@see ::AJAAncDataHorizOffset_AnyVanc). + AJAAncillaryDataSpace_HANC, ///< @brief Ancillary data found between EAV and SAV (@see ::AJAAncDataHorizOffset_AnyHanc). + AJAAncillaryDataSpace_Unknown, ///< @brief It's unknown which raster section contains the ancillary data (@see ::AJAAncDataHorizOffset_Unknown). + AJAAncillaryDataSpace_Size +}; + +#define IS_VALID_AJAAncillaryDataSpace(_x_) ((_x_) >= AJAAncillaryDataSpace_VANC && (_x_) < AJAAncillaryDataSpace_Unknown) +#define IS_HANC_AJAAncillaryDataSpace(_x_) ((_x_) == AJAAncillaryDataSpace_HANC) +#define IS_VANC_AJAAncillaryDataSpace(_x_) ((_x_) == AJAAncillaryDataSpace_VANC) + +/** + @return A string containing a human-readable representation of the given AJAAncillaryDataSpace value (or empty if not possible). + @param[in] inValue Specifies the AJAAncillaryDataSpace value to be converted. + @param[in] inCompact If true (the default), returns the compact representation; otherwise use the longer symbolic format. +**/ +AJAExport const std::string & AJAAncillaryDataSpaceToString (const AJAAncillaryDataSpace inValue, const bool inCompact = true); + + +#define AJAAncDataLineNumber_Unknown uint16_t(0x0000) ///< @brief Packet line number is unknown. +#define AJAAncDataLineNumber_DontCare uint16_t(0x07FF) ///< @brief Packet placed/found on any legal line number (in field or frame). +#define AJAAncDataLineNumber_Anywhere (AJAAncDataLineNumber_DontCare) +#define AJAAncDataLineNumber_AnyVanc uint16_t(0x07FE) ///< @brief Packet placed/found on any line past RP168 switch line and before SAV. +#define AJAAncDataLineNumber_Future uint16_t(0x07FD) ///< @brief Line number exceeds 11 bits (future). + +#define IS_UNKNOWN_AJAAncDataLineNumber(_x_) ((_x_) == AJAAncDataLineNumber_Unknown) +#define IS_IRRELEVANT_AJAAncDataLineNumber(_x_) ((_x_) == AJAAncDataLineNumber_DontCare) +#define IS_GOOD_AJAAncDataLineNumber(_x_) ((_x_) > 0 && (_x_) < AJAAncDataLineNumber_DontCare) + +AJAExport std::string AJAAncLineNumberToString (const uint16_t inValue); + +// Special horizOffset values: +#define AJAAncDataHorizOffset_Unknown uint16_t(0x0000) ///< @brief Unknown. +#define AJAAncDataHorizOffset_Anywhere uint16_t(0x0FFF) ///< @brief Unspecified -- Packet placed/found in any legal area of raster line. +#define AJAAncDataHorizOffset_AnyHanc uint16_t(0x0FFE) ///< @brief HANC -- Packet placed/found in any legal area of raster line after EAV. +#define AJAAncDataHorizOffset_AnyVanc uint16_t(0x0FFD) ///< @brief VANC -- Packet placed/found in any legal area of raster line after SAV, but before EAV. +#define AJAAncDataHorizOffset_Future uint16_t(0x0FFC) ///< @brief Offset exceeds 12 bits (future). + +/** + @return A string containing a human-readable representation of the given horizontal offset location value. + @param[in] inValue Specifies the horizontal offset location value to be converted. +**/ +AJAExport std::string AJAAncHorizOffsetToString (const uint16_t inValue); + + +/** + @brief Defines where the ancillary data can be found within a video stream. +**/ +typedef struct AJAAncillaryDataLocation +{ + // Instance Methods + public: + inline AJAAncillaryDataLocation ( const AJAAncillaryDataLink inLink = AJAAncillaryDataLink_Unknown, + const AJAAncillaryDataChannel inChannel = AJAAncillaryDataChannel_Unknown, + const AJAAncillaryDataSpace inIgnored = AJAAncillaryDataSpace_Unknown, + const uint16_t inLineNum = AJAAncDataLineNumber_Unknown, + const uint16_t inHorizOffset = AJAAncDataHorizOffset_Unknown, + const AJAAncillaryDataStream inStream = AJAAncillaryDataStream_1) + { AJA_UNUSED(inIgnored); + SetDataLink(inLink).SetDataChannel(inChannel).SetLineNumber(inLineNum).SetHorizontalOffset(inHorizOffset).SetDataStream(inStream); + } + + inline bool operator == (const AJAAncillaryDataLocation & inRHS) const + { + // Everything must match exactly: + return GetDataLink() == inRHS.GetDataLink() + && GetDataStream() == inRHS.GetDataStream() + && GetDataChannel() == inRHS.GetDataChannel() +// No longer necessary && GetDataSpace() == inRHS.GetDataSpace() + && GetLineNumber() == inRHS.GetLineNumber() + && GetHorizontalOffset() == inRHS.GetHorizontalOffset(); + } + + inline bool operator < (const AJAAncillaryDataLocation & inRHS) const + { + const uint64_t lhs (OrdinalValue()); + const uint64_t rhs (inRHS.OrdinalValue()); + return lhs < rhs; // 64-bit unsigned compare: + } + + inline bool IsValid (void) const + { + return IS_VALID_AJAAncillaryDataLink(link) + && IS_VALID_AJAAncillaryDataStream(stream) + && IS_VALID_AJAAncillaryDataChannel(channel) + && (IS_VALID_AJAAncillaryDataSpace(GetDataSpace()) + || (GetDataSpace() == AJAAncillaryDataSpace_Unknown)); + } + +#if !defined(NTV2_DEPRECATE_15_2) + /** + @deprecated Use the individual SetXXX functions (below) instead. + **/ + inline AJAAncillaryDataLocation & Set ( const AJAAncillaryDataLink inLink, + const AJAAncillaryDataChannel inChannel, + const AJAAncillaryDataSpace inIgnored, + const uint16_t inLineNum, + const uint16_t inHorizOffset = AJAAncDataHorizOffset_Unknown, + const AJAAncillaryDataStream inStream = AJAAncillaryDataStream_1) + { AJA_UNUSED(inIgnored); + link = inLink; + stream = inStream; + channel = inChannel; + lineNum = inLineNum; + horizOffset = inHorizOffset; + return *this; + } +#endif // !defined(NTV2_DEPRECATE_15_2) + + /** + @brief Resets all of my location elements to an unknown, invalid state. + @return A reference to myself. + **/ + inline AJAAncillaryDataLocation & Reset (void) + { + link = AJAAncillaryDataLink_Unknown; + stream = AJAAncillaryDataStream_Unknown; + channel = AJAAncillaryDataChannel_Unknown; + lineNum = AJAAncDataLineNumber_Unknown; + horizOffset = AJAAncDataHorizOffset_Unknown; + return *this; + } + + inline AJAAncillaryDataLink GetDataLink (void) const {return link;} ///< @return My data link. + inline bool IsDataLinkA (void) const {return link == AJAAncillaryDataLink_A;} + inline bool IsDataLinkB (void) const {return link == AJAAncillaryDataLink_B;} + + inline AJAAncillaryDataStream GetDataStream (void) const {return stream;} ///< @return My data stream. + + inline AJAAncillaryDataChannel GetDataChannel (void) const {return channel;} ///< @return My data channel. + inline bool IsLumaChannel (void) const {return channel == AJAAncillaryDataChannel_Y;} + inline bool IsChromaChannel (void) const {return channel == AJAAncillaryDataChannel_C;} + + /** + @return "VANC" if my horizontal offset is "Any VANC", or "HANC" if my H offset is "Any HANC"; + otherwise "UNKNOWN". + @note To be truly accurate, this function would need to know the video standard/geometry + to determine if my line number precedes SAV, and if my horizontal offset is after EAV. + **/ + inline AJAAncillaryDataSpace GetDataSpace (void) const + { + if (horizOffset == AJAAncDataHorizOffset_AnyVanc) + return AJAAncillaryDataSpace_VANC; + if (horizOffset == AJAAncDataHorizOffset_AnyHanc) + return AJAAncillaryDataSpace_HANC; + return AJAAncillaryDataSpace_Unknown; + } + inline bool IsVanc (void) const {return GetDataSpace() == AJAAncillaryDataSpace_VANC;} + inline bool IsHanc (void) const {return GetDataSpace() == AJAAncillaryDataSpace_HANC;} + + inline uint16_t GetLineNumber (void) const {return lineNum;} ///< @return My SMPTE line number. + + /** + @return The 12-bit horizontal offset of the packet. + For HD, this is the number of luma samples (see SMPTE ST274). + For SD, this is the number of Y/C muxed words (see SMPTE ST125). + Can also be one of these predefined values: + - ::AJAAncDataHorizOffset_Anywhere -- i.e., anywhere after SAV. + - ::AJAAncDataHorizOffset_Unknown -- unspecified. + - ::AJAAncDataHorizOffset_AnyHanc -- i.e., any legal area of the raster line after EAV. + - ::AJAAncDataHorizOffset_AnyVanc -- i.e., any legal area of raster line after SAV, but before EAV. + **/ + inline uint16_t GetHorizontalOffset (void) const {return horizOffset & 0x0FFF;} + + /** + @brief Writes a human-readable rendition of me into the given output stream. + @param ostrm Specifies the output stream. + @param[in] inCompact Specify 'true' for compact output; otherwise 'false' for more detail. + @return The given output stream. + **/ + std::ostream & Print (std::ostream & ostrm, const bool inCompact = true) const; + + /** + @brief Sets my data link value to the given value (if valid). + @param[in] inLink Specifies the new data link value to use. Must be valid. + @return A non-const reference to myself. + **/ + inline AJAAncillaryDataLocation & SetDataLink (const AJAAncillaryDataLink inLink) {link = inLink; return *this;} + + /** + @brief Sets my data link value to the given value (if valid). + @param[in] inStream Specifies the new data stream value to use. Must be valid. + @return A non-const reference to myself. + **/ + inline AJAAncillaryDataLocation & SetDataStream (const AJAAncillaryDataStream inStream) {stream = inStream; return *this;} + + /** + @brief Sets my data video stream value to the given value (if valid). + @param[in] inChannel Specifies the new data channel value to use. Must be valid. + @return A non-const reference to myself. + **/ + inline AJAAncillaryDataLocation & SetDataChannel (const AJAAncillaryDataChannel inChannel) {channel = inChannel; return *this;} + inline AJAAncillaryDataLocation & SetDataVideoStream (const AJAAncillaryDataVideoStream inChannel) {return SetDataChannel(inChannel);} + + /** + @brief Sets my data space value to the given value (if valid). + @param[in] inSpace Specifies the new data space value to use. Must be valid. + @return A non-const reference to myself. + **/ + inline AJAAncillaryDataLocation & SetDataSpace (const AJAAncillaryDataSpace inSpace) + { + if (IS_VANC_AJAAncillaryDataSpace(inSpace)) + horizOffset = AJAAncDataHorizOffset_AnyVanc; + else if (IS_HANC_AJAAncillaryDataSpace(inSpace)) + horizOffset = AJAAncDataHorizOffset_AnyHanc; + return *this; + } + + /** + @brief Sets my anc data line number value. + @param[in] inLineNum Specifies the new line number value to use. + Can also be AJAAncDataLineNumber_DontCare. + @return A non-const reference to myself. + **/ + inline AJAAncillaryDataLocation & SetLineNumber (const uint16_t inLineNum) {lineNum = inLineNum; return *this;} + + + /** + @brief Specifies the horizontal packet position in the raster. + @param[in] inHOffset Specifies my new horizontal offset. Only the least-significant 12 bits are used. + - Use AJAAncillaryDataLocation::AJAAncDataHorizOffset_AnyVanc for any legal area of the raster line after SAV. + This will reset my ::AJAAncillaryDataSpace to ::AJAAncillaryDataSpace_VANC. + - Use AJAAncillaryDataLocation::AJAAncDataHorizOffset_AnyHanc for any legal area of the raster line after EAV. + This will reset my ::AJAAncillaryDataSpace to ::AJAAncillaryDataSpace_HANC. + - For HD, this is the number of luma samples (see SMPTE ST274). + - For SD, this is the number of Y/C muxed words (see SMPTE ST125). + - Use AJAAncDataHorizOffset_Unknown for zero -- i.e., immediately after SAV. + @return A non-const reference to myself. + **/ + inline AJAAncillaryDataLocation & SetHorizontalOffset (uint16_t inHOffset) + { inHOffset &= 0x0FFF; + if (inHOffset == AJAAncDataHorizOffset_AnyVanc) + horizOffset = inHOffset; // Force [any] VANC + else if (inHOffset == AJAAncDataHorizOffset_AnyHanc) + horizOffset = inHOffset; // Force [any] HANC + else if (inHOffset == AJAAncDataHorizOffset_Anywhere) + horizOffset = inHOffset; // Anywhere (unknown DataSpace) + else + horizOffset = inHOffset; // Trust the caller; don't mess with existing DataSpace + return *this; + } + +#if defined(_DEBUG) + private: // Ordinarily, this is a private API +#endif // defined(_DEBUG) + /** + @return A 64-bit unsigned ordinal value used for sorting/comparing. + In highest to lowest order of magnitude: + - line number, ascending + - data space, ascending (VANC precedes HANC) + - horizontal offset, ascending + - data channel, ascending (Chroma highest, then Luma, then Unknown lowest) + - data stream, ascending (DS1 highest, then DS2, ... then Unknown lowest) + - data link, ascending (Link "A" highest, then Link "B", then Unknown lowest) + **/ + inline uint64_t OrdinalValue (void) const + { // 64-bit unsigned compare: LLLLLLLLLLLLSSSHHHHHHHHHHHHCCCDDDDDDDKK + const uint64_t hOffset (horizOffset == AJAAncDataHorizOffset_AnyVanc || horizOffset == AJAAncDataHorizOffset_Anywhere ? 0 : horizOffset); + return ((uint64_t(lineNum) << 27) // LLLLLLLLLLLL + | (uint64_t(GetDataSpace()) << 24) // SSS + | (hOffset << 12) // HHHHHHHHHHHH + | (uint64_t(channel) << 9) // CCC + | (uint64_t(stream) << 2) // DDDDDDD + | uint64_t(link)); // KK + } + +#if defined(NTV2_DEPRECATE_15_2) + private: // First proposed to make my member data private in SDK 15.2 +#endif + AJAAncillaryDataLink link; ///< @brief Which data link (A or B)? + AJAAncillaryDataStream stream; ///< @brief Which data stream (DS1, DS2... etc.)? + AJAAncillaryDataChannel channel; ///< @brief Which channel (Y or C)? + uint16_t lineNum; ///< @brief Which SMPTE line number? + uint16_t horizOffset; ///< @brief 12-bit horizontal offset in raster line + +} AJAAncillaryDataLocation, AJAAncDataLoc, *AJAAncillaryDataLocationPtr; + + +/** + @return A string containing a human-readable representation of the given AJAAncillaryDataLocation value (or empty if invalid). + @param[in] inValue Specifies the AJAAncillaryDataLocation to be converted. + @param[in] inCompact If true (the default), returns the compact representation; otherwise use the longer symbolic format. +**/ +AJAExport std::string AJAAncillaryDataLocationToString (const AJAAncillaryDataLocation & inValue, const bool inCompact = true); + + +/** + @brief Writes a human-readable rendition of the given AJAAncillaryDataLocation into the given output stream. + @param inOutStream Specifies the output stream to be written. + @param[in] inData Specifies the AJAAncillaryDataLocation to be rendered into the output stream. + @return A non-constant reference to the specified output stream. +**/ +AJAExport std::ostream & operator << (std::ostream & inOutStream, const AJAAncillaryDataLocation & inData); + + +/** + @brief Identifies the ancillary data coding type: digital or non-digital (analog/raw). +**/ +enum AJAAncillaryDataCoding +{ + AJAAncillaryDataCoding_Digital, ///< @brief The ancillary data is in the form of a SMPTE-291 Ancillary Packet. + AJAAncillaryDataCoding_Raw, ///< @brief The ancillary data is in the form of a digitized waveform (e.g. CEA-608 captions, VITC, etc.). + AJAAncillaryDataCoding_Analog = AJAAncillaryDataCoding_Raw, ///< @deprecated Use AJAAncillaryDataCoding_Raw instead. + AJAAncillaryDataCoding_Unknown, ///< @brief It is not known which coding type the ancillary data is using. + AJAAncillaryDataCoding_Size +}; + +#define IS_VALID_AJAAncillaryDataCoding(_x_) ((_x_) >= AJAAncillaryDataCoding_Digital && (_x_) < AJAAncillaryDataCoding_Size) + +/** + @return A string containing a human-readable representation of the given AJAAncillaryDataLocation value (or empty if invalid). + @param[in] inValue Specifies the AJAAncillaryDataLocation to be converted. + @param[in] inCompact If true (the default), returns the compact representation; otherwise use the longer symbolic format. +**/ +AJAExport const std::string & AJAAncillaryDataCodingToString (const AJAAncillaryDataCoding inValue, const bool inCompact = true); + + +/** + @brief Identifies the type of anc buffer the packet originated from: GUMP, RTP, VANC, or unknown. +**/ +enum AJAAncillaryBufferFormat +{ + AJAAncillaryBufferFormat_Unknown, ///< @brief Unknown or "don't care". + AJAAncillaryBufferFormat_FBVANC, ///< @brief Frame buffer VANC line. + AJAAncillaryBufferFormat_SDI, ///< @brief SDI ("GUMP"). + AJAAncillaryBufferFormat_RTP, ///< @brief RTP/IP. + AJAAncillaryBufferFormat_Invalid, ///< @brief Invalid. + AJAAncillaryBufferFormat_Size = AJAAncillaryBufferFormat_Invalid +}; + +#define IS_VALID_AJAAncillaryBufferFormat(_x_) ((_x_) >= AJAAncillaryBufferFormat_Unknown && (_x_) < AJAAncillaryBufferFormat_Size) +#define IS_KNOWN_AJAAncillaryBufferFormat(_x_) ((_x_) > AJAAncillaryBufferFormat_Unknown && (_x_) < AJAAncillaryBufferFormat_Size) + +/** + @return A string containing a human-readable representation of the given AJAAncillaryBufferFormat value (or empty if invalid). + @param[in] inValue Specifies the AJAAncillaryBufferFormat to be converted. + @param[in] inCompact If true (the default), returns the compact representation; otherwise use the longer symbolic format. +**/ +AJAExport const std::string & AJAAncillaryBufferFormatToString (const AJAAncillaryBufferFormat inValue, const bool inCompact = true); + + +/** + @brief I am the principal class that stores a single SMPTE-291 SDI ancillary data packet OR the + digitized contents of one "analog" raster line (e.g. line 21 captions or VITC). Since I'm + payload-agnostic, I serve as the generic base class for more specific objects that know + how to decode/parse specific types of ancillary data. + + @details My AJAAncillaryData::m_payload member stores the User Data Words (UDWs) as an ordered collection of 8-bit data bytes. + Because it's an STL vector, it knows how many UDW elements it contains. Thus, it stores the SMPTE "DC" + (data count) value. + + I also have several member variables for metadata -- i.e., information about the packet -- including + my data ID (DID), secondary data ID (SDID), checksum (CS), location in the video stream, etc. + + Transmit -- Packet Creation + - Use AJAAncillaryDataFactory::Create to instantiate a specific type of data packet. + - Or to "Manually" create a packet: + @code{.cpp} + const string myPacketData ("This is a test"); + AJAAncillaryData packet; // Defaults to AJAAncillaryDataCoding_Digital, AJAAncillaryDataLink_A, AJAAncillaryDataStream_1, AJAAncillaryDataVideoStream_Y, AJAAncillaryDataSpace_VANC + packet.SetDID(0xAA); packet.SetSID(0xBB); // Set the DID & SDID + packet.SetLocationLineNumber(10); // Set the SMPTE line number you want the packet inserted at + packet.SetPayloadData(myPacketData.c_str(), myPacketData.length()); // Copy in the packet data + @endcode + - For newer devices with Anc inserters, call AJAAncillaryData::GenerateTransmitData to fill the Anc buffer + used in the AUTOCIRCULATE_TRANSFER::SetAncBuffers call (see \ref ancgumpformat). + - For multiple packets, put each AJAAncillaryData instance into an AJAAncillaryList. + + Receive -- Packet Detection + - Use AJAAncillaryDataFactory::GuessAncillaryDataType to detect the Anc packet type. + + @warning Not thread-safe! When any of my non-const methods are called by one thread, do not call any of my + methods from any other thread. +**/ +class AJAExport AJAAncillaryData +{ +public: + /** + @name Construction, Destruction, Copying + **/ + ///@{ + + AJAAncillaryData (); ///< @brief My default constructor. + + /** + @brief My copy constructor (from reference). + @param[in] inClone The AJAAncillaryData object to be cloned. + **/ + AJAAncillaryData (const AJAAncillaryData & inClone); + + /** + @brief My copy constructor (from pointer). + @param[in] pInClone A valid pointer to the AJAAncillaryData object to be cloned. + **/ + AJAAncillaryData (const AJAAncillaryData * pInClone); + + virtual ~AJAAncillaryData (); ///< @brief My destructor. + virtual void Clear (void); ///< @brief Frees my allocated memory, if any, and resets my members to their default values. + virtual AJAAncillaryData * Clone (void) const; ///< @return A clone of myself. + ///@} + + + /** + @name Inquiry + **/ + ///@{ + + virtual inline uint8_t GetDID (void) const {return m_DID;} ///< @return My Data ID (DID). + virtual inline uint8_t GetSID (void) const {return m_SID;} ///< @return My secondary data ID (SID). + virtual inline uint32_t GetDC (void) const {return uint32_t(m_payload.size());} ///< @return My payload data count, in bytes. + virtual inline AJAAncillaryDIDSIDPair GetDIDSIDPair (void) const {return AJAAncillaryDIDSIDPair(GetDID(),GetSID());} ///< @return My DID & SID as an AJAAncillaryDIDSIDPair. + virtual inline AJAAncPktDIDSID GetDIDSID (void) const {return ToAJAAncPktDIDSID(GetDID(),GetSID());} ///< @return My DID & SID as an AJAAncPktDIDSID. + virtual inline size_t GetPayloadByteCount (void) const {return size_t(GetDC());} ///< @return My current payload byte count. + virtual AJAAncillaryDataType GetAncillaryDataType (void) const {return m_ancType;} ///< @return My anc data type (if known). + virtual inline uint32_t GetFrameID (void) const {return m_frameID;} ///< @return My frame identifier (if known). + + virtual inline const AJAAncillaryDataLocation & GetDataLocation (void) const {return m_location;} ///< @brief My ancillary data "location" within the video stream. + virtual inline AJAAncillaryDataCoding GetDataCoding (void) const {return m_coding;} ///< @return The ancillary data coding type (e.g., digital or analog/raw waveform). + virtual inline AJAAncillaryBufferFormat GetBufferFormat (void) const {return m_bufferFmt;} ///< @return The ancillary buffer format (e.g., SDI/GUMP, RTP or Unknown). + virtual uint8_t GetChecksum (void) const {return m_checksum;} ///< @return My 8-bit checksum. + + virtual inline AJAAncillaryDataLink GetLocationVideoLink (void) const {return GetDataLocation().GetDataLink();} ///< @return My current anc data video link value (A or B). + virtual inline AJAAncillaryDataStream GetLocationDataStream (void) const {return GetDataLocation().GetDataStream();} ///< @return My current anc data location's data stream (DS1,DS2...). + virtual inline AJAAncillaryDataChannel GetLocationDataChannel (void) const {return GetDataLocation().GetDataChannel();} ///< @return My current anc data location's video stream (Y or C). + virtual inline AJAAncillaryDataSpace GetLocationVideoSpace (void) const {return GetDataLocation().GetDataSpace();} ///< @return My current ancillary data space (HANC or VANC). + virtual inline uint16_t GetLocationLineNumber (void) const {return GetDataLocation().GetLineNumber();} ///< @return My current frame line number value (SMPTE line numbering). + virtual inline uint16_t GetLocationHorizOffset (void) const {return GetDataLocation().GetHorizontalOffset();} ///< @return My current horizontal offset value. + virtual uint16_t GetStreamInfo (void) const; ///< @return My 7-bit stream info (if relevant) + virtual inline const uint64_t & UserData (void) const {return m_userData;} ///< @return My user data (if any). + + /** + @return True if I have valid DataLink/DataStream stream information (rather than unknown). + **/ + virtual inline bool HasStreamInfo (void) const {return IS_VALID_AJAAncillaryDataLink(GetLocationVideoLink()) && IS_VALID_AJAAncillaryDataStream(GetLocationDataStream());} + virtual inline bool IsEmpty (void) const {return GetDC() == 0;} ///< @return True if I have an empty payload. + virtual inline bool IsLumaChannel (void) const {return GetDataLocation().IsLumaChannel ();} ///< @return True if my location component stream is Y (luma). + virtual inline bool IsChromaChannel (void) const {return GetDataLocation().IsChromaChannel ();} ///< @return True if my location component stream is C (chroma). + virtual inline bool IsVanc (void) const {return GetDataLocation().IsVanc ();} ///< @return True if my location data space is VANC. + virtual inline bool IsHanc (void) const {return GetDataLocation().IsHanc ();} ///< @return True if my location data space is HANC. + virtual inline bool IsDigital (void) const {return GetDataCoding() == AJAAncillaryDataCoding_Digital;} ///< @return True if my coding type is digital. + virtual inline bool IsRaw (void) const {return GetDataCoding() == AJAAncillaryDataCoding_Raw;} ///< @return True if my coding type is "raw" (i.e., from an digitized waveform). + + /** + @brief Generates an 8-bit checksum from the DID + SID + DC + payload data. + @note This is NOT the same as the official SMPTE-291 checksum, which is 9 bits wide and should be calculated by the hardware embedder. + @note The calculated checksum is NOT stored in my m_checksum member variable. Call SetChecksum to store it. + @return The calculated 8-bit checksum. + **/ + virtual uint8_t Calculate8BitChecksum (void) const; + + /** + @brief Generates the official SMPTE 291 9-bit checksum from the DID + SID + DC + payload data. + @note This class is only applicable to 8-bit ancillary data applications. + @return The calculated 9-bit checksum. + **/ + virtual uint16_t Calculate9BitChecksum (void) const; + + /** + @brief Compares the received 8-bit checksum with a newly calculated 8-bit checksum. Returns 'true' if they match. + @note This is NOT the same as the official SMPTE-291 checksum, which is 9 bits wide and should be calculated by the hardware. + @return True if the calculated checksum matches received checksum; otherwise false. + **/ + virtual bool ChecksumOK (void) const {return m_checksum == Calculate8BitChecksum ();} + + virtual AJAAncillaryData & operator = (const AJAAncillaryData & inRHS); + + /** + @param[in] inRHS The packet I am to be compared with. + @return True if I'm identical to the RHS packet. + **/ + virtual bool operator == (const AJAAncillaryData & inRHS) const; + + /** + @param[in] inRHS The packet I am to be compared with. + @return True if I differ from the RHS packet. + **/ + virtual inline bool operator != (const AJAAncillaryData & inRHS) const {return !(*this == inRHS);} + + /** + @brief Compares me with another packet. + @param[in] inRHS The packet I am to be compared with. + @param[in] inIgnoreLocation If true, don't compare each packet's AJAAncillaryDataLocation info. Defaults to true. + @param[in] inIgnoreChecksum If true, don't compare each packet's checksums. Defaults to true. + @return AJA_STATUS_SUCCESS if equal; otherwise AJA_STATUS_FAIL. + **/ + virtual AJAStatus Compare (const AJAAncillaryData & inRHS, const bool inIgnoreLocation = true, const bool inIgnoreChecksum = true) const; + + +#if !defined(NTV2_DEPRECATE_15_2) + virtual inline AJAStatus GetDataLocation (AJAAncillaryDataLocation & outLocInfo) const ///< @deprecated Use the inline version instead. + {outLocInfo = GetDataLocation(); return AJA_STATUS_SUCCESS;} + virtual AJAStatus GetDataLocation (AJAAncillaryDataLink & outLink, + AJAAncillaryDataVideoStream & outChannel, + AJAAncillaryDataSpace & outAncSpace, + uint16_t & outLineNum); ///< @deprecated Use the inline GetDataLocation() instead. + virtual inline AJAAncillaryDataVideoStream GetLocationVideoStream (void) const {return m_location.GetDataChannel();} ///< @deprecated Use GetLocationDataChannel instead. + virtual inline bool IsAnalog (void) const {return GetDataCoding() == AJAAncillaryDataCoding_Raw;} ///< @deprecated Use IsRaw instead. +#endif // !defined(NTV2_DEPRECATE_15_2) + ///@} + + + /** + @name Modification + **/ + ///@{ + + /** + @brief Sets my Data ID (DID). + @param[in] inDataID Specifies my new Data ID (for digital ancillary data, usually the "official" SMPTE packet ID). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetDID (const uint8_t inDataID); + + /** + @brief Sets my Secondary Data ID (SID) - (aka the Data Block Number (DBN) for "Type 1" SMPTE-291 packets). + @param[in] inSID Specifies my new secondary Data ID. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetSID (const uint8_t inSID); + + /** + @brief Sets both my Data ID (DID) and Secondary Data ID (SID). + @param[in] inDIDSID The AJAAncillaryDIDSIDPair that specifies both a DID and SID value. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual inline AJAStatus SetDIDSID (const AJAAncillaryDIDSIDPair & inDIDSID) {SetDID(inDIDSID.first); return SetSID(inDIDSID.second);} // New in SDK 16.0 + + /** + @brief Sets my 8-bit checksum. Note that it is not usually necessary to generate an 8-bit checksum, since the ANC Insertion + hardware ignores this field and (for SMPTE-291 Anc packets) generates and inserts its own "proper" 9-bit SMPTE-291 checksum. + @param[in] inChecksum8 Specifies the new 8-bit checksum. + @param[in] inValidate If 'true', fails the function if the given checksum doesn't match the result + of the AJAAncillaryData::Calculate8BitChecksum function. + If 'false', does not validate the given checksum. Defaults to 'false'. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetChecksum (const uint8_t inChecksum8, const bool inValidate = false); + + /** + @brief Sets my ancillary data "location" within the video stream. + @param[in] inLoc Specifies the new AJAAncillaryDataLocation value. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetDataLocation (const AJAAncillaryDataLocation & inLoc); + +#if !defined(NTV2_DEPRECATE_15_2) + /** + @brief Sets my ancillary data "location" within the video stream. + @param[in] inLink Specifies the video link (A or B). + @param[in] inChannel Specifies the video channel (Y or C or SD/both). + @param[in] inAncSpace Specifies the ancillary data space (HANC or VANC). + @param[in] inLineNum Specifies the frame line number (SMPTE line numbering). + @param[in] inStream Optionally specifies the data stream (DS1 or DS2 for link A, or DS3 or DS4 for link B). Defaults to DS1. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetDataLocation ( const AJAAncillaryDataLink inLink, + const AJAAncillaryDataChannel inChannel, + const AJAAncillaryDataSpace inAncSpace, + const uint16_t inLineNum, + const AJAAncillaryDataStream inStream = AJAAncillaryDataStream_1); +#endif // !defined(NTV2_DEPRECATE_15_2) + + /** + @brief Sets my ancillary data "location" within the video stream. + @param[in] inLink Specifies the new video link value (A or B). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetLocationVideoLink (const AJAAncillaryDataLink inLink); + + /** + @brief Sets my ancillary data "location" data stream value (DS1,DS2...). + @param[in] inStream Specifies my new data stream (DS1,DS2...) value. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetLocationDataStream (const AJAAncillaryDataStream inStream); + + /** + @brief Sets my ancillary data "location" data channel value (Y or C). + @param[in] inChannel Specifies my new data channel (Y or C) value. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetLocationDataChannel (const AJAAncillaryDataChannel inChannel); + +#if !defined(NTV2_DEPRECATE_15_2) + virtual AJAStatus SetLocationVideoSpace (const AJAAncillaryDataSpace inAncSpace); ///< @deprecated Call SetLocationHorizOffset instead. +#endif // NTV2_DEPRECATE_15_2 + + /** + @brief Sets my ancillary data "location" frame line number. + @param[in] inLineNum Specifies the new frame line number value (SMPTE line numbering). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetLocationLineNumber (const uint16_t inLineNum); + + /** + @brief Sets my ancillary data "location" horizontal offset. + @param[in] inOffset Specifies the new horizontal offset value. \sa AJAAncillaryDataLocation::SetHorizontalOffset. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetLocationHorizOffset (const uint16_t inOffset); + + /** + @brief Sets my ancillary data coding type (e.g. digital or analog/raw waveform). + @param[in] inCodingType AJAAncillaryDataCoding + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetDataCoding (const AJAAncillaryDataCoding inCodingType); + + /** + @brief Sets my originating frame identifier. + @param[in] inFrameID Specifies my new frame identifier. + @return A non-constant reference to myself. + **/ + virtual inline AJAAncillaryData & SetFrameID (const uint32_t inFrameID) {m_frameID = inFrameID; return *this;} + + /** + @brief Sets my originating buffer format. + @param[in] inFmt Specifies my new buffer format. + @return A non-constant reference to myself. + **/ + virtual inline AJAAncillaryData & SetBufferFormat (const AJAAncillaryBufferFormat inFmt) {m_bufferFmt = inFmt; return *this;} + + virtual inline uint64_t & UserData (void) {return m_userData;} ///< @return Returns a non-constant reference to my user data. (New in SDK 16.0) + +#if !defined(NTV2_DEPRECATE_14_2) + /** + @deprecated Use SetLocationDataChannel function instead. + **/ + virtual inline NTV2_DEPRECATED_f(AJAStatus SetLocationVideoStream (const AJAAncillaryDataVideoStream inChannel)) + {return SetLocationDataChannel(inChannel);} +#endif // !defined(NTV2_DEPRECATE_14_2) + ///@} + + + /** + @name Payload Data Access + **/ + ///@{ + + /** + @param[in] inIndex0 Specifies the zero-based index value. This should be less than GetDC's result. + @return The payload data byte at the given zero-based index (or zero if the index value is invalid). + **/ + virtual uint8_t GetPayloadByteAtIndex (const uint32_t inIndex0) const; + + /** + @return A const pointer to my payload buffer. + **/ + virtual inline const uint8_t * GetPayloadData (void) const {return m_payload.empty() ? NULL : &(m_payload[0]);} + + /** + @brief Copies my payload data into an external buffer. + @param[in] pBuffer Specifies a valid, non-null starting address to where the payload data is to be copied. + @param[in] inByteCapacity Specifies the maximum number of bytes that can be safely copied into the external buffer. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GetPayloadData (uint8_t * pBuffer, const uint32_t inByteCapacity) const; + + /** + @brief Appends my payload data onto the given UDW vector as 10-bit User Data Words (UDWs), adding parity as needed. + @param[out] outUDWs The 10-bit UDW vector to be appended to. + @param[in] inAddParity If true, each UDW will have even parity added. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GetPayloadData (UWordSequence & outUDWs, const bool inAddParity = true) const; + ///@} + + + /** + @name Payload Data Modification + **/ + ///@{ + + /** + @param[in] inDataByte Specifies the data byte to be stored in my payload buffer. + @param[in] inIndex0 Specifies the zero-based index value. This should be less than GetDC's result. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetPayloadByteAtIndex (const uint8_t inDataByte, const uint32_t inIndex0); + + /** + @brief Copy data from external memory into my local payload memory. + @param[in] pInData Specifies the address of the first byte of the external payload data to be copied (source). + @param[in] inByteCount Specifies the number of bytes of payload data to be copied. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetPayloadData (const uint8_t * pInData, const uint32_t inByteCount); + + /** + @brief Appends data from an external buffer onto the end of my existing payload. + @param[in] pInBuffer Specifies a valid, non-NULL starting address of the external buffer from which the payload data will be copied. + @param[in] inByteCount Specifies the number of bytes to append. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus AppendPayloadData (const uint8_t * pInBuffer, const uint32_t inByteCount); + + /** + @brief Appends payload data from another AJAAncillaryData object to my existing payload. + @param[in] inAncData The AJAAncillaryData object whose payload data is to be appended to my own. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus AppendPayload (const AJAAncillaryData & inAncData); + + /** + @deprecated Use AppendPayload(const AJAAncillaryData &) instead. + **/ + virtual inline NTV2_DEPRECATED_f(AJAStatus AppendPayload (const AJAAncillaryData * pInAncData)) {return pInAncData ? AppendPayload (*pInAncData) : AJA_STATUS_NULL;} + + /** + @brief Copies payload data from an external 16-bit source into local payload memory. + @param[in] pInData A valid, non-NULL pointer to the external payload data to be copied (source). + The upper 8 bits of each 16-bit word will be skipped and ignored. + @param[in] inNumWords Specifies the number of 16-bit words of payload data to copy. + @param[in] inLocInfo Specifies the anc data location information. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetFromSMPTE334 (const uint16_t * pInData, const uint32_t inNumWords, const AJAAncillaryDataLocation & inLocInfo); + + /** + @brief Parses (interprets) the "local" ancillary data from my payload data. + @note This method is overridden by specific packet types (e.g. AJAAncillaryData_Cea608_Vanc). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus ParsePayloadData (void); + + /** + @return True if I think I have valid ancillary data; otherwise false. + @details This result will only be trustworthy if I'm an AJAAncillaryData subclass (e.g. AJAAncillaryData_Cea708), + and my ParsePayloadData method was previously called, to determine whether or not my packet + data is legit or not. Typically, AJAAncillaryDataFactory::GuessAncillaryDataType is called + to ascertain a packet's AJAAncillaryDataType, then AJAAncillaryDataFactory::Create is used + to instantiate the specific AJAAncillaryData subclass instance. This is done automatically + by AJAAncillaryList::AddReceivedAncillaryData. + **/ + virtual inline bool GotValidReceiveData (void) const {return m_rcvDataValid;} + + /** + @brief Generates the payload data from the "local" ancillary data. + @note This abstract method is overridden for specific Anc data types. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual inline AJAStatus GeneratePayloadData (void) {return AJA_STATUS_SUCCESS;} + ///@} + + + /** + @name Receive From AJA Hardware + **/ + ///@{ + + /** + @brief Initializes me from "raw" ancillary data received from hardware (ingest) -- see \ref ancgumpformat. + @param[in] pInData Specifies the starting address of the "raw" packet data that was received from the AJA device. + @param[in] inMaxBytes Specifies the maximum number of bytes left in the source buffer. + @param[in] inLocationInfo Specifies the default location info. + @param[out] outPacketByteCount Receives the size (in bytes) of the parsed packet. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus InitWithReceivedData ( const uint8_t * pInData, + const size_t inMaxBytes, + const AJAAncillaryDataLocation & inLocationInfo, + uint32_t & outPacketByteCount); + /** + @brief Initializes me from "raw" ancillary data received from hardware (ingest) -- see \ref ancgumpformat. + @param[in] inData Specifies the "raw" packet data. + @param[in] inLocationInfo Specifies the default location info. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus InitWithReceivedData ( const std::vector & inData, + const AJAAncillaryDataLocation & inLocationInfo); + + /** + @brief Initializes me from the given 32-bit IP packet words received from hardware (ingest). + @param[in] inData Specifies the "raw" packet data (in network byte order). + @param inOutStartIndex On entry, specifies the zero-based starting index number of the first + 32-bit word associated with this Ancillary data packet. + On exit, if successful, receives the zero-based starting index number + of the first 32-bit word associated with the NEXT packet that may be + in the vector. + @param[in] inIgnoreChecksum If true, ignores checksum failures. Defaults to false (don't ignore). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus InitWithReceivedData (const ULWordSequence & inData, uint16_t & inOutStartIndex, const bool inIgnoreChecksum = false); + ///@} + + + /** + @name Transmit To AJA Hardware + **/ + ///@{ + + /** + @brief Returns the number of "raw" ancillary data bytes that will be generated by AJAAncillaryData::GenerateTransmitData + (for playback mode). + @param[out] outPacketSize Receives the size (in bytes) of the packet I will generate. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GetRawPacketSize (uint32_t & outPacketSize) const; + + /** + @brief Generates "raw" ancillary data from my internal ancillary data (playback) -- see \ref ancgumpformat. + @param pBuffer Pointer to "raw" packet data buffer to be filled. + @param[in] inMaxBytes Maximum number of bytes left in the given data buffer. + @param[out] outPacketSize Receives the size, in bytes, of the generated packet. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GenerateTransmitData (uint8_t * pBuffer, const size_t inMaxBytes, uint32_t & outPacketSize); + + /** + @brief Generates "raw" 10-bit ancillary packet component data from my internal ancillary data (playback). + @param outData Specifies the vector to which data will be appended. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GenerateTransmitData (UWordSequence & outData); + + /** + @brief Generates the 32-bit IP packet words necessary for constructing an outgoing IP/RTP stream. + @param outData Specifies the vector into which data will be appended. + The data will be in network byte order (big-endian). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GenerateTransmitData (ULWordSequence & outData); + ///@} + + + /** + @name Printing & Debugging + **/ + ///@{ + + /** + @brief Streams a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream. + @param[in] inDetailed Specify 'true' for a detailed representation; otherwise use 'false' for a brief one. + @return The given output stream. + **/ + virtual std::ostream & Print (std::ostream & inOutStream, const bool inDetailed = false) const; + + /** + @brief Dumps a human-readable representation of my payload bytes into the given output stream. + @return The given output stream. + **/ + virtual std::ostream & DumpPayload (std::ostream & inOutStream) const; + + /** + @brief Compares me with another packet and returns a string that describes what's different. + @param[in] inRHS The packet I am to be compared with. + @param[in] inIgnoreLocation If true, don't compare each packet's AJAAncillaryDataLocation info. Defaults to true. + @param[in] inIgnoreChecksum If true, don't compare each packet's checksums. Defaults to true. + @return Empty string if equal; otherwise a string that contains the differences. + **/ + virtual std::string CompareWithInfo (const AJAAncillaryData & inRHS, const bool inIgnoreLocation = true, const bool inIgnoreChecksum = true) const; + + virtual inline std::string IDAsString (void) const {return DIDSIDToString (GetDID(), GetSID());} ///< @return A string representing my DID/SID. + + /** + @return Converts me into a compact, human-readable string. + @param[in] inDumpMaxBytes Number of payload bytes to dump into the returned string. Defaults to zero (none). + **/ + virtual std::string AsString (const uint16_t inDumpMaxBytes = 0) const; + + + /** + @return A string containing a human-readable representation of the given DID/SDID values, + or empty for invalid or unknown values. + @param[in] inDID Specifies the Data ID value. + @param[in] inSDID Specifies the Secondary Data ID value. + **/ + static std::string DIDSIDToString (const uint8_t inDID, const uint8_t inSDID); + ///@} + + /** + @return The given data byte in bits 7:0, plus even parity in bit 8 and ~bit 8 in bit 9. + @param[in] inDataByte The given data byte to have parity added to it. + **/ + static uint16_t AddEvenParity (const uint8_t inDataByte); + + + typedef UWordSequence U16Packet; ///< @brief An ordered sequence of 10-bit packet words stored in uint16_t values. + typedef std::vector U16Packets; ///< @brief An ordered sequence of zero or more U16Packet values. + + /** + @brief Extracts whatever VANC packets are found inside the given 16-bit YUV line buffer. + @param[in] inYUV16Line Specifies the uint16_t sequence containing the 10-bit YUV VANC line data components. + (Use ::UnpackLine_10BitYUVtoUWordSequence to convert a VANC line from an NTV2_FBF_10BIT_YCBCR + frame buffer into this format. Use UnpackLine_8BitYUVtoU16s to convert a VANC line from an + ::NTV2_FBF_8BIT_YCBCR frame buffer into this format.) + @param[in] inChanSelect Specifies the ancillary data channel to search. Use AncChannelSearch_Y for luma, AncChannelSearch_C + for chroma, or AncChannelSearch_Both for both (SD only). + @param[out] outRawPackets Receives the packet vector, which will contain one vector of uint16_t values per extracted packet. + Each packet in the returned list will start with the 0x000/0x3FF/0x3FF/DID/SDID/DC + sequence, followed by each 10-bit packet data word, and ending with the checksum word. + @param[out] outWordOffsets Receives the horizontal word offsets into the line, one for each packet found. + This should have the same number of elements as "outRawPackets". + These offsets can also be used to discern which channel each packet originated in (Y or C). + @return True if successful; false if failed. + @note This function will not finish parsing the line once a parity, checksum, or overrun error is discovered in the line. + **/ + static bool GetAncPacketsFromVANCLine (const UWordSequence & inYUV16Line, + const AncChannelSearchSelect inChanSelect, + U16Packets & outRawPackets, + U16Packet & outWordOffsets); + /** + @brief Converts a single line of ::NTV2_FBF_8BIT_YCBCR data from the given source buffer into an ordered sequence of uint16_t + values that contain the resulting 10-bit even-parity data. + @param[in] pInYUV8Line A valid, non-NULL pointer to the start of the VANC line in an ::NTV2_FBF_8BIT_YCBCR video buffer. + @param[out] outU16YUVLine Receives the converted 10-bit-per-component values as an ordered sequence of uint16_t values, + which will include even parity and valid checksums. + @param[in] inNumPixels Specifies the length of the line to be converted, in pixels. + @return True if successful; otherwise false. + @note If SMPTE ancillary data is detected in the video, this routine "intelligently" stretches it by copying the 8-bits to + the LS 8-bits of the 10-bit output, recalculating parity and checksums as needed. (This emulates what NTV2 device + firmware does during playout of ::NTV2_FBF_8BIT_YCBCR frame buffers with ::NTV2_VANCDATA_8BITSHIFT_ENABLE.) + @note NTV2 firmware is expected to start the first anc packet at the first pixel position in the VANC line, and place + subsequent packets, if any, in immediate succession, without any gaps. Therefore, a line that does not start with + the 0x00/0xFF/0xFF packet header is assumed to not contain any packets. This saves a substantial amount of CPU time. + **/ + static bool Unpack8BitYCbCrToU16sVANCLine (const void * pInYUV8Line, + U16Packet & outU16YUVLine, + const uint32_t inNumPixels); + + protected: + typedef std::vector ByteVector; + typedef ByteVector::size_type ByteVectorIndex; + typedef ByteVector::const_iterator ByteVectorConstIter; + + void Init (void); // NOT virtual - called by constructors + + AJAStatus AllocDataMemory (const uint32_t inNumBytes); + AJAStatus FreeDataMemory (void); + + static inline uint8_t GetGUMPHeaderByte1 (void) {return 0xFF;} + virtual uint8_t GetGUMPHeaderByte2 (void) const; + virtual inline uint8_t GetGUMPHeaderByte3 (void) const {return GetLocationLineNumber() & 0x7F;} // ls 7 bits [6:0] of line num + + // Instance Data + protected: + uint8_t m_DID; ///< @brief Official SMPTE ancillary packet ID (w/o parity) + uint8_t m_SID; ///< @brief Official SMPTE secondary ID (or DBN - w/o parity) + uint8_t m_checksum; ///< @brief My 8-bit checksum: DID + SID + DC + payload (w/o parity) [note: NOT the same as the 9-bit checksum in a SMPTE-291 packet!] + AJAAncillaryDataLocation m_location; ///< @brief Location of the ancillary data in the video stream (Y or C, HANC or VANC, etc.) + AJAAncillaryDataCoding m_coding; ///< @brief Analog or digital data + ByteVector m_payload; ///< @brief My payload data (DC = size) + bool m_rcvDataValid; ///< @brief This is set true (or not) by ParsePayloadData() + AJAAncillaryDataType m_ancType; ///< @brief One of a known set of ancillary data types (or "Custom" if not identified) + AJAAncillaryBufferFormat m_bufferFmt; ///< @brief My originating buffer format, if known + uint32_t m_frameID; ///< @brief ID of my originating frame, if known + uint64_t m_userData; ///< @brief User data (for client use) + +}; // AJAAncillaryData + + +/** + @brief Writes a human-readable rendition of the given AJAAncillaryData into the given output stream. + @param inOutStream Specifies the output stream to be written. + @param[in] inAncData Specifies the AJAAncillaryData to be rendered into the output stream. + @return A non-constant reference to the specified output stream. +**/ +static inline std::ostream & operator << (std::ostream & inOutStream, const AJAAncillaryData & inAncData) {return inAncData.Print(inOutStream);} + + +/** + @brief I represent the header of a SMPTE 2110 compliant RTP Anc network packet. +**/ +class AJAExport AJARTPAncPayloadHeader +{ + public: // CLASS METHODS + /** + @name Construction & Destruction + **/ + ///@{ + /** + @return True if the given buffer starts with an RTP packet header. + @param[in] inBuffer Specifies the buffer to inspect. + **/ + static bool BufferStartsWithRTPHeader (const NTV2_POINTER & inBuffer); + + static inline size_t GetHeaderWordCount (void) {return 5;} ///< @return The number of U32s in an RTP header. + static inline size_t GetHeaderByteCount (void) {return GetHeaderWordCount() * sizeof(uint32_t);} ///< @return The number of bytes in an RTP header. + + /** + @return A string containing a human-readable description of the given Field Bits value. + @param[in] inFBits Specifies the Field Bits of interest. + **/ + static const std::string & FieldSignalToString (const uint8_t inFBits); + ///@} + + + public: // INSTANCE METHODS + AJARTPAncPayloadHeader (); ///< @brief My default constructor + virtual inline ~AJARTPAncPayloadHeader () {} ///< @brief My destructor + + /** + @name Inquiry Methods + **/ + ///@{ + virtual bool IsNULL (void) const; ///< @return True if all of my fields are currently zero or false. + virtual bool IsValid (void) const; ///< @return True if I'm considered "valid" in my current state. + virtual inline bool IsEndOfFieldOrFrame (void) const {return mMarkerBit;} ///< @return True if my Marker Bit value is non-zero; otherwise false. + virtual inline uint8_t GetPayloadType (void) const {return mPayloadType;} ///< @return The Payload Type value. + virtual inline uint32_t GetSequenceNumber (void) const {return mSequenceNumber;} ///< @return The 32-bit Sequence Number value (in native host byte order). + virtual inline uint32_t GetTimeStamp (void) const {return mTimeStamp;} ///< @return The 32-bit RTP Time Stamp value (in native host byte order). + virtual inline uint32_t GetSyncSourceID (void) const {return mSyncSourceID;} ///< @return The Sync Source ID (SSID) value (in native host byte order). + virtual inline uint16_t GetPayloadLength (void) const {return mPayloadLength;} ///< @return The RTP packet payload length, in bytes (native host byte order). + virtual inline uint8_t GetAncPacketCount (void) const {return mAncCount;} ///< @return The number of SMPTE 291 Anc packets in this RTP packet payload. + virtual inline uint8_t GetFieldSignal (void) const {return mFieldSignal & 3;} ///< @return The 3-bit Field Bits value. + virtual inline bool IsProgressive (void) const {return mFieldSignal == 0;} ///< @return True if my Field Bits indicate Progressive video. + virtual inline bool NoFieldSpecified (void) const {return IsProgressive();} ///< @return True if my Field Bits indicate No Field Specified. + virtual inline bool IsField1 (void) const {return mFieldSignal == 2;} ///< @return True if my Field Bits indicate Field1. + virtual inline bool IsField2 (void) const {return mFieldSignal == 3;} ///< @return True if my Field Bits indicate Field2. + virtual inline bool IsValidFieldSignal (void) const {return mFieldSignal != 1;} ///< @return True if my Field Bits are valid. (New in SDK 16.0) + virtual inline bool HasPaddingBytes (void) const {return mPBit;} ///< @return True if my Padding Bit is set. (New in SDK 16.0) + virtual inline bool HasExtendedHeader (void) const {return mXBit;} ///< @return True if my Header Extension Bit is set. (New in SDK 16.0) + + /** + @return True if the RHS payload header state matches my own current state; otherwise false. + @param[in] inRHS The RHS operand ::AJARTPAncPayloadHeader to compare with me. + **/ + virtual bool operator == (const AJARTPAncPayloadHeader & inRHS) const; + + /** + @return True if the RHS payload header state doesn't match my own current state; otherwise false. + @param[in] inRHS The RHS operand ::AJARTPAncPayloadHeader to compare with me. + **/ + virtual inline bool operator != (const AJARTPAncPayloadHeader & inRHS) const {return !(operator == (inRHS));} + + /** + @brief Writes a human-readable dump of my current state into a given output stream. + @param inOutStream The output stream to write into. + @return A reference to the specified output stream. + **/ + virtual std::ostream & Print (std::ostream & inOutStream) const; + ///@} + + /** + @name I/O Methods + **/ + ///@{ + /** + @brief Writes an RTP packet header based on my current state into the given ::ULWordSequence. + Each 32-bit word will be written in network byte order. + @param[out] outVector Specifies the ::ULWordSequence to receive the RTP header words. + @param[in] inReset Clears the ::ULWordSequence before appending my header, if true (the default). + Specify false to append the 32-bit words to the ::ULWordSequence without first clearing it. + @return True if successful; otherwise false. + **/ + virtual bool WriteToULWordVector (ULWordSequence & outVector, const bool inReset = true) const; + + /** + @brief Writes an RTP packet header based on my current state into the given buffer. + Each 32-bit word will be written in network byte order. + @param[out] outBuffer Specifies the buffer to modify. + @param[in] inU32Offset Specifies where to start writing in the buffer, as a count of 32-bit words. + Defaults to zero (the start of the buffer). + @return True if successful; otherwise false. + **/ + virtual bool WriteToBuffer (NTV2_POINTER & outBuffer, const ULWord inU32Offset = 0) const; + + /** + @brief Resets my current state from the RTP packet header stored in the given ::ULWordSequence. + Each 32-bit word in the vector is expected to be in network byte order. + @param[in] inVector A vector of 32-bit words. Each word must be in network byte order. + @return True if successful; otherwise false. + **/ + virtual bool ReadFromULWordVector (const ULWordSequence & inVector); + + /** + @brief Resets my current state from the RTP packet header stored in the given buffer. + Each 32-bit word in the vector is expected to be in network byte order. + @param[in] inBuffer A buffer containing a number of 32-bit words. Each word must be in network byte order. + @return True if successful; otherwise false. + **/ + virtual bool ReadFromBuffer (const NTV2_POINTER & inBuffer); + ///@} + + /** + @name Setters + **/ + ///@{ + /** + @brief Sets my Field Signal value to "Field 1". + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPayloadHeader & SetField1 (void) {return SetFieldSignal(2);} + + /** + @brief Sets my Field Signal value to "Field 2". + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPayloadHeader & SetField2 (void) {return SetFieldSignal(3);} + + /** + @brief Sets my Field Signal value to "Progressive". + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPayloadHeader & SetProgressive (void) {return SetFieldSignal(0);} + + /** + @brief Sets my Payload Type value. + @param[in] inPayloadType Specifies the new Payload Type value. + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPayloadHeader & SetPayloadType (const uint8_t inPayloadType) {mPayloadType = inPayloadType & 0x7F; return *this;} + + /** + @brief Sets my RTP Packet Length value. + @param[in] inByteCount Specifies the new RTP Payload Length value, which must be in native host byte order. + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPayloadHeader & SetPayloadLength (const uint16_t inByteCount) {mPayloadLength = inByteCount; return *this;} + + /** + @brief Sets my RTP Anc Packet Count value. + @param[in] inPktCount Specifies the new Anc Packet Count value. + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPayloadHeader & SetAncPacketCount (const uint8_t inPktCount) {mAncCount = inPktCount; return *this;} + + /** + @brief Sets my RTP Packet Time Stamp value. + @param[in] inTimeStamp Specifies my new Packet Time Stamp value, which must be in native host byte order. + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPayloadHeader & SetTimeStamp (const uint32_t inTimeStamp) {mTimeStamp = inTimeStamp; return *this;} + + /** + @brief Sets my RTP Packet Sync Source ID value. + @param[in] inSyncSrcID Specifies my new Sync Source ID value, which must be in native host byte order. + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPayloadHeader & SetSyncSourceID (const uint32_t inSyncSrcID) {mSyncSourceID = inSyncSrcID; return *this;} + + /** + @brief Sets my RTP Packet Sequence Number value. + @param[in] inSeqNumber Specifies my new Sequence Number value, which must be in native host byte order. + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPayloadHeader & SetSequenceNumber (const uint32_t inSeqNumber) {mSequenceNumber = inSeqNumber; return *this;} + + /** + @brief Sets my RTP Packet CC Bits value. + @param[in] inCCBits Specifies my new CC Bits value. + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPayloadHeader & SetCCBits (const uint8_t inCCBits) {mCCBits = inCCBits & 0x0F; return *this;} + + /** + @brief Sets my RTP Packet End-Of-Field or End-Of-Frame (Marker Bit) value. + @param[in] inIsLast Specify true to set the Marker Bit (the default); otherwise specify false to clear it. + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPayloadHeader & SetEndOfFieldOrFrame (const bool inIsLast = true) {mMarkerBit = inIsLast; return *this;} + ///@} + + #if !defined(NTV2_DEPRECATE_15_5) + /** + @deprecated To get the full RTP packet length, add GetPayloadLength and GetHeaderByteCount. + **/ + virtual inline uint16_t GetPacketLength (void) const {return GetPayloadLength()+uint16_t(GetHeaderByteCount());} + #endif // !defined(NTV2_DEPRECATE_15_5) + + protected: + /** + @brief Resets (part of) my state from a given 32-bit word in an existing RTP header. + @param[in] inIndex0 Specifies which 32-bit word of the RTP header as a zero-based index number (must be under 5). + @param[in] inULWord Specifies the 32-bit word from the RTP header (in network-byte-order). + @return True if successful; otherwise false. + **/ + virtual bool SetFromPacketHeaderULWordAtIndex (const unsigned inIndex0, const uint32_t inULWord); + + /** + @brief Sets my Field Signal value from the given 8-bit value. + @param[in] inFieldSignal Specifies my new Field Signal value. Only the least significant 3 bits are used. + @return A non-constant reference to myself. + **/ + virtual inline AJARTPAncPayloadHeader & SetFieldSignal (const uint8_t inFieldSignal) {mFieldSignal = (inFieldSignal & 0x03); return *this;} + + /** + @brief Answers with the 32-bit RTP packet header value for the given position. The returned value will be in network byte order. + @param[in] inIndex0 Specifies which 32-bit word of the RTP packet header to calculate and return. It's a zero-based index number, and must be under 5. + @param[out] outULWord Receives the requested 32-bit RTP packet header value. It will be in network byte order. + @return True if successful; otherwise false. + **/ + virtual bool GetPacketHeaderULWordForIndex (const unsigned inIndex0, uint32_t & outULWord) const; + + /** + @return The 32-bit RTP packet header value for a given position. It will be in network byte order. + @param[in] inIndex0 Specifies which 32-bit word of the RTP packet header to calculate and return. It's a zero-based index number, and must be under 5. + **/ + virtual inline uint32_t GetPacketHeaderULWordForIndex (const unsigned inIndex0) const {uint32_t result(0); GetPacketHeaderULWordForIndex(inIndex0, result); return result;} + + private: // INSTANCE DATA + uint8_t mVBits; ///< @brief Version -- currently should be 0x02 + bool mPBit; ///< @brief Padding -- hardware gets/sets this + bool mXBit; ///< @brief Extended Header -- Hardware gets/sets this + bool mMarkerBit; ///< @brief Marker Bit (last RTP pkt?) -- Playout: WriteRTPPackets sets this + uint8_t mCCBits; ///< @brief CSRC Count -- Hardware gets/sets this + uint8_t mPayloadType; ///< @brief Payload Type -- Hardware gets/sets this + uint32_t mSequenceNumber;///< @brief Sequence Number (native host byte order) -- Hardware gets/sets this + uint32_t mTimeStamp; ///< @brief Time Stamp (native host byte order) -- Hardware gets/sets this + uint32_t mSyncSourceID; ///< @brief Sync Source ID (native host byte order) -- Playout: client sets this + uint16_t mPayloadLength; ///< @brief RTP Payload Length, in bytes (native host byte order) + /// Playout: WriteRTPPackets sets this + /// Payload starts at 'C' bit of first SMPTE Anc packet data + uint8_t mAncCount; ///< @brief Anc Packet Count -- Playout: WriteRTPPackets sets this + uint8_t mFieldSignal; ///< @brief Field Signal -- Playout: WriteRTPPackets sets this +}; // AJARTPAncPayloadHeader + +/** + @brief Streams a human-readable representation of the given ::AJARTPAncPayloadHeader to the given output stream. + @param[in] inOutStrm Specifies the output stream to receive the payload header's state information. + @param[in] inObj Specifies the ::AJARTPAncPayloadHeader of interest. + @return A non-constant reference to the given output stream. +**/ +static inline std::ostream & operator << (std::ostream & inOutStrm, const AJARTPAncPayloadHeader & inObj) {return inObj.Print(inOutStrm);} + + +/** + @brief I represent the 4-byte header of an anc packet that's inside an RTP packet. +**/ +class AJAExport AJARTPAncPacketHeader +{ + public: // INSTANCE METHODS + /** + @name Construction & Destruction + **/ + ///@{ + AJARTPAncPacketHeader (); ///< @brief My default constructor + explicit AJARTPAncPacketHeader (const AJAAncillaryDataLocation & inLocation); ///< @brief Constructs me from an ::AJAAncillaryDataLocation + virtual inline ~AJARTPAncPacketHeader () {} ///< @brief My destructor + ///@} + + /** + @name Inquiry Methods + **/ + ///@{ + virtual uint32_t GetULWord (void) const; ///< @return The 4-byte header value (in network byte order) that represents my current state. + virtual inline bool IsCBitSet (void) const {return mCBit;} ///< @return True if my "C" bit ("C" channel bit) is set; otherwise false. + virtual inline bool IsSBitSet (void) const {return mSBit;} ///< @return True if my "S" bit (Data Stream valid bit) is set; otherwise false. + virtual inline uint16_t GetLineNumber (void) const {return mLineNum;} ///< @return My current line number value (in host native byte order). + virtual inline uint16_t GetHorizOffset (void) const {return mHOffset;} ///< @return My current horizontal offset value (in host native byte order). + virtual inline uint8_t GetStreamNumber (void) const {return mStreamNum;} ///< @return My current data stream number value. + virtual AJAAncillaryDataLocation AsDataLocation(void) const; ///< @return An ::AJAAncillaryDataLocation that represents my current state. + + /** + @brief Streams a human-readable represetation of my current state to the given output stream. + @param[in] inOutStream Specifies the output stream to receive my state information. + @return A non-constant reference to the given output stream. + **/ + virtual std::ostream & Print (std::ostream & inOutStream) const; + ///@} + + /** + @name Modifiers + **/ + ///@{ + /** + @brief Sets my "C" channel bit setting to 'true'. + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPacketHeader & SetCChannel (void) {mCBit = true; return *this;} + + /** + @brief Sets my "C" channel bit setting to 'false'. + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPacketHeader & SetYChannel (void) {mCBit = false; return *this;} + + /** + @brief Sets my line number value to least-significant 11 bits of the given value. + @param[in] inLineNum Specifies my new line number value. Only the LS 11 bits are used. + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPacketHeader & SetLineNumber (const uint16_t inLineNum) {mLineNum = inLineNum & 0x7FF; return *this;} + + /** + @brief Sets my horizontal offset value to least-significant 12 bits of the given value. + @param[in] inHOffset Specifies my new horizontal offset value. Only the LS 12 bits are used. + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPacketHeader & SetHorizOffset (const uint16_t inHOffset) {mHOffset = inHOffset & 0x0FFF; return *this;} + + /** + @brief Sets my stream number value to least-significant 7 bits of the given value. + @param[in] inStreamNum Specifies my new data stream number value. Only the LS 7 bits are used. + @note It is recommended that SetDataStreamFlag be called with 'true' if the stream number is non-zero. + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPacketHeader & SetStreamNumber (const uint8_t inStreamNum) {mStreamNum = inStreamNum & 0x07F; return *this;} + + /** + @brief Sets my data stream flag. + @param[in] inFlag Specify true to signify my Data Stream Number is legitimate (and non-zero); + otherwise 'false'. + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPacketHeader & SetDataStreamFlag (const bool inFlag) {mSBit = inFlag; return *this;} + + /** + @brief Resets me from a given ::AJAAncillaryDataLocation. + @param[in] inLocation Specifies the ::AJAAncillaryDataLocation to reset my current state from. + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual AJARTPAncPacketHeader & SetFrom (const AJAAncillaryDataLocation & inLocation); + + /** + @brief Assigns the given ::AJAAncillaryDataLocation to me, resetting my current state. + @param[in] inRHS Specifies the ::AJAAncillaryDataLocation to reset my current state from. + @return A non-constant reference to myself (for daisy-chaining "Set..." calls). + **/ + virtual inline AJARTPAncPacketHeader & operator = (const AJAAncillaryDataLocation & inRHS) {return SetFrom(inRHS);} + ///@} + + /** + @name I/O + **/ + ///@{ + /** + @brief Resets my current state by decoding the given 4-byte header value. + @param[in] inULWord The 4-byte header value obtained from an RTP packet, in network-byte-order. + @return True if successful; otherwise false. + **/ + virtual bool SetFromULWord (const uint32_t inULWord); + + /** + @brief Resets my current state by decoding the 4-byte header value stored in the given ::ULWordSequence + at the given zero-based index position. + @param[in] inVector A ::ULWordSequence of 4-byte words, each in network-byte-order. + @param[in] inIndex0 Specifies the position (offset) of the header word in the ::ULWordSequence. + @return True if successful; otherwise false. + **/ + virtual bool ReadFromULWordVector (const ULWordSequence & inVector, const unsigned inIndex0); + + /** + @brief Writes my 4-byte header value into the given ::ULWordSequence. The 4-byte value will be in network byte order. + @param[out] outVector Specifies the ::ULWordSequence to receive my 4-byte header value. + @param[in] inReset Optionally clears the ::ULWordSequence before appending, if true (the default). + Specify false to append my header value to the ::ULWordSequence without first clearing it. + @return True if successful; otherwise false. + **/ + virtual bool WriteToULWordVector (ULWordSequence & outVector, const bool inReset = true) const; + ///@} + + private: // INSTANCE DATA + bool mCBit; ///< @brief My C-channel bit + bool mSBit; ///< @brief My Data Stream Flag bit + uint16_t mLineNum; ///< @brief My line number (in host native byte order) + uint16_t mHOffset; ///< @brief My horizontal offset (in host native byte order) + uint8_t mStreamNum; ///< @brief My stream number +}; // AJARTPAncPacketHeader + +/** + @brief Streams a human-readable representation of the given ::AJARTPAncPacketHeader to the given output stream. + @param[in] inOutStrm Specifies the output stream to receive my state information. + @param[in] inObj Specifies the ::AJARTPAncPacketHeader of interest. + @return A non-constant reference to the given output stream. +**/ +static inline std::ostream & operator << (std::ostream & inOutStrm, const AJARTPAncPacketHeader & inObj) {return inObj.Print(inOutStrm);} + +#endif // AJA_ANCILLARYDATA_H diff --git a/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_cea608.h b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_cea608.h new file mode 100644 index 0000000..7792262 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_cea608.h @@ -0,0 +1,124 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ancillarydata_cea608.h + @brief Declares the AJAAncillaryData_Cea608 class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. +**/ + +#ifndef AJA_ANCILLARYDATA_CEA608_H +#define AJA_ANCILLARYDATA_CEA608_H + +#include "ancillarydatafactory.h" +#include "ancillarydata.h" + + +/** + @brief This is the base class for handling CEA-608 caption data packets. +**/ +class AJAExport AJAAncillaryData_Cea608 : public AJAAncillaryData +{ +public: + AJAAncillaryData_Cea608 (); ///< @brief My default constructor. + + /** + @brief My copy constructor. + @param[in] inClone The object to be cloned. + **/ + AJAAncillaryData_Cea608 (const AJAAncillaryData_Cea608 & inClone); + + /** + @brief My copy constructor. + @param[in] pInClone A valid pointer to the object to be cloned. + **/ + AJAAncillaryData_Cea608 (const AJAAncillaryData_Cea608 * pInClone); + + /** + @brief My copy constructor. + @param[in] pInData A valid pointer to the object to be cloned. + **/ + AJAAncillaryData_Cea608 (const AJAAncillaryData * pInData); + + virtual ~AJAAncillaryData_Cea608 (); ///< @brief My destructor. + + virtual void Clear (void); ///< @brief Frees my allocated memory, if any, and resets my members to their default values. + + /** + @brief Assignment operator -- replaces my contents with the right-hand-side value. + @param[in] inRHS The value to be assigned to me. + @return A reference to myself. + **/ + virtual AJAAncillaryData_Cea608 & operator = (const AJAAncillaryData_Cea608 & inRHS); + + + virtual inline AJAAncillaryData_Cea608 * Clone (void) const {return new AJAAncillaryData_Cea608 (this);} ///< @return A clone of myself. + + /** + @brief Set the CEA608 payload bytes. + @note This function assumes the caller has already added parity. + @param[in] inByte1 Specifies the first byte of the pair. + @param[in] inByte2 Specifies the second byte of the pair. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetCEA608Bytes (const uint8_t inByte1, const uint8_t inByte2); + + /** + @brief Answers with the CEA608 payload bytes. + @param[out] outByte1 Receives the first byte of the pair (includes parity). + @param[out] outByte2 Receives the second byte of the pair (includes parity). + @param[out] outIsValid Receives 'true' if returned data is valid. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GetCEA608Bytes (uint8_t & outByte1, uint8_t & outByte2, bool & outIsValid) const; + + + /** + @brief Sets the CEA608 payload characters. Uses the least significant 7 bits of the input values + and adds odd parity. + @param[in] inChar1 Specifies the first character of the pair. + @param[in] inChar2 Specifies the second character of the pair. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetCEA608Characters (const uint8_t inChar1, const uint8_t inChar2); + + /** + @brief Answers with the CEA608 payload characters. + @param[out] outChar1 Receives the first character of the pair (after stripping odd parity). + @param[out] outChar2 Receives the second character of the pair (after stripping odd parity). + @param[out] outIsValid Receives 'true' if the returned characters are valid; otherwise 'false'. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GetCEA608Characters (uint8_t & outChar1, uint8_t & outChar2, bool & outIsValid) const; + + /** + @brief Set/Clear bit 7 of a byte to make odd parity. + @param[in] inValue Specifies the 7-bit input value. + @return The least-significant 7 bits of the input byte with bit 7 set or cleared to make odd parity. + **/ + static uint8_t AddOddParity (const uint8_t inValue); + + /** + @brief Streams a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream. + @param[in] inDetailed Specify 'true' for a detailed representation; otherwise use 'false' for a brief one. + @return The given output stream. + **/ + virtual std::ostream & Print (std::ostream & inOutStream, const bool inDetailed = false) const; + + /** + @param[in] pInAncData A valid pointer to a base AJAAncillaryData object that contains the Anc data to inspect. + @return AJAAncillaryDataType if I recognize this Anc data (or AJAAncillaryDataType_Unknown if unrecognized). + **/ + static AJAAncillaryDataType RecognizeThisAncillaryData (const AJAAncillaryData * pInAncData); + +protected: + void Init (void); // NOT virtual - called by constructors + + // Note: if you make a change to the local member data, be sure to ALSO make the appropriate + // changes in the Init() and operator= methods! + uint8_t m_char1; // the 1st character in this field + uint8_t m_char2; // the 2nd character in this field + +}; // AJAAncillaryData_Cea608 + +#endif // AJA_ANCILLARYDATA_CEA608_H + diff --git a/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_cea608_line21.h b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_cea608_line21.h new file mode 100644 index 0000000..684b365 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_cea608_line21.h @@ -0,0 +1,181 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ancillarydata_cea608_line21.h + @brief Declares the AJAAncillaryData_Cea608_line21 class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. +**/ + +#ifndef AJA_ANCILLARYDATA_CEA608_LINE21_H +#define AJA_ANCILLARYDATA_CEA608_LINE21_H + +#include "ancillarydatafactory.h" +#include "ancillarydata.h" +#include "ancillarydata_cea608.h" + + +// Line 21 ("Analog") Packet IDs +const uint8_t AJAAncillaryData_Cea608_Line21_DID = AJAAncillaryData_AnalogSID; +const uint8_t AJAAncillaryData_Cea608_Line21_SID = AJAAncillaryData_AnalogDID; + +const uint32_t AJAAncillaryData_Cea608_Line21_PayloadSize = 720; // note: assumes we're only using this for SD (720 pixels/line) + + + +/** + @brief This class handles "analog" (Line 21) based CEA-608 caption data packets. +**/ +class AJAExport AJAAncillaryData_Cea608_Line21 : public AJAAncillaryData_Cea608 +{ +public: + AJAAncillaryData_Cea608_Line21 (); ///< @brief My default constructor. + + /** + @brief My copy constructor. + @param[in] inClone The object to be cloned. + **/ + AJAAncillaryData_Cea608_Line21 (const AJAAncillaryData_Cea608_Line21 & inClone); + + /** + @brief My copy constructor. + @param[in] pInClone A valid pointer to the object to be cloned. + **/ + AJAAncillaryData_Cea608_Line21 (const AJAAncillaryData_Cea608_Line21 * pInClone); + + /** + @brief My copy constructor. + @param[in] pInData A valid pointer to the object to be cloned. + **/ + AJAAncillaryData_Cea608_Line21 (const AJAAncillaryData * pInData); + + virtual ~AJAAncillaryData_Cea608_Line21 (); ///< @brief My destructor. + + virtual void Clear (void); ///< @brief Frees my allocated memory, if any, and resets my members to their default values. + + /** + @brief Assignment operator -- replaces my contents with the right-hand-side value. + @param[in] inRHS The value to be assigned to me. + @return A reference to myself. + **/ + virtual AJAAncillaryData_Cea608_Line21 & operator = (const AJAAncillaryData_Cea608_Line21 & inRHS); + + virtual inline AJAAncillaryData_Cea608_Line21 * Clone (void) const {return new AJAAncillaryData_Cea608_Line21 (this);} ///< @return A clone of myself. + + /** + @brief Parses out (interprets) the "local" ancillary data from my payload data. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus ParsePayloadData (void); + + /** + @brief Generate the payload data from the "local" ancillary data. + @note This method is overridden for the specific Anc data type. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GeneratePayloadData (void); + + /** + @brief Streams a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream. + @param[in] inDetailed Specify 'true' for a detailed representation; otherwise use 'false' for a brief one. + @return The given output stream. + **/ + virtual std::ostream & Print (std::ostream & inOutStream, const bool inDetailed = false) const; + + /** + @param[in] pInAncData A valid pointer to a base AJAAncillaryData object that contains the Anc data to inspect. + @return AJAAncillaryDataType if I recognize this Anc data (or AJAAncillaryDataType_Unknown if unrecognized). + **/ + static AJAAncillaryDataType RecognizeThisAncillaryData (const AJAAncillaryData * pInAncData); + + +protected: + void Init (void); // NOT virtual - called by constructors + virtual AJAStatus AllocEncodeBuffer (void); + + // Encode methods ported/stolen from ntv2closedcaptioning.cpp + + /** + @brief Initializes the payload buffer with all of the "static" pixels, e.g. run-in clock, pre- and post- black, etc. + @param[in] inLineStartOffset Pixel count from beginning of line (buffer) to the start of the waveform. + @param[out] outDataStartOffset Receives the pixel count from beginning of line (buffer) to the first data pixel + (required by the AJAAncillaryData_Cea608_Line21::EncodeLine function). + @return AJA_STATUS_SUCCESS if successful, or AJA_STATUS_FAIL if payload not allocated or wrong size. + **/ + virtual AJAStatus InitEncodeBuffer (const uint32_t inLineStartOffset, uint32_t & outDataStartOffset); + + + /** + @brief Encode and insert the given 8-bit characters into the (already initialized) payload buffer. + @param[in] inChar1 Specifies the 8-bit "1st" character on the line. + @param[in] inChar2 Specifies the 8-bit "2nd" character on the line. + @param[in] inDataStartOffset Specifies the pixel count from beginning of line (buffer) to the first data pixel. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus EncodeLine (const uint8_t inChar1, const uint8_t inChar2, const uint32_t inDataStartOffset); + + /** + @brief Encodes a single 8-bit character from just after the transition to the first bit until just before the transition from the last bit. + @param[in] ptr Pointer to the location in buffer where the encoding should start. + @param[in] inChar Specifies the 8-bit character to encode. + @return Pointer to next pixel in the buffer following the end of the encoded byte. + **/ + virtual uint8_t * EncodeCharacter (uint8_t * ptr, const uint8_t inChar); + + + /** + @brief Encodes a single bit transition from the "from" level to the "to" level. + @param[in] ptr ptr to the location in buffer where the encoding should start + @param[in] inStartLevel Specifies the beginning level (0=low, >0=high). + @param[in] inEndLevel Specifies the ending level (0=low, >0=high). + @return Pointer to next pixel in the buffer following the end of the encoded transition. + **/ + virtual uint8_t * EncodeTransition (uint8_t * ptr, const uint8_t inStartLevel, const uint8_t inEndLevel); + + + // Decode methods ported/stolen from ntv2closedcaptioning.cpp + + /** + @brief Decodes the payload to extract the two captioning characters. + The caller must check \c outGotClock to determine whether a valid CEA-608 ("Line 21") + waveform was found: lack of captioning waveform does NOT return an error! + @param[out] outChar1 Receives data byte 1 (set to 0xFF if no clock or data is found). + @param[out] outChar2 Receives data byte 2 (set to 0xFF if no clock or data is found). + @param[out] outGotClock Receives 'true' if a valid CEA-608 ("Line 21") clock waveform was found. + @return AJA_STATUS_SUCCESS if successful, or AJA_STATUS_FAIL if payload not allocated or wrong size. + **/ + virtual AJAStatus DecodeLine (uint8_t & outChar1, uint8_t & outChar2, bool & outGotClock) const; + + + /** + @brief Checks for the existence of a CEA-608 "analog" waveform and, if found, returns a pointer + to the start of the data bits. + @param[in] pInLine The start of the payload buffer. + @param[out] outGotClock Receives 'true' if a valid CEA-608 ("Line 21") clock waveform was found. + @return Pointer to the middle of the first data bit (used by DecodeCharacters function). + **/ + static const uint8_t * CheckDecodeClock (const uint8_t * pInLine, bool & outGotClock); + + + /** + @brief Decodes the two CEA-608 data characters for this line. + @param[in] ptr Points to the middle of the first data bit in the waveform + (i.e. the one following the '1' start bit). + @param[out] outChar1 Receives data byte 1. + @param[out] outChar2 Receives data byte 2. + @return AJA_STATUS_SUCCESS if successful. + @note This function returns the parity bit of each character in the MS bit position. + It makes no calculation or value judgment as to the correctness of the parity. + **/ + static AJAStatus DecodeCharacters (const uint8_t * ptr, uint8_t & outChar1, uint8_t & outChar2); + + +protected: + // Note: if you make a change to the local member data, be sure to ALSO make the appropriate + // changes in the Init() and operator= methods! + bool m_bEncodeBufferInitialized; ///< @brief Set 'true' after successfully allocating and initializing the m_payload buffer for encoding + uint32_t m_dataStartOffset; ///< @brief Offset into the encode buffer where data starts + +}; // AJAAncillaryData_Cea608_Line21 + +#endif // AJA_ANCILLARYDATA_CEA608_LINE21_H + diff --git a/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_cea608_vanc.h b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_cea608_vanc.h new file mode 100644 index 0000000..7ef2ab4 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_cea608_vanc.h @@ -0,0 +1,114 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ancillarydata_cea608_vanc.h + @brief Declares the AJAAncillaryData_Cea608_Vanc class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. +**/ + +#ifndef AJA_ANCILLARYDATA_CEA608_VANC_H +#define AJA_ANCILLARYDATA_CEA608_VANC_H + +#include "ancillarydatafactory.h" +#include "ancillarydata.h" +#include "ancillarydata_cea608.h" + + +// CEA-608 (SMPTE 334) Ancillary Packet +const uint8_t AJAAncillaryData_Cea608_Vanc_DID = 0x61; +const uint8_t AJAAncillaryData_Cea608_Vanc_SID = 0x02; + +const uint32_t AJAAncillaryData_Cea608_Vanc_PayloadSize = 3; // constant 3 bytes + + +/** + @brief This class handles VANC-based CEA-608 caption data packets (not "analog" Line 21). +**/ +class AJAExport AJAAncillaryData_Cea608_Vanc : public AJAAncillaryData_Cea608 +{ +public: + AJAAncillaryData_Cea608_Vanc (); ///< @brief My default constructor. + + /** + @brief My copy constructor. + @param[in] inClone The AJAAncillaryData object to be cloned. + **/ + AJAAncillaryData_Cea608_Vanc (const AJAAncillaryData_Cea608_Vanc & inClone); + + /** + @brief My copy constructor. + @param[in] pInClone A valid pointer to the AJAAncillaryData object to be cloned. + **/ + AJAAncillaryData_Cea608_Vanc (const AJAAncillaryData_Cea608_Vanc * pInClone); + + /** + @brief Constructs me from a generic AJAAncillaryData object. + @param[in] pInData A valid pointer to the AJAAncillaryData object. + **/ + AJAAncillaryData_Cea608_Vanc (const AJAAncillaryData * pInData); + + virtual ~AJAAncillaryData_Cea608_Vanc (); ///< @brief My destructor. + + virtual void Clear (void); ///< @brief Frees my allocated memory, if any, and resets my members to their default values. + + /** + @brief Assignment operator -- replaces my contents with the right-hand-side value. + @param[in] inRHS The value to be assigned to me. + @return A reference to myself. + **/ + virtual AJAAncillaryData_Cea608_Vanc & operator = (const AJAAncillaryData_Cea608_Vanc & inRHS); + + virtual inline AJAAncillaryData_Cea608_Vanc * Clone (void) const {return new AJAAncillaryData_Cea608_Vanc (this);} ///< @return A clone of myself. + + /** + @brief Sets my SMPTE 334 (CEA608) field/line numbers. + @param[in] inIsF2 Specifies the field number ('true' for F2, 'false' for F1). + @param[in] inLineNum Specifies the line number (see SMPTE 334-1 for details). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetLine (const bool inIsF2, const uint8_t inLineNum); + + virtual inline uint16_t GetLineNumber (void) const {return m_lineNum;} ///< @return My current SMPTE 334 (CEA608) line number. + virtual inline bool IsField2 (void) const {return m_isF2;} ///< @return True if my current Field ID is Field 2; otherwise false. + + /** + @brief Parses out (interprets) the "local" ancillary data from my payload data. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus ParsePayloadData (void); + + /** + @brief Generate the payload data from my "local" ancillary data. + @note This method is overridden for the specific Anc data type. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GeneratePayloadData (void); + + /** + @brief Streams a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream. + @param[in] inDetailed Specify 'true' for a detailed representation; otherwise use 'false' for a brief one. + @return The given output stream. + **/ + virtual std::ostream & Print (std::ostream & inOutStream, const bool inDetailed = false) const; + + /** + @param[in] pInAncData A valid pointer to a base AJAAncillaryData object that contains the Anc data to inspect. + @return AJAAncillaryDataType if I recognize this Anc data (or AJAAncillaryDataType_Unknown if unrecognized). + **/ + static AJAAncillaryDataType RecognizeThisAncillaryData (const AJAAncillaryData * pInAncData); + + + virtual AJAStatus GetLine (uint8_t & outFieldNum, uint8_t & outLineNum) const; ///< @deprecated Use AJAAncillaryData_Cea608_Vanc::GetLineNumber or AJAAncillaryData_Cea608_Vanc::IsField2 instead. + +protected: + void Init (void); // NOT virtual - called by constructors + + // Note: if you make a change to the local member data, be sure to ALSO make the appropriate + // changes in the Init() and operator= methods! + bool m_isF2; // F2 if true; otherwise F1 + uint8_t m_lineNum; // 525i: 0 = line 9 (field 1) or line 272 (field 2) + // 625i: 0 = line 5 (field 1) or line 318 (field 2) + +}; // AJAAncillaryData_Cea608_Vanc + +#endif // AJA_ANCILLARYDATA_CEA608_VANC_H diff --git a/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_cea708.h b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_cea708.h new file mode 100644 index 0000000..c8836e0 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_cea708.h @@ -0,0 +1,93 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ancillarydata_cea708.h + @brief Declares the AJAAncillaryData_Cea708 class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. +**/ + +#ifndef AJA_ANCILLARYDATA_CEA708_H +#define AJA_ANCILLARYDATA_CEA708_H + +#include "ancillarydatafactory.h" +#include "ancillarydata.h" + + +// SMPTE 334 Ancillary Packet +const uint8_t AJAAncillaryData_CEA708_DID = 0x61; +const uint8_t AJAAncillaryData_CEA708_SID = 0x01; + + +/** + @brief This class handles CEA-708 SMPTE 334 packets. +**/ +class AJAExport AJAAncillaryData_Cea708 : public AJAAncillaryData +{ +public: + AJAAncillaryData_Cea708 (); ///< @brief My default constructor. + + /** + @brief My copy constructor. + @param[in] inClone The object to be cloned. + **/ + AJAAncillaryData_Cea708 (const AJAAncillaryData_Cea708 & inClone); + + /** + @brief My copy constructor. + @param[in] pInClone A valid pointer to the object to be cloned. + **/ + AJAAncillaryData_Cea708 (const AJAAncillaryData_Cea708 * pInClone); + + /** + @brief My copy constructor. + @param[in] pInData A valid pointer to the object to be cloned. + **/ + AJAAncillaryData_Cea708 (const AJAAncillaryData * pInData); + + virtual ~AJAAncillaryData_Cea708 (); ///< @brief My destructor. + + virtual void Clear (void); ///< @brief Frees my allocated memory, if any, and resets my members to their default values. + + /** + @brief Assignment operator -- replaces my contents with the right-hand-side value. + @param[in] inRHS The value to be assigned to me. + @return A reference to myself. + **/ + virtual AJAAncillaryData_Cea708 & operator = (const AJAAncillaryData_Cea708 & inRHS); + + virtual inline AJAAncillaryData_Cea708 * Clone (void) const {return new AJAAncillaryData_Cea708 (this);} ///< @return A clone of myself. + + /** + @brief Parses out (interprets) the "local" ancillary data from my payload data. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus ParsePayloadData (void); + + /** + @brief Generate the payload data from the "local" ancillary data. + @note This method is overridden for the specific Anc data type. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GeneratePayloadData (void); + + /** + @param[in] pInAncData A valid pointer to a base AJAAncillaryData object that contains the Anc data to inspect. + @return AJAAncillaryDataType if I recognize this Anc data (or AJAAncillaryDataType_Unknown if unrecognized). + **/ + static AJAAncillaryDataType RecognizeThisAncillaryData (const AJAAncillaryData * pInAncData); + + /** + @brief Streams a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream. + @param[in] inDetailed Specify 'true' for a detailed representation; otherwise use 'false' for a brief one. + @return The given output stream. + **/ + virtual std::ostream & Print (std::ostream & inOutStream, const bool inDetailed = false) const; + +protected: + void Init (void); // NOT virtual - called by constructors + + // Note: if you make a change to the local member data, be sure to ALSO make the appropriate + // changes in the Init() and operator= methods! +}; // AJAAncillaryData_Cea708 + +#endif // AJA_ANCILLARYDATA_CEA708_H diff --git a/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_framestatusinfo524D.h b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_framestatusinfo524D.h new file mode 100644 index 0000000..8bfce67 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_framestatusinfo524D.h @@ -0,0 +1,94 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ancillarydata_framestatusinfo524D.h + @brief Declares the AJAAncillaryData_FrameStatusInfo524D class. + @copyright (C) 2012-2021 AJA Video Systems, Inc. +**/ + +#ifndef AJA_ANCILLARYDATA_FRAMESTATUSINFO524D_H +#define AJA_ANCILLARYDATA_FRAMESTATUSINFO524D_H + +#include "ancillarydatafactory.h" +#include "ancillarydata.h" + + +// Ancillary Packet generated by the Canon C300, so far, the C500 +const uint8_t AJAAncillaryData_FrameStatusInfo524D_DID = 0x52; +const uint8_t AJAAncillaryData_FrameStatusInfo524D_SID = 0x4D; + + + +/** + @brief This class handles "524D" Frame Status Information packets. +**/ +class AJA_EXPORT AJAAncillaryData_FrameStatusInfo524D : public AJAAncillaryData +{ +public: + AJAAncillaryData_FrameStatusInfo524D (); ///< @brief My default constructor. + + /** + @brief My copy constructor. + @param[in] inClone The AJAAncillaryData object to be cloned. + **/ + AJAAncillaryData_FrameStatusInfo524D (const AJAAncillaryData_FrameStatusInfo524D & inClone); + + /** + @brief My copy constructor. + @param[in] pInClone A valid pointer to the AJAAncillaryData object to be cloned. + **/ + AJAAncillaryData_FrameStatusInfo524D (const AJAAncillaryData_FrameStatusInfo524D * pInClone); + + /** + @brief Constructs me from a generic AJAAncillaryData object. + @param[in] pInData A valid pointer to the AJAAncillaryData object. + **/ + AJAAncillaryData_FrameStatusInfo524D (const AJAAncillaryData * pInData); + + virtual ~AJAAncillaryData_FrameStatusInfo524D (); ///< @brief My destructor. + + virtual void Clear (void); ///< @brief Frees my allocated memory, if any, and resets my members to their default values. + + /** + @brief Assignment operator -- replaces my contents with the right-hand-side value. + @param[in] inRHS The value to be assigned to me. + @return A reference to myself. + **/ + virtual AJAAncillaryData_FrameStatusInfo524D & operator = (const AJAAncillaryData_FrameStatusInfo524D & inRHS); + + + virtual inline AJAAncillaryData_FrameStatusInfo524D * Clone (void) const {return new AJAAncillaryData_FrameStatusInfo524D (this);} ///< @return A clone of myself. + + /** + @brief Parses out (interprets) the "local" ancillary data from my payload data. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus ParsePayloadData (void); + + virtual inline bool IsRecording (void) const {return m_IsRecording;} ///< @return The remote camera's recording state. + + /** + @param[in] pInAncData A valid pointer to a base AJAAncillaryData object that contains the Anc data to inspect. + @return AJAAncillaryDataType if I recognize this Anc data (or AJAAncillaryDataType_Unknown if unrecognized). + **/ + static AJAAncillaryDataType RecognizeThisAncillaryData (const AJAAncillaryData * pInAncData); + + /** + @brief Streams a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream. + @param[in] inDetailed Specify 'true' for a detailed representation; otherwise use 'false' for a brief one. + @return The given output stream. + **/ + virtual std::ostream & Print (std::ostream & inOutStream, const bool inDetailed = false) const; + + +protected: + void Init (void); // NOT virtual - called by constructors + +private: + bool m_IsRecording; + + +}; + +#endif // AJA_ANCILLARYDATA_FRAMESTATUSINFO524D_H + diff --git a/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_framestatusinfo5251.h b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_framestatusinfo5251.h new file mode 100644 index 0000000..15e87c3 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_framestatusinfo5251.h @@ -0,0 +1,94 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ancillarydata_framestatusinfo5251.h + @brief Declares the AJAAncillaryData_FrameStatusInfo5251 class. + @copyright (C) 2012-2021 AJA Video Systems, Inc. +**/ + +#ifndef AJA_ANCILLARYDATA_FRAMESTATUSINFO5251_H +#define AJA_ANCILLARYDATA_FRAMESTATUSINFO5251_H + +#include "ancillarydatafactory.h" +#include "ancillarydata.h" + + +// Ancillary Packet generated by the Canon C500 +const uint8_t AJAAncillaryData_FrameStatusInfo5251_DID = 0x52; +const uint8_t AJAAncillaryData_FrameStatusInfo5251_SID = 0x51; + + +/** + @brief This class handles "5251" Frame Status Information packets. +**/ +class AJA_EXPORT AJAAncillaryData_FrameStatusInfo5251 : public AJAAncillaryData +{ +public: + AJAAncillaryData_FrameStatusInfo5251 (); ///< @brief My default constructor. + + /** + @brief My copy constructor. + @param[in] inClone The AJAAncillaryData object to be cloned. + **/ + AJAAncillaryData_FrameStatusInfo5251 (const AJAAncillaryData_FrameStatusInfo5251 & inClone); + + /** + @brief My copy constructor. + @param[in] pInClone A valid pointer to the AJAAncillaryData object to be cloned. + **/ + AJAAncillaryData_FrameStatusInfo5251 (const AJAAncillaryData_FrameStatusInfo5251 * pInClone); + + /** + @brief Constructs me from a generic AJAAncillaryData object. + @param[in] pInData A valid pointer to the AJAAncillaryData object. + **/ + AJAAncillaryData_FrameStatusInfo5251 (const AJAAncillaryData * pInData); + + virtual ~AJAAncillaryData_FrameStatusInfo5251 (); ///< @brief My destructor. + + virtual void Clear (void); ///< @brief Frees my allocated memory, if any, and resets my members to their default values. + + /** + @brief Assignment operator -- replaces my contents with the right-hand-side value. + @param[in] inRHS The value to be assigned to me. + @return A reference to myself. + **/ + virtual AJAAncillaryData_FrameStatusInfo5251 & operator = (const AJAAncillaryData_FrameStatusInfo5251 & inRHS); + + + virtual inline AJAAncillaryData_FrameStatusInfo5251 * Clone (void) const {return new AJAAncillaryData_FrameStatusInfo5251 (this);} ///< @return A clone of myself. + + /** + @brief Parses out (interprets) the "local" ancillary data from my payload data. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus ParsePayloadData (void); + + /** + @brief Streams a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream. + @param[in] inDetailed Specify 'true' for a detailed representation; otherwise use 'false' for a brief one. + @return The given output stream. + **/ + virtual std::ostream & Print (std::ostream & inOutStream, const bool inDetailed = false) const; + + virtual inline bool IsRecording (void) const {return m_IsRecording;} ///< @return True if the remote camera is recording. + + virtual inline bool IsValidFrame (void) const {return m_IsValidFrame;} ///< @return True if the remote camera's outbound frame is valid for capture. + + /** + @param[in] pInAncData A valid pointer to a base AJAAncillaryData object that contains the Anc data to inspect. + @return AJAAncillaryDataType if I recognize this Anc data (or AJAAncillaryDataType_Unknown if unrecognized). + **/ + static AJAAncillaryDataType RecognizeThisAncillaryData (const AJAAncillaryData * pInAncData); + + +protected: + void Init (void); // NOT virtual - called by constructors + +private: + bool m_IsRecording; + bool m_IsValidFrame; + +}; // AJAAncillaryData_FrameStatusInfo5251 + +#endif // AJA_ANCILLARYDATA_FRAMESTATUSINFO5251_H diff --git a/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_hdr_hdr10.h b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_hdr_hdr10.h new file mode 100644 index 0000000..47aea75 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_hdr_hdr10.h @@ -0,0 +1,84 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ancillarydata_hdr_hdr10.h + @brief Declares the AJAAncillaryData_HDR_HDR10 class. + @copyright (C) 2012-2021 AJA Video Systems, Inc. +**/ + +#ifndef AJA_ANCILLARYDATA_HDR_HDR10_H +#define AJA_ANCILLARYDATA_HDR_HDR10_H + +#include "ancillarydatafactory.h" +#include "ancillarydata.h" + +const uint8_t AJAAncillaryData_HDR_HDR10_DID = 0xC0; +const uint8_t AJAAncillaryData_HDR_HDR10_SID = 0x00; + + +/** + @brief This class handles "5251" Frame Status Information packets. +**/ +class AJA_EXPORT AJAAncillaryData_HDR_HDR10 : public AJAAncillaryData +{ +public: + AJAAncillaryData_HDR_HDR10 (); ///< @brief My default constructor. + + /** + @brief My copy constructor. + @param[in] inClone The AJAAncillaryData object to be cloned. + **/ + AJAAncillaryData_HDR_HDR10 (const AJAAncillaryData_HDR_HDR10 & inClone); + + /** + @brief My copy constructor. + @param[in] pInClone A valid pointer to the AJAAncillaryData object to be cloned. + **/ + AJAAncillaryData_HDR_HDR10 (const AJAAncillaryData_HDR_HDR10 * pInClone); + + /** + @brief Constructs me from a generic AJAAncillaryData object. + @param[in] pInData A valid pointer to the AJAAncillaryData object. + **/ + AJAAncillaryData_HDR_HDR10 (const AJAAncillaryData * pInData); + + virtual ~AJAAncillaryData_HDR_HDR10 (); ///< @brief My destructor. + + virtual void Clear (void); ///< @brief Frees my allocated memory, if any, and resets my members to their default values. + + /** + @brief Assignment operator -- replaces my contents with the right-hand-side value. + @param[in] inRHS The value to be assigned to me. + @return A reference to myself. + **/ + virtual AJAAncillaryData_HDR_HDR10 & operator = (const AJAAncillaryData_HDR_HDR10 & inRHS); + + + virtual inline AJAAncillaryData_HDR_HDR10 * Clone (void) const {return new AJAAncillaryData_HDR_HDR10 (this);} ///< @return A clone of myself. + + /** + @brief Parses out (interprets) the "local" ancillary data from my payload data. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus ParsePayloadData (void); + + /** + @brief Streams a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream. + @param[in] inDetailed Specify 'true' for a detailed representation; otherwise use 'false' for a brief one. + @return The given output stream. + **/ + virtual std::ostream & Print (std::ostream & inOutStream, const bool inDetailed = false) const; + + /** + @param[in] pInAncData A valid pointer to a base AJAAncillaryData object that contains the Anc data to inspect. + @return AJAAncillaryDataType if I recognize this Anc data (or AJAAncillaryDataType_Unknown if unrecognized). + **/ + static AJAAncillaryDataType RecognizeThisAncillaryData (const AJAAncillaryData * pInAncData); + + +protected: + void Init (void); // NOT virtual - called by constructors + +}; // AJAAncillaryData_HDR_HDR10 + +#endif // AJA_ANCILLARYDATA_HDR_HDR10_H diff --git a/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_hdr_hlg.h b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_hdr_hlg.h new file mode 100644 index 0000000..cb07c6b --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_hdr_hlg.h @@ -0,0 +1,84 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ancillarydata_hdr_hlg.h + @brief Declares the AJAAncillaryData_HDR_HLG class. + @copyright (C) 2012-2021 AJA Video Systems, Inc. +**/ + +#ifndef AJA_ANCILLARYDATA_HDR_HLG_H +#define AJA_ANCILLARYDATA_HDR_HLG_H + +#include "ancillarydatafactory.h" +#include "ancillarydata.h" + +const uint8_t AJAAncillaryData_HDR_HLG_DID = 0xC0; +const uint8_t AJAAncillaryData_HDR_HLG_SID = 0x00; + + +/** + @brief This class handles "5251" Frame Status Information packets. +**/ +class AJA_EXPORT AJAAncillaryData_HDR_HLG : public AJAAncillaryData +{ +public: + AJAAncillaryData_HDR_HLG (); ///< @brief My default constructor. + + /** + @brief My copy constructor. + @param[in] inClone The AJAAncillaryData object to be cloned. + **/ + AJAAncillaryData_HDR_HLG (const AJAAncillaryData_HDR_HLG & inClone); + + /** + @brief My copy constructor. + @param[in] pInClone A valid pointer to the AJAAncillaryData object to be cloned. + **/ + AJAAncillaryData_HDR_HLG (const AJAAncillaryData_HDR_HLG * pInClone); + + /** + @brief Constructs me from a generic AJAAncillaryData object. + @param[in] pInData A valid pointer to the AJAAncillaryData object. + **/ + AJAAncillaryData_HDR_HLG (const AJAAncillaryData * pInData); + + virtual ~AJAAncillaryData_HDR_HLG (); ///< @brief My destructor. + + virtual void Clear (void); ///< @brief Frees my allocated memory, if any, and resets my members to their default values. + + /** + @brief Assignment operator -- replaces my contents with the right-hand-side value. + @param[in] inRHS The value to be assigned to me. + @return A reference to myself. + **/ + virtual AJAAncillaryData_HDR_HLG & operator = (const AJAAncillaryData_HDR_HLG & inRHS); + + + virtual inline AJAAncillaryData_HDR_HLG * Clone (void) const {return new AJAAncillaryData_HDR_HLG (this);} ///< @return A clone of myself. + + /** + @brief Parses out (interprets) the "local" ancillary data from my payload data. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus ParsePayloadData (void); + + /** + @brief Streams a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream. + @param[in] inDetailed Specify 'true' for a detailed representation; otherwise use 'false' for a brief one. + @return The given output stream. + **/ + virtual std::ostream & Print (std::ostream & inOutStream, const bool inDetailed = false) const; + + /** + @param[in] pInAncData A valid pointer to a base AJAAncillaryData object that contains the Anc data to inspect. + @return AJAAncillaryDataType if I recognize this Anc data (or AJAAncillaryDataType_Unknown if unrecognized). + **/ + static AJAAncillaryDataType RecognizeThisAncillaryData (const AJAAncillaryData * pInAncData); + + +protected: + void Init (void); // NOT virtual - called by constructors + +}; // AJAAncillaryData_HDR_HLG + +#endif // AJA_ANCILLARYDATA_HDR_HLG_H diff --git a/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_hdr_sdr.h b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_hdr_sdr.h new file mode 100644 index 0000000..30f611b --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_hdr_sdr.h @@ -0,0 +1,84 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ancillarydata_hdr_sdr.h + @brief Declares the AJAAncillaryData_HDR_SDR class. + @copyright (C) 2012-2021 AJA Video Systems, Inc. +**/ + +#ifndef AJA_ANCILLARYDATA_HDR_SDR_H +#define AJA_ANCILLARYDATA_HDR_SDR_H + +#include "ancillarydatafactory.h" +#include "ancillarydata.h" + +const uint8_t AJAAncillaryData_HDR_SDR_DID = 0xC0; +const uint8_t AJAAncillaryData_HDR_SDR_SID = 0x00; + + +/** + @brief This class handles "5251" Frame Status Information packets. +**/ +class AJA_EXPORT AJAAncillaryData_HDR_SDR : public AJAAncillaryData +{ +public: + AJAAncillaryData_HDR_SDR (); ///< @brief My default constructor. + + /** + @brief My copy constructor. + @param[in] inClone The AJAAncillaryData object to be cloned. + **/ + AJAAncillaryData_HDR_SDR (const AJAAncillaryData_HDR_SDR & inClone); + + /** + @brief My copy constructor. + @param[in] pInClone A valid pointer to the AJAAncillaryData object to be cloned. + **/ + AJAAncillaryData_HDR_SDR (const AJAAncillaryData_HDR_SDR * pInClone); + + /** + @brief Constructs me from a generic AJAAncillaryData object. + @param[in] pInData A valid pointer to the AJAAncillaryData object. + **/ + AJAAncillaryData_HDR_SDR (const AJAAncillaryData * pInData); + + virtual ~AJAAncillaryData_HDR_SDR (); ///< @brief My destructor. + + virtual void Clear (void); ///< @brief Frees my allocated memory, if any, and resets my members to their default values. + + /** + @brief Assignment operator -- replaces my contents with the right-hand-side value. + @param[in] inRHS The value to be assigned to me. + @return A reference to myself. + **/ + virtual AJAAncillaryData_HDR_SDR & operator = (const AJAAncillaryData_HDR_SDR & inRHS); + + + virtual inline AJAAncillaryData_HDR_SDR * Clone (void) const {return new AJAAncillaryData_HDR_SDR (this);} ///< @return A clone of myself. + + /** + @brief Parses out (interprets) the "local" ancillary data from my payload data. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus ParsePayloadData (void); + + /** + @brief Streams a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream. + @param[in] inDetailed Specify 'true' for a detailed representation; otherwise use 'false' for a brief one. + @return The given output stream. + **/ + virtual std::ostream & Print (std::ostream & inOutStream, const bool inDetailed = false) const; + + /** + @param[in] pInAncData A valid pointer to a base AJAAncillaryData object that contains the Anc data to inspect. + @return AJAAncillaryDataType if I recognize this Anc data (or AJAAncillaryDataType_Unknown if unrecognized). + **/ + static AJAAncillaryDataType RecognizeThisAncillaryData (const AJAAncillaryData * pInAncData); + + +protected: + void Init (void); // NOT virtual - called by constructors + +}; // AJAAncillaryData_HDR_SDR + +#endif // AJA_ANCILLARYDATA_HDR_SDR_H diff --git a/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_timecode.h b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_timecode.h new file mode 100644 index 0000000..82d1ca9 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_timecode.h @@ -0,0 +1,317 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ancillarydata_timecode.h + @brief Declares the AJAAncillaryData_Timecode class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. +**/ + +#ifndef AJA_ANCILLARYDATA_TIMECODE_H +#define AJA_ANCILLARYDATA_TIMECODE_H + +#include "ajabase/common/timecode.h" +#include "ajabase/common/timebase.h" +#include "ancillarydatafactory.h" +#include "ancillarydata.h" + + +enum AJAAncillaryData_Timecode_Format +{ + AJAAncillaryData_Timecode_Format_Unknown, // not set (usually defaults to 30 fps) + + AJAAncillaryData_Timecode_Format_60fps, // 60/59.94 fps format ("NTSC") + AJAAncillaryData_Timecode_Format_50fps, // 50 fps format ("PAL") + AJAAncillaryData_Timecode_Format_48fps, // 48/47.95 fps format + AJAAncillaryData_Timecode_Format_30fps, // 30/29.97 fps format ("NTSC") + AJAAncillaryData_Timecode_Format_25fps, // 25 fps format ("PAL") + AJAAncillaryData_Timecode_Format_24fps // 24/23.98 fps format +}; + + +/** + @brief This is the base class for the AJAAncillaryData_Timecode_ATC and AJAAncillaryData_Timecode_VITC + classes, because they share the same "payload" data (i.e. timecode) and only differ in the transport + (ancillary packets vs. "analog" coding). + @note Do not instantiate a "pure" AJAAncillaryData_Timecode object. Always use the subclasses. +**/ +class AJAExport AJAAncillaryData_Timecode : public AJAAncillaryData +{ +public: + AJAAncillaryData_Timecode (); + AJAAncillaryData_Timecode (const AJAAncillaryData_Timecode & inClone); + AJAAncillaryData_Timecode (const AJAAncillaryData_Timecode * pClone); + AJAAncillaryData_Timecode (const AJAAncillaryData *pData); + + virtual inline ~AJAAncillaryData_Timecode () {} + + virtual void Clear (void); ///< @brief Frees my allocated memory, if any, and resets my members to their default values. + + /** + @brief Assignment operator -- replaces my contents with the right-hand-side value. + @param[in] inRHS The value to be assigned to me. + @return A reference to myself. + **/ + virtual AJAAncillaryData_Timecode & operator = (const AJAAncillaryData_Timecode & inRHS); + + virtual inline AJAAncillaryData_Timecode * Clone (void) const {return new AJAAncillaryData_Timecode (this);} ///< @return A clone of myself. + + /** + @brief Parses out (interprets) the "local" ancillary data from my payload data. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus ParsePayloadData (void); + + + /** + @brief Generate the payload data from the "local" ancillary data. + @note This method is overridden for the specific Anc data type. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GeneratePayloadData (void) {return AJA_STATUS_SUCCESS;} + + + /** + @brief Sets my raw "time" hex values. + @param[in] inDigitNum Specifies the index (0-7) of time digits in "transmission" order: + 0 = 1st (frame units) digit, 1 = 2nd digit, ... 7 = last (hour tens) digit. + @param[in] inHexValue Specifies the hex value (least significant 4 bits) to be set. + @param[in] inMask Optionally specifies which bits to set: (1 = set bit to new value, 0 = retain current bit value). + Defaults to 0x0F. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetTimeHexValue (const uint8_t inDigitNum, const uint8_t inHexValue, const uint8_t inMask = 0x0f); + + /** + @brief Answers with my current raw "time" hex values. + @param[in] inDigitNum Specifies the index (0-7) of the time digit of interest, in "transmission" order: + 0 = 1st (frame units) digit, 1 = 2nd digit, ... 7 = last (hour tens) digit. + @param[out] outHexValue Receives the hex value (least significant 4 bits) to be set. + @param[in] inMask Optionally specifies which bits to receive: (1 = set bit to new value, 0 = retain current bit value). + Defaults to 0x0F. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GetTimeHexValue (uint8_t inDigitNum, uint8_t & outHexValue, uint8_t inMask = 0x0f) const; + + /** + @brief Sets my timecode "time" using discrete BCD digits. + @param[in] inHourTens Specifies the hours "tens" digit value. + @param[in] inHourOnes Specifies the hours "ones" digit value. + @param[in] inMinTens Specifies the minutes "tens" digit value. + @param[in] inMinOnes Specifies the minutes "ones" digit value. + @param[in] inSecsTens Specifies the seconds "tens" digit value. + @param[in] inSecsOnes Specifies the seconds "ones" digit value. + @param[in] inFrameTens Specifies the frame "tens" digit value. + @param[in] inFrameOnes Specifies the frame "ones" digit value. + @note Each digit is masked to the number of bits allotted in the payload. Note that the digit order is reversed! + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetTimeDigits ( const uint8_t inHourTens, const uint8_t inHourOnes, + const uint8_t inMinTens, const uint8_t inMinOnes, + const uint8_t inSecsTens, const uint8_t inSecsOnes, + const uint8_t inFrameTens, const uint8_t inFrameOnes); + + /** + @brief Answers with my current timecode "time" as discrete BCD digits. + @param[out] outHourTens Specifies the hours "tens" digit value. + @param[out] outHourOnes Specifies the hours "ones" digit value. + @param[out] outMinTens Specifies the minutes "tens" digit value. + @param[out] outMinOnes Specifies the minutes "ones" digit value. + @param[out] outSecsTens Specifies the seconds "tens" digit value. + @param[out] outSecsOnes Specifies the seconds "ones" digit value. + @param[out] outFrameTens Specifies the frame "tens" digit value. + @param[out] outFrameOnes Specifies the frame "ones" digit value. + @note Each digit is masked to the number of bits allotted in the payload. Note that the digit order is reversed! + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GetTimeDigits ( uint8_t & outHourTens, uint8_t & outHourOnes, + uint8_t & outMinTens, uint8_t & outMinOnes, + uint8_t & outSecsTens, uint8_t & outSecsOnes, + uint8_t & outFrameTens, uint8_t & outFrameOnes) const; + + /** + @brief Sets my timecode "time" with hours, minutes, seconds, frames (in decimal, not BCD digits). + @param[in] inFormat Specifies a valid AJAAncillaryData_Timecode_Format. + @param[in] inHours Specifies the hours value, which must be less than 24. + @param[in] inMinutes Specifies the minutes value, which must be less than 60. + @param[in] inSeconds Specifies the seconds value, which must be less than 60. + @param[in] inFrames Specifies the frame value, which must be less than the frame rate. + @note This method takes into account the "FieldID" bit for HFR timecode formats (e.g. p50, p59.94, p60, etc.). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetTime (const AJAAncillaryData_Timecode_Format inFormat, const uint32_t inHours, + const uint32_t inMinutes, const uint32_t inSeconds, const uint32_t inFrames); + + /** + @brief Answers with my current timecode "time" as individual hour, minute, second, and frame components (in decimal, not BCD digits). + @param[in] inFormat Specifies a valid AJAAncillaryData_Timecode_Format. + @param[out] outHours Receives the hours value. + @param[out] outMinutes Receives the minutes value. + @param[out] outSeconds Receives the seconds value. + @param[out] outFrames Receives the frame value. + @note This method takes into account the "FieldID" bit for HFR timecode formats (e.g. p50, p59.94, p60, etc.). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GetTime (const AJAAncillaryData_Timecode_Format inFormat, uint32_t & outHours, + uint32_t & outMinutes, uint32_t & outSeconds, uint32_t & outFrames) const; + + /** + @brief Sets my timecode "time" from an AJATimeCode. + @param[in] inTimecode Specifies the timecode. + @param[in] inTimeBase Specifies the time base (frame rate) associated with the specified timecode. + @param[in] inIsDropFrame Specify 'true' for dropframe; otherwise false. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetTimecode (const AJATimeCode & inTimecode, const AJATimeBase & inTimeBase, const bool inIsDropFrame); + + /** + @brief Answers with my timecode "time" as an AJATimeCode. + @param[out] outTimecode Receives the timecode. + @param[out] outTimeBase Receives the time base (frame rate). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GetTimecode (AJATimeCode & outTimecode, AJATimeBase & outTimeBase) const; + + + /** + @brief Sets my raw "Binary Group" hex values. + @param[in] digitNum the index (0 - 7) of the Binary Group value in "transmission" order, i.e. 0 = 1st (BG1) digit, 1 = 2nd digit, ..., 7 = last (BG7) digit + @param[in] hexValue the hex value (ls 4 bits) to be set/get + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetBinaryGroupHexValue (uint8_t digitNum, uint8_t hexValue, uint8_t mask = 0x0f); + virtual AJAStatus GetBinaryGroupHexValue (uint8_t digitNum, uint8_t& hexValue, uint8_t mask = 0x0f) const; + + /** + @brief Sets my binary group values. + @param[in] bg8 binary group values (only the ls 4 bits of each value are retained) - note that the BG order is reversed!) + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetBinaryGroups (uint8_t bg8, uint8_t bg7, uint8_t bg6, uint8_t bg5, uint8_t bg4, uint8_t bg3, uint8_t bg2, uint8_t bg1); + virtual AJAStatus GetBinaryGroups (uint8_t& bg8, uint8_t& bg7, uint8_t& bg6, uint8_t& bg5, uint8_t& bg4, uint8_t& bg3, uint8_t& bg2, uint8_t& bg1) const; + + + /** + @brief Sets my FieldID flag. + @param[in] bFlag false = field 1 (0), true = field 2 (1) + @param[in] tcFmt AJAAncillaryData_Timecode_Format associated with timecode (default is handled as 30-frame timecode). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetFieldIdFlag (bool bFlag, AJAAncillaryData_Timecode_Format tcFmt = AJAAncillaryData_Timecode_Format_Unknown); + virtual AJAStatus GetFieldIdFlag (bool& bFlag, AJAAncillaryData_Timecode_Format tcFmt = AJAAncillaryData_Timecode_Format_Unknown) const; + + + /** + @brief Sets my drop frame flag. + @param[in] bFlag false = non-dropframe format, true = drop frame + @param[in] tcFmt AJAAncillaryData_Timecode_Format associated with timecode (default is handled as 30-frame timecode). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetDropFrameFlag (bool bFlag, AJAAncillaryData_Timecode_Format tcFmt = AJAAncillaryData_Timecode_Format_Unknown); + virtual AJAStatus GetDropFrameFlag (bool& bFlag, AJAAncillaryData_Timecode_Format tcFmt = AJAAncillaryData_Timecode_Format_Unknown) const; + + + /** + @brief Sets my color frame flag. + @param[in] bFlag false = no relation between color frames and timecode values, true = timecode values are aligned with color frames (see SMPTE-12M). + @param[in] tcFmt AJAAncillaryData_Timecode_Format associated with timecode (default is handled as 30-frame timecode). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetColorFrameFlag (bool bFlag, AJAAncillaryData_Timecode_Format tcFmt = AJAAncillaryData_Timecode_Format_Unknown); + virtual AJAStatus GetColorFrameFlag (bool& bFlag, AJAAncillaryData_Timecode_Format tcFmt = AJAAncillaryData_Timecode_Format_Unknown) const; + + + /** + @brief Sets my binary group flag (3 bits). + @param[in] inBGFlag Specifies the BG Flag value (only the least significant 3 bits are retained). + @param[in] inFormat Specifies the timecode format associated with timecode (default is handled as 30-frame timecode). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetBinaryGroupFlag (const uint8_t inBGFlag, const AJAAncillaryData_Timecode_Format inFormat = AJAAncillaryData_Timecode_Format_Unknown); + + /** + @brief Answers with my current binary group flag (3 bits). + @param[out] outBGFlag Specifies the BG Flag value (only the least significant 3 bits are retained). + @param[in] inFormat Specifies the timecode format associated with timecode (default is handled as 30-frame timecode). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GetBinaryGroupFlag (uint8_t & outBGFlag, const AJAAncillaryData_Timecode_Format inFormat = AJAAncillaryData_Timecode_Format_Unknown) const; + + /** + @param[in] pInAncData A valid pointer to an AJAAncillaryData instance. + @return The AJAAncillaryDataType if I recognize this ancillary data (or unknown if unrecognized). + **/ + static AJAAncillaryDataType RecognizeThisAncillaryData (const AJAAncillaryData * pInAncData); + + /** + @brief Streams a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream. + @param[in] inDetailed Specify 'true' for a detailed representation; otherwise use 'false' for a brief one. + @return The given output stream. + **/ + virtual std::ostream & Print (std::ostream & inOutStream, const bool inDetailed = false) const; + + /** + @return A string containing my human-readable timecode. + **/ + virtual std::string TimecodeString (void) const; + + /** + @brief Get the timecode format that matches the input timebase. + @param[in] inTimeBase Specifies the time base (frame rate) associated with the specified timecode. + @return The AJAAncillaryData_Timecode_Format that corresponds to the input timebase, returns AJAAncillaryData_Timecode_Format_Unknown when no match found. + **/ + static AJAAncillaryData_Timecode_Format GetTimecodeFormatFromTimeBase (const AJATimeBase & inTimeBase); + +protected: + void Init (void); // NOT virtual - called by constructors + + // Which timecode digits go in which elements of timeDigits[] + // Note that this is the same order as received/transmitted, i.e. ls digits FIRST! + enum + { + kTcFrameUnits = 0, + kTcFrameTens = 1, + kTcSecondUnits = 2, + kTcSecondTens = 3, + kTcMinuteUnits = 4, + kTcMinuteTens = 5, + kTcHourUnits = 6, + kTcHourTens = 7, + kNumTimeDigits = 8 + }; + + // Which binary groups go in which elements of binaryGroup[]? + // Note that this is the same order as received/transmitted, i.e. ls digits FIRST! + enum + { + kBg1 = 0, + kBg2 = 1, + kBg3 = 2, + kBg4 = 3, + kBg5 = 4, + kBg6 = 5, + kBg7 = 6, + kBg8 = 7, + kNumBinaryGroups = 8 + }; + + // Note: if you make a change to the local member data, be sure to ALSO make the appropriate + // changes in the Init() and operator= methods! + + // The timecode data is stored as "raw" hex nibbles of data, split up between "time" values and "binary group" values. + // This means that sundry "flags" which take advantage of unused time bits (e.g. bits 2 and 3 of the hour tens digit) + // are kept with the hex digit data, and only parsed in or out by the appropriate Set()/Get() methods. + uint8_t m_timeDigits[kNumTimeDigits]; // the 8 hex values of the time data, in order of received/transmitted (i.e. ls digits first) + uint8_t m_binaryGroup[kNumBinaryGroups]; // the 8 hex values of the "Binary Groups", in order from BG1 - BG8 + +}; // AJAAncillaryData_Timecode + + +/** + @brief Writes a human-readable rendition of the given AJAAncillaryData_Timecode into the given output stream. + @param inOutStream Specifies the output stream to be written. + @param[in] inAncData Specifies the AJAAncillaryData_Timecode to be rendered into the output stream. + @return A non-constant reference to the specified output stream. +**/ +inline std::ostream & operator << (std::ostream & inOutStream, const AJAAncillaryData_Timecode & inAncData) {return inAncData.Print (inOutStream);} + +#endif // AJA_ANCILLARYDATA_TIMECODE_H diff --git a/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_timecode_atc.h b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_timecode_atc.h new file mode 100644 index 0000000..08e2904 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_timecode_atc.h @@ -0,0 +1,148 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ancillarydata_timecode_atc.h + @brief Declares the AJAAncillaryData_Timecode_ATC class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. +**/ + +#ifndef AJA_ANCILLARYDATA_TIMECODE_ATC_H +#define AJA_ANCILLARYDATA_TIMECODE_ATC_H + +#include "ancillarydatafactory.h" +#include "ancillarydata.h" +#include "ancillarydata_timecode.h" + + +// SMPTE 12M Ancillary Packet (formerly "RP-188") +const uint8_t AJAAncillaryData_SMPTE12M_DID = 0x60; +const uint8_t AJAAncillaryData_SMPTE12M_SID = 0x60; +const uint32_t AJAAncillaryData_SMPTE12M_PayloadSize = 16; // constant 16 bytes + + +// see SMPTE 12M-2 Table 2 +enum AJAAncillaryData_Timecode_ATC_DBB1PayloadType +{ + AJAAncillaryData_Timecode_ATC_DBB1PayloadType_LTC = 0x00, + AJAAncillaryData_Timecode_ATC_DBB1PayloadType_VITC1 = 0x01, + AJAAncillaryData_Timecode_ATC_DBB1PayloadType_VITC2 = 0x02, + + AJAAncillaryData_Timecode_ATC_DBB1PayloadType_ReaderFilmData = 0x06, + AJAAncillaryData_Timecode_ATC_DBB1PayloadType_ReaderProdData = 0x07, + + AJAAncillaryData_Timecode_ATC_DBB1PayloadType_LocalVideoData = 0x7D, + AJAAncillaryData_Timecode_ATC_DBB1PayloadType_LocalFilmData = 0x7E, + AJAAncillaryData_Timecode_ATC_DBB1PayloadType_LocalProdData = 0x7F, + + AJAAncillaryData_Timecode_ATC_DBB1PayloadType_Unknown = 0xFF +}; + + +/** + @brief I am the ATC-specific (analog) subclass of the AJAAncillaryData_Timecode class. +**/ +class AJAExport AJAAncillaryData_Timecode_ATC : public AJAAncillaryData_Timecode +{ +public: + AJAAncillaryData_Timecode_ATC (); ///< @brief My default constructor. + + /** + @brief My copy constructor. + @param[in] inClone The object to be cloned. + **/ + AJAAncillaryData_Timecode_ATC (const AJAAncillaryData_Timecode_ATC & inClone); + + /** + @brief My copy constructor. + @param[in] pInClone A valid pointer to the object to be cloned. + **/ + AJAAncillaryData_Timecode_ATC (const AJAAncillaryData_Timecode_ATC * pInClone); + + /** + @brief My copy constructor. + @param[in] pInData A valid pointer to the object to be cloned. + **/ + AJAAncillaryData_Timecode_ATC (const AJAAncillaryData * pInData); + + virtual ~AJAAncillaryData_Timecode_ATC (); ///< @brief My destructor. + + virtual void Clear (void); ///< @brief Frees my allocated memory, if any, and resets my members to their default values. + + /** + @brief Assignment operator -- replaces my contents with the right-hand-side value. + @param[in] inRHS The value to be assigned to me. + @return A reference to myself. + **/ + virtual AJAAncillaryData_Timecode_ATC & operator = (const AJAAncillaryData_Timecode_ATC & inRHS); + + virtual inline AJAAncillaryData_Timecode_ATC * Clone (void) const {return new AJAAncillaryData_Timecode_ATC (this);} ///< @return A clone of myself. + + + /** + * Set/Get the Distributed Binary Bits + * + * @param[in] dbb1 DBB bits + * @return AJA_STATUS_SUCCESS + */ + virtual AJAStatus SetDBB1(uint8_t dbb1); + virtual AJAStatus GetDBB1(uint8_t& dbb1) const; + + virtual AJAStatus SetDBB2(uint8_t dbb2); + virtual AJAStatus GetDBB2(uint8_t& dbb2) const; + + virtual AJAStatus SetDBB(uint8_t dbb1, uint8_t dbb2); + virtual AJAStatus GetDBB(uint8_t& dbb1, uint8_t& dbb2) const; + + + /** + @brief Sets my payload type. + @param[in] inType Specifies the payload type. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetDBB1PayloadType (const AJAAncillaryData_Timecode_ATC_DBB1PayloadType inType); + + /** + @brief Answers with my current payload type. + @param[out] outType Receives my payload type. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GetDBB1PayloadType (AJAAncillaryData_Timecode_ATC_DBB1PayloadType & outType) const; + + /** + @brief Parses out (interprets) the "local" ancillary data from my payload data. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus ParsePayloadData (void); + + /** + @brief Generate the payload data from the "local" ancillary data. + @note This method is overridden for the specific Anc data type. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GeneratePayloadData (void); + + /** + @brief Streams a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream. + @param[in] inDetailed Specify 'true' for a detailed representation; otherwise use 'false' for a brief one. + @return The given output stream. + **/ + virtual std::ostream & Print (std::ostream & inOutStream, const bool inDetailed = false) const; + + /** + @param[in] pInAncData A valid pointer to a base AJAAncillaryData object that contains the Anc data to inspect. + @return AJAAncillaryDataType if I recognize this Anc data (or AJAAncillaryDataType_Unknown if unrecognized). + **/ + static AJAAncillaryDataType RecognizeThisAncillaryData (const AJAAncillaryData * pInAncData); + +protected: + void Init (void); // NOT virtual - called by constructors + + // Note: if you make a change to the local member data, be sure to ALSO make the appropriate + // changes in the Init() and operator= methods! + uint8_t m_dbb1; // "Distributed Binary Bits" - only transported by ATC + uint8_t m_dbb2; // + +}; // AJAAncillaryData_Timecode_ATC + +#endif // AJA_ANCILLARYDATA_TIMECODE_ATC_H + diff --git a/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_timecode_vitc.h b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_timecode_vitc.h new file mode 100644 index 0000000..16ff966 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydata_timecode_vitc.h @@ -0,0 +1,124 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ancillarydata_timecode_vitc.h + @brief Declares the AJAAncillaryData_Timecode_VITC class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. +**/ + +#ifndef AJA_ANCILLARYDATA_TIMECODE_VITC_H +#define AJA_ANCILLARYDATA_TIMECODE_VITC_H + +#include "ancillarydatafactory.h" +#include "ancillarydata.h" +#include "ancillarydata_timecode.h" + + +// comment this out to use older "NTV2" VITC Encode algorithm +// leave defined to use "D-VITC" parameters as defined in SMPTE-266M +#define USE_SMPTE_266M + + +// VITC ("Analog") Packet IDs +const uint8_t AJAAncillaryData_VITC_DID = AJAAncillaryData_AnalogSID; +const uint8_t AJAAncillaryData_VITC_SID = AJAAncillaryData_AnalogDID; + +const uint32_t AJAAncillaryData_VITC_PayloadSize = 720; // note: assumes we're only using this for SD (720 pixels/line) + + +enum AJAAncillaryData_Timecode_VITC_Type +{ + AJAAncillaryData_Timecode_VITC_Type_Unknown = 0, + AJAAncillaryData_Timecode_VITC_Type_Timecode = 1, // CRC == 0x00 + AJAAncillaryData_Timecode_VITC_Type_FilmData = 2, // RP-201 Film Data (CRC == 0xFF) + AJAAncillaryData_Timecode_VITC_Type_ProdData = 3 // RP-201 Production Data (CRC == 0x0F) +}; + + + +/** + @brief This is the VITC-specific subclass of the AJAAncillaryData_Timecode class. +**/ +class AJAExport AJAAncillaryData_Timecode_VITC : public AJAAncillaryData_Timecode +{ +public: + AJAAncillaryData_Timecode_VITC (); + AJAAncillaryData_Timecode_VITC (const AJAAncillaryData_Timecode_VITC & clone); + AJAAncillaryData_Timecode_VITC (const AJAAncillaryData_Timecode_VITC * pClone); + AJAAncillaryData_Timecode_VITC (const AJAAncillaryData * pData); + + virtual ~AJAAncillaryData_Timecode_VITC () {} + + virtual void Clear (void); ///< @brief Frees my allocated memory, if any, and resets my members to their default values. + + /** + @brief Assignment operator -- replaces my contents with the right-hand-side value. + @param[in] inRHS The value to be assigned to me. + @return A reference to myself. + **/ + virtual AJAAncillaryData_Timecode_VITC & operator = (const AJAAncillaryData_Timecode_VITC & inRHS); + + virtual inline AJAAncillaryData_Timecode_VITC * Clone (void) const {return new AJAAncillaryData_Timecode_VITC (this);} ///< @return A clone of myself. + + /** + @brief Parses out (interprets) the "local" ancillary data from my payload data. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus ParsePayloadData (void); + + /** + @brief Generate the payload data from the "local" ancillary data. + @note This method is overridden for the specific Anc data type. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GeneratePayloadData (void); + + virtual inline AJAAncillaryData_Timecode_VITC_Type GetVITCDataType (void) const {return m_vitcType;} ///< @return The "type" of received VITC data based on the parsed CRC. + + /** + @brief Sets my VITC data type. + @param[in] inType Specifies my new VITC data type. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SetVITCDataType (const AJAAncillaryData_Timecode_VITC_Type inType); + + /** + @brief Streams a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream. + @param[in] inDetailed Specify 'true' for a detailed representation; otherwise use 'false' for a brief one. + @return The given output stream. + **/ + virtual std::ostream & Print (std::ostream & inOutStream, const bool inDetailed = false) const; + + + /** + @param[in] pInAncData A valid pointer to an AJAAncillaryData instance. + @return The AJAAncillaryDataType if I recognize this ancillary data (or unknown if unrecognized). + **/ + static AJAAncillaryDataType RecognizeThisAncillaryData (const AJAAncillaryData * pInAncData); + + /** + @param[in] inType Specifies the VITC data type. + @return A string containing a human-readable representation of the given VITC data type. + **/ + static std::string VITCTypeToString (const AJAAncillaryData_Timecode_VITC_Type inType); + + +protected: + void Init (void); // NOT virtual - called by constructors + + // Encode methods ported/stolen from ntv2vitc.cpp + bool DecodeLine (const uint8_t * pInLine); + AJAStatus EncodeLine (uint8_t * pOutLine) const; + +#ifdef USE_SMPTE_266M +#else + void DoVITCBitPair(uint8_t *pLine, uint32_t& pixelIndex, bool bPrevBit, bool bBit0, bool bBit1, bool bDropBit); +#endif + + // Note: if you make a change to the local member data, be sure to ALSO make the appropriate + // changes in the Init() and operator= methods! + AJAAncillaryData_Timecode_VITC_Type m_vitcType; ///< @brief The "type" of VITC received or to be transmitted + +}; // AJAAncillaryData_Timecode_VITC + +#endif // AJA_ANCILLARYDATA_TIMECODE_VITC_H diff --git a/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydatafactory.h b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydatafactory.h new file mode 100644 index 0000000..a9ddaa8 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarydatafactory.h @@ -0,0 +1,59 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ancillarydatafactory.h + @brief Declaration of the AJAAncillaryDataFactory class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. +**/ + +#ifndef AJA_ANCILLARYDATAFACTORY_H + #define AJA_ANCILLARYDATAFACTORY_H + + #include "ancillarydata.h" + + + /** + @brief Use my AJAAncillaryDataFactory::GuessAncillaryDataType method to determine what kind of + ancillary data is being held by a (generic) ::AJAAncillaryData object. + Use my AJAAncillaryDataFactory::Create method to instantiate a new ::AJAAncillaryData + object specific to a given type. + **/ + class AJAExport AJAAncillaryDataFactory + { + public: + /** + @brief Creates a new particular subtype of ::AJAAncillaryData object. + @param[in] inAncType Specifies the subtype of ::AJAAncillaryData object (subclass) to instantiate. + @param[in] inAncData Supplies an existing ::AJAAncillaryData object to clone from. + @return A pointer to the new instance; or NULL upon failure. + **/ + static AJAAncillaryData * Create (const AJAAncillaryDataType inAncType, const AJAAncillaryData & inAncData); + + /** + @brief Creates a new ::AJAAncillaryData object having a particular subtype. + @param[in] inAncType Type of ::AJAAncillaryData object (subclass) to instantiate. + @param[in] pInAncData Optionally supplies an existing ::AJAAncillaryData object to clone from. + @return A pointer to the new instance; or NULL upon failure. + **/ + static AJAAncillaryData * Create (const AJAAncillaryDataType inAncType, const AJAAncillaryData * pInAncData = NULL); + + + /** + @brief Given a generic ::AJAAncillaryData object, attempts to guess what kind of specific + ::AJAAncillaryData object it might be from its raw packet data. + @param[in] inAncData An ::AJAAncillaryData object that contains "raw" packet data. + @return The guessed ::AJAAncillaryDataType (or ::AJAAncillaryDataType_Unknown if no idea...). + **/ + static AJAAncillaryDataType GuessAncillaryDataType (const AJAAncillaryData & inAncData); + + /** + @brief Given a generic ::AJAAncillaryData object, attempts to guess what kind of specific + ::AJAAncillaryData object from its raw packet data. + @param[in] pInAncData A valid, non-NULL pointer to an ::AJAAncillaryData object that contains + "raw" packet data. + @return The guessed ::AJAAncillaryDataType (or ::AJAAncillaryDataType_Unknown if no idea...). + **/ + static AJAAncillaryDataType GuessAncillaryDataType (const AJAAncillaryData * pInAncData); + + }; // AJAAncillaryDataFactory + +#endif // AJA_ANCILLARYDATAFACTORY_H diff --git a/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarylist.h b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarylist.h new file mode 100644 index 0000000..e0bbf52 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajaanc/includes/ancillarylist.h @@ -0,0 +1,671 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ancillarylist.h + @brief Declares the AJAAncillaryList class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. +**/ + +#ifndef AJA_ANCILLARYLIST_H +#define AJA_ANCILLARYLIST_H + +#include "ancillarydata.h" +#include "ntv2formatdescriptor.h" +#include +#include +#include + + +// used for "match any" searches and counts +const uint8_t AJAAncillaryDataWildcard_DID = 0xFF; +const uint8_t AJAAncillaryDataWildcard_SID = 0xFF; + +/** + @brief Associates certain frame line numbers with specific types of "raw" or "analog" ancillary data. + For example, you may wish to associate line 21 (in 525i) with ::AJAAncillaryDataType_Cea608_Line21. + @note This facility is ONLY used by AJAAncillaryList::AddReceivedAncillaryData to identify captured + "raw" data (AJAAncillaryDataCoding_Analog). +**/ +typedef std::map AJAAncillaryAnalogTypeMap; + +typedef std::vector AJAU32Pkts; ///< @brief Ordered sequence of U32 RTP packets (U32s in network byte order) +typedef AJAU32Pkts::const_iterator AJAU32PktsConstIter; ///< @brief Handy const iterator over AJAU32Pkts +typedef AJAU32Pkts::iterator AJAU32PktsIter; ///< @brief Handy non-const iterator over AJAU32Pkts + +typedef UByteSequence AJAAncPktCounts; ///< @brief Ordered sequence of SMPTE Anc packet counts +typedef AJAAncPktCounts::const_iterator AJAAncPktCountsConstIter; ///< @brief Handy const iterator over AJAAncPktCounts +class CNTV2Card; + +typedef std::set AJAAncPktDIDSIDSet; ///< @brief Set of distinct packet DID/SIDs (New in SDK 16.0) +typedef AJAAncPktDIDSIDSet::const_iterator AJAAncPktDIDSIDSetConstIter; ///< @brief Handy const iterator for AJAAncPktDIDSIDSet (New in SDK 16.0) +typedef AJAAncPktDIDSIDSet::iterator AJAAncPktDIDSIDSetIter; ///< @brief Handy non-const iterator for AJAAncPktDIDSIDSet (New in SDK 16.0) + + +/** + @brief I am an ordered collection of AJAAncillaryData instances which represent one or more SMPTE 291 + data packets that were captured from, or destined to be played into, one video field or frame. + I can be built from the ancillary data received by the hardware during one field/frame, and/or + built "from scratch" and used as the source of outgoing ancillary data to hardware. + + By default, packets (::AJAAncillaryData instances) remain in the order added to me. + Use my AJAAncillaryList::SortListByDID, AJAAncillaryList::SortListBySID or AJAAncillaryList::SortListByLocation + methods to sort my packets by DID, SDID or location. + + @warning I am not thread-safe! When any of my non-const instance methods are called by one thread, + do not call any of my other instance methods from any other thread. +**/ +class AJAExport AJAAncillaryList +{ +public: // CLASS METHODS + + /** + @name Create from Device Buffers (Capture/Ingest) + **/ + ///@{ + /** + @brief Returns all packets found in the VANC lines of the given NTV2 frame buffer. + @param[in] inFrameBuffer Specifies the NTV2 frame buffer (or at least the portion containing the VANC lines). + @param[in] inFormatDesc Describes the frame buffer (pixel format, video standard, etc.). + @param[out] outPackets Receives the packets found. + @param[in] inFrameNum If non-zero, specifies/sets the frame identifier for the packets. + @return AJA_STATUS_SUCCESS if successful. + @bug The ::AJAAncillaryDataLink in the ::AJAAncillaryDataLocation in each of the returned packets + is currently ::AJAAncillaryDataLink_A, which will be incorrect if, for example, the FrameStore + that delivered the \c inFrameBuffer was sourced from the "B" link of a Dual-Link SDI source. + **/ + static AJAStatus SetFromVANCData (const NTV2_POINTER & inFrameBuffer, + const NTV2FormatDescriptor & inFormatDesc, + AJAAncillaryList & outPackets, + const uint32_t inFrameNum = 0); + + /** + @brief Returns all ancillary data packets found in the given F1 and F2 ancillary data buffers. + @param[in] inF1AncBuffer Specifies the F1 ancillary data buffer. + @param[in] inF2AncBuffer Specifies the F2 ancillary data buffer. + @param[out] outPackets Receives the packet list. + @param[in] inFrameNum If non-zero, replaces the frame identifier of new packets that have a zero frame ID. + @return AJA_STATUS_SUCCESS if successful. + **/ + static AJAStatus SetFromDeviceAncBuffers (const NTV2_POINTER & inF1AncBuffer, + const NTV2_POINTER & inF2AncBuffer, + AJAAncillaryList & outPackets, + const uint32_t inFrameNum = 0); + + #if !defined(NTV2_DEPRECATE_15_2) + static inline AJAStatus SetFromSDIAncData (const NTV2_POINTER & inF1, const NTV2_POINTER & inF2, AJAAncillaryList & outPkts) {return SetFromDeviceAncBuffers(inF1, inF2, outPkts);} ///< @deprecated Use SetFromDeviceAncBuffers instead. + static inline AJAStatus SetFromIPAncData (const NTV2_POINTER & inF1, const NTV2_POINTER & inF2, AJAAncillaryList & outPkts) {return SetFromDeviceAncBuffers(inF1, inF2, outPkts);} ///< @deprecated Use SetFromDeviceAncBuffers instead. + #endif // !defined(NTV2_DEPRECATE_15_2) + ///@} + + + /** + @name Global Configuration + **/ + ///@{ + /** + @brief Clears my global Analog Ancillary Data Type map. + @return AJA_STATUS_SUCCESS if successful. + **/ + static AJAStatus ClearAnalogAncillaryDataTypeMap (void); + + + /** + @brief Copies the given map to the global Analog Ancillary Data Type map. + @param[in] inMap The map to copy. + @return AJA_STATUS_SUCCESS if successful. + **/ + static AJAStatus SetAnalogAncillaryDataTypeMap (const AJAAncillaryAnalogTypeMap & inMap); + + + /** + @brief Returns a copy of the global Analog Ancillary Data Type map. + @param[out] outMap Receives a copy of the map. + @return AJA_STATUS_SUCCESS if successful. + **/ + static AJAStatus GetAnalogAncillaryDataTypeMap (AJAAncillaryAnalogTypeMap & outMap); + + + /** + @brief Sets (or changes) the map entry for the designated line to the designated type. + @param[in] inLineNum Specifies the frame line number to be added or changed. + @param[in] inType Specifies the ancillary data type to be associated with this line. + Use AJAAncillaryDataType_Unknown to remove any associations with the line. + @return AJA_STATUS_SUCCESS if successful. + **/ + static AJAStatus SetAnalogAncillaryDataTypeForLine (const uint16_t inLineNum, const AJAAncillaryDataType inType); + + + /** + @brief Answers with the ancillary data type associated with the designated line. + @param[in] inLineNum Specifies the frame line number of interest. + @return The ancillary data type associated with the designated line, if any; + otherwise AJAAncillaryDataType_Unknown if the line has no association. + **/ + static AJAAncillaryDataType GetAnalogAncillaryDataTypeForLine (const uint16_t inLineNum); + + + /** + @brief Sets whether or not zero-length packets are included or not. + @param[in] inExclude Specify true to exclude zero-length packets. + **/ + static void SetIncludeZeroLengthPackets (const bool inExclude); + static uint32_t GetExcludedZeroLengthPacketCount (void); ///< @return The current number of zero-length packets that have been excluded + static void ResetExcludedZeroLengthPacketCount (void); ///< @brief Resets my tally of excluded zero-length packets to zero. + static bool IsIncludingZeroLengthPackets (void); ///< @return True if zero-length packets are included; otherwise false. + ///@} + + +public: // INSTANCE METHODS + /** + @name Construction, Destruction, Assignment & Copying + **/ + ///@{ + AJAAncillaryList (); ///< @brief Instantiate and initialize with a default set of values. + inline AJAAncillaryList (const AJAAncillaryList & inRHS) {*this = inRHS;} ///< @brief My copy constructor. + virtual ~AJAAncillaryList (); ///< @brief My destructor. + + /** + @brief Assignment operator -- replaces my contents with the right-hand-side value. + @param[in] inRHS The value to be assigned to me. + @return A reference to myself. + **/ + virtual AJAAncillaryList & operator = (const AJAAncillaryList & inRHS); + ///@} + + + /** + @name Fetching, Searching & Enumerating Packets + **/ + ///@{ + + /** + @brief Answers with the number of AJAAncillaryData objects I contain (any/all types). + @return The number of AJAAncillaryData objects I contain. + **/ + virtual inline uint32_t CountAncillaryData (void) const {return uint32_t(m_ancList.size());} + + /** + @return True if I'm empty; otherwise false. + **/ + virtual inline bool IsEmpty (void) const {return !CountAncillaryData();} + + /** + @brief Answers with the AJAAncillaryData object at the given index. + @param[in] inIndex Specifies the zero-based index position. + @return The AJAAncillaryData object at the given index (or NULL if not found). + @note The AJAAncillaryList owns the returned object. If the list gets Cleared or deleted, the returned pointer will become invalid. + **/ + virtual AJAAncillaryData * GetAncillaryDataAtIndex (const uint32_t inIndex) const; + + /** + @brief Answers with the number of AJAAncillaryData objects having the given type. + @param[in] inMatchType Specifies the AJAAncillaryDataType to match. + @return The number of AJAAncillaryData objects having the given type. + **/ + virtual uint32_t CountAncillaryDataWithType (const AJAAncillaryDataType inMatchType) const; + + /** + @brief Answers with the AJAAncillaryData object having the given type and index. + @param[in] inMatchType Specifies the AJAAncillaryDataType to match. + @param[in] inIndex Specifies the desired instance of the given type (use zero for the first one). + @return The AJAAncillaryData object (or NULL if not found). + @note The AJAAncillaryList owns the returned object. If the list gets Cleared or deleted, the returned pointer will become invalid. + **/ + virtual AJAAncillaryData * GetAncillaryDataWithType (const AJAAncillaryDataType inMatchType, const uint32_t inIndex = 0) const; + + /** + @brief Answers with the number of AncillaryData objects having the given DataID and SecondaryID. + @param[in] inDID Specifies the DataID to match. Use AJAAncillaryDataWildcard_DID to match any/all DIDs. + @param[in] inSID Specifies the secondary ID to match. Use AJAAncillaryDataWildcard_SID to match any/all SIDs. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual uint32_t CountAncillaryDataWithID (const uint8_t inDID, const uint8_t inSID) const; + + /** + @brief Answers with the AJAAncillaryData object having the given DataID and SecondaryID, at the given index. + @param[in] inDID DataID to match (use AJAAncillaryDataWildcard_DID to match "any" DID) + @param[in] inSID Secondary ID to match (use AJAAncillaryDataWildcard_SID to match "any" SID) + @param[in] inIndex Specifies which instance among those having the given DID and SID (use zero for the first one). + @return The AJAAncillaryData object having the given DID, SID and index. + @note The AJAAncillaryList owns the returned object. If the list gets Cleared or deleted, the returned pointer will become invalid. + **/ + virtual AJAAncillaryData * GetAncillaryDataWithID (const uint8_t inDID, const uint8_t inSID, const uint32_t inIndex = 0) const; + + virtual AJAAncPktDIDSIDSet GetAncillaryPacketIDs (void) const; ///< @return The set of DID/SID pairs of all of my packets. (New in SDK 16.0) + ///@} + + + /** + @name Adding & Removing Packets + **/ + ///@{ + + /** + @brief Removes and frees all of my AJAAncillaryData objects. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus Clear (void); + + /** + @brief Adds (appends) a copy (using AJAAncillaryData::Clone) of the given list's packet objects to me. + @param[in] inPackets Specifies the AJAAncillaryList containing the packets to be copied and added to me. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus AddAncillaryData (const AJAAncillaryList & inPackets); + + /** + @brief Adds (appends) a copy (using AJAAncillaryData::Clone) of the AJAAncillaryData object to me. + @param[in] pInAncData Specifies the AJAAncillaryData object to be copied and added to me. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus AddAncillaryData (const AJAAncillaryData * pInAncData); + + /** + @brief Adds a copy of the AJAAncillaryData object to me. + @param[in] inAncData Specifies the AJAAncillaryData object to be copied and added to me. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual inline AJAStatus AddAncillaryData (const AJAAncillaryData & inAncData) {return AddAncillaryData(&inAncData);} + + /** + @brief Removes all copies of the AJAAncillaryData object from me. + @note The given AJAAncillaryData object is not freed/deleted -- it's only removed from my list. + @param[in] pInAncData Specifies the AJAAncillaryData object to remove. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus RemoveAncillaryData (AJAAncillaryData * pInAncData); + + /** + @brief Removes all copies of the AJAAncillaryData object from me and deletes the object itself. + @param[in] pInAncData Specifies the AJAAncillaryData object to remove and delete. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus DeleteAncillaryData (AJAAncillaryData * pInAncData); + ///@} + + + /** + @name Operations + **/ + ///@{ + + /** + @brief Sort the AncillaryDataList by DataID (DID) value. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SortListByDID (void); + + /** + @brief Sort the AncillaryDataList by Secondary ID (SID) value. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SortListBySID (void); + + /** + @brief Sort the AncillaryDataList by "location", i.e. where in the video (field, line num, HANC/VANC) + the data came from or will be inserted to. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus SortListByLocation (void); + + /** + @brief Compares me with another list. + @param[in] inCompareList Specifies the other list to be compared with me. + @param[in] inIgnoreLocation If true, don't compare each packet's AJAAncillaryDataLocation info. Defaults to true. + @param[in] inIgnoreChecksum If true, don't compare each packet's checksums. Defaults to true. + @return AJA_STATUS_SUCCESS if equal; otherwise AJA_STATUS_FAIL. + @note The sort order of each list, to be considered identical, must be the same. + **/ + virtual AJAStatus Compare (const AJAAncillaryList & inCompareList, const bool inIgnoreLocation = true, const bool inIgnoreChecksum = true) const; + + /** + @brief Compares me with another list and returns a std::string that contains a human-readable explanation + of the first difference found (if any). + @param[in] inCompareList Specifies the other list to be compared with me. + @param[in] inIgnoreLocation If true, don't compare each packet's AJAAncillaryDataLocation info. Defaults to true. + @param[in] inIgnoreChecksum If true, don't compare each packet's checksums. Defaults to true. + @return A string that contains a human-readable explanation of the first difference found (if any); + or an empty string if the lists are identical. + @note The sort order of each list, to be considered identical, must be the same. + **/ + virtual std::string CompareWithInfo (const AJAAncillaryList & inCompareList, const bool inIgnoreLocation = true, const bool inIgnoreChecksum = true) const; + ///@} + + + /** + @name Transmit to AJA Hardware (Playout) + **/ + ///@{ + /** + @brief Answers with the sizes of the buffers (one for field 1, one for field 2) needed to hold the anc data inserter + "transmit" data for all of my AJAAncillaryData objects. + @param[in] inIsProgressive Specify true for insertion into Progressive (transport) frames, or false for interlaced or psf. + @param[in] inF2StartLine For interlaced/psf frames, specifies the line number where "field 2" begins; otherwise ignored. + @param[out] outF1ByteCount Receives the size (in bytes) of the buffer needed to hold the "Field 1" anc data. + @param[out] outF2ByteCount Receives the size (in bytes) of the buffer needed to hold the "Field 2" anc data. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GetAncillaryDataTransmitSize (const bool inIsProgressive, const uint32_t inF2StartLine, + uint32_t & outF1ByteCount, uint32_t & outF2ByteCount); + + + /** + @brief Builds one or two ancillary data buffers (one for field 1, one for field 2) with the anc data inserter + "transmit" data for all of my AJAAncillaryData objects. + @param[in] inIsProgressive Specify true for insertion into Progressive (transport) frames, or false for interlaced or psf. + @param[in] inF2StartLine For interlaced/psf frames, specifies the line number where "field 2" begins; otherwise ignored. + @param pOutF1AncData Specifies the valid, non-NULL starting address of the "Field 1" ancillary data buffer. + Note that this buffer is written for Progressive frames. + @param[in] inF1ByteCountMax Specifies the capacity (in bytes) of the Field 1 buffer (may be larger than needed). + @param pOutF2AncData Specifies the valid, non-NULL starting address of the "Field 2" ancillary data buffer. + Note that this buffer is not written for Progressive frames. + @param[in] inF2ByteCountMax Specifies the capacity (in bytes) of the Field 2 buffer (may be larger than needed). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GetAncillaryDataTransmitData (const bool inIsProgressive, const uint32_t inF2StartLine, + uint8_t * pOutF1AncData, const uint32_t inF1ByteCountMax, + uint8_t * pOutF2AncData, const uint32_t inF2ByteCountMax); + + /** + @brief Encodes my AJAAncillaryData packets into the given buffers in the default \ref ancgumpformat . + The buffer contents are replaced; the unused remainder, if any, will be zeroed. + @param F1Buffer Specifies the buffer memory into which Field 1's anc data will be written. + @param F2Buffer Specifies the buffer memory into which Field 2's anc data will be written. + @param inIsProgressive Specify true to designate the output ancillary data stream as progressive; + otherwise, specify false. Defaults to true (is progressive). + @param[in] inF2StartLine For interlaced/psf frames, specifies the line number where Field 2 begins; otherwise ignored. + Defaults to zero (progressive). For interlaced video, see NTV2SmpteLineNumber::GetLastLine . + @note This function has a side-effect of automatically sorting my packets by ascending location before encoding. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GetTransmitData (NTV2_POINTER & F1Buffer, NTV2_POINTER & F2Buffer, + const bool inIsProgressive = true, const uint32_t inF2StartLine = 0); + + virtual inline AJAStatus GetSDITransmitData (NTV2_POINTER & F1Buffer, NTV2_POINTER & F2Buffer, + const bool inIsProgressive = true, const uint32_t inF2StartLine = 0) + {return GetTransmitData(F1Buffer, F2Buffer, inIsProgressive, inF2StartLine);} ///< @deprecated An alias for GetTransmitData + + /** + @brief Writes my AJAAncillaryData objects into the given tall/taller frame buffer having the given raster/format. + @param inFrameBuffer Specifies the frame buffer memory on the host to modify. + @param[in] inFormatDesc Describes the frame buffer's raster and pixel format. + @note Before writing, I automatically sort my packets by location. + @return AJA_STATUS_SUCCESS if successful. + @bug Currently ignores each packet's horizontal offset (assumes AJAAncDataHorizOffset_Anywhere). + **/ + virtual AJAStatus GetVANCTransmitData (NTV2_POINTER & inFrameBuffer, const NTV2FormatDescriptor & inFormatDesc); + + /** + @brief Explicitly encodes my AJAAncillaryData packets into the given buffers in \ref ancrtpformat . + The buffer contents are replaced; the unused remainder, if any, will be zeroed. + @param F1Buffer Specifies the buffer memory into which Field 1's IP/RTP data will be written. + @param F2Buffer Specifies the buffer memory into which Field 2's IP/RTP data will be written. + @param[in] inIsProgressive Specify true to designate the output ancillary data stream as progressive; + otherwise, specify false. Defaults to true (is progressive). + @param[in] inF2StartLine For interlaced/psf frames, specifies the line number where Field 2 begins; otherwise ignored. + Defaults to zero (progressive). + @note This function has the following side-effects: + - Sorts my packets by ascending location before encoding. + - Calls AJAAncillaryData::GenerateTransmitData on each of my packets. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GetIPTransmitData (NTV2_POINTER & F1Buffer, NTV2_POINTER & F2Buffer, + const bool inIsProgressive = true, const uint32_t inF2StartLine = 0); + + /** + @brief Answers with the number of bytes required to store IP/RTP for my AJAAncillaryData packets in \ref ancrtpformat . + @param[out] outF1ByteCount Receives the requisite byte count for Field 1's IP/RTP packet data. + @param[out] outF2ByteCount Receives the requisite byte count for Field 1's IP/RTP packet data. + @param[in] inIsProgressive Specify true to designate the output ancillary data stream as progressive; + otherwise, specify false. Defaults to true (is progressive). + @param[in] inF2StartLine For interlaced/psf frames, specifies the line number where Field 2 begins; otherwise ignored. + Defaults to zero (progressive). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GetIPTransmitDataLength (uint32_t & outF1ByteCount, uint32_t & outF2ByteCount, + const bool inIsProgressive = true, const uint32_t inF2StartLine = 0); + + /** + @brief Answers true if multiple RTP packets will be transmitted/encoded. + The default behavior is to transmit/encode a single RTP packet. + @return True if multiple RTP packets are allowed to be encoded; otherwise false. + **/ + virtual inline bool AllowMultiRTPTransmit (void) const {return m_xmitMultiRTP;} + + /** + @brief Determines if multiple RTP packets will be encoded for playout (via GetIPTransmitData). + The default behavior is to transmit/encode a single RTP packet. + @param[in] inAllow Specify true to allow encoding more than one RTP packet into the destination Anc buffer. + Specify false to transmit/encode a single RTP packet (the default). + **/ + virtual inline void SetAllowMultiRTPTransmit (const bool inAllow) {m_xmitMultiRTP = inAllow;} + +#if !defined(NTV2_DEPRECATE_15_5) + /** + @deprecated Use SetAllowMultiRTPTransmit with the 4-parameter version of this function. + **/ + virtual NTV2_DEPRECATED_f(AJAStatus GetIPTransmitData (NTV2_POINTER & F1Buffer, NTV2_POINTER & F2Buffer, + const bool inIsProgressive, const uint32_t inF2StartLine, + const bool inSingleRTPPkt)) + { const bool oldValue(AllowMultiRTPTransmit()); + SetAllowMultiRTPTransmit(!inSingleRTPPkt); + const AJAStatus result(GetIPTransmitData(F1Buffer, F2Buffer, inIsProgressive, inF2StartLine)); + SetAllowMultiRTPTransmit(oldValue); + return result; + } + /** + @deprecated Use SetAllowMultiRTPTransmit with the 4-parameter version of this function. + **/ + virtual NTV2_DEPRECATED_f(AJAStatus GetIPTransmitDataLength (uint32_t & outF1ByteCount, uint32_t & outF2ByteCount, + const bool inIsProgressive, const uint32_t inF2StartLine, + const bool inSingleRTPPkt)) + { const bool oldValue(AllowMultiRTPTransmit()); + SetAllowMultiRTPTransmit(!inSingleRTPPkt); + const AJAStatus result(GetIPTransmitDataLength(outF1ByteCount, outF2ByteCount, inIsProgressive, inF2StartLine)); + SetAllowMultiRTPTransmit(oldValue); + return result; + } +#endif // !defined(NTV2_DEPRECATE_15_5) + ///@} + + + /** + @name Receive from AJA Hardware (Ingest) + **/ + ///@{ + + /** + @brief Parse "raw" ancillary data bytes received from hardware (ingest) -- see \ref ancgumpformat -- + into separate AJAAncillaryData objects and appends them to me. + @param[in] pInReceivedData Specifies a valid, non-NULL address of the first byte of "raw" ancillary data received by an AncExtractor widget. + @param[in] inByteCount Specifies the number of bytes of data in the specified buffer to process. + @param[in] inFrameNum If non-zero, replaces the frame identifier of new packets that have a zero frame ID. + @details For each packet parsed from the received data, AJAAncillaryDataFactory::GuessAncillaryDataType + is called to ascertain the packet's AJAAncillaryDataType, then AJAAncillaryDataFactory::Create + is used to instantiate the specific AJAAncillaryData subclass instance. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus AddReceivedAncillaryData (const uint8_t * pInReceivedData, const uint32_t inByteCount, const uint32_t inFrameNum = 0); + + + /** + @brief Parse a "raw" RTP packet received from hardware (ingest) in network byte order into separate + AJAAncillaryData objects and appends them to me. + @param[in] inReceivedData The received packet words in network byte order. + @details For each packet parsed from the received data, AJAAncillaryDataFactory::GuessAncillaryDataType + is called to ascertain the packet's AJAAncillaryDataType, then AJAAncillaryDataFactory::Create + is used to instantiate the specific AJAAncillaryData subclass instance. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus AddReceivedAncillaryData (const ULWordSequence & inReceivedData); + + + /** + @brief Adds the packet that originated in the VANC lines of an NTV2 frame buffer to my list. + @param[in] inPacketWords Specifies the "raw" 16-bit User Data Words of the packet to be added. The first + six elements must be 0x0000, 0x03ff, 0x03ff, DID, SDID, DC, data words, and CS. + Each word will have its upper byte masked off. + @param[in] inLocation Specifies where the packet was found. + @param[in] inFrameNum If non-zero, specifies/sets the frame identifier for the added packets. + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus AddVANCData (const UWordSequence & inPacketWords, + const AJAAncillaryDataLocation & inLocation, + const uint32_t inFrameNum = 0); + + /** + @brief Answers true if multiple RTP packets are allowed for capture/receive. + The default behavior is to process all (multiple) received RTP packets. + @return True if multiple RTP packets are allowed to be decoded; otherwise false. + **/ + virtual inline bool AllowMultiRTPReceive (void) const {return m_rcvMultiRTP;} + + /** + @brief Determines if more than one RTP packet will be processed/decoded (via AddReceivedAncillaryData). + @param[in] inAllow Specify true to allow processing/decoding multiple RTP packets from the receiving Anc buffer. + Specify false to only process/decode the first RTP packet found in the receiving Anc buffer. + **/ + virtual inline void SetAllowMultiRTPReceive (const bool inAllow) {m_rcvMultiRTP = inAllow;} + + /** + @brief Answers if checksum errors are to be ignored or not. + The default behavior is to not ignore them. + @note This applies to capture/ingest (i.e. AddReceivedAncillaryData methods). + @return True if ignoring checksum errors; otherwise false. + **/ + virtual inline bool IgnoreChecksumErrors (void) const {return m_ignoreCS;} + + /** + @brief Determines if checksum errors encountered during capture/ingest + (via AddReceivedAncillaryData) will be ignored or not. + @param[in] inIgnore Specify true to ignore checksum errors; otherwise use false. + **/ + virtual inline void SetIgnoreChecksumErrors (const bool inIgnore) {m_ignoreCS = inIgnore;} + + +#if !defined(NTV2_DEPRECATE_14_2) + /** + @deprecated Use the 2-parameter version of this function instead. + **/ + virtual NTV2_DEPRECATED_f(AJAStatus AddVANCData (const UWordSequence & inPacketWords, const uint16_t inLineNum, + const AJAAncillaryDataVideoStream inStream = AJAAncillaryDataChannel_Y)); +#endif // !defined(NTV2_DEPRECATE_14_2) + + + /** + @brief Sends a "ParsePayloadData" command to all of my AJAAncillaryData objects. + @return AJA_STATUS_SUCCESS if all items parse successfully; otherwise the last failure result. + **/ + virtual AJAStatus ParseAllAncillaryData (void); + ///@} + + + /** + @name Printing & Debugging + **/ + ///@{ + + /** + @brief Dumps a human-readable description of every packet in my list to the given output stream. + @param[in] inDetailed If true, include some of the packet data; otherwise omit packet data. + Defaults to true. + @return The specified output stream. + **/ + virtual std::ostream & Print (std::ostream & inOutStream, const bool inDetailed = true) const; + ///@} + + +protected: + friend class CNTV2Card; // CNTV2Card's member functions can call AJAAncillaryList's private & protected member functions + + typedef std::list AJAAncillaryDataList; + typedef AJAAncillaryDataList::const_iterator AJAAncDataListConstIter; ///< @brief Handy const iterator for iterating over members of an AJAAncillaryDataList. + typedef AJAAncillaryDataList::iterator AJAAncDataListIter; ///< @brief Handy non-const iterator for iterating over members of an AJAAncillaryDataList. + + virtual inline AJAAncillaryDataType GetAnalogAncillaryDataType (const AJAAncillaryData & inAncData) {return GetAnalogAncillaryDataTypeForLine(inAncData.GetLocationLineNumber());} + + static bool BufferHasGUMPData (const NTV2_POINTER & inBuffer); + + /** + @brief Appends whatever can be decoded from the given device Anc buffer to the AJAAncillaryList. + @param[in] inAncBuffer Specifies the Anc buffer to be parsed. + @param outPacketList The AJAAncillaryList to be appended to, for whatever packets are found in the buffer. + @param[in] inFrameNum If non-zero, replaces the frame identifier of packets that have a zero frame ID. + @note Called by SetFromDeviceAncBuffers, once for the F1 buffer, another time for the F2 buffer. + @return AJA_STATUS_SUCCESS if successful, including if no Anc packets are found and added to the list. + **/ + static AJAStatus AddFromDeviceAncBuffer (const NTV2_POINTER & inAncBuffer, + AJAAncillaryList & outPacketList, + const uint32_t inFrameNum = 0); + + /** + @brief Answers with my F1 & F2 SMPTE anc packets encoded as RTP ULWordSequences. + The returned ULWords are already network-byte-order, ready to encapsulate into an RTP packet buffer. + @param[out] outF1U32Pkts Receives my F1 AJAU32Pkts, containing zero or more RTP ULWordSequences. + @param[out] outF2U32Pkts Receives my F1 AJAU32Pkts, containing zero or more RTP ULWordSequences. + @param[out] outF1AncCounts Receives my F1 SMPTE Anc packet counts for each of the returned F1 RTP packets (in outF1U32Pkts). + @param[out] outF2AncCounts Receives my F2 SMPTE Anc packet counts for each of the returned F2 RTP packets (in outF2U32Pkts). + @param[in] inIsProgressive Specify false for interlace; true for progressive/Psf. + @param[in] inF2StartLine For interlaced/psf frames, specifies the line number where Field 2 begins; otherwise ignored. + Defaults to zero (progressive). + @return AJA_STATUS_SUCCESS if successful. + **/ + virtual AJAStatus GetRTPPackets (AJAU32Pkts & outF1U32Pkts, + AJAU32Pkts & outF2U32Pkts, + AJAAncPktCounts & outF1AncCounts, + AJAAncPktCounts & outF2AncCounts, + const bool inIsProgressive, + const uint32_t inF2StartLine); + /** + @brief Fills the buffer with the given RTP packets. + @param theBuffer The buffer to be filled. An empty/NULL buffer is permitted, and + will copy no data, but instead will return the byte count that + otherwise would've been written. + @param[out] outBytesWritten Receives the total bytes written into the buffer (or that would + be written if given a non-NULL buffer). + @param[in] inRTPPkts The RTP packets, a vector of zero or more RTP ULWordSequences. + @param[in] inAncCounts The per-RTP-packet anc packet counts. + @param[in] inIsF2 Specify false for Field1 (or progressive or Psf); true for Field2. + @param[in] inIsProgressive Specify false for interlace; true for progressive/Psf. + @return AJA_STATUS_SUCCESS if successful. + **/ + static AJAStatus WriteRTPPackets (NTV2_POINTER & theBuffer, + uint32_t & outBytesWritten, + const AJAU32Pkts & inRTPPkts, + const AJAAncPktCounts & inAncCounts, + const bool inIsF2, + const bool inIsProgressive); + +private: + AJAAncillaryDataList m_ancList; ///< @brief My packet list + bool m_rcvMultiRTP; ///< @brief True: Rcv 1 RTP pkt per Anc pkt; False: Rcv 1 RTP pkt for all Anc pkts + bool m_xmitMultiRTP; ///< @brief True: Xmit 1 RTP pkt per Anc pkt; False: Xmit 1 RTP pkt for all Anc pkts + bool m_ignoreCS; ///< @brief True: ignore checksum errors; False: don't ignore CS errors + +}; // AJAAncillaryList + + +/** + @brief Writes a human-readable rendition of the given AJAAncillaryList into the given output stream. + @param inOutStream Specifies the output stream to be written. + @param[in] inList Specifies the AJAAncillaryList to be rendered into the output stream. + @return A non-constant reference to the specified output stream. +**/ +inline std::ostream & operator << (std::ostream & inOutStream, const AJAAncillaryList & inList) {return inList.Print(inOutStream);} + +/** + @brief Writes the given AJAU32Pkts object into the given output stream in a human-readable format. + @param inOutStream Specifies the output stream to be written. + @param[in] inPkts Specifies the AJAU32Pkts object to be rendered into the output stream. + @return A non-constant reference to the specified output stream. +**/ +AJAExport std::ostream & operator << (std::ostream & inOutStream, const AJAU32Pkts & inPkts); + +/** + @brief Writes the given AJAAncPktDIDSIDSet set into the given output stream in a human-readable format. + @param inOutStream Specifies the output stream to be written. + @param[in] inSet Specifies the AJAAncPktDIDSIDSet to be rendered into the output stream. + @return A non-constant reference to the specified output stream. +**/ +AJAExport std::ostream & operator << (std::ostream & inOutStream, const AJAAncPktDIDSIDSet & inSet); // New in SDK 16.0 + +#endif // AJA_ANCILLARYLIST_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/ajarefptr.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/ajarefptr.h new file mode 100644 index 0000000..848f2f1 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/ajarefptr.h @@ -0,0 +1,217 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ajarefptr.h + @copyright (C) 2013-2021 AJA Video Systems, Inc. All rights reserved. + @brief Defines the AJARefPtr template class. +**/ + +#if !defined (__AJAREFPTR__) + #define __AJAREFPTR__ + +#include "../system/atomic.h" + + /** + @brief I am the referent object that maintains the reference count and + the pointer to the underlying object whose lifespan I manage. + @note I am not designed to be used as a superclass, therefore, none of + my methods are virtual. + **/ + template + class Referent + { + // Instance Methods + public: + // Constructor + Referent (TRef * ptr); + + // Reference Count Management + void AddRef () throw (); + void RemoveRef () throw (); + + // Access To Underlying Object + TRef * get () const throw(); + + // Instance Data + private: + uint32_t m_nCount; // Reference count + TRef * m_pointer; // Pointer to underlying object I refer to + + }; // Referent + + + template + Referent ::Referent (TRef * ptr) + : m_nCount (1), + m_pointer (ptr) + { + } + + + template + void Referent ::AddRef (void) throw () + { + AJAAtomic::Increment(&m_nCount); + } + + + template + void Referent ::RemoveRef (void) throw () + { + if (m_nCount > 0) + { + if (AJAAtomic::Decrement(&m_nCount) == 0) + { + delete m_pointer; + m_pointer = 0; + delete this; + } + } + } + + + template + TRef * Referent ::get (void) const throw () + { + return m_pointer; + } + + + + /** + @brief I am a reference-counted pointer template class. + I am intended to be a proxy for an underlying object, + whose lifespan is automatically managed by the Referent + template class that I work with. + @note Be sure not to create more than one of me using the same + object pointer or else a double-free will ensue. + **/ + template + class AJARefPtr + { + public: + typedef TRef element_type; + + // Construction & Destruction + explicit AJARefPtr (TRef * ptr = NULL) throw (); + AJARefPtr (const AJARefPtr& obToCopy ) throw (); + ~AJARefPtr () throw (); + + // Assignment + AJARefPtr& operator = (const AJARefPtr& inRHS) throw (); + AJARefPtr& operator = (TRef * pobRHS) throw (); + + // Comparison + bool operator == (const AJARefPtr< TRef > & inRHS) const throw (); + bool operator != (const AJARefPtr< TRef > & inRHS) const throw (); + bool operator < (const AJARefPtr< TRef > & inRHS) const throw (); + + // Dereferencing + TRef & operator * () const throw (); + TRef * operator -> () const throw (); + TRef * get () const throw (); + + // Testing + operator bool () const throw (); + + private: + Referent * m_pRef; // My referent + + }; // AJARefPtr + + + template + AJARefPtr ::AJARefPtr (TRef * ptr) throw () : m_pRef (new Referent (ptr)) + { + } + + + template + AJARefPtr ::AJARefPtr (const AJARefPtr & obToCopy) throw () : m_pRef (obToCopy.m_pRef) + { + m_pRef->AddRef (); + } + + + template + AJARefPtr & AJARefPtr ::operator = (const AJARefPtr & inRHS) throw () + { + if (*this != inRHS) + { + if (m_pRef) + m_pRef->RemoveRef (); + m_pRef = inRHS.m_pRef; + m_pRef->AddRef (); + } + return *this; + } + + + template + AJARefPtr & AJARefPtr ::operator = (TRef * pobRHS) throw () + { + if (pobRHS != get ()) + { + if (m_pRef) + m_pRef->RemoveRef (); + m_pRef = new Referent (pobRHS); + } + return *this; + } + + + template + AJARefPtr ::~AJARefPtr () throw () + { + m_pRef->RemoveRef (); + } + + + template + bool AJARefPtr ::operator == (const AJARefPtr & inRHS) const throw () + { + return get() == inRHS.get(); + } + + + template + bool AJARefPtr ::operator != (const AJARefPtr & inRHS) const throw () + { + return get() != inRHS.get (); + } + + + template + bool AJARefPtr ::operator < (const AJARefPtr & inRHS) const throw () + { + return get() < inRHS.get (); + } + + + template + TRef & AJARefPtr ::operator * () const throw () + { + return *(m_pRef->get()); + } + + + template + TRef * AJARefPtr ::operator -> () const throw () + { + return m_pRef ? m_pRef->get () : NULL; + } + + + template + TRef * AJARefPtr ::get () const throw () + { + return m_pRef ? m_pRef->get () : NULL; + } + + + template + AJARefPtr ::operator bool () const throw () + { + return m_pRef && m_pRef->get () != 0; + } + +#endif // __AJAREFPTR__ diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/audioutilities.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/audioutilities.h new file mode 100644 index 0000000..dc05910 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/audioutilities.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file audioutilities.h + @brief Declaration of AJA_GenerateAudioTone function. + @copyright (C) 2012-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_AUDIOUTILS_H +#define AJA_AUDIOUTILS_H + +#include "public.h" + +#define AJA_MAX_AUDIO_CHANNELS 16 + +uint32_t AJA_EXPORT AJA_GenerateAudioTone ( + uint32_t* audioBuffer, + uint32_t numSamples, + uint32_t numChannels, + uint32_t numBits, + uint32_t& cycleSample, + double sampleRate, + double* amplitude, + double* frequency, + bool endianConvert); + + +#endif diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/buffer.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/buffer.h new file mode 100644 index 0000000..09b9d10 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/buffer.h @@ -0,0 +1,138 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file buffer.h + @brief Implementation of AJABuffer class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_BUFFER_H +#define AJA_BUFFER_H + +#include "public.h" + +/** + * Class that represents a memory buffer. + */ +class AJA_EXPORT AJABuffer +{ +public: + AJABuffer(); + virtual ~AJABuffer(); + + /** + * Attach a preallocated buffer. + * + * @param[in] pBuffer Address of the memory to attach. + * @param[in] size Size of the memory region. + * @return AJA_STATUS_SUCCESS Buffer successfully attached + * AJA_STATUS_FAIL Attach failed + */ + AJAStatus AttachBuffer(uint8_t* pBuffer, size_t size); + + /** + * Allocate memory from the system. + * + * @param[in] size Size of the memory buffer. + * @param[in] alignment Memory buffer alignment in bytes. + * @param[in] pName Name of shared memory buffer to attach. + * @return AJA_STATUS_SUCCESS Buffer successfully allocated + * AJA_STATUS_FAIL Allocation failed + */ + AJAStatus AllocateBuffer(size_t size, size_t alignment = 0, char* pName = NULL); + + /** + * Free allocated memory back to the system + * + * @return AJA_STATUS_SUCCESS Buffer successfully freed + * AJA_STATUS_FAIL Free failed + */ + AJAStatus FreeBuffer(); + + /** + * Get the buffer address. + * + * @return Address of the buffer. + */ + uint8_t* GetBuffer(); + + uint32_t* GetUINT32Buffer(); + + /** + * Get the buffer size. + * + * @return Size of the buffer. + */ + size_t GetBufferSize(); + + /** + * Get the buffer alignment. + * + * @return Alignment of the buffer in bytes. + */ + size_t GetBufferAlignment(); + + /** + * Get the name of the shared buffer. + * + * @return Name of the shared buffer, NULL if not shared. + */ + const char* GetBufferName(); + + /** + * Set the offset of the data in the buffer. + * + * @param[in] offset Offset of the data. + * @return AJA_STATUS_SUCCESS Data offset set + * AJA_STATUS_RANGE Data offset + data size > buffer size + */ + AJAStatus SetDataOffset(size_t offset); + + /** + * Get the offset of the data in the buffer. + * + * @return Offset of the data. + */ + size_t GetDataOffset(); + + /** + * Set the size of the data region in the buffer + * + * @param[in] size Size of the data. + * @return AJA_STATUS_SUCCESS Size set + * AJA_STATUS_RANGE Data offset + data size > buffer size + */ + AJAStatus SetDataSize(size_t size); + + /** + * Get the size of the data region in the buffer. + * + * @return Size of the data. + */ + size_t GetDataSize(); + + /** + * Get the address of the data region in the buffer. + * + * @return Address of the data. + */ + uint8_t* GetData(); + +private: + + void ComputeAlignment(); + + uint8_t* mpAllocate; + size_t mAllocateSize; + size_t mAllocateAlignment; + char* mpAllocateName; + + uint8_t* mpBuffer; + size_t mBufferSize; + size_t mBufferAlignment; + + size_t mDataOffset; + size_t mDataSize; +}; + +#endif + diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/bytestream.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/bytestream.h new file mode 100644 index 0000000..6ee494f --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/bytestream.h @@ -0,0 +1,232 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file bytestream.h + @brief Declaration of AJAByteStream class. + @copyright (C) 2012-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_BYTESTREAM_H +#define AJA_BYTESTREAM_H + +#include +#include +#include "ajabase/common/types.h" + +class AJAByteStream { + public: + AJAByteStream(void *buf = NULL, size_t pos = 0); + + size_t Pos() const; + void *Buffer() const; + + void Reset(); + void Seek(size_t val); // Seeks to an absolute position + void SeekFwd(size_t val); // Seeks forward n bytes + void SeekRev(size_t val); // Seeks backwards n bytes + + void Set(uint8_t val, size_t bytes); + void Write(const void *buf, size_t bytes); + void Write8(uint8_t val); + void Write16LE(uint16_t val); + void Write16BE(uint16_t val); + void Write32LE(uint32_t val); + void Write32BE(uint32_t val); + void Write64LE(uint64_t val); + void Write64BE(uint64_t val); + + void Read(void *buf, size_t LEn); + uint8_t Read8(); + uint16_t Read16LE(); + uint16_t Read16BE(); + uint32_t Read32LE(); + uint32_t Read32BE(); + uint64_t Read64LE(); + uint64_t Read64BE(); + + private: + uint8_t *b; // Beginning buffer position + uint8_t *c; // Current buffer position +}; + +inline AJAByteStream::AJAByteStream(void *buf, size_t pos) : b((uint8_t *)buf) { + Seek(pos); +} + +inline size_t AJAByteStream::Pos() const { + return (size_t)(c - b); +} + +inline void *AJAByteStream::Buffer() const { + return b; +} + +inline void AJAByteStream::Reset() { + c = b; + return; +} + +inline void AJAByteStream::Seek(size_t val) { + c = b + val; + return; +} + +inline void AJAByteStream::SeekFwd(size_t val) { + c += val; + return; +} + +inline void AJAByteStream::SeekRev(size_t val) { + c -= val; + return; +} + +inline void AJAByteStream::Set(uint8_t val, size_t bytes) { + uint8_t *last = c + bytes; + while(c != last) *c++ = val; + return; +} + +inline void AJAByteStream::Write(const void *buf, size_t bytes) { + memcpy(c, buf, bytes); + c += bytes; + return; +} + +inline void AJAByteStream::Write8(uint8_t val) { + *c++ = val; + return; +} + +inline void AJAByteStream::Write16LE(uint16_t val) { + c[0] = val & 0xFF; + c[1] = (val >> 8) & 0xFF; + c += 2; + return; +} + +inline void AJAByteStream::Write16BE(uint16_t val) { + c[0] = (val >> 8) & 0xFF; + c[1] = val & 0xFF; + c += 2; + return; +} + +inline void AJAByteStream::Write32LE(uint32_t val) { + c[0] = val & 0xFF; + c[1] = (val >> 8) & 0xFF; + c[2] = (val >> 16) & 0xFF; + c[3] = (val >> 24) & 0xFF; + c += 4; + return; +} + +inline void AJAByteStream::Write32BE(uint32_t val) { + c[0] = (val >> 24) & 0xFF; + c[1] = (val >> 16) & 0xFF; + c[2] = (val >> 8) & 0xFF; + c[3] = val & 0xFF; + c += 4; + return; +} + +inline void AJAByteStream::Write64LE(uint64_t val) { + c[0] = val & 0xFF; + c[1] = (val >> 8) & 0xFF; + c[2] = (val >> 16) & 0xFF; + c[3] = (val >> 24) & 0xFF; + c[4] = (val >> 32) & 0xFF; + c[5] = (val >> 40) & 0xFF; + c[6] = (val >> 48) & 0xFF; + c[7] = (val >> 56) & 0xFF; + c += 8; + return; +} + +inline void AJAByteStream::Write64BE(uint64_t val) { + c[0] = (val >> 56) & 0xFF; + c[1] = (val >> 48) & 0xFF; + c[2] = (val >> 40) & 0xFF; + c[3] = (val >> 32) & 0xFF; + c[4] = (val >> 24) & 0xFF; + c[5] = (val >> 16) & 0xFF; + c[6] = (val >> 8) & 0xFF; + c[7] = val & 0xFF; + c += 8; + return; +} + +inline void AJAByteStream::Read(void *buf, size_t bytes) { + uint8_t *last = c + bytes, *o = (uint8_t *)buf; + while(c != last) *o++ = *c++; + return; +} + +inline uint8_t AJAByteStream::Read8() { + return *c++; +} + +inline uint16_t AJAByteStream::Read16LE() { + uint16_t ret; + ret = (uint16_t)c[0]; + ret |= (uint16_t)c[1] << 8; + c += 2; + return ret; +} + +inline uint16_t AJAByteStream::Read16BE() { + uint16_t ret; + ret = (uint16_t)c[0] << 8; + ret |= (uint16_t)c[1]; + c += 2; + return ret; +} + +inline uint32_t AJAByteStream::Read32LE() { + uint32_t ret; + ret = (uint32_t)c[0]; + ret |= (uint32_t)c[1] << 8; + ret |= (uint32_t)c[2] << 16; + ret |= (uint32_t)c[3] << 24; + c += 4; + return ret; +} + +inline uint32_t AJAByteStream::Read32BE() { + uint32_t ret; + ret = (uint32_t)c[0] << 24; + ret |= (uint32_t)c[1] << 16; + ret |= (uint32_t)c[2] << 8; + ret |= (uint32_t)c[3]; + c += 4; + return ret; +} + +inline uint64_t AJAByteStream::Read64LE() { + uint64_t ret; + ret = (uint64_t)c[0]; + ret |= (uint64_t)c[1] << 8; + ret |= (uint64_t)c[2] << 16; + ret |= (uint64_t)c[3] << 24; + ret |= (uint64_t)c[4] << 32; + ret |= (uint64_t)c[5] << 40; + ret |= (uint64_t)c[6] << 48; + ret |= (uint64_t)c[7] << 56; + c += 8; + return ret; +} + +inline uint64_t AJAByteStream::Read64BE() { + uint64_t ret; + ret = (uint64_t)c[0] << 56; + ret |= (uint64_t)c[1] << 48; + ret |= (uint64_t)c[2] << 40; + ret |= (uint64_t)c[3] << 32; + ret |= (uint64_t)c[4] << 24; + ret |= (uint64_t)c[5] << 16; + ret |= (uint64_t)c[6] << 8; + ret |= (uint64_t)c[7]; + c += 8; + return ret; +} + +#endif /* ifndef AJA_BYTESTREAM_H */ diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/circularbuffer.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/circularbuffer.h new file mode 100644 index 0000000..4bf77b6 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/circularbuffer.h @@ -0,0 +1,327 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file circularbuffer.h + @brief Declaration of AJACircularBuffer template class. + @copyright (C) 2012-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_CIRCULAR_BUFFER_H +#define AJA_CIRCULAR_BUFFER_H + +#include "ajabase/common/public.h" +#include "ajabase/system/lock.h" +#include "ajabase/system/event.h" + + + +/** + @brief I am a circular frame buffer that simplifies implementing a type-safe producer/consumer + model for processing frame-based streaming media. I can be used with any client-defined + "frame", be it a struct or class. To use me: + -# Instantiate me. + -# Initialize me by calling my Add method, adding client-defined frames for me to manage. + -# Spawn a producer thread and a consumer thread. + -# The producer thread repeatedly calls my StartProduceNextBuffer, puts data in the frame, + then calls EndProduceNextBuffer when finished. + -# The consumer thread repeatedly calls my StartConsumeNextBuffer, processes data in the frame, + then calls EndConsumeNextBuffer when finished. +**/ +template +class AJACircularBuffer +{ +public: + /** + @brief My default constructor. + **/ + AJACircularBuffer (); + + + /** + @brief My destructor. + **/ + virtual ~AJACircularBuffer (); + + + /** + @brief Tells me the boolean variable I should monitor such that when it gets set to "true" will cause + any threads waiting on my events/locks to gracefully exit. + @param[in] pAbortFlag Specifies the valid, non-NULL address of a boolean variable that, when it becomes "true", + will cause threads waiting on me to exit gracefully. + **/ + inline void SetAbortFlag (const bool * pAbortFlag) + { + mAbortFlag = pAbortFlag; + } + + + /** + @brief Retrieves the size count of the circular buffer, i.e. how far the tail pointer is behind the head pointer. + @return The number of frames that I contain. + */ + inline unsigned int GetCircBufferCount (void) const + { + return mCircBufferCount; + } + + + /** + @brief Returns "true" if I'm empty -- i.e., if my tail and head are in the same place. + @return True if I contain no frames. + **/ + inline bool IsEmpty (void) const + { + return GetCircBufferCount () == 0; + } + + /** + @brief Returns my frame storage capacity, which reflects how many times my Add method has been called. + @return My frame capacity. + **/ + inline unsigned int GetNumFrames (void) const + { + return (unsigned int) mFrames.size (); + } + + + /** + @brief Appends a new frame buffer to me, increasing my frame storage capacity by one frame. + @param[in] pInFrameData Specifies the FrameDataPtr to be added to me. + @return AJA_STATUS_SUCCESS Frame successfully added. + AJA_STATUS_FAIL Frame failed to add. + **/ + AJAStatus Add (FrameDataPtr pInFrameData) + { + mFrames.push_back(pInFrameData); + AJALock* lock = new AJALock; + mLocks.push_back(lock); + + return (mFrames.size() == mLocks.size() && lock) ? AJA_STATUS_SUCCESS + : AJA_STATUS_FAIL; + } + + + /** + @brief The thread that's responsible for providing frames -- the producer -- calls this function + to populate the the returned FrameDataPtr. + @return A pointer (of the type in the template argument) to the next frame to be filled by the + producer thread. + **/ + FrameDataPtr StartProduceNextBuffer (void) + { + while (1) + { + if( !WaitForLockOrAbort(&mDataBufferLock) ) + return NULL; + + if ( mCircBufferCount == mFrames.size() ) + { + mDataBufferLock.Unlock(); + if( !WaitForEventOrAbort(&mNotFullEvent) ) + return NULL; + + continue; + } + break; + } + if( !WaitForLockOrAbort(mLocks[mHead]) ) return NULL; + mFillIndex = mHead; + mHead = (mHead+1)%((unsigned int)(mFrames.size())); + mCircBufferCount++; + if( mCircBufferCount == mFrames.size() ) + mNotFullEvent.SetState(false); + + mDataBufferLock.Unlock(); + + return mFrames[mFillIndex]; + } + + + /** + @brief The producer thread calls this function to signal that it has finished populating the frame + it obtained from a prior call to StartProduceNextBuffer. This releases the frame, making it + available for processing by the consumer thread. + **/ + void EndProduceNextBuffer (void); + + + /** + @brief The thread that's responsible for processing incoming frames -- the consumer -- calls this + function to obtain the next available frame. + @return A pointer (of the type in the template argument) to the next frame to be processed by the + consumer thread. + **/ + FrameDataPtr StartConsumeNextBuffer (void) + { + while (1) + { + if( !WaitForLockOrAbort(&mDataBufferLock) ) + return NULL; + + if ( mCircBufferCount == 0 ) + { + mDataBufferLock.Unlock(); + if( !WaitForEventOrAbort(&mNotEmptyEvent) ) + return NULL; + + continue; + } + break; + } + + if( !WaitForLockOrAbort(mLocks[mTail]) ) + return NULL; + + mEmptyIndex = mTail; + mTail = (mTail+1)%((unsigned int)mFrames.size()); + mCircBufferCount--; + if( mCircBufferCount == 0 ) + mNotEmptyEvent.SetState(false); + mDataBufferLock.Unlock(); + + return mFrames[mEmptyIndex]; + } + + + /** + @brief The consumer thread calls this function to signal that it has finished processing the frame it + obtained from a prior call to StartConsumeNextBuffer. This releases the frame, making it available + for filling by the producer thread. + **/ + void EndConsumeNextBuffer (void); + + + /** + @brief Clears my frame collection, their locks, everything. + @note This is not thread-safe. Thus, before calling this method, be sure all locks have been released and + producer/consumer threads using me have terminated. + **/ + void Clear (void); + + +private: + typedef std::vector AJALockVector; + + std::vector mFrames; ///< @brief My ordered frame collection + AJALockVector mLocks; ///< @brief My per-frame locks, to control access to each frame + + unsigned int mHead; ///< @brief My current "head" pointer, an index into my frame collection + unsigned int mTail; ///< @brief My current "tail" pointer, an index into my frame collection + unsigned int mCircBufferCount; ///< @brief My current size, the distance between my "head" and "tail" + AJAEvent mNotFullEvent; ///< @brief An event that signals when I transition from being full to not full + AJAEvent mNotEmptyEvent; ///< @brief An event that signals when I transition from empty to having at least one frame + AJALock mDataBufferLock; ///< @brief Protects my "head" and "tail" members + + unsigned int mFillIndex; ///< @brief Index where frames are added to me + unsigned int mEmptyIndex; ///< @brief Index where frames are removed from me + + const bool * mAbortFlag; ///< @brief Optional pointer to a boolean that clients can set to break threads waiting on me + + /** + @brief Waits for the given event with a timeout, and abort the wait if mAbortFlag is set. + @param[in] ajaEvent Specifies a valid, non-NULL AJAEvent object to trigger on. + @return True if the event triggers successfully; false otherwise. + **/ + bool WaitForEventOrAbort (AJAEvent * ajaEvent); + + + /** + @brief Wait for mutex with a timeout and check to see if mAbortFlag is set. + @param[in] ajaEvent Specifies a valid, non-NULL AJALock (mutex) object to wait on. + @return True if mutex is received; otherwise false. + **/ + bool WaitForLockOrAbort (AJALock * ajaEvent); + +}; // AJACircularBuffer + + + +template +AJACircularBuffer ::AJACircularBuffer () + : mHead (0), + mTail (0), + mCircBufferCount (0), + mFillIndex (0), + mEmptyIndex (0), + mAbortFlag (NULL) +{ +} + +template +AJACircularBuffer ::~AJACircularBuffer () +{ + Clear (); +} + + + + +template +void AJACircularBuffer::EndProduceNextBuffer() +{ + mLocks[mFillIndex]->Unlock(); + mNotEmptyEvent.SetState(true); +} + +template +void AJACircularBuffer::EndConsumeNextBuffer() +{ + mLocks[mEmptyIndex]->Unlock(); + mNotFullEvent.SetState(true); +} + +template +bool AJACircularBuffer::WaitForEventOrAbort(AJAEvent* ajaEvent) +{ + const unsigned int timeout = 100; + + do { + AJAStatus status = ajaEvent->WaitForSignal(timeout); + if (status == AJA_STATUS_TIMEOUT) + if ( mAbortFlag ) + if ( *mAbortFlag ) + return false; + if (status == AJA_STATUS_FAIL) + return false; + if (status == AJA_STATUS_SUCCESS ) + break; + } while(1); + + return true; +} + +template +bool AJACircularBuffer::WaitForLockOrAbort(AJALock* ajaLock) +{ + const unsigned int timeout = 100; + + do { + AJAStatus status = ajaLock->Lock(timeout); + if (status == AJA_STATUS_TIMEOUT) + if ( mAbortFlag ) + if ( *mAbortFlag) + return false; + if (status == AJA_STATUS_FAIL) + return false; + if (status == AJA_STATUS_SUCCESS ) + break; + } while(1); + + return true; +} + + +template +void AJACircularBuffer::Clear (void) +{ + for (AJALockVector::iterator iter (mLocks.begin()); iter != mLocks.end(); ++iter) + delete *iter; + + mLocks.clear(); + mFrames.clear(); + + mHead = mTail = mFillIndex = mEmptyIndex = mCircBufferCount = 0; + mAbortFlag = NULL; +} + + +#endif // AJA_CIRCULAR_BUFFER_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/cli_utils.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/cli_utils.h new file mode 100644 index 0000000..2357907 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/cli_utils.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file cli_utils.h + @brief Declaration of GetNumber, GetString and GetCharAsInt functions. + @copyright (C) 2011-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_CLI_UTILS_H +#define AJA_CLI_UTILS_H + +/* + * This file has been removed the functionality is available elsewhere in ajabase + * see common.h + */ + +#endif // AJA_CLI_UTILS_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/common.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/common.h new file mode 100644 index 0000000..2010853 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/common.h @@ -0,0 +1,284 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file common.h + @brief Private include file for all ajabase sources. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_COMMON_H +#define AJA_COMMON_H + +#if defined(AJA_WINDOWS) + #pragma warning(disable:4996) + #pragma warning(disable:4800) +#endif + +#include "ajabase/common/export.h" +#include "ajabase/common/public.h" +#include "ajabase/system/debug.h" +#include + +namespace aja +{ + +static std::string WHITESPACE = " \t\n\r"; + +/** + * Replaces all occurrences of a substring within a string with a new string + * + * @param[in,out] str The string to modify + * @param[in] from The substring to look for + * @param[in] to The string to replace the substring with + * @return Reference to the modified STL string + */ +AJA_EXPORT std::string& replace(std::string& str, const std::string& from, const std::string& to); + +// NOTE: these sto* functions are ment to be similar to the C++11 functions of the same name +// one big difference is that these do not throw exceptions on errors and instead return +// 0 like the underlying strtol function does. + +/** + * Convert string to integer + * + * @param[in] str The string to get the int value of + * @param[in,out] idx Pointer to an object of type size_t, whose value is set by the function + * to the position of the next character in str after the numerical value. + * This parameter can also be a null pointer, in which case it is not used. + * @param[in] base Numerical base that determines the valid characters and their interpretation. + * If this is 0, the base is determined by the format (like strtol). + * @return The int value of the input str + */ +AJA_EXPORT int stoi(const std::string& str, std::size_t* idx=0, int base = 10); + +/** + * Convert string to long + * + * @param[in] str The string to get the long value of + * @param[in,out] idx Pointer to an object of type size_t, whose value is set by the function + * to the position of the next character in str after the numerical value. + * This parameter can also be a null pointer, in which case it is not used. + * @param[in] base Numerical base that determines the valid characters and their interpretation. + * If this is 0, the base is determined by the format (like strtol). + * @return The long value of the input str + */ +AJA_EXPORT long stol(const std::string& str, std::size_t* idx=0, int base = 10); + +/** + * Convert string to long long + * + * @param[in] str The string to get the long long value of + * @param[in,out] idx Pointer to an object of type size_t, whose value is set by the function + * to the position of the next character in str after the numerical value. + * This parameter can also be a null pointer, in which case it is not used. + * @param[in] base Numerical base that determines the valid characters and their interpretation. + * If this is 0, the base is determined by the format (like strtol). + * @return The long long value of the input str + */ +//AJA_EXPORT long long stoll(const std::string& str, std::size_t* idx=0, int base = 10); + +/** + * Convert string to unsigned long + * + * @param[in] str The string to get the unsigned long value of + * @param[in,out] idx Pointer to an object of type size_t, whose value is set by the function + * to the position of the next character in str after the numerical value. + * This parameter can also be a null pointer, in which case it is not used. + * @param[in] base Numerical base that determines the valid characters and their interpretation. + * If this is 0, the base is determined by the format (like strtol). + * @return The unsigned long value of the input str + */ +AJA_EXPORT unsigned long stoul(const std::string& str, std::size_t* idx=0, int base = 10); + +/** + * Convert string to unsigned long long + * + * @param[in] str The string to get the unsigned long long value of + * @param[in,out] idx Pointer to an object of type size_t, whose value is set by the function + * to the position of the next character in str after the numerical value. + * This parameter can also be a null pointer, in which case it is not used. + * @param[in] base Numerical base that determines the valid characters and their interpretation. + * If this is 0, the base is determined by the format (like strtol). + * @return The unsigned long long value of the input str + */ +//AJA_EXPORT unsigned long long stoull(const std::string& str, std::size_t* idx=0, int base = 10); + +/** + * Convert string to float + * + * @param[in] str The string to get the float value of + * @param[in,out] idx Pointer to an object of type size_t, whose value is set by the function + * to the position of the next character in str after the numerical value. + * This parameter can also be a null pointer, in which case it is not used. + * @return The float value of the input str + */ +AJA_EXPORT float stof(const std::string& str, std::size_t* idx=0); + +/** + * Convert string to double + * + * @param[in] str The string to get the double value of + * @param[in,out] idx Pointer to an object of type size_t, whose value is set by the function + * to the position of the next character in str after the numerical value. + * This parameter can also be a null pointer, in which case it is not used. + * @return The double value of the input str + */ +AJA_EXPORT double stod(const std::string& str, std::size_t* idx=0); + +/** + * Convert string to long double + * + * @param[in] str The string to get the long double value of + * @param[in,out] idx Pointer to an object of type size_t, whose value is set by the function + * to the position of the next character in str after the numerical value. + * This parameter can also be a null pointer, in which case it is not used. + * @return The long double value of the input str + */ +AJA_EXPORT long double stold(const std::string& str, std::size_t* idx=0); + +/** + * Convert numerical value to string + * + * @param[in] val The numerical value to convert + * @return A string representing the passed value + */ +AJA_EXPORT std::string to_string(bool val); +AJA_EXPORT std::string to_string(int val); +AJA_EXPORT std::string to_string(long val); +//AJA_EXPORT std::string to_string(long long val); +AJA_EXPORT std::string to_string(unsigned val); +AJA_EXPORT std::string to_string(unsigned long val); +//AJA_EXPORT std::string to_string(unsigned long long val); +AJA_EXPORT std::string to_string(float val); +AJA_EXPORT std::string to_string(double val); +AJA_EXPORT std::string to_string(long double val); + +/** + * Convert string to wstring + * + * @param[in] str The string to convert + * @param[out] wstr The wstring to convert to + * @return true if success else false + */ +AJA_EXPORT bool string_to_wstring(const std::string& str, std::wstring& wstr); + +/** + * Convert wstring to string + * + * @param[in] wstr The wstring to convert + * @param[out] str The string to convert to + * @return true if success else false + */ +AJA_EXPORT bool wstring_to_string(const std::wstring& wstr, std::string& str); + +/** + * Convert string to cstring + * + * @param[in] str The string to convert + * @param[out] c_str The char buffer to use as a c string + * @param[in] c_str_size The size of the passed in c_str buffer in bytes + * @return true if success else false + */ +AJA_EXPORT bool string_to_cstring (const std::string & str, char * c_str, size_t c_str_size); + +/** + * Splits a string into substrings at a character delimiter + * + * @param[in] str The string to split into parts + * @param[in] delim The character delimiter to split the string at + * @param[out] elems A vector of strings that contains all the substrings + */ +AJA_EXPORT void split (const std::string & str, const char delim, std::vector & elems); + +/** + * Splits a string into substrings at a character delimiter + * + * @param[in] str The string to split into parts + * @param[in] delim The character delimiter to split the string at + * @return A vector of strings that contains all the substrings + */ +AJA_EXPORT std::vector split (const std::string & str, const char delim); + +/** + * Splits a string into substrings at a string delimiter + * + * @param[in] inStr The string to split into parts + * @param[in] inDelim The delimiter string to split the string at + * @return A vector of strings that contains all the substrings + */ +AJA_EXPORT std::vector split (const std::string & inStr, const std::string & inDelim); + +/** + * Converts the passed string to lowercase + * + * @param[in,out] str The string to make lowercase + * @return Reference to the modified STL string + */ +AJA_EXPORT std::string & lower (std::string & str); + +/** + * Converts the passed string to uppercase + * + * @param[in,out] str The string to make uppercase + * @return Reference to the modified STL string + */ +AJA_EXPORT std::string & upper (std::string & str); + +/** + * Strips the leading whitespace characters from the string + * + * @param[in,out] str The string to strip leading characters from + * @param[in] ws The whitespace characters to strip + * @return Reference to the modified STL string + */ +AJA_EXPORT std::string & lstrip (std::string & str, const std::string & ws = aja::WHITESPACE); + +/** + * Strips the trailing whitespace characters from the string + * + * @param[in,out] str The string to strip trailing characters from + * @param[in] ws The whitespace characters to strip + * @return Reference to the modified STL string + */ +AJA_EXPORT std::string & rstrip (std::string & str, const std::string & ws = aja::WHITESPACE); + +/** + * Strips the leading & trailing whitespace characters from the string + * + * @param[in,out] str The string to strip leading & trailing characters from + * @param[in] ws The whitespace characters to strip + * @return Reference to the modified STL string + */ +AJA_EXPORT std::string & strip (std::string & str, const std::string & ws = aja::WHITESPACE); + +/** + * Join a vector of strings separated by a string delimiter + * + * @param[in] parts The vector of strings to join together + * @param[in] delim The string delimiter that will separate the strings + * @return The joined string made up of the parts concatinated with delimiter string + */ +AJA_EXPORT std::string join (const std::vector & parts, const std::string & delim=" "); + +/** + * Join a set of strings separated by a string delimiter + * + * @param[in] parts The set of strings to join together + * @param[in] delim The string delimiter that will separate the strings + * @return The joined string made up of the parts concatinated with delimiter string + */ +AJA_EXPORT std::string join (const std::set & parts, const std::string & delim=" "); + +/** + * Like strncpy() but always adds a null-character at last index of target string + * + * @param[in,out] target Pointer to the destination array where the content is to be copied. + * @param[in] source C string to be copied. + * @param[in] num Maximum number of characters to be copied from source. + * @param[in] maxSize Maximum size of the destination array pointed to by target. + * @return target is returned + */ +AJA_EXPORT char* safer_strncpy(char* target, const char* source, size_t num, size_t maxSize); + +} //end aja namespace + +#endif // AJA_COMMON_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/dpx_hdr.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/dpx_hdr.h new file mode 100644 index 0000000..2cc3a46 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/dpx_hdr.h @@ -0,0 +1,485 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file dpx_hdr.h + @brief Declaration of DpxHdr class adapted from STwo's dpx file I/O. + @copyright (C) 2015-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef DPX_HDR_H +#define DPX_HDR_H + +#include "public.h" +#include "ajabase/common/types.h" +#include "ajabase/system/system.h" + +#include + + +#define DPX_C_MAGIC 0x53445058 /**< little-endian magic number */ +#define DPX_C_MAGIC_BE 0x58504453 /**< big-endian magic number */ +#define DPX_C_VERSION "V1.0" +#define DPX_C_UNDEFINED_FLOAT 0xffffffff /**< DPX undefined float */ + +#define SWAP16(e,v) ((e) ? htons(v) : (v)) +#define SWAP32(e,v) ((e) ? htonl(v) : (v)) +#define SWAPR32(e,v) ((e) ? htonf(v) : (v)) +#define UNSWAP16(e,v) ((e) ? ntohs(v) : (v)) +#define UNSWAP32(e,v) ((e) ? ntohl(v) : (v)) +#define UNSWAPR32(e,v) ((e) ? ntohf(v) : (v)) + +#define DPX_VALID(p) \ + ((p) && (((p)->file_info.magic_num==DPX_C_MAGIC) || \ + ((p)->file_info.magic_num==DPX_C_MAGIC_BE))) + +#define DPX_IS_BE(p) \ + ((p) && ((p)->file_info.magic_num == DPX_C_MAGIC_BE)) + +#define DPX_C_IMAGE_ELEM_DESC_RGB 50 +#define DPX_C_IMAGE_ELEM_DESC_RGBA 51 +#define DPX_C_IMAGE_ELEM_DESC_ARGB 52 +#define DPX_C_IMAGE_ELEM_DESC_422 100 +#define DPX_C_IMAGE_ELEM_DESC_444 102 + + +typedef struct dpx_file_info_struct +{ + uint32_t magic_num; /* magic number 0x53445058 (SDPX) or 0x58504453 (XPDS) */ + uint32_t offset; /* offset to image data in bytes */ + uint8_t vers[8]; /* which header format version is being used (v1.0)*/ + uint32_t file_size; /* file size in bytes */ + uint32_t ditto_key; /* read time short cut - 0 = same, 1 = new */ + uint32_t gen_hdr_size; /* generic header length in bytes */ + uint32_t ind_hdr_size; /* industry header length in bytes */ + uint32_t user_data_size;/* user-defined data length in bytes */ + uint8_t file_name[100]; /* iamge file name */ + uint8_t create_time[24]; /* file creation date "yyyy:mm:dd:hh:mm:ss:LTZ" */ + uint8_t creator[100]; /* file creator's name */ + uint8_t project[200]; /* project name */ + uint8_t copyright[200]; /* right to use or copyright info */ + uint32_t key; /* encryption ( FFFFFFFF = unencrypted ) */ + union + { + uint8_t Reserved[104]; /* reserved field TBD (need to pad) */ + struct + { + uint32_t tcFrame; /* Timecode as a frame number */ + uint32_t filenum; /* FileNumber of preallocated files */ + uint8_t rid; + uint8_t sid; + uint8_t tid; + uint8_t pad; + } s2; + } resv; +} DPX_file_info_t; + + +typedef struct dpx_image_element_struct +{ + uint32_t data_sign; /* data sign (0 = unsigned, 1 = signed ) */ + /* "Core set images are unsigned" */ + uint32_t ref_low_data; /* reference low data code value */ + float ref_low_quantity; /* reference low quantity represented */ + uint32_t ref_high_data; /* reference high data code value */ + float ref_high_quantity; /* reference high quantity represented */ + uint8_t descriptor; /* descriptor for image element */ + uint8_t transfer; /* transfer uint8_tacteristics for element */ + uint8_t colorimetric; /* colormetric specification for element */ + uint8_t bit_size; /* bit size for element */ + uint16_t packing; /* packing for element */ + uint16_t encoding; /* encoding for element */ + uint32_t data_offset; /* offset to data of element */ + uint32_t eol_padding; /* end of line padding used in element */ + uint32_t eo_image_padding; /* end of image padding used in element */ + uint8_t description[32]; /* description of element */ +} DPX_image_element_t; + + +typedef struct dpx_image_info_struct +{ + uint16_t orientation; /* image orientation */ + uint16_t element_number; /* number of image elements */ + uint32_t pixels_per_line; /* or x value */ + uint32_t lines_per_image_ele; /* or y value, per element */ + DPX_image_element_t image_element[8]; + uint8_t reserved[52]; /* reserved for future use (padding) */ +} DPX_image_info_t; + + + +typedef struct dpx_image_source_struct +{ + uint32_t x_offset; /* X offset */ + uint32_t y_offset; /* Y offset */ + float x_center; /* X center */ + float y_center; /* Y center */ + uint32_t x_orig_size; /* X original size */ + uint32_t y_orig_size; /* Y original size */ + uint8_t file_name[100]; /* source image file name */ + uint8_t creation_time[24]; /* source image creation date and time */ + uint8_t input_dev[32]; /* input device name */ + uint8_t input_serial[32]; /* input device serial number */ + uint16_t border[4]; /* border validity (XL, XR, YT, YB) */ + uint32_t pixel_aspect[2]; /* pixel aspect ratio (H:V) */ + uint8_t reserved[28]; /* reserved for future use (padding) */ +} DPX_image_source_t; + + + +typedef struct dpx_motion_picture_film_header_struct +{ + uint8_t film_mfg_id[2]; /* film manufacturer ID code (2 digits from film edge code) */ + uint8_t film_type[2]; /* file type (2 digits from film edge code) */ + uint8_t offset[2]; /* offset in perfs (2 digits from film edge code)*/ + uint8_t prefix[6]; /* prefix (6 digits from film edge code) */ + uint8_t count[4]; /* count (4 digits from film edge code)*/ + uint8_t format[32]; /* format (i.e. academy) */ + uint32_t frame_position; /* frame position in sequence */ + uint32_t sequence_len; /* sequence length in frames */ + uint32_t held_count; /* held count (1 = default) */ + float frame_rate; /* frame rate of original in frames/sec */ + float shutter_angle; /* shutter angle of camera in degrees */ + uint8_t frame_id[32]; /* frame identification (i.e. keyframe) */ + uint8_t slate_info[100]; /* slate information */ + uint8_t reserved[56]; /* reserved for future use (padding) */ +} DPX_film_t; + + + + +typedef struct dpx_television_header_struct +{ + uint32_t tim_code; /* SMPTE time code */ + uint32_t userBits; /* SMPTE user bits */ + uint8_t interlace; /* interlace ( 0 = noninterlaced, 1 = 2:1 interlace*/ + uint8_t field_num; /* field number */ + uint8_t video_signal; /* video signal standard (table 4)*/ + uint8_t unused; /* used for byte alignment only */ + float hor_sample_rate; /* horizontal sampling rate in Hz */ + float ver_sample_rate; /* vertical sampling rate in Hz */ + float frame_rate; /* temporal sampling rate or frame rate in Hz */ + float time_offset; /* time offset from sync to first pixel */ + float gamma; /* gamma value */ + float black_level; /* black level code value */ + float black_gain; /* black gain */ + float break_point; /* breakpoint */ + float white_level; /* reference white level code value */ + float integration_times; /* integration time(s) */ + uint8_t reserved[76]; /* reserved for future use (padding) */ +} DPX_television_t; + + +typedef struct dpx_header_struct +{ + DPX_file_info_t file_info; + DPX_image_info_t image_info; + DPX_image_source_t image_source; + DPX_film_t film_header; + DPX_television_t tv_header; +#ifdef NTV4_RAID_SUPPORT + uint8_t reserved[2048]; +#endif +} DPX_header_t; + + +uint32_t AJA_EXPORT dpx_get_u32(const uint32_t *ptr, bool BE ); +void AJA_EXPORT dpx_set_u32(uint32_t *ptr, bool BE, uint32_t val ); +uint16_t AJA_EXPORT dpx_get_u16(const uint16_t *ptr, bool BE ); +void AJA_EXPORT dpx_set_u16(uint16_t *ptr, bool BE, uint16_t val ); +float AJA_EXPORT dpx_get_r32(const float *ptr, bool BE ); +void AJA_EXPORT dpx_set_r32(float *ptr, bool BE, float val ); + + +#define FLD_OFFET( TYPE,field) \ + ((uint32_t)(&(((TYPE *)0)->field))) + +#define DPX_GET_U32(hdr,fld) \ + DPX_VALID(hdr) ? \ + dpx_get_u32(&(hdr)->fld,DPX_IS_BE(hdr)) : \ + (uint32_t)(-1) + +#define DPX_SET_U32(hdr,fld,val) \ + do { \ + if ( DPX_VALID(hdr)) \ + dpx_set_u32(&(hdr)->fld,DPX_IS_BE(hdr),val); \ + } while(0) + + +#define DPX_GET_R32(hdr,fld) \ + DPX_VALID(hdr) ? \ + dpx_get_r32(&(hdr)->fld,DPX_IS_BE(hdr)) : \ + (float)(0xffffffff) + +#define DPX_SET_R32(hdr,fld,val) \ + do { \ + if ( DPX_VALID(hdr)) \ + dpx_set_r32(&(hdr)->fld,DPX_IS_BE(hdr),val); \ + } while(0) + +#define DPX_GET_U16(hdr,fld) \ + DPX_VALID(hdr) ? \ + dpx_get_u16(&(hdr)->fld,DPX_IS_BE(hdr)) : \ + (uint16_t)(-1) + +#define DPX_SET_U16(hdr,fld,val) \ + do { \ + if ( DPX_VALID(hdr)) \ + dpx_set_u16(&(hdr)->fld,DPX_IS_BE(hdr),val); \ + } while(0) + + +#define DPX_GET_U8(hdr,fld) \ + DPX_VALID(hdr) ? (hdr)->fld : (uint8_t)(-1) + + +#define DPX_SET_U8(hdr,fld,val) \ + if ( DPX_VALID(hdr)) \ + (hdr)->fld = val + +#define DPX_SET_TEXT(hdr,fld,buf,len) \ + if ( DPX_VALID(hdr)) \ + memcpy((void*)&((hdr)->fld),(const void*)buf,len) + + +#define DPX_GET_TEXT(hdr,fld,buf,len) \ + DPX_VALID(hdr) ? \ + memcpy((void*)buf,(const void*)&((hdr)->fld),len) : \ + memset((void*)buf,0xff,len) + + +class AJA_EXPORT DpxHdr +{ +public: + DpxHdr(void) { init(DPX_C_MAGIC_BE); } + ~DpxHdr(); + + DpxHdr& operator=(const DpxHdr& rhs); + + void init(uint32_t endianness); + bool valid() const; + + bool IsBigEndian() { return DPX_IS_BE(&m_hdr); } + + std::string get_fi_time_stamp() const; + void set_fi_time_stamp(); + + void set_s2_tcframe(uint32_t frame); + size_t get_s2_tcframe() const; + + uint32_t get_s2_filenumber() const; + void set_s2_filenumber(uint32_t fr); + + void set_s2_ids(uint8_t rid, uint8_t sid, uint8_t tid); + void get_s2_ids(uint8_t *rid, uint8_t *sid, uint8_t *tid) const; + + size_t get_file_size(); + size_t get_generic_hdr_size(); + size_t get_industry_hdr_size(); + size_t get_user_hdr_size(); + + // File Info access + // + size_t get_fi_image_offset() const; + void set_fi_image_offset(size_t offs ); + + size_t get_fi_file_size() const; + void set_fi_file_size(size_t offs ); + + std::string get_fi_version() const; + void set_fi_version(const std::string& str); + + std::string get_fi_file_name() const; + void set_fi_file_name(const std::string& str); + + std::string get_fi_creator() const; + void set_fi_creator(const std::string& str); + + std::string get_fi_create_time() const; + void set_fi_create_time(const std::string& str); + + std::string get_fi_project() const; + void set_fi_project(const std::string& str); + + std::string get_fi_copyright() const; + void set_fi_copyright(const std::string& str); + + // Image Info + void set_ii_orientation(uint16_t orientation ); + uint16_t get_ii_orientation() const; + + void set_ii_element_number(uint16_t element_number ); + uint16_t get_ii_element_number() const; + + void set_ii_pixels(uint32_t pixels ); + size_t get_ii_pixels() const; + + void set_ii_lines(uint32_t lines ); + size_t get_ii_lines(void ) const; + + size_t get_ii_image_size() + { + // Note: Incorrect for some configs + uint32_t expectedSize = -1; + if (get_ie_descriptor() == 50) + { + if ( get_ie_bit_size() == 10 ) + expectedSize = (uint32_t)(get_ii_pixels() * get_ii_lines() * 4); + else + expectedSize = (uint32_t)(get_ii_pixels() * get_ii_lines() * 6); // 16 bit + } + else if (get_ie_descriptor() == 100) + { + if (get_ii_pixels() % 48 == 0) + expectedSize = (uint32_t)(get_ii_pixels() * get_ii_lines() * 8 / 3); + else + expectedSize = (uint32_t)(((get_ii_pixels()/48+1)*48) * get_ii_lines() * 8 / 3); + } +// rowBytes = (( width % 48 == 0 ) ? width : (((width / 48 ) + 1) * 48)) * 8 / 3; + + + if (0 == get_fi_file_size()) + { + return (0); + } + + uint32_t sizeInFile = (uint32_t)(get_fi_file_size() - get_fi_image_offset()); + + if ( sizeInFile < expectedSize) + return sizeInFile; + else + return expectedSize; + + } + + // Image Element + void set_ie_data_sign (uint32_t sign, int i=0); + size_t get_ie_data_sign(int i = 0); + + void set_ie_ref_low_data(uint32_t data, int i=0); + size_t get_ie_ref_low_data(int i = 0) const; + + void set_ie_ref_high_data(uint32_t data, int i=0); + size_t get_ie_ref_high_data(int i = 0) const; + + void set_ie_ref_low_quantity(float data, int i=0); + float get_ie_ref_low_quantity(int i = 0) const; + + void set_ie_ref_high_quantity(float data, int i=0); + float get_ie_ref_high_quantity(int i = 0) const; + + void set_ie_descriptor(uint8_t desc, int i = 0); + uint8_t get_ie_descriptor(int i = 0) const; + + void set_ie_transfer(uint8_t trans, int i = 0); + uint8_t get_ie_transfer(int i = 0) const; + + void set_ie_colorimetric(uint8_t c, int i = 0); + uint8_t get_ie_colorimetric(int i = 0) const; + + void set_ie_bit_size(uint8_t bits, int i = 0); + uint8_t get_ie_bit_size(int i = 0) const; + + void set_ie_packing(uint16_t pack, int i = 0); + uint16_t get_ie_packing (int i = 0) const; + + void set_ie_encoding(uint16_t enc, int i = 0); + uint16_t get_ie_encoding(int i = 0) const; + + void set_ie_data_offset(uint32_t offs, int i = 0); + uint32_t get_ie_data_offset (int i = 0) const; + + void set_ie_eol_padding(uint32_t padding, int i = 0); + uint32_t get_ie_eol_padding(int i = 0) const; + + void set_ie_eo_image_padding(uint32_t padding, int i = 0); + uint32_t get_ie_eo_image_padding(int i = 0) const; + + std::string get_ie_description(int i=0) const; + void set_ie_description(const std::string& str, int i = 0); + + // Image Source access. + std::string get_is_filename() const; + void set_is_filename(const std::string& str); + + std::string get_is_creation_time() const; + void set_is_creation_time(const std::string& str); + + std::string get_is_input_device() const; + void set_is_input_device(const std::string& str); + + std::string get_is_input_serial() const; + void set_is_input_serial(const std::string& str); + + // Film header + std::string get_film_mfg_id() const; + void set_film_mfg_id(const std::string& str); + + std::string get_film_type() const; + void set_film_type(const std::string& str); + + std::string get_film_offset() const; + void set_film_offset(const std::string& str); + + std::string get_film_prefix() const; + void set_film_prefix(const std::string& str); + + std::string get_film_count() const; + void set_film_count(const std::string& str); + + std::string get_film_format() const; + void set_film_format(const std::string& str); + + size_t get_film_frame_position() const; + void set_film_frame_position(size_t pos ); + + size_t get_film_sequence_len() const; + void set_film_sequence_len(size_t len ); + + size_t get_film_held_count() const; + void set_film_held_count(size_t count ); + + float get_film_frame_rate () const; + void set_film_frame_rate (float len ); + + float get_film_shutter_angle() const; + void set_film_shutter_angle(float ); + + std::string get_film_frame_id() const; + void set_film_frame_id(const std::string& str); + + std::string get_film_slate_info() const; + void set_film_slate_info(const std::string& str); + + // TV header + size_t get_tv_timecode() const; + void set_tv_timecode(size_t tc); + + size_t get_tv_userbits() const; + void set_tv_userbits(size_t tc); + + float get_tv_frame_rate() const; + void set_tv_frame_rate(float fr); + + uint8_t get_tv_interlace() const; + void set_tv_interlace(uint8_t interlace); + + const DPX_header_t& GetHdr(void) const + { + return (m_hdr); + } + + DPX_header_t& GetHdr(void) + { + return (m_hdr); + } + + size_t GetHdrSize(void) const + { + return (sizeof(DPX_header_t)); + } + +private: + DPX_header_t m_hdr; +}; + + +#endif // DPX_HDR_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/dpxfileio.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/dpxfileio.h new file mode 100644 index 0000000..f82b572 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/dpxfileio.h @@ -0,0 +1,138 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file dpxfileio.h + @brief Declaration of the AJADPXFileIO class, for low level file I/O. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_DPXFILEIO_H +#define AJA_DPXFILEIO_H + +#include "ajabase/common/dpx_hdr.h" +#include "ajabase/common/types.h" + +/** + * Class to support low level I/O for DPX files. + * @ingroup AJAFileIO + */ +class AJADPXFileIO : public DpxHdr +{ + // Public Instance Methods + public: + /** + @brief Constructs a DPX file IO object. + @note Do not call this method without first calling the SetPath method. + **/ + AJA_EXPORT AJADPXFileIO (); + + AJA_EXPORT virtual ~AJADPXFileIO (); + + /** + @brief Returns the list of DPX files that were found at the destination. + **/ + AJA_EXPORT std::vector & GetFileList (); + + /** + @brief Returns the number of DPX files in the location specified by the path. + **/ + AJA_EXPORT uint32_t GetFileCount () const; + + /** + @brief Returns the index in the file list of the next file to be read. + **/ + AJA_EXPORT uint32_t GetIndex () const; + + /** + @brief Returns the current setting of the loop play control. + **/ + AJA_EXPORT bool GetLoopMode () const; + + /** + @brief Returns the current setting of the pause control. + **/ + AJA_EXPORT bool GetPauseMode () const; + + /** + @brief Returns the current path to the DPX files to be read. + **/ + AJA_EXPORT std::string GetPath () const; + + /** + @brief Read only the header from the specified file in the DPX sequence. + @param[in] inIndex Specifies the index number of the file to read. + 0 <= outIndex <= FileCount + **/ + AJA_EXPORT AJAStatus Read (const uint32_t inIndex); + + /** + @brief Read the next file in the DPX sequence. + @param[out] outBuffer Receives the DPX file image payload. + @param[in] inBufferSize Specifies the maximum number of bytes to store in outBuffer. + @param[out] outIndex Receives the index number of the file read. + 0 <= outIndex <= FileCount + **/ + AJA_EXPORT AJAStatus Read (uint8_t & outBuffer, + const uint32_t inBufferSize, + uint32_t & outIndex); + + /** + @brief Specifies an ordered list of DPX files to read. + **/ + void SetFileList (std::vector & list); + + /** + @brief Specifies the index in the file list of the next file to be read. + **/ + AJA_EXPORT AJAStatus SetIndex (const uint32_t & index); + + /** + @brief Specifies the setting of the loop play control. + If true, the last file of a sequence is followed by the first file. + If false, attempting to read beyond the end of a sequence is an error. + **/ + AJA_EXPORT void SetLoopMode (bool mode); + + /** + @brief Specifies the setting of the pause control. + If true, pause mode will take effect. + If false, pause mode is canceled. + **/ + AJA_EXPORT void SetPauseMode (bool mode); + + /** + @brief Change the path to the DPX files to be read. + @param[in] inPath Specifies the path to where the DPX files are located. + The file count will change to reflect the number of + files present in the new location. + **/ + AJA_EXPORT AJAStatus SetPath (const std::string & inPath); + + /** + @brief Write a DPX file. + @param[in] inBuffer Specifies the DPX file image payload. + #param[in] inBufferSize Specifies the number of payload bytes in inBuffer. + #param[in] inIndex Specifies the index number to be appended to the file name. + **/ + AJA_EXPORT AJAStatus Write (const uint8_t & inBuffer, + const uint32_t inBufferSize, + const uint32_t & inIndex) const; + + + // Protected Instance Methods + protected: + + + // Private Member Data + private: + bool mPathSet; /// True if the path to use has been set, else false + bool mLoopMode; /// True if last sequence frame is followed by the first + bool mPauseMode; /// True if currently paused, else false + std::string mPath; /// Location of the files to read + uint32_t mFileCount; /// Number of DPX files in the path + uint32_t mCurrentIndex; /// Index into the vector below of the next file to read + std::vector mFileList; /// File names of all the DPX files in the path + +}; // AJADPXFileIO + +#endif // AJA_DPXFILEIO_H + diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/export.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/export.h new file mode 100644 index 0000000..1f0b59b --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/export.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file export.h + @brief Declares system-dependent import/export macros and libraries. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_EXPORT_H +#define AJA_EXPORT_H + +#ifdef MSWindows + #ifndef AJASTATIC + #if defined(AJADLL) || defined(AJA_WINDLL) + #pragma warning (disable : 4251) + #if defined(AJADLL_BUILD) || defined(AJA_DLL_BUILD) + #define AJAExport __declspec(dllexport) // ajantv2 way + #define AJA_EXPORT __declspec(dllexport) // ajabase way + #else + #define AJAExport __declspec(dllimport) // ajantv2 way + #define AJA_EXPORT __declspec(dllimport) // ajabase way + #endif + #else + #define AJAExport // ajantv2 way + #define AJA_EXPORT // ajabase way + #ifndef AJA_NO_AUTOIMPORT + #endif + #endif + #else + #define AJAExport // ajantv2 way + #define AJA_EXPORT // ajabase way + #endif +#else + #define AJAExport // ajantv2 way + #define AJA_EXPORT // ajabase way +#endif + +#endif // AJA_EXPORT_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/guid.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/guid.h new file mode 100644 index 0000000..0df5620 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/guid.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file guid.h + @brief Generates a new, unique UUID as an STL string. + @copyright (C) 2015-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_GUID_H +#define AJA_GUID_H + +#include +#include "public.h" + +extern "C" +{ + #if defined(AJA_WINDOWS) + #include + #elif defined(AJA_LINUX) + #include + #else + #include + #endif +} + +/** + * Generates a uuid. + * + * @return An STL string that contains the new UUID. + */ +std::string AJA_EXPORT CreateGuid (void); + + +#endif // AJA_GUID_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/options_popt.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/options_popt.h new file mode 100644 index 0000000..0390918 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/options_popt.h @@ -0,0 +1,618 @@ +/** \file options_popt.h + * \ingroup popt + */ + +/* This file is a port of the popt library for use with the AJA SDK. + * The code for the library was consolidated into a .h and .cpp file + * to simplify building demonstration applications. Not all the features + * of popt have been tested. Only simple command line parameter parsing + * was needed for the SDK, but popt was ported to allow enhancing our + * applications with additional functionality as needed. +*/ + +/* (C) 1998-2000 Red Hat, Inc. -- Licensing details are in the COPYING + file accompanying popt source distributions, available from + ftp://ftp.rpm.org/pub/rpm/dist. */ + +/* Here is the contents of the COPYING file: +*/ + +/* +Copyright (c) 1998 Red Hat Software + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the X Consortium. +*/ + +#ifndef H_POPT +#define H_POPT + +#include /* for FILE * */ +#include "export.h" + +#define POPT_OPTION_DEPTH 10 + +/** \ingroup popt + * \name Arg type identifiers + */ +#define POPT_ARG_NONE 0U /*!< no arg */ +#define POPT_ARG_STRING 1U /*!< arg will be saved as string */ +#define POPT_ARG_INT 2U /*!< arg ==> int */ +#define POPT_ARG_LONG 3U /*!< arg ==> long */ +#define POPT_ARG_INCLUDE_TABLE 4U /*!< arg points to table */ +#define POPT_ARG_CALLBACK 5U /*!< table-wide callback... must be + set first in table; arg points + to callback, descrip points to + callback data to pass */ +#define POPT_ARG_INTL_DOMAIN 6U /*!< set the translation domain + for this table and any + included tables; arg points + to the domain string */ +#define POPT_ARG_VAL 7U /*!< arg should take value val */ +#define POPT_ARG_FLOAT 8U /*!< arg ==> float */ +#define POPT_ARG_DOUBLE 9U /*!< arg ==> double */ +#define POPT_ARG_LONGLONG 10U /*!< arg ==> long long */ + +#define POPT_ARG_MAINCALL 16U+11U /*!< EXPERIMENTAL: return (*arg) (argc, argv) */ +#define POPT_ARG_ARGV 12U /*!< dupe'd arg appended to realloc'd argv array. */ +#define POPT_ARG_SHORT 13U /*!< arg ==> short */ +#define POPT_ARG_BITSET 16U+14U /*!< arg ==> bit set */ + +#define POPT_ARG_MASK 0x000000FFU +#define POPT_GROUP_MASK 0x0000FF00U + +/** \ingroup popt + * \name Arg modifiers + */ +#define POPT_ARGFLAG_ONEDASH 0x80000000U /*!< allow -longoption */ +#define POPT_ARGFLAG_DOC_HIDDEN 0x40000000U /*!< don't show in help/usage */ +#define POPT_ARGFLAG_STRIP 0x20000000U /*!< strip this arg from argv(only applies to long args) */ +#define POPT_ARGFLAG_OPTIONAL 0x10000000U /*!< arg may be missing */ + +#define POPT_ARGFLAG_OR 0x08000000U /*!< arg will be or'ed */ +#define POPT_ARGFLAG_NOR 0x09000000U /*!< arg will be nor'ed */ +#define POPT_ARGFLAG_AND 0x04000000U /*!< arg will be and'ed */ +#define POPT_ARGFLAG_NAND 0x05000000U /*!< arg will be nand'ed */ +#define POPT_ARGFLAG_XOR 0x02000000U /*!< arg will be xor'ed */ +#define POPT_ARGFLAG_NOT 0x01000000U /*!< arg will be negated */ +#define POPT_ARGFLAG_LOGICALOPS \ + (POPT_ARGFLAG_OR|POPT_ARGFLAG_AND|POPT_ARGFLAG_XOR) + +#define POPT_BIT_SET (POPT_ARG_VAL|POPT_ARGFLAG_OR) + /*!< set arg bit(s) */ +#define POPT_BIT_CLR (POPT_ARG_VAL|POPT_ARGFLAG_NAND) + /*!< clear arg bit(s) */ + +#define POPT_ARGFLAG_SHOW_DEFAULT 0x00800000U /*!< show default value in --help */ +#define POPT_ARGFLAG_RANDOM 0x00400000U /*!< random value in [1,arg] */ +#define POPT_ARGFLAG_TOGGLE 0x00200000U /*!< permit --[no]opt prefix toggle */ + +/** \ingroup popt + * \name Callback modifiers + */ +#define POPT_CBFLAG_PRE 0x80000000U /*!< call the callback before parse */ +#define POPT_CBFLAG_POST 0x40000000U /*!< call the callback after parse */ +#define POPT_CBFLAG_INC_DATA 0x20000000U /*!< use data from the include line, + not the subtable */ +#define POPT_CBFLAG_SKIPOPTION 0x10000000U /*!< don't callback with option */ +#define POPT_CBFLAG_CONTINUE 0x08000000U /*!< continue callbacks with option */ + +/** \ingroup popt + * \name Error return values + */ +#define POPT_ERROR_NOARG -10 /*!< missing argument */ +#define POPT_ERROR_BADOPT -11 /*!< unknown option */ +#define POPT_ERROR_OPTSTOODEEP -13 /*!< aliases nested too deeply */ +#define POPT_ERROR_BADQUOTE -15 /*!< error in paramter quoting */ +#define POPT_ERROR_ERRNO -16 /*!< errno set, use strerror(errno) */ +#define POPT_ERROR_BADNUMBER -17 /*!< invalid numeric value */ +#define POPT_ERROR_OVERFLOW -18 /*!< number too large or too small */ +#define POPT_ERROR_BADOPERATION -19 /*!< mutually exclusive logical operations requested */ +#define POPT_ERROR_NULLARG -20 /*!< opt->arg should not be NULL */ +#define POPT_ERROR_MALLOC -21 /*!< memory allocation failed */ +#define POPT_ERROR_BADCONFIG -22 /*!< config file failed sanity test */ + +/** \ingroup popt + * \name poptBadOption() flags + */ +#define POPT_BADOPTION_NOALIAS (1U << 0) /*!< don't go into an alias */ + +/** \ingroup popt + * \name poptGetContext() flags + */ +#define POPT_CONTEXT_NO_EXEC (1U << 0) /*!< ignore exec expansions */ +#define POPT_CONTEXT_KEEP_FIRST (1U << 1) /*!< pay attention to argv[0] */ +#define POPT_CONTEXT_POSIXMEHARDER (1U << 2) /*!< options can't follow args */ +#define POPT_CONTEXT_ARG_OPTS (1U << 4) /*!< return args as options with value 0 */ + +/** \ingroup popt + */ +struct poptOption { + const char * longName; /*!< may be NULL */ + char shortName; /*!< may be NUL */ + unsigned int argInfo; + void * arg; /*!< depends on argInfo */ + int val; /*!< 0 means don't return, just update flag */ + const char * descrip; /*!< description for autohelp -- may be NULL */ + const char * argDescrip; /*!< argument description for autohelp */ +}; + +/** \ingroup popt + * A popt alias argument for poptAddAlias(). + */ +struct poptAlias { + const char * longName; /*!< may be NULL */ + char shortName; /*!< may be NUL */ + int argc; + const char ** argv; /*!< must be free()able */ +}; + +/** \ingroup popt + * A popt alias or exec argument for poptAddItem(). + */ +typedef struct poptItem_s { + struct poptOption option; /*!< alias/exec name(s) and description. */ + int argc; /*!< (alias) no. of args. */ + const char ** argv; /*!< (alias) args, must be free()able. */ +} * poptItem; + +/** \ingroup popt + * \name Auto-generated help/usage + */ + +/** + * Empty table marker to enable displaying popt alias/exec options. + */ +extern struct poptOption poptAliasOptions[]; +#define POPT_AUTOALIAS { NULL, '\0', POPT_ARG_INCLUDE_TABLE, poptAliasOptions, \ + 0, "Options implemented via popt alias/exec:", NULL }, + +/** + * Auto help table options. + */ +extern struct poptOption poptHelpOptions[]; + +extern struct poptOption * poptHelpOptionsI18N; + +#define POPT_AUTOHELP { NULL, '\0', POPT_ARG_INCLUDE_TABLE, poptHelpOptions, \ + 0, "Help options:", NULL }, + +#define POPT_TABLEEND { NULL, '\0', 0, NULL, 0, NULL, NULL } + +/** \ingroup popt + */ +typedef struct poptContext_s * poptContext; + +/** \ingroup popt + */ +#ifndef __cplusplus +typedef struct poptOption * poptOption; +#endif + +/** \ingroup popt + */ +enum poptCallbackReason { + POPT_CALLBACK_REASON_PRE = 0, + POPT_CALLBACK_REASON_POST = 1, + POPT_CALLBACK_REASON_OPTION = 2 +}; + +#ifdef __cplusplus +extern "C" { +#endif + +/** \ingroup popt + * Table callback prototype. + * @param con context + * @param reason reason for callback + * @param opt option that triggered callback + * @param arg argument + * @param data argument data + */ +typedef void (*poptCallbackType) (poptContext con, + enum poptCallbackReason reason, + const struct poptOption * opt, + const char * arg, + const void * data); + +/** \ingroup popt + * Destroy context. + * @param con context + * @return NULL always + */ +poptContext poptFreeContext(poptContext con); + +/** \ingroup popt + * Initialize popt context. + * @param name context name (usually argv[0] program name) + * @param argc no. of arguments + * @param argv argument array + * @param options address of popt option table + * @param flags or'd POPT_CONTEXT_* bits + * @return initialized popt context + */ +poptContext poptGetContext( + const char * name, + int argc, const char ** argv, + const struct poptOption * options, + unsigned int flags); + +/** \ingroup popt + * Destroy context (alternative implementation). + * @param con context + * @return NULL always + */ +poptContext poptFini(poptContext con); + +/** \ingroup popt + * Initialize popt context (alternative implementation). + * This routine does poptGetContext() and then poptReadConfigFiles(). + * @param argc no. of arguments + * @param argv argument array + * @param options address of popt option table + * @param configPaths colon separated file path(s) to read. + * @return initialized popt context (NULL on error). + */ +poptContext poptInit(int argc, const char ** argv, + const struct poptOption * options, + const char * configPaths); + +/** \ingroup popt + * Reinitialize popt context. + * @param con context + */ +void poptResetContext(poptContext con); + +/** \ingroup popt + * Return value of next option found. + * @param con context + * @return next option val, -1 on last item, POPT_ERROR_* on error + */ +int poptGetNextOpt(poptContext con); + +/** \ingroup popt + * Return next option argument (if any). + * @param con context + * @return option argument, NULL if no argument is available + */ +char * poptGetOptArg(poptContext con); + +/** \ingroup popt + * Return next argument. + * @param con context + * @return next argument, NULL if no argument is available + */ +const char * poptGetArg(/*@null@*/poptContext con); + +/** \ingroup popt + * Peek at current argument. + * @param con context + * @return current argument, NULL if no argument is available + */ +const char * poptPeekArg(poptContext con); + +/** \ingroup popt + * Return remaining arguments. + * @param con context + * @return argument array, NULL terminated + */ +const char ** poptGetArgs(poptContext con); + +/** \ingroup popt + * Return the option which caused the most recent error. + * @param con context + * @param flags option flags + * @return offending option + */ +const char * poptBadOption(poptContext con, unsigned int flags); + +/** \ingroup popt + * Add arguments to context. + * @param con context + * @param argv argument array, NULL terminated + * @return 0 on success, POPT_ERROR_OPTSTOODEEP on failure + */ +int poptStuffArgs(poptContext con, const char ** argv); + +/** \ingroup popt + * Add alias to context. + * @todo Pass alias by reference, not value. + * @note This function is deprecated. Use poptAddItem instead. + * @param con context + * @param alias alias to add + * @param flags (unused) + * @return 0 on success + */ +int poptAddAlias(poptContext con, struct poptAlias alias, int flags); + +/** \ingroup popt + * Add alias/exec item to context. + * @param con context + * @param newItem alias/exec item to add + * @param flags 0 for alias, 1 for exec + * @return 0 on success + */ +int poptAddItem(poptContext con, poptItem newItem, int flags); + +/** \ingroup popt + * Perform sanity checks on a file path. + * @param fn file name + * @return 0 on OK, 1 on NOTOK. + */ +int poptSaneFile(const char * fn); + +/** + * Read a file into a buffer. + * @param fn file name + * @retval *bp buffer (malloc'd) (or NULL) + * @retval *nbp no. of bytes in buffer (including final NUL) (or NULL) + * @param flags 1 to trim escaped newlines + * return 0 on success + */ +int poptReadFile(const char * fn, char ** bp, + size_t * nbp, int flags); +#define POPT_READFILE_TRIMNEWLINES 1 + +/** \ingroup popt + * Read configuration file. + * @param con context + * @param fn file name to read + * @return 0 on success, POPT_ERROR_ERRNO on failure + */ +int poptReadConfigFile(poptContext con, const char * fn); + +/** \ingroup popt + * Read configuration file(s). + * Colon separated files to read, looping over poptReadConfigFile(). + * Note that an '@' character preceeding a path in the list will + * also perform additional sanity checks on the file before reading. + * @param con context + * @param paths colon separated file name(s) to read + * @return 0 on success, POPT_ERROR_BADCONFIG on failure + */ +int poptReadConfigFiles(poptContext con, const char * paths); + +/** \ingroup popt + * Read default configuration from /etc/popt and $HOME/.popt. + * @param con context + * @param useEnv (unused) + * @return 0 on success, POPT_ERROR_ERRNO on failure + */ +int poptReadDefaultConfig(poptContext con, int useEnv); + +/** \ingroup popt + * Duplicate an argument array. + * @note: The argument array is malloc'd as a single area, so only argv must + * be free'd. + * + * @param argc no. of arguments + * @param argv argument array + * @retval argcPtr address of returned no. of arguments + * @retval argvPtr address of returned argument array + * @return 0 on success, POPT_ERROR_NOARG on failure + */ +int poptDupArgv(int argc, const char **argv, + int * argcPtr, + const char *** argvPtr); + +/** \ingroup popt + * Parse a string into an argument array. + * The parse allows ', ", and \ quoting, but ' is treated the same as " and + * both may include \ quotes. + * @note: The argument array is malloc'd as a single area, so only argv must + * be free'd. + * + * @param s string to parse + * @retval argcPtr address of returned no. of arguments + * @retval argvPtr address of returned argument array + */ +int poptParseArgvString(const char * s, + int * argcPtr, const char *** argvPtr); + +/** \ingroup popt + * Parses an input configuration file and returns an string that is a + * command line. For use with popt. You must free the return value when done. + * + * Given the file: +\verbatim +# this line is ignored + # this one too +aaa + bbb + ccc +bla=bla + +this_is = fdsafdas + bad_line= + reall bad line + reall bad line = again +5555= 55555 + test = with lots of spaces +\endverbatim +* +* The result is: +\verbatim +--aaa --bbb --ccc --bla="bla" --this_is="fdsafdas" --5555="55555" --test="with lots of spaces" +\endverbatim +* +* Passing this to poptParseArgvString() yields an argv of: +\verbatim +'--aaa' +'--bbb' +'--ccc' +'--bla=bla' +'--this_is=fdsafdas' +'--5555=55555' +'--test=with lots of spaces' +\endverbatim + * + * @bug NULL is returned if file line is too long. + * @bug Silently ignores invalid lines. + * + * @param fp file handle to read + * @param argstrp return string of options (malloc'd) + * @param flags unused + * @return 0 on success + * @see poptParseArgvString + */ +int poptConfigFileToString(FILE *fp, char ** argstrp, int flags); + +/** \ingroup popt + * Return formatted error string for popt failure. + * @param error popt error + * @return error string + */ +const char * poptStrerror(const int error); + +/** \ingroup popt + * Limit search for executables. + * @param con context + * @param path single path to search for executables + * @param allowAbsolute absolute paths only? + */ +void poptSetExecPath(poptContext con, const char * path, int allowAbsolute); + +/** \ingroup popt + * Print detailed description of options. + * @param con context + * @param fp ouput file handle + * @param flags (unused) + */ +void poptPrintHelp(poptContext con, FILE * fp, int flags); + +/** \ingroup popt + * Print terse description of options. + * @param con context + * @param fp ouput file handle + * @param flags (unused) + */ +void poptPrintUsage(poptContext con, FILE * fp, int flags); + +/** \ingroup popt + * Provide text to replace default "[OPTION...]" in help/usage output. + * @param con context + * @param text replacement text + */ +void poptSetOtherOptionHelp(poptContext con, const char * text); + +/** \ingroup popt + * Return argv[0] from context. + * @param con context + * @return argv[0] + */ +const char * poptGetInvocationName(poptContext con); + +/** \ingroup popt + * Shuffle argv pointers to remove stripped args, returns new argc. + * @param con context + * @param argc no. of args + * @param argv arg vector + * @return new argc + */ +int poptStrippedArgv(poptContext con, int argc, char ** argv); + +/** + * Add a string to an argv array. + * @retval *argvp argv array + * @param argInfo (unused) + * @param val string arg to add (using strdup) + * @return 0 on success, POPT_ERROR_NULLARG/POPT_ERROR_BADOPERATION + */ +int poptSaveString(const char *** argvp, unsigned int argInfo, + const char * val); + +/** + * Save a long long, performing logical operation with value. + * @warning Alignment check may be too strict on certain platorms. + * @param arg integer pointer, aligned on int boundary. + * @param argInfo logical operation (see POPT_ARGFLAG_*) + * @param aLongLong value to use + * @return 0 on success, POPT_ERROR_NULLARG/POPT_ERROR_BADOPERATION + */ +int poptSaveLongLong(long long * arg, unsigned int argInfo, + long long aLongLong); + +/** + * Save a long, performing logical operation with value. + * @warning Alignment check may be too strict on certain platorms. + * @param arg integer pointer, aligned on int boundary. + * @param argInfo logical operation (see POPT_ARGFLAG_*) + * @param aLong value to use + * @return 0 on success, POPT_ERROR_NULLARG/POPT_ERROR_BADOPERATION + */ +int poptSaveLong(long * arg, unsigned int argInfo, long aLong); + +/** + * Save a short integer, performing logical operation with value. + * @warning Alignment check may be too strict on certain platorms. + * @param arg short pointer, aligned on short boundary. + * @param argInfo logical operation (see POPT_ARGFLAG_*) + * @param aLong value to use + * @return 0 on success, POPT_ERROR_NULLARG/POPT_ERROR_BADOPERATION + */ +int poptSaveShort(short * arg, unsigned int argInfo, long aLong); + +/** + * Save an integer, performing logical operation with value. + * @warning Alignment check may be too strict on certain platorms. + * @param arg integer pointer, aligned on int boundary. + * @param argInfo logical operation (see POPT_ARGFLAG_*) + * @param aLong value to use + * @return 0 on success, POPT_ERROR_NULLARG/POPT_ERROR_BADOPERATION + */ +int poptSaveInt(int * arg, unsigned int argInfo, long aLong); + +/* The bit set typedef. */ +typedef struct poptBits_s { + unsigned int bits[1]; +} * poptBits; + +#define _POPT_BITS_N 1024U /* estimated population */ +#define _POPT_BITS_M ((3U * _POPT_BITS_N) / 2U) +#define _POPT_BITS_K 16U /* no. of linear hash combinations */ + +extern unsigned int _poptBitsN; +extern unsigned int _poptBitsM; +extern unsigned int _poptBitsK; + +int poptBitsAdd(poptBits bits, const char * s); +int poptBitsChk(poptBits bits, const char * s); +int poptBitsClr(poptBits bits); +int poptBitsDel(poptBits bits, const char * s); +int poptBitsIntersect(poptBits * ap, const poptBits b); +int poptBitsUnion(poptBits * ap, const poptBits b); +int poptBitsArgs(poptContext con, poptBits * ap); + +/** + * Save a string into a bit set (experimental). + * @retval *bits bit set (lazily malloc'd if NULL) + * @param argInfo logical operation (see POPT_ARGFLAG_*) + * @param s string to add to bit set + * @return 0 on success, POPT_ERROR_NULLARG/POPT_ERROR_BADOPERATION + */ +int poptSaveBits(poptBits * bitsp, unsigned int argInfo, + const char * s); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/performance.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/performance.h new file mode 100644 index 0000000..9f4bec4 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/performance.h @@ -0,0 +1,174 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file performance.h + @brief Declaration of the AJAPerformance class. + @copyright (C) 2011-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_PERFORMANCE_H +#define AJA_PERFORMANCE_H + +///////////////////////////// +// Includes +///////////////////////////// +#include "ajabase/common/timer.h" +#include +#include + +typedef std::map AJAPerformanceExtraMap; + +///////////////////////////// +// Declarations +///////////////////////////// +class AJAExport AJAPerformance +{ + public: + /** + * Constructor + * + * @param[in] name The name for the performance object. + * @param[in] precision The Precision units to use. + * @param[in] skipEntries The number of entries to skip over before tracking performance, + * the idea here is to skip over any "warm-up" period. + */ + AJAPerformance(const std::string& name, + AJATimerPrecision precision = AJATimerPrecisionMilliseconds, + uint64_t skipEntries = 0); + + /** + * Constructor + * + * @param[in] name The name for the performance object. + * @param[in] values Extra values that can be stored along with performance info. + * @param[in] precision The Precision units to use. + * @param[in] skipEntries The number of entries to skip over before tracking performance, + * the idea here is to skip over any "warm-up" period. + */ + AJAPerformance(const std::string& name, const AJAPerformanceExtraMap& values, + AJATimerPrecision precision = AJATimerPrecisionMilliseconds, + uint64_t skipEntries = 0); + + /** + * Constructor + * + * @param[in] precision The Precision units to use. + * @param[in] skipEntries The number of entries to skip over before tracking performance, + * the idea here is to skip over any "warm-up" period. + */ + AJAPerformance(AJATimerPrecision precision = AJATimerPrecisionMilliseconds, + uint64_t skipEntries = 0); + + ~AJAPerformance(void); + + /** + * Set extra values that can be stored along with performance info + * + * @param[in] values The extra values to assign to this object + */ + void SetExtras(const AJAPerformanceExtraMap& values); + + /** + * Start the timer of the performance object + */ + void Start(void); + + /** + * Stop the timer of the performance object and updates the performance stats: + * number of entries, min time, max time, total time + */ + void Stop(void); + + /** + * Print out a performance report to AJADebug + * @param[in] name Name to use in printout, if empty will use the name passed in constructor + * @param[in] pFileName The source filename reporting the performace. + * @param[in] lineNumber The line number in the source file reporting the performance. + */ + void Report(const std::string& name = "", const char *pFileName = NULL, int32_t lineNumber = -1); + + /** + * Returns the name for the performance object that was set in the constructor + */ + std::string Name(void); + + /** + * Returns the Precision units set in the constructor + */ + AJATimerPrecision Precision(void); + + /** + * Returns the number of times that the start/stop pair has been called + */ + uint64_t Entries(void); + + /** + * Returns the total elapsed time between all start/stop pairs (in Precision units) + */ + uint64_t TotalTime(void); + + /** + * Returns the minimum time between all start/stop pairs (in Precision units) + */ + uint64_t MinTime(void); + + /** + * Returns the maximum time between all start/stop pairs (in Precision units) + */ + uint64_t MaxTime(void); + + /** + * Returns the mean (average) time of all start/stop pairs (in Precision units) + */ + double Mean(void); + + /** + * Returns the variance of all start/stop pairs (in Precision units) + */ + double Variance(void); + + /** + * Returns the standard deviation of all start/stop pairs (in Precision units) + */ + double StandardDeviation(void); + + /** + * Returns a map of any extra values stored in the performance object + */ + const AJAPerformanceExtraMap Extras(void); + + private: + AJATimer mTimer; + std::string mName; + uint64_t mTotalTime; + uint64_t mEntries; + uint64_t mMinTime; + uint64_t mMaxTime; + double mMean; + double mM2; + uint64_t mNumEntriesToSkipAtStart; + + AJAPerformanceExtraMap mExtras; +}; + +// Helper functions to track/report many performance timers and store in a map +typedef std::map AJAPerformanceTracking; + +extern bool AJAPerformanceTracking_start(AJAPerformanceTracking& stats, + std::string key, + AJATimerPrecision precision = AJATimerPrecisionMilliseconds, + uint64_t skipEntries = 0); + +extern bool AJAPerformanceTracking_start(AJAPerformanceTracking& stats, + std::string key, const AJAPerformanceExtraMap& extras, + AJATimerPrecision precision = AJATimerPrecisionMilliseconds, + uint64_t skipEntries = 0); + +extern bool AJAPerformanceTracking_stop(AJAPerformanceTracking& stats, std::string key); + +extern bool AJAPerformanceTracking_report(AJAPerformanceTracking& stats, std::string title = "", + const char *pFileName = NULL, int32_t lineNumber = -1); + + +#endif // AJA_PERFORMANCE_H +//////////////////////// End of performance.h /////////////////////// + diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/pixelformat.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/pixelformat.h new file mode 100644 index 0000000..bd6bfec --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/pixelformat.h @@ -0,0 +1,178 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file pixelformat.h + @brief Contains the declaration of the AJAPixelFormat class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef _PixelFormat_Defined_ +#define _PixelFormat_Defined_ + +#include "ajabase/common/videotypes.h" + +#define IS_CION_RAW(pixFmt) (pixFmt >= AJA_PixelFormat_RAW10 && pixFmt <= AJA_PixelFormat_RAW10_HS) + +enum AJAScaleType +{ + AJAScaleTypeNone = 0, + AJAScaleType1280To1920 = 1 << 0, + AJAScaleType960To1280 = 1 << 1, + AJAScaleType1440To1920 = 1 << 2, + AJAScaleTypeQRez = 1 << 3, + AJAScaleTypeHDV = AJAScaleType960To1280 | AJAScaleType1440To1920, + AJAScaleTypeDVCPro = AJAScaleType960To1280 | AJAScaleType1280To1920 +}; + + +/** + @class AJAPixelFormat pixelformat.h "streams/common/pixelformat.h" + @brief Storage and utility class for AJA_PixelFormat defines. + This class provides a means of storing and querying facts about the various AJA_PixelFormat values. +**/ +class AJA_EXPORT AJAPixelFormat +{ +public: + + AJAPixelFormat(); + AJAPixelFormat(AJA_PixelFormat format); + virtual ~AJAPixelFormat(); + + /** + * Set current format value. + * + * @param[in] format new AJA_PixelFormat. + */ + void Set(AJA_PixelFormat format); + + /** + * Query current format value. + * + * @return current AJA_PixelFormat value. + */ + AJA_PixelFormat Query(void); + + /** + * Query current fourCC value. + * + * @return current FourCC value. + */ + uint32_t QueryFourCC(void); + + /** + * Query display name. + * + * @return current display name. + */ + const char* QueryDisplayName(void); + + /** + * Query RGB. + * + * @return whether or not current format is RGB. + */ + bool QueryRgb(void); + + /** + * Query max bit depth per component for specified format + * + * @return bit depth per component for specified format + */ + uint32_t QueryBitDepth(); + + /** + * Query Scale Type. + * + * @return what type of scale format uses if any. + */ + AJAScaleType QueryScaleType(void); + + /** + * Static method to get number of possible formats + * Useful for filling out GUI's + * + * @return number of possible formats + */ + static int QueryNumberPossibleFormats(); + + /** + * Static method to get a format out of table of all possible formats + * + * @param[in] index Zero-based index value. + * @param[out] fmt Receives format for index. + * Unmodified if index out of bounds. + * @return true if index within bounds + */ + static bool QueryFormatAtIndex(int index,AJAPixelFormat& fmt); + + /** + * Static method to see if a source and target resolution are scalable + * + * @param[in] bitmapWidth width of the bitmap in PC memory + * @param[in] wireWidth width of the bitmap in Kona memory + * @param[in] xAspect Horizontal component of aspect ratio + * @param[in] yAspect Vertical component of aspect ratio + * @param[in] pMatchingFormat Pixel format used for matching + * @param[out] pScalingFormat Receives scaling pixel format + * @return returns true if one of the pixel formats will suffice for scaling + */ + static bool QueryIsScalable(uint32_t bitmapWidth,uint32_t wireWidth,uint32_t xAspect,uint32_t yAspect, + AJA_PixelFormat *pMatchingFormat,AJA_PixelFormat *pScalingFormat); + + /** + * Static method to convert scaled x resolution + * + * @param[in] scaleType type of scaling to be done + * @param[in] xIn either the wire or bitmap resolution + * @param[out] xOut the corrected resolution + * @return returns true if conversion occurred + */ + static bool ConvertWidth(AJAScaleType scaleType,int xIn,int &xOut); + + /** + * Static method to convert aspect ratio from wire to bitmap + * + * @param[in] scaleType Type of scaling to be done + * @param[in] hIn Horizontal value to convert + * @param[in] vIn Vertical value to convert + * @param[out] hOut Converted horizontal value + * @param[out] vOut Converted vertical value + * @return True if conversion occurred + */ + static bool ConvertAspect(AJAScaleType scaleType,int hIn, int vIn, int &hOut,int &vOut); + + /** + * Static method to provide a suggested scaling type and primary pixel format + * + * @param[in] xWire wire resolution + * @param[in] xBitmap bitmap resolution + * @param[out] primaryFormat unscaled pixel format + * @param[out] scaleType type of scaling that needs to occur + * @return returns true if conversion occurred + */ + static bool QueryScaleType(int xWire,int xBitmap,AJA_PixelFormat &primaryFormat,AJAScaleType &scaleType); + + + /** + * Static method to provide expanded width for width-scaled rasters (e.g. DVCPro, HDV) + * + * @param[in] scaledWidth width of scaled raster prior to full-width video expansion + * @param[in] height height of scaled raster + * @return returns expanded width if input raster size matches known scaled raster type, otherwise returns input (scaledWidth) + */ + static int QueryFullScaleWidth(int scaledWidth, int height); + + + /** + * Static method to provide associated pixel format (e.g. DVCPro, HDV) + * + * @param[in] scaledWidth width of scaled raster prior to full-width video expansion + * @param[in] height height of scaled raster + * @return returns associated pixel format + */ + static AJA_PixelFormat QueryScaledPixelFormat(int scaledWidth, int height); + +protected: + AJA_PixelFormat m_format; +}; + +#endif // _PixelFormat_Defined_ diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/public.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/public.h new file mode 100644 index 0000000..e5b81b5 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/public.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file public.h + @brief Master header for the ajabase library. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_PUBLIC_H + #define AJA_PUBLIC_H + + #include "ajabase/common/export.h" + #include + #include + #include + #include + #include "ajabase/common/types.h" + #if defined(AJA_USE_CPLUSPLUS11) + #include + #endif + +#endif // AJA_PUBLIC_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/rawfile.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/rawfile.h new file mode 100644 index 0000000..d793fed --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/rawfile.h @@ -0,0 +1,64 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file rawfile.h + @brief Defines data structures used to read and write AJA raw files. + @copyright (C) 2011-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_RAWFILE_H +#define AJA_RAWFILE_H + +const uint32_t AJAAudioHeaderTag = AJA_FOURCC('a','j','a','h'); +const uint32_t AJAVideoHeaderTag = AJA_FOURCC('a','j','v','h'); +const uint32_t AJAAudioDataTag = AJA_FOURCC('a','j','a','d'); +const uint32_t AJAVideoDataTag = AJA_FOURCC('a','j','v','d'); + +#pragma pack(push,1) + +struct AJARawAudioHeader +{ + uint32_t tag; // should be AJAAudioHeaderTag + int64_t size; // sizeof(AJARawAudioHeader) + int64_t scale; // video frame scale for timecode, ie. 30000 + int64_t duration; // video frame duration for timecode, ie. 1001 + int64_t timecode; // video frame offset of first sample + + uint32_t rate; // number of samples per second, ie. 48000 + uint32_t channels; // number of channels, ie. 2,4,8, etc. + uint32_t bigEndian; // non-zero if samples are in big endian format + uint32_t sampleSize; // number of bytes per sample, ie. 2,3,4 + uint32_t isFloat; // non-zero if samples are in floating point format + + // crank this out to 1024 bytes for additional future stuff + uint32_t reserved[(1024 - (sizeof(uint32_t) * 6) - (sizeof(int64_t) * 4)) / sizeof(uint32_t)]; +}; + +struct AJARawVideoHeader +{ + uint32_t tag; // should be AJAVideoHeaderTag + int64_t size; // sizeof(AJARawVideoHeader) + int64_t scale; // video frame scale for timecode, ie. 30000 + int64_t duration; // video frame duration for timecode, ie. 1001 + int64_t timecode; // video frame offset of first sample + + uint32_t fourcc; // fourcc of video frames, this format implies fixed bytes per frame + uint32_t xRes; // x resolution of video frames, ie. 1920 + uint32_t yRes; // y resolution of video frames, ie. 1080 + uint32_t bytesPerFrame; // number of bytes per frame of video, all frames are the same + uint32_t aspectX; // x aspect of video frames, ie. 1 + uint32_t aspectY; // y aspect of video frames, ie. 1 + uint32_t interlace; // interlace of frames, 0-progressive, 1-lower, 2-upper + + // crank this out to 1024 bytes for additional future stuff + uint32_t reserved[(1024 - (sizeof(uint32_t) * 8) - (sizeof(int64_t) * 4)) / sizeof(uint32_t)]; +}; + +struct AJARawDataHeader +{ + uint32_t tag; // should be AJAVideoDataTag or AJAAudioDataTag + int64_t size; // if size is zero, go to end of file with this chunk +}; + +#pragma pack(pop) + +#endif // AJA_RAWFILE_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/testpatterngen.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/testpatterngen.h new file mode 100644 index 0000000..32f8c88 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/testpatterngen.h @@ -0,0 +1,95 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file testpatterngen.h + @brief Declares the AJATestPatternGen class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_TESTPATTERN_GEN +#define AJA_TESTPATTERN_GEN +#if !defined(NTV2_DEPRECATE_15_0) +#include "types.h" +#include "videotypes.h" +#include "videoutilities.h" + +#include +typedef std::vector AJATestPatternBuffer; + +enum AJATestPatternSelect +{ + AJA_TestPatt_ColorBars100, + AJA_TestPatt_ColorBars75, + AJA_TestPatt_Ramp, + AJA_TestPatt_MultiBurst, + AJA_TestPatt_LineSweep, + AJA_TestPatt_CheckField, + AJA_TestPatt_FlatField, + AJA_TestPatt_MultiPattern, + AJA_TestPatt_Black, + AJA_TestPatt_White, + AJA_TestPatt_Border, + AJA_TestPatt_LinearRamp, + AJA_TestPatt_SlantRamp, + AJA_TestPatt_ZonePlate, + AJA_TestPatt_ColorQuadrant, + AJA_TestPatt_ColorQuadrantBorder, + AJA_TestPatt_ColorQuadrantTSI, + AJA_TestPatt_All +}; + +//********************************************************************************* + +// CTestPattern + +class AJA_EXPORT AJATestPatternGen +{ + // Construction +public: + AJATestPatternGen(); + + // Implementation +public: + virtual ~AJATestPatternGen(); + + virtual bool DrawTestPattern(AJATestPatternSelect pattNum, uint32_t frameWidth, uint32_t frameHeight, AJA_PixelFormat pixelFormat, AJATestPatternBuffer &testPatternBuffer); + virtual bool DrawTestPattern(AJATestPatternSelect pattNum, uint32_t frameWidth, uint32_t frameHeight, + AJA_PixelFormat pixelFormat, AJA_BayerColorPhase phase, AJATestPatternBuffer &testPatternBuffer); + + void setSignalMask(AJASignalMask signalMask) { _signalMask = signalMask;} + AJASignalMask getSignalMask() { return _signalMask;} + void setSliderValue(double sliderValue) { _sliderValue = sliderValue;} + double getSliderValue() { return _sliderValue;} + +protected: + + virtual bool DrawSegmentedTestPattern(); + virtual bool DrawYCbCrFrame(uint16_t Y, uint16_t Cb, uint16_t Cr); + virtual bool DrawBorderFrame(); + virtual bool DrawLinearRampFrame(); + virtual bool DrawSlantRampFrame(); + virtual bool DrawZonePlateFrame(); + virtual bool DrawQuandrantBorderFrame(); + virtual bool DrawColorQuandrantFrame(); + virtual bool DrawColorQuandrantTSIFrame(); + +protected: + AJATestPatternSelect _patternNumber; + uint32_t _frameWidth; + uint32_t _frameHeight; + uint32_t _linePitch; + uint32_t _dataLinePitch; + uint32_t _bufferSize; + uint8_t* _pTestPatternBuffer; + uint32_t* _pPackedLineBuffer; + uint16_t* _pUnPackedLineBuffer; + + double _sliderValue; + AJASignalMask _signalMask; + AJA_PixelFormat _pixelFormat; + AJA_BayerColorPhase _bayerPhase; + +}; // AJATestPatternGen + +#endif // !defined(NTV2_DEPRECATE_15_0) + +#endif // AJA_TESTPATTERN_GEN diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/timebase.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/timebase.h new file mode 100644 index 0000000..a33fcec --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/timebase.h @@ -0,0 +1,393 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file timebase.h + @brief Declares the AJATimeBase class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef TIMEBASE_H +#define TIMEBASE_H + +#include "ajabase/common/public.h" +#include "ajabase/common/videotypes.h" + +/** + * Class provides high resolution time base conversion + * @ingroup AJAGroupSystem + */ +class AJA_EXPORT AJATimeBase +{ +public: + + AJATimeBase(); + + /** + * Construct the time base class. + * + * @param[in] ajaFrameRate Frame rate define found in videotypes.h + */ + AJATimeBase(AJA_FrameRate ajaFrameRate); + + /** + * Construct the time base class. + * + * @param[in] frameTimeScale Time units per second (units/second) + * @param[in] frameDuration Time units per frame (units/frame) + */ + AJATimeBase(int64_t frameTimeScale, int64_t frameDuration); + + /** + * Construct the time base class. + * + * @param[in] frameTimeScale Time units per second (units/second) + * @param[in] frameDuration Time units per frame (units/frame) + * @param[in] audioRate Audio sample rate (samples/second) + */ + AJATimeBase(int64_t frameTimeScale, int64_t frameDuration, int64_t audioRate); + + /** + * Copy constructor + * + * @param[in] other AJATimeBase to copy + */ + AJATimeBase(const AJATimeBase &other); + + virtual ~AJATimeBase(); + + /** + * Set to default value. + */ + void SetToDefault(void); + + /** + * Set the video frame rate to use in conversions. + * + * The frame rate is specified as frameTimeScale/frameDuration = frames/second. + * + * @param[in] frameTimeScale Time units per second (units/second) + * @param[in] frameDuration Time units per frame (units/frame) + */ + void SetFrameRate(int64_t frameTimeScale, int64_t frameDuration); + + /** + * Set the video frame rate to use in conversions. + * + * The frame rate is specified Frame rate define found in videotypes.h + * + * @param[in] ajaFrameRate AJA_FrameRate + */ + void SetAJAFrameRate(AJA_FrameRate ajaFrameRate); + + /** + * Get the video frame rate used in conversions. + * + * The frame rate is specified as frameTimeScale/frameDuration = frames/seconds. + * + * @param[out] frameTimeScale Time units per second (units/second) + * @param[out] frameDuration Time units per frame (units/frame) + */ + void GetFrameRate(int64_t& frameTimeScale, int64_t& frameDuration) const; + void GetFrameRate(uint32_t& frameTimeScale, uint32_t& frameDuration) const; + + /** + * Get the video frame time scale used in conversions. + * + * @return frameTimeScale Time units per second (units/second) + */ + int64_t GetFrameTimeScale(void) const; + + /** + * Set the video frame duration used in conversions. + * + * @param[in] timeScale Time units per second (units/second) + */ + void SetFrameTimeScale(int64_t timeScale); + + /** + * Get the video frame duration used in conversions. + * + * @return frameDuration Time units per frame (units/frame) + */ + int64_t GetFrameDuration(void) const; + + /** + * Set the audio sample rate to use in conversions. + * + * @param[in] rate Audio rate in samples/second. + */ + void SetAudioRate(int64_t rate); + + /** + * Get the audio sample rate used in conversions. + * + * @return Audio rate in samples/second. + */ + int64_t GetAudioRate() const; + + /** + * Get the AJA_FrameRate which is close to the current value, return unknown if not close. + * + * @return AJA_FrameRate value, may be unknown + */ + AJA_FrameRate GetAJAFrameRate(void) const; + + /** + * Set the system tick rate to use in conversions. + * + * @param[in] rate System tick rate in ticks/second. + * 0 == system native rate. + */ + void SetTickRate(int64_t rate); + + /** + * Get the system tick rate used in conversions. + * + * @return Tick rate in ticks/second. + */ + int64_t GetTickRate() const; + + /** + * Convert video frames to audio samples. + * + * @param[in] frames Video frame count to convert. + * @param[in] round Round the result. + * @return Audio sample count. + */ + int64_t FramesToSamples(int64_t frames, bool round = false) const; + + /** + * Convert video frames to system ticks. + * + * @param[in] frames Video frame count to convert. + * @param[in] round Round the result. + * @return System tick count. + */ + int64_t FramesToTicks(int64_t frames, bool round = false) const; + + /** + * Convert video frames to time in seconds. + * + * @param[in] frames Video frame count to convert. + * @return Time in seconds. + */ + double FramesToSeconds(int64_t frames) const; + + /** + * Convert time scale units to time in seconds. + * + * @param[in] num Time scale units to convert. + * @return Time in seconds. + */ + double ScaleUnitsToSeconds(int64_t num) const; + + /** + * Convert video frames to time in microseconds. + * + * @param[in] frames Video frame count to convert. + * @param[in] round Round the result. + * @return Time in microseconds. + */ + int64_t FramesToMicroseconds(int64_t frames, bool round = false) const; + + /** + * Convert audio samples to video frames. + * + * @param[in] samples Audio sample count to convert. + * @param[in] round Round the result. + * @return Video frame count. + */ + int64_t SamplesToFrames(int64_t samples, bool round = false) const; + + /** + * Convert audio samples to system ticks. + * + * @param[in] samples Audio sample count to convert. + * @param[in] round Round the result. + * @return System tick count. + */ + int64_t SamplesToTicks(int64_t samples, bool round = false) const; + + /** + * Convert audio samples to time in seconds. + * + * @param[in] samples Sample count to convert. + * @return Time in seconds. + */ + double SamplesToSeconds(int64_t samples); + + /** + * Convert audio samples to time in microseconds. + * + * @param[in] samples Sample count to convert. + * @param[in] round Round the result. + * @return Time in microseconds. + */ + int64_t SamplesToMicroseconds(int64_t samples, bool round = false); + + /** + * Convert system ticks to video frames. + * + * @param[in] ticks System tick count to convert. + * @param[in] round Round the result. + * @return Video frame count. + */ + int64_t TicksToFrames(int64_t ticks, bool round = false); + + /** + * Convert system ticks to audio samples. + * + * @param[in] ticks System tick count to convert. + * @param[in] round Round the result. + * @return Audio sample count. + */ + int64_t TicksToSamples(int64_t ticks, bool round = false); + + /** + * Convert system ticks to time in seconds. + * + * @param[in] ticks System tick count to convert. + * @return Time in seconds. + */ + double TicksToSeconds(int64_t ticks); + + /** + * Convert system ticks to time in microseconds. + * + * @param[in] ticks System tick count to convert. + * @param[in] round Round the result. + * @return Time in microseconds. + */ + int64_t TicksToMicroseconds(int64_t ticks, bool round = false); + + /** + * Convert time in seconds to video frames. + * + * @param[in] seconds Time in seconds. + * @param[in] round Round the result. + * @return Video frame count. + */ + int64_t SecondsToFrames(double seconds, bool round = false); + + /** + * Convert time in seconds to audio samples. + * + * @param[in] seconds Time in seconds. + * @param[in] round Round the result. + * @return Audio sample count. + */ + int64_t SecondsToSamples(double seconds, bool round = false); + + /** + * Convert time in seconds to system ticks. + * + * @param[in] seconds Time in seconds. + * @param[in] round Round the result. + * @return System tick count. + */ + int64_t SecondsToTicks(double seconds, bool round = false); + + /** + * Convert microseconds to video frames. + * + * @param[in] microseconds System tick count to convert. + * @param[in] round Round the result. + * @return Video frame count. + */ + int64_t MicrosecondsToFrames(int64_t microseconds, bool round = false); + + /** + * Convert microseconds to audio samples. + * + * @param[in] microseconds System tick count to convert. + * @param[in] round Round the result. + * @return Audio sample count. + */ + int64_t MicrosecondsToSamples(int64_t microseconds, bool round = false); + + /** + * Convert microseconds to system ticks. + * + * @param[in] microseconds System tick count to convert. + * @param[in] round Round the result. + * @return Time in microseconds. + */ + int64_t MicrosecondsToTicks(int64_t microseconds, bool round = false); + + /** + * Get the current value of the system tick count. + * + * @return System tick count. + */ + int64_t GetSystemTicks(); + + /** + * Returns if timebases are reasonably close + * + * @param[in] timeBase Time base to compare. + * @return True if the same or close (returns false if either duration is zero). + */ + bool IsCloseTo(const AJATimeBase &timeBase) const; + + /** + * Returns if timebases are reasonably close + * + * @param[in] frameTimeScale Time scale to compare. + * @param[in] frameDuration Time duration to compare. + * @return True if the same or close (returns false if either duration is zero). + */ + bool IsCloseTo(int64_t frameTimeScale, int64_t frameDuration) const; + + /** + * Test if the timescale is not a simple multiple of the duration + * + * The intent is that even ratios are "non-drop", otherwise the timebase is "drop frame" + * In this sense, this method can be thought of as equivalent to IsDropFrame() + * + * @return True if the timescale/duration ratio has a non-zero fraction, i.e. "drop frame". + */ + bool IsNonIntegralRatio(void) const; + + /** + * Returns frames per second + * + * @return frames per second + */ + float GetFramesPerSecond(void) const; + double GetFramesPerSecondDouble(void) const; + + AJATimeBase& operator=(const AJATimeBase &t); + bool operator==(const AJATimeBase &val) const; + bool operator!=(const AJATimeBase &val) const; + + /** + * Convert time in seconds to microseconds. + * + * @param[in] seconds Time in seconds. + * @param[in] round Round the result. + * @return Time in microseconds. + */ + static int64_t SecondsToMicroseconds(double seconds, bool round = false); + + /** + * Convert microseconds to time in seconds. + * + * @param[in] microseconds System tick count to convert. + * @return Time in seconds. + */ + static double MicrosecondsToSeconds(int64_t microseconds); + + static int64_t Convert(int64_t inValue, int64_t inRate, int64_t outRate, bool round, bool large); + static int64_t Convert(int64_t inValue, int64_t inScale, int64_t inDuration, + int64_t outScale, int64_t outDuration, bool round, bool large); + +private: + void SetAJAFrameRatePrivate(AJA_FrameRate ajaFrameRate); + + int64_t mFrameTimeScale; + int64_t mFrameDuration; + int64_t mAudioRate; + int64_t mTickRate; +}; + +#endif + diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/timecode.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/timecode.h new file mode 100644 index 0000000..af94c42 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/timecode.h @@ -0,0 +1,219 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file timecode.h + @brief Declares the AJATimeCode class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_TIMECODE_H +#define AJA_TIMECODE_H +#include "ajabase/common/timebase.h" + +/** \class AJATimeCode timecode.h + * \brief Utility class for timecodes. + * + * This is a storage and conversion class for timecodes. + */ +class AJA_EXPORT AJATimeCode +{ +public: + AJATimeCode(); + AJATimeCode(uint32_t frame); + AJATimeCode(const std::string &str, const AJATimeBase& timeBase, bool bDropFrame, bool bStdTc=false); + AJATimeCode(const std::string &str, const AJATimeBase& timeBase); + AJATimeCode(const AJATimeCode& other); + + virtual ~AJATimeCode(); + + /** + * Query string showing timecode for current frame count given the passed parameters. + * + * @param[out] str string in which to place timecode. + * @param[in] timeBase frame rate from which to calculate string. + * @param[in] bDropFrame drop frame value for string. + */ + void QueryString(std::string &str, const AJATimeBase& timeBase, bool bDropFrame); + void QueryString(char *pString, const AJATimeBase& timeBase, bool bDropFrame); ///< @deprecated Use QueryString(std::string) instead. + + /** + * Query SMPTE string showing timecode for current frame count given the passed parameters. + * + * @param[out] pString buffer in which to place string. + * @param[in] timeBase frame rate from which to calculate string. + * @param[in] bDropFrame drop frame value for string. + */ + void QuerySMPTEString(char *pString, const AJATimeBase& timeBase, bool bDropFrame); + + /** + * Query SMPTE string byte count. + * + * @return number of bytes in SMPTE timecode string. + */ + static int QuerySMPTEStringSize(void); + + /** + * Query frame number. + * + * @return frame number. + */ + uint32_t QueryFrame(void) const; + + + /** + * Query HFR divide-by-two flag. + * + * @return bStdTc Return true when using standard TC notation for HFR (e.g 01:00:00:59 -> 01:00:00:29*), set to true by default + */ + bool QueryStdTimecodeForHfr() { return m_stdTimecodeForHfr; } + + /** + * Query hmsf values showing timecode for current frame count given the passed parameters. + * + * @param[out] h place in which to put hours value. + * @param[out] m place in which to put minutes value. + * @param[out] s place in which to put seconds value. + * @param[out] f place in which to put frames value. + * @param[in] timeBase frame rate from which to calculate string. + * @param[in] bDropFrame drop frame value for string. + */ + void QueryHmsf(uint32_t &h, uint32_t &m, uint32_t &s, uint32_t &f, const AJATimeBase& timeBase, bool bDropFrame) const; + + /** + * Set current frame number. + * + * @param[in] frame new frame number. + */ + void Set(uint32_t frame); + + /** + * Set current frame number. + * + * @param[in] str xx:xx:xx:xx style string representing new frame number. + * @param[in] timeBase frame rate associated with pString. + */ + void Set(const std::string &str, const AJATimeBase& timeBase); + + /** + * Set current frame number. A variant which may have junk in the string. + * + * @param[in] str xx:xx:xx:xx style string representing new frame number. + * @param[in] timeBase frame rate associated with pString. + * @param[in] bDrop true if drop frame + */ + void SetWithCleanup(const std::string &str, const AJATimeBase& timeBase, bool bDrop); + + /** + * Set current frame number. + * + * @param[in] str xx:xx:xx:xx style string representing new frame number. + * @param[in] timeBase frame rate associated with pString. + * @param[in] bDropFrame true if forcing dropframe, false otherwise. + */ + void Set(const std::string &str, const AJATimeBase& timeBase, bool bDropFrame); + + /** + * Set current frame number. + * + * @param[in] h hours value. + * @param[in] m minutes value. + * @param[in] s seconds value. + * @param[in] f frames value. + * @param[in] timeBase frame rate associated with hmsf. + * @param[in] bDropFrame true if forcing dropframe, false otherwise. + */ + void SetHmsf(uint32_t h, uint32_t m, uint32_t s, uint32_t f, const AJATimeBase& timeBase, bool bDropFrame); + + /** + * Set timecode via a SMPTE string. + * + * @param[in] pBufr pointer to string. + * @param[in] timeBase time base associated with string. + */ + void SetSMPTEString(const char *pBufr, const AJATimeBase& timeBase); + + /** + * Set timecode via RP188 bytes. + * + * @param[in] inDBB Specifies the DBB bits of the RP188 struct. + * @param[in] inLo Specifies the lo-order 32-bit word of the RP188 struct. + * @param[in] inHi Specifies the hi-order 32-bit word of the RP188 struct. + * @param[in] inTimeBase Specifies the time base to use. + */ + void SetRP188 (const uint32_t inDBB, const uint32_t inLo, const uint32_t inHi, const AJATimeBase & inTimeBase); + + /** + * Get RP188 register values using the given timebase, and drop frame. + * + * @param[in] pDbb If non-NULL, points to the variable to receive the DBB component. + * @param[in] pLow If non-NULL, points to the variable to receive the low byte component. + * @param[in] pHigh If non-NULL, points to the variable to receive the high byte component. + * @param[in] timeBase Specifies the AJATimeBase to use. + * @param[in] bDrop Specify true if forcing drop-frame; otherwise false. + * @bug Unimplemented. + * @todo Needs to be implemented. + */ + void QueryRP188(uint32_t *pDbb, uint32_t *pLow, uint32_t *pHigh, const AJATimeBase& timeBase, bool bDrop); + + /** + * Get RP188 register values using the given timebase, and drop frame. + * + * @param[out] outDBB Receives the DBB component. + * @param[out] outLo Receives the low byte component. + * @param[out] outHi Receives the high byte component. + * @param[in] timeBase Specifies the AJATimeBase to use. + * @param[in] bDrop Specify true if forcing drop-frame; otherwise false. + * @bug Unimplemented. + * @todo Needs to be implemented. + */ + void QueryRP188(uint32_t & outDBB, uint32_t & outLo, uint32_t & outHi, const AJATimeBase & timeBase, const bool bDrop); + + /** + * Set HFR divide-by-two flag. + * + * @param[in] bStdTc Set true when using standard TC notation for HFR (e.g 01:00:00:59 -> 01:00:00:29*), set to true by default + */ + void SetStdTimecodeForHfr(bool bStdTc) {m_stdTimecodeForHfr = bStdTc;} + + + /** + * Query string showing timecode for current frame count given the passed parameters. + * + * @param[in] str string with timecode + */ + static bool QueryIsDropFrame(const std::string &str); + + + static int QueryStringSize(void); ///< @deprecated Not needed when using std::string. + + /** + * Query if rp188 data is drop frame or not + * + * @param[in] inDBB Specifies the DBB bits of the RP188 struct. + * @param[in] inLo Specifies the lo-order 32-bit word of the RP188 struct. + * @param[in] inHi Specifies the hi-order 32-bit word of the RP188 struct. + */ + static bool QueryIsRP188DropFrame (const uint32_t inDBB, const uint32_t inLo, const uint32_t inHi); + + AJATimeCode& operator=(const AJATimeCode &val); + AJATimeCode& operator+=(const AJATimeCode &val); + AJATimeCode& operator-=(const AJATimeCode &val); + AJATimeCode& operator+=(const int32_t val); + AJATimeCode& operator-=(const int32_t val); + const AJATimeCode operator+(const AJATimeCode &val) const; + const AJATimeCode operator+(const int32_t val) const; + const AJATimeCode operator-(const AJATimeCode &val) const; + const AJATimeCode operator-(const int32_t val) const; + bool operator==(const AJATimeCode &val) const; + bool operator<(const AJATimeCode &val) const; + bool operator<(const int32_t val) const; + bool operator>(const AJATimeCode &val) const; + bool operator>(const int32_t val) const; + bool operator!=(const AJATimeCode &val) const; + + uint32_t m_frame; + bool m_stdTimecodeForHfr; +protected: +private: +}; + +#endif // AJA_TIMECODE_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/timecodeburn.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/timecodeburn.h new file mode 100644 index 0000000..22e8e89 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/timecodeburn.h @@ -0,0 +1,69 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file timecodeburn.h + @brief Declares the AJATimeCodeBurn class. + @copyright (C) 2012-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_TIMECODEBURN_H +#define AJA_TIMECODEBURN_H + +#include "public.h" +//#include "ajabase/common/types.h" +#include "ajabase/common/videotypes.h" + +/** + * Class to support burning a simple timecode over raster. + * @ingroup AJATimeCodeBurn + */ +class AJATimeCodeBurn +{ +public: + AJA_EXPORT AJATimeCodeBurn(void); + AJA_EXPORT virtual ~AJATimeCodeBurn(void); + /** + * Render a small set of characters for timecode ahead of time...This needs to be called before + * BurnTimeCode or BurnTimeCode will fail. + * + * @param[in] pixelFormat Specifies the pixel format of the rendering buffer. + * @param[in] numPixels Specifies the raster bitmap width. + * @param[in] numLines Specifies the raster bitmap height. + */ + AJA_EXPORT bool RenderTimeCodeFont (AJA_PixelFormat pixelFormat, uint32_t numPixels, uint32_t numLines); + + /** + * Burns a timecode in with simple font 00:00:00;00. + * + * + * @param[in] pBaseVideoAddress Base address of Raster + * @param[in] inTimeCodeStr A string containing something like "00:00:00:00" + * @param[in] inYPercent Percent down the screen. If 0, will make it 80. + * @returns True if successful; otherwise false. + */ + AJA_EXPORT bool BurnTimeCode (void * pBaseVideoAddress, const std::string & inTimeCodeStr, const uint32_t inYPercent); + + /** + * DEPRECATED: Use std::string version of this function. + */ + AJA_EXPORT bool BurnTimeCode (char * pBaseVideoAddress, const char * pTimeCodeString, const uint32_t percentY); + +protected: + + void CopyDigit (int digitOffset,char *pFrameBuff); + void writeV210Pixel (char **pBytePtr, int x, int c, int y); + void writeYCbCr10PackedPlanerPixel (char **pBytePtr, int x, int y); + +private: + bool _bRendered; // set 'true' when Burn-In character map has been rendered + char * _pCharRenderMap; // ptr to rendered Burn-In character set + AJA_PixelFormat _charRenderPixelFormat; // frame buffer format of rendered characters + int _charRenderHeight; // frame height for which rendered characters were rendered + int _charRenderWidth; // frame width for which rendered characters were rendered + int _charWidthBytes; // rendered character width in bytes + int _charHeightLines; // rendered character height in frame lines + int _charPositionX; // offset (in bytes) from left side of screen to first burn-in character + int _charPositionY; // offset (in lines) from top of screen to top of burn-in characters + int _rowBytes; + +}; +#endif diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/timer.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/timer.h new file mode 100644 index 0000000..fe6a4d4 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/timer.h @@ -0,0 +1,97 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file timer.h + @brief Declares the AJATimer class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_TIMER_H +#define AJA_TIMER_H + +#include "ajabase/common/public.h" + +enum AJATimerPrecision +{ + AJATimerPrecisionMilliseconds, + AJATimerPrecisionMicroseconds, + AJATimerPrecisionNanoseconds +}; + +/** + * Class to support timing of events + * @ingroup AJAGroupSystem + */ +class AJA_EXPORT AJATimer +{ +public: + + AJATimer(AJATimerPrecision precision = AJATimerPrecisionMilliseconds); + virtual ~AJATimer(); + + /** + * Start the timer. + */ + void Start(); + + /** + * Stop the timer. + */ + void Stop(); + + /** + * Reset the timer. + */ + void Reset(); + + /** + * Get the elapsed time. + * + * If the timer is running, return the elapsed time since Start() was called. If Stop() + * has been called, return the time between Start() and Stop(). + * + * @return The elapsed time in selected timer precision units + */ + uint32_t ElapsedTime(); + + /** + * Check for timeout. + * + * Timeout checks the ElapsedTime() and returns true if it is greater than interval. + * + * @param interval Timeout interval in selected timer precision units. + * @return true if elapsed time greater than interval. + */ + bool Timeout(uint32_t interval); + + /** + * Is the timer running. + * + * @return true if timer is running. + */ + bool IsRunning(void); + + /** + * Return the timer precision enum. + * + * @return precision enum that was used in the constructor. + */ + AJATimerPrecision Precision(void); + + /** + * Return the display string for the given timer precision enum. + * + * @param precision The precision enum to get the display string for. + * @param longName If true the string is set to a long description, otherwise an abbreviation. + * @return string description + */ + static std::string PrecisionName(AJATimerPrecision precision, bool longName = true); + +private: + + uint64_t mStartTime; + uint64_t mStopTime; + bool mRun; + AJATimerPrecision mPrecision; +}; + +#endif // AJA_TIMER_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/types.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/types.h new file mode 100644 index 0000000..e07af4c --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/types.h @@ -0,0 +1,375 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file types.h + @brief Declares common types used in the ajabase library. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_TYPES_H +#define AJA_TYPES_H + +#define AJA_USE_CPLUSPLUS11 // If defined, use C++11 features (requires C++11 compiler) + +#if defined(AJA_WINDOWS) + + #if !defined(NULL) + #define NULL (0) + #endif + + #define AJA_PAGE_SIZE (4096) + + #define AJA_MAX_PATH (256) + + typedef signed __int8 int8_t; + typedef signed __int16 int16_t; + typedef signed __int32 int32_t; + typedef signed __int64 int64_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int64 uint64_t; + + #if defined(_WIN64) + typedef signed __int64 intptr_t; + typedef unsigned __int64 uintptr_t; + #define AJA_OS_64 + #else + typedef signed __int32 intptr_t; + typedef unsigned __int32 uintptr_t; + #define AJA_OS_32 + #endif + #define AJA_LITTLE_ENDIAN + + // This adds the ability to format 64-bit entities + #if defined(_MSC_VER) && _MSC_VER >= 1900 // VS2015 or later: + #include // Prevent duplicate macro definition warnings + #endif + # define __PRI64_PREFIX "ll" + + // Macros for printing format specifiers. + #ifndef PRId64 + #define PRId64 __PRI64_PREFIX "d" + #endif + #ifndef PRIi64 + #define PRIi64 __PRI64_PREFIX "i" + #endif + #ifndef PRIu64 + #define PRIu64 __PRI64_PREFIX "u" + #endif + #ifndef PRIo64 + #define PRIo64 __PRI64_PREFIX "o" + #endif + #ifndef PRIx64 + #define PRIx64 __PRI64_PREFIX "x" + #endif + + // Synonyms for library functions with different names on different platforms + #define ajasnprintf(_str_, _maxbytes_, _format_, ...) _snprintf( _str_, _maxbytes_, _format_, __VA_ARGS__ ) + #define ajavsnprintf(_str_, _maxbytes_, _format_, ...) vsprintf_s( _str_, _maxbytes_, _format_, __VA_ARGS__ ) + #define ajastrcasecmp(_str1_, _str2_) _stricmp( _str1_, _str2_ ) + #define ajawcscasecmp(_str1_, _str2_) _wcsicmp( _str1_, _str2_ ) + +#endif // defined(AJA_WINDOWS) + +#if defined(AJA_LINUX) + + #if !defined(NULL) + #define NULL (0) + #endif + + #if defined(AJA_USE_CPLUSPLUS11) + #undef AJA_USE_CPLUSPLUS11 // Linux c++11-in-SDK TBD + #endif + + #define AJA_PAGE_SIZE (4096) + + #define AJA_MAX_PATH (4096) + + #if defined(MODULE) + // We're building the code as a kernel module + #include + #include // memset, etc. + #include + #if defined(x86_64) + typedef long int intptr_t; + // Not sure which version number should be used here + #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18)) + typedef unsigned long int uintptr_t; + #endif + #elif !defined(powerpc) + typedef int intptr_t; + typedef unsigned int uintptr_t; + #endif + #else + #include + #include // Pull in userland defines + + #ifdef __x86_64__ + #define AJA_OS_64 + #else + #define AJA_OS_32 + #endif + + #if __BYTE_ORDER == __LITTLE_ENDIAN + #define AJA_LITTLE_ENDIAN + #else + #define AJA_BIG_ENDIAN + #endif + + // This adds the ability to format 64-bit entities + #if CPU_ARCH == x86_64 + # define __PRI64_PREFIX "l" + # define __PRIPTR_PREFIX "l" + #else + # define __PRI64_PREFIX "ll" + # define __PRIPTR_PREFIX + #endif + + // Macros for printing format specifiers. + #ifndef PRId64 + #define PRId64 __PRI64_PREFIX "d" + #endif + #ifndef PRIi64 + #define PRIi64 __PRI64_PREFIX "i" + #endif + #ifndef PRIu64 + #define PRIu64 __PRI64_PREFIX "u" + #endif + #ifndef PRIo64 + #define PRIo64 __PRI64_PREFIX "o" + #endif + #ifndef PRIx64 + #define PRIx64 __PRI64_PREFIX "x" + #endif + #endif // MODULE + + // Synonyms for library functions with different names on different platforms + #define ajasnprintf(_str_, _maxbytes_, _format_, ...) snprintf( _str_, _maxbytes_, _format_, __VA_ARGS__ ) + #define ajavsnprintf(_str_, _maxbytes_, _format_, ...) vsnprintf( _str_, _maxbytes_, _format_, __VA_ARGS__ ) + #define ajastrcasecmp(_str1_, _str2_) strcasecmp( _str1_, _str2_ ) + #define ajawcscasecmp(_str1_, _str2_) wcscasecmp( _str1_, _str2_ ) + +#endif // defined(AJA_LINUX) + +// NOTE: +// In order to get universal binaries compiling need to add the following defines +// to the project that uses this file. +// PER_ARCH_CFLAGS_i386 = -Dx86=1 +// PER_ARCH_CFLAGS_x86_64 = -Dx86_64=1 +// see: http://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/64bitPorting/building/building.html +#if defined(AJA_MAC) + + #define AJA_PAGE_SIZE (4096) + #define AJA_MAX_PATH (1024) + #define AJA_LITTLE_ENDIAN + + #include + #ifdef __LP64__ + #define AJA_OS_64 + #else + #define AJA_OS_32 + #endif + + // This adds the ability to format 64-bit entities + #ifdef x86_64 + # define __PRI64_PREFIX "l" + # define __PRIPTR_PREFIX "l" + #else + # define __PRI64_PREFIX "ll" + # define __PRIPTR_PREFIX + #endif + + // Macros for printing format specifiers. + #ifndef PRId64 + #define PRId64 __PRI64_PREFIX "d" + #endif + #ifndef PRIi64 + #define PRIi64 __PRI64_PREFIX "i" + #endif + #ifndef PRIu64 + #define PRIu64 __PRI64_PREFIX "u" + #endif + #ifndef PRIo64 + #define PRIo64 __PRI64_PREFIX "o" + #endif + #ifndef PRIx64 + #define PRIx64 __PRI64_PREFIX "x" + #endif + + // Synonyms for library functions with different names on different platforms + #define ajasnprintf(_str_, _maxbytes_, _format_, ...) snprintf( _str_, _maxbytes_, _format_, __VA_ARGS__ ) + #define ajavsnprintf(_str_, _maxbytes_, _format_, ...) vsnprintf( _str_, _maxbytes_, _format_, __VA_ARGS__ ) + #define ajastrcasecmp(_str1_, _str2_) strcasecmp( _str1_, _str2_ ) + #define ajawcscasecmp(_str1_, _str2_) wcscasecmp( _str1_, _str2_ ) + + #ifndef EXCLUDE_WCHAR + #include + + inline wchar_t wcstoupper(wchar_t c) + { + // probably needs to be more robust + wchar_t newChar = c; + + if (c >= (wchar_t)L'a' && c <= (wchar_t)L'z') + newChar = c - (L'a' - L'A'); + + return newChar; + } + + inline int wcscasecmp(const wchar_t *string1,const wchar_t *string2) + { + int retVal = 0; + + int str1Len = (int)wcslen(string1); + int str2Len = (int)wcslen(string2); + + if(str1Len > str2Len) + retVal = 1; + else if(str1Len < str2Len) + retVal = -1; + else //same length + { + bool match = true; + for(int i=0;i= 0) +#define AJA_FAILURE(_status_) (_status_ < 0) + +/** + @defgroup AJAGroupStatus AJA_STATUS + Defines return code status. Successful return codes are greater than 0. +**/ +///@{ +typedef enum +{ + AJA_STATUS_TRUE = 1, /**< Result was true */ + AJA_STATUS_SUCCESS = 0, /**< Function succeeded */ + AJA_STATUS_FAIL =-1, /**< Function failed */ + AJA_STATUS_UNKNOWN =-2, /**< Unknown status */ + AJA_STATUS_TIMEOUT =-3, /**< A wait timed out */ + AJA_STATUS_RANGE =-4, /**< A parameter was out of range */ + AJA_STATUS_INITIALIZE =-5, /**< The object has not been initialized */ + AJA_STATUS_NULL =-6, /**< A pointer parameter was NULL */ + AJA_STATUS_OPEN =-7, /**< Something failed to open */ + AJA_STATUS_IO =-8, /**< An IO operation failed */ + AJA_STATUS_DISABLED =-9, /**< Device is disabled */ + AJA_STATUS_BUSY =-10, /**< Device is busy */ + AJA_STATUS_BAD_PARAM =-11, /**< Bad parameter value */ + AJA_STATUS_FEATURE =-12, /**< A required device feature does not exist */ + AJA_STATUS_UNSUPPORTED =-13, /**< Parameters are valid but not supported */ + AJA_STATUS_READONLY =-14, /**< Write is not supported */ + AJA_STATUS_WRITEONLY =-15, /**< Read is not supported */ + AJA_STATUS_MEMORY =-16, /**< Memory allocation failed */ + AJA_STATUS_ALIGN =-17, /**< Parameter not properly aligned */ + AJA_STATUS_FLUSH =-18, /**< Something has been flushed */ + AJA_STATUS_NOINPUT =-19, /**< No input detected */ + AJA_STATUS_SURPRISE_REMOVAL =-20, /**< Hardware communication failed */ + AJA_STATUS_NOT_FOUND =-21, /**< Something wasn't found */ + +// Sequence errors + + AJA_STATUS_NOBUFFER =-100, /**< No free buffers, all are scheduled or in use */ + AJA_STATUS_INVALID_TIME =-101, /**< Invalid schedule time */ + AJA_STATUS_NOSTREAM =-102, /**< No stream found */ + AJA_STATUS_TIMEEXPIRED =-103, /**< Scheduled time is too late */ + AJA_STATUS_BADBUFFERCOUNT =-104, /**< Buffer count out of bounds */ + AJA_STATUS_BADBUFFERSIZE =-105, /**< Buffer size out of bounds */ + AJA_STATUS_STREAMCONFLICT =-106, /**< Another stream is using resources */ + AJA_STATUS_NOTINITIALIZED =-107, /**< Streams not initialized */ + AJA_STATUS_STREAMRUNNING =-108, /**< Streams is running, should be stopped */ + +// Other + AJA_STATUS_REBOOT = -109, /**< Device requires reboot */ + AJA_STATUS_POWER_CYCLE = -110 /**< Device requires a machine power-cycle */ + +} AJAStatus; +///@} + +// Use to silence "unused parameter" warnings +#define AJA_UNUSED(_x_) (void)_x_; + +#define AJA_CHECK_NULL(_ptr_, _res_) { if (__ptr__ == NULL) { return _res_; } } +#define AJA_RETURN_STATUS(_status_) { const AJAStatus s = _status_; if (s != AJA_STATUS_SUCCESS) { return s; } } + +#ifndef NUMELMS + #define NUMELMS(aa) (sizeof(aa)/sizeof((aa)[0])) +#endif + +#define AJA_ENDIAN_SWAP16(_data_) ( ((uint16_t(_data_) << 8) & uint16_t(0xff00)) | \ + ((uint16_t(_data_) >> 8) & uint16_t(0x00ff)) ) +#define AJA_ENDIAN_SWAP32(_data_) ( ((uint32_t(_data_) << 24) & uint32_t(0xff000000)) | \ + ((uint32_t(_data_) << 8) & uint32_t(0x00ff0000)) | \ + ((uint32_t(_data_) >> 8) & uint32_t(0x0000ff00)) | \ + ((uint32_t(_data_) >> 24) & uint32_t(0x000000ff)) ) +#define AJA_ENDIAN_SWAP64(_data_) ( ((uint64_t(_data_) << 56) & uint64_t(0xff00000000000000)) | \ + ((uint64_t(_data_) << 40) & uint64_t(0x00ff000000000000)) | \ + ((uint64_t(_data_) << 24) & uint64_t(0x0000ff0000000000)) | \ + ((uint64_t(_data_) << 8) & uint64_t(0x000000ff00000000)) | \ + ((uint64_t(_data_) >> 8) & uint64_t(0x00000000ff000000)) | \ + ((uint64_t(_data_) >> 24) & uint64_t(0x0000000000ff0000)) | \ + ((uint64_t(_data_) >> 40) & uint64_t(0x000000000000ff00)) | \ + ((uint64_t(_data_) >> 56) & uint64_t(0x00000000000000ff)) ) + +#endif // AJA_TYPES_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/videotypes.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/videotypes.h new file mode 100644 index 0000000..5d441ed --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/videotypes.h @@ -0,0 +1,286 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file videotypes.h + @brief Declares the enumeration constants used in the ajabase library. + @copyright (C) 2010-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_VIDEODEFINES +#define AJA_VIDEODEFINES + +enum AJA_VideoFormat +{ + AJA_VideoFormat_Unknown, // 0 + AJA_VideoFormat_525i_2997, // 1 525 + AJA_VideoFormat_525p_5994, + AJA_VideoFormat_525i_2398, + AJA_VideoFormat_525_2400, + AJA_VideoFormat_525psf_2997, + AJA_VideoFormat_625psf_2500, // 6 625 + AJA_VideoFormat_625i_2500, + AJA_VideoFormat_720p_2398, // 8 HD - 720 + AJA_VideoFormat_720p_2400, + AJA_VideoFormat_720p_2500, + AJA_VideoFormat_720p_2997, + AJA_VideoFormat_720p_3000, + AJA_VideoFormat_720p_5000, + AJA_VideoFormat_720p_5994, + AJA_VideoFormat_720p_6000, + AJA_VideoFormat_1080i_2500, // 16 HD 1080i + AJA_VideoFormat_1080i_2997, + AJA_VideoFormat_1080i_3000, + AJA_VideoFormat_1080psf_2398, // 19 HD 1080psf + AJA_VideoFormat_1080psf_2400, + AJA_VideoFormat_1080psf_2500, + AJA_VideoFormat_1080psf_2997, + AJA_VideoFormat_1080psf_3000, + AJA_VideoFormat_1080p_2398, // 24 HD 1080p + AJA_VideoFormat_1080p_2400, + AJA_VideoFormat_1080p_2500, + AJA_VideoFormat_1080p_2997, + AJA_VideoFormat_1080p_3000, + AJA_VideoFormat_1080p_5000, + AJA_VideoFormat_1080p_5994, + AJA_VideoFormat_1080p_6000, + AJA_VideoFormat_2K_1080psf_2398, // 32 2Kx1080psf + AJA_VideoFormat_2K_1080psf_2400, + AJA_VideoFormat_2K_1080psf_2500, + AJA_VideoFormat_2K_1080psf_2997, + AJA_VideoFormat_2K_1080psf_3000, + AJA_VideoFormat_2K_1080p_2398, // 37 2Kx1080p + AJA_VideoFormat_2K_1080p_2400, + AJA_VideoFormat_2K_1080p_2500, + AJA_VideoFormat_2K_1080p_2997, + AJA_VideoFormat_2K_1080p_3000, + AJA_VideoFormat_2K_1080p_4795, + AJA_VideoFormat_2K_1080p_4800, + AJA_VideoFormat_2K_1080p_5000, + AJA_VideoFormat_2K_1080p_5994, + AJA_VideoFormat_2K_1080p_6000, + AJA_VideoFormat_2K_1556psf_1498, //2Kx1556 + AJA_VideoFormat_2K_1556psf_1500, + AJA_VideoFormat_2K_1556psf_2398, + AJA_VideoFormat_2K_1556psf_2400, + AJA_VideoFormat_2K_1556psf_2500, + AJA_VideoFormat_2K_1556psf_2997, + AJA_VideoFormat_2K_1556psf_3000, + AJA_VideoFormat_Quad_1080psf_2398, // 54 UltaHD + AJA_VideoFormat_Quad_1080psf_2400, + AJA_VideoFormat_Quad_1080psf_2500, + AJA_VideoFormat_Quad_1080psf_2997, + AJA_VideoFormat_Quad_1080psf_3000, + AJA_VideoFormat_Quad_1080p_2398, // 59 + AJA_VideoFormat_Quad_1080p_2400, + AJA_VideoFormat_Quad_1080p_2500, + AJA_VideoFormat_Quad_1080p_2997, + AJA_VideoFormat_Quad_1080p_3000, + AJA_VideoFormat_Quad_1080p_5000, + AJA_VideoFormat_Quad_1080p_5994, + AJA_VideoFormat_Quad_1080p_6000, + AJA_VideoFormat_4K_1080psf_2398, // 67 4K + AJA_VideoFormat_4K_1080psf_2400, + AJA_VideoFormat_4K_1080psf_2500, + AJA_VideoFormat_4K_1080psf_2997, + AJA_VideoFormat_4K_1080psf_3000, + AJA_VideoFormat_4K_1080p_2398, + AJA_VideoFormat_4K_1080p_2400, + AJA_VideoFormat_4K_1080p_2500, + AJA_VideoFormat_4K_1080p_2997, + AJA_VideoFormat_4K_1080p_3000, + AJA_VideoFormat_4K_1080p_4795, + AJA_VideoFormat_4K_1080p_4800, + AJA_VideoFormat_4K_1080p_5000, + AJA_VideoFormat_4K_1080p_5994, + AJA_VideoFormat_4K_1080p_6000, + + // UHD2 (8K) + AJA_VideoFormat_4x3840x2160p_2398, + AJA_VideoFormat_4x3840x2160p_2400, + AJA_VideoFormat_4x3840x2160p_2500, + AJA_VideoFormat_4x3840x2160p_2997, + AJA_VideoFormat_4x3840x2160p_3000, + AJA_VideoFormat_4x3840x2160p_5000, + AJA_VideoFormat_4x3840x2160p_5994, + AJA_VideoFormat_4x3840x2160p_6000, + + // UHD2 (8K) + AJA_VideoFormat_4x4096x2160p_2398, + AJA_VideoFormat_4x4096x2160p_2400, + AJA_VideoFormat_4x4096x2160p_2500, + AJA_VideoFormat_4x4096x2160p_2997, + AJA_VideoFormat_4x4096x2160p_3000, + AJA_VideoFormat_4x4096x2160p_4795, + AJA_VideoFormat_4x4096x2160p_4800, + AJA_VideoFormat_4x4096x2160p_5000, + AJA_VideoFormat_4x4096x2160p_5994, + AJA_VideoFormat_4x4096x2160p_6000, + + AJA_VideoFormat_Size +}; + +enum AJA_PixelFormat +{ + AJA_PixelFormat_Unknown, + AJA_PixelFormat_YCbCr10, /**< Pixel format YCbCr 10 bit */ + AJA_PixelFormat_YCbCr8, /**< Pixel format YCbCr 8 bit */ + AJA_PixelFormat_ARGB8, /**< Pixel format ARGB 8 bit */ + AJA_PixelFormat_RGBA8, /**< Pixel format RGBA 8 bit */ + AJA_PixelFormat_RGB10, /**< Pixel format RGB 10 bit */ + AJA_PixelFormat_YUY28, /**< Pixel format YUY2 8 bit */ + AJA_PixelFormat_ABGR8, /**< Pixel format ABGR 8 bit */ + AJA_PixelFormat_RGB_DPX, /**< Pixel format RGB DPX */ + AJA_PixelFormat_YCbCr_DPX, /**< Pixel format YCrCb DPX */ + AJA_PixelFormat_DVCPRO, /**< Pixel format DVCPRO */ + AJA_PixelFormat_QREZ, /**< Pixel format QREZ */ + AJA_PixelFormat_HDV, /**< Pixel format HDV */ + AJA_PixelFormat_RGB8_PACK, /**< Pixel format RGB 8 bit packed */ + AJA_PixelFormat_BGR8_PACK, /**< Pixel format BGR 8 bit packed */ + AJA_PixelFormat_YCbCrA10, /**< Pixel format YCbCrA 10 bit */ + AJA_PixelFormat_RGB_DPX_LE, /**< Pixel format RGB DPX little endian */ + AJA_PixelFormat_RGB12, /**< Pixel format RGB 12 bit */ + AJA_PixelFormat_RGB12P, /**< Pixel format RGB 12 bit packed */ + AJA_PixelFormat_PRORES_DVPRO, /**< Pixel format PRORES DVPRO */ + AJA_PixelFormat_PRORES_HDV, /**< Pixel format PRORES HDV */ + AJA_PixelFormat_RGB10_PACK, /**< Pixel format RGB 10 bit packed */ + AJA_PixelFormat_YCbCr12_444, /**< Pixel format YCrCb 12 bit 444 */ + AJA_PixelFormat_YCbCr12_422, /**< Pixel format YCbCr 12 bit 422 */ + AJA_PixelFormat_RGB16, /**< Pixel format RGB 16 bit */ + AJA_PixelFormat_YCbCr10_4K_RQ, /**< Pixel format YCbCr 10 bit 4K right quadrant */ + AJA_PixelFormat_BAYER10_DPX_LJ, /**< Pixel format Bayer 10 bit DPX Left Justified */ + AJA_PixelFormat_BAYER12_DPX_LJ, /**< Pixel format Bayer 12 bit DPX Left Justified */ + AJA_PixelFormat_BAYER10_HS, /**< Pixel format Bayer 10 bit */ + AJA_PixelFormat_BAYER12_HS, /**< Pixel format Bayer 12 bit */ + AJA_PixelFormat_BAYER12_PACK_HS, /**< Pixel format Bayer 12 bit packed */ + AJA_PixelFormat_RAW10, /**< Pixel format RAW 10 bit fully packed */ + AJA_PixelFormat_RAW10_HS, /**< Pixel format RAW 10 bit fully packed, high speed */ + AJA_PixelFormat_YCBCR10_420PL, /**< Pixel format YCbCr 10 bit 420 packed planer */ + AJA_PixelFormat_YCBCR10_422PL, /**< Pixel format YCbCr 10 bit 422 packed planer */ + AJA_PixelFormat_YCBCR8_420PL, /**< Pixel format YCbCr 8 bit 420 packed planer */ + AJA_PixelFormat_YCBCR8_422PL, /**< Pixel format YCbCr 8 bit 422 packed planer */ + + AJA_PixelFormat_YCBCR8_420PL3, /**< Pixel format YCbCr 8 bit 420 planar */ + AJA_PixelFormat_YCBCR8_422PL3, /**< Pixel format YCbCr 8 bit 422 planar */ + AJA_PixelFormat_YCBCR10_420PL3LE, /**< Pixel format YCbCr 10 bit 420 little-endian planar */ + AJA_PixelFormat_YCBCR10_422PL3LE, /**< Pixel format YCbCr 10 bit 422 little-endian planar */ + + /// SMPTE 2022-6/211/OpenCL related....not actually pixel formats on any board... + AJA_PixelFormat_S0226_720p50, + AJA_PixelFormat_S0226_720p60, + AJA_PixelFormat_S0226_1080i30, + AJA_PixelFormat_S0226_1080i25, + AJA_PixelFormat_S0226_1080p30, + AJA_PixelFormat_S0226_1080p25, + AJA_PixelFormat_S0226_1080p24, + AJA_PixelFormat_S0226_525i30, + AJA_PixelFormat_S0226_625i25, + + AJA_PixelFormat_RFC4175_720p, + AJA_PixelFormat_RFC4175_1080i, + AJA_PixelFormat_RFC4175_1080p, + AJA_PixelFormat_RFC4175_525i30, + AJA_PixelFormat_RFC4175_625i25, + AJA_PixelFormat_RFC4175_2160p, + + AJA_PixelFormat_RGB10_3DLUT, + AJA_PixelFormat_Size +}; + + +enum AJA_BayerColorPhase +{ + AJA_BayerColorPhase_Unknown, + AJA_BayerColorPhase_RedGreen, + AJA_BayerColorPhase_GreenRed, + AJA_BayerColorPhase_BlueGreen, + AJA_BayerColorPhase_GreenBlue, + AJA_BayerColorPhase_Size +}; + + +enum AJA_FrameRate +{ + AJA_FrameRate_Unknown, + AJA_FrameRate_1498, + AJA_FrameRate_1500, + AJA_FrameRate_1798, + AJA_FrameRate_1800, + AJA_FrameRate_1898, + AJA_FrameRate_1900, + AJA_FrameRate_2398, + AJA_FrameRate_2400, + AJA_FrameRate_2500, + AJA_FrameRate_2997, + AJA_FrameRate_3000, + AJA_FrameRate_4795, + AJA_FrameRate_4800, + AJA_FrameRate_5000, + AJA_FrameRate_5994, + AJA_FrameRate_6000, + AJA_FrameRate_10000, + AJA_FrameRate_11988, + AJA_FrameRate_12000, + + AJA_FrameRate_Size +}; + +enum AJA_VideoConversion +{ + AJA_VideoConversion_Unknown, + AJA_VideoConversion_1080i_5994to525_5994, + AJA_VideoConversion_1080i_2500to625_2500, + AJA_VideoConversion_720p_5994to525_5994, + AJA_VideoConversion_720p_5000to625_2500, + AJA_VideoConversion_525_5994to1080i_5994, + AJA_VideoConversion_525_5994to720p_5994, + AJA_VideoConversion_625_2500to1080i_2500, + AJA_VideoConversion_625_2500to720p_5000, + AJA_VideoConversion_720p_5000to1080i_2500, + AJA_VideoConversion_720p_5994to1080i_5994, + AJA_VideoConversion_720p_6000to1080i_3000, + AJA_VideoConversion_1080i2398to525_2398, + AJA_VideoConversion_1080i2398to525_2997, + AJA_VideoConversion_1080i_2500to720p_5000, + AJA_VideoConversion_1080i_5994to720p_5994, + AJA_VideoConversion_1080i_3000to720p_6000, + AJA_VideoConversion_1080i_2398to720p_2398, + AJA_VideoConversion_720p_2398to1080i_2398, + AJA_VideoConversion_525_2398to1080i_2398, + AJA_VideoConversion_525_5994to525_5994, + AJA_VideoConversion_625_2500to625_2500, + AJA_VideoConversion_525_5994to525psf_2997, + AJA_VideoConversion_625_5000to625psf_2500, + AJA_VideoConversion_1080i_5000to1080psf_2500, + AJA_VideoConversion_1080i_5994to1080psf_2997, + AJA_VideoConversion_1080i_6000to1080psf_3000, + AJA_VideoConversion_Size +}; + + +enum AJA_HdrColorimetry // compare R2HdrColorimetry +{ + AJA_HdrColor_Auto, + AJA_HdrColor_SDR, + AJA_HdrColor_P3, + AJA_HdrColor_2020, + AJA_HdrColor_Custom +}; + + +enum AJA_HdrTransfer // compare R2HdrTransfer +{ + AJA_HdrTrans_Auto, + AJA_HdrTrans_SDR, + AJA_HdrTrans_HLG, + AJA_HdrTrans_PQ, +}; + + +enum AJA_HdrLuminance // compare R2HdrLuminance +{ + AJA_Luminance_Auto, + AJA_Luminance_YCbCr, + AJA_Luminance_ICtCp +}; + + +#endif // AJA_VIDEODEFINES diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/videoutilities.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/videoutilities.h new file mode 100644 index 0000000..c553571 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/videoutilities.h @@ -0,0 +1,381 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file videoutilities.h + @brief Declares the ajabase library's video utility functions. + @copyright (C) 2010-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_VIDEOUTILS_H +#define AJA_VIDEOUTILS_H + +#include "public.h" +#include "videotypes.h" + +#define DEFAULT_PATT_GAIN 0.9 // some patterns pay attention to this... +#define HD_NUMCOMPONENTPIXELS_2K 2048 +#define HD_NUMCOMPONENTPIXELS_1080_2K 2048 +#define HD_NUMCOMPONENTPIXELS_1080 1920 +#define CCIR601_10BIT_BLACK 64 +#define CCIR601_10BIT_WHITE 940 +#define CCIR601_10BIT_CHROMAOFFSET 512 + +#define CCIR601_8BIT_BLACK 16 +#define CCIR601_8BIT_WHITE 235 +#define CCIR601_8BIT_CHROMAOFFSET 128 + +#define MIN_RGB_8BIT 0 +#define MAX_RGB_8BIT 255 +#define MIN_RGB_10BIT 0 +#define MAX_RGB_10BIT 1023 +#define MIN_RGB_16BIT 0 +#define MAX_RGB_16BIT 65535 + +// line pitch is in bytes. +#define FRAME_0_BASE (0x0) +#define FRAME_1080_10BIT_LINEPITCH (1280*4) +#define FRAME_1080_8BIT_LINEPITCH (1920*2) +#define FRAME_QUADHD_10BIT_SIZE (FRAME_1080_10BIT_LINEPITCH*2160) +#define FRAME_QUADHD_8BIT_SIZE (FRAME_1080_8BIT_LINEPITCH*2160) +#define FRAME_BASE(__frameNum__,__frameSize__) ((__frameNum__)*(__frameSize__)) + +// NOTE: Changed the "(__x__) < MIN_RGB_nBIT" comparisons to "(__x__) <= MIN_RGB_nBIT" +// in the following three macros to eliminate gcc "comparison always true" warnings +// when __x__ is an unsigned value. +#if !defined(ClipRGB_8BIT) + #define ClipRGB_8BIT(__x__) ((__x__) > MAX_RGB_8BIT ? (MAX_RGB_8BIT) \ + : ((__x__) <= MIN_RGB_8BIT ? (MIN_RGB_8BIT) \ + : (__x__))) +#endif +#if !defined(ClipRGB_10BIT) + #define ClipRGB_10BIT(__x__) ((__x__) > MAX_RGB_10BIT ? (MAX_RGB_10BIT) \ + : ((__x__) <= MIN_RGB_10BIT ? (MIN_RGB_10BIT) \ + : (__x__))) +#endif + +#define MIN_YCBCR_10BIT 4 +#define MAX_YCBCR_10BIT 1019 +#define ClipYCbCr_10BIT(X) ((X) > MAX_YCBCR_10BIT ? (MAX_YCBCR_10BIT) : ((X) < MIN_YCBCR_10BIT ? (MIN_YCBCR_10BIT) : (X))) + + +typedef enum { + AJA_SIGNALMASK_NONE=0, // Output Black. + AJA_SIGNALMASK_Y=1 , // Output Y if set, else Output Y=0x40 + AJA_SIGNALMASK_Cb=2 , // Output Cb if set, elso Output Cb to 0x200 + AJA_SIGNALMASK_Cr=4 , // Output Cr if set, elso Output Cr to 0x200 + AJA_SIGNALMASK_ALL=1+2+4 // Output Cr if set, elso Output Cr to 0x200 +} AJASignalMask; + +typedef struct { + uint8_t Blue; + uint8_t Green; + uint8_t Red; + uint8_t Alpha; +} AJA_RGBAlphaPixel; + +typedef struct { + uint8_t Alpha; + uint8_t Red; + uint8_t Green; + uint8_t Blue; +} AJA_AlphaRGBPixel; + +typedef struct { + uint16_t Blue; + uint16_t Green; + uint16_t Red; + uint16_t Alpha; +} AJA_RGBAlpha10BitPixel; + +typedef struct { + uint16_t Blue; + uint16_t Green; + uint16_t Red; + uint16_t Alpha; +} AJA_RGBAlpha16BitPixel; + +typedef struct +{ + uint16_t Alpha; + uint16_t cb; + uint16_t y; + uint16_t cr; +} AJA_YCbCr10BitAlphaPixel; + +typedef struct +{ + uint16_t cb; + uint16_t y; + uint16_t cr; +} AJA_YCbCr10BitPixel; + +void AJA_EXPORT createVideoFrame( uint32_t *buffer , uint64_t frameNumber, AJA_PixelFormat pixFmt, uint32_t lines, uint32_t pixels, uint32_t linepitch, uint16_t y, uint16_t cb, uint16_t cr ); +uint32_t AJA_EXPORT AJA_CalcRowBytesForFormat(AJA_PixelFormat format, uint32_t width); +void AJA_EXPORT AJA_UnPack10BitYCbCrBuffer(uint32_t* packedBuffer, uint16_t* ycbcrBuffer, uint32_t numPixels); +void AJA_EXPORT AJA_PackTo10BitYCbCrBuffer(uint16_t *ycbcrBuffer, uint32_t *packedBuffer,uint32_t numPixels); +void AJA_EXPORT AJA_PackTo10BitYCbCrDPXBuffer( uint16_t *ycbcrBuffer, uint32_t *packedBuffer,uint32_t numPixels ,bool bigEndian = true); +void AJA_EXPORT AJA_PackRGB10BitFor10BitRGB(AJA_RGBAlpha10BitPixel* rgba10BitBuffer,uint32_t numPixels); +void AJA_EXPORT AJA_PackRGB10BitFor10BitRGBPacked(AJA_RGBAlpha10BitPixel* rgba10BitBuffer,uint32_t numPixels); +void AJA_EXPORT AJA_PackRGB10BitFor10BitDPX(AJA_RGBAlpha10BitPixel* rgba10BitBuffer,uint32_t numPixels, bool bigEndian=true); +void AJA_EXPORT AJA_UnPack10BitDPXtoRGBAlpha10BitPixel(AJA_RGBAlpha10BitPixel* rgba10BitBuffer,uint32_t* DPXLinebuffer ,uint32_t numPixels, bool bigEndian=true); +void AJA_EXPORT AJA_UnPack10BitDPXtoRGBAlphaBitPixel(uint8_t* rgbaBuffer,uint32_t* DPXLinebuffer ,uint32_t numPixels, bool bigEndian=true); +void AJA_EXPORT AJA_RePackLineDataForYCbCrDPX(uint32_t *packedycbcrLine, uint32_t numULWords); +void AJA_EXPORT AJA_MakeUnPacked8BitYCbCrBuffer( uint8_t* buffer, uint8_t Y , uint8_t Cb , uint8_t Cr,uint32_t numPixels ); +void AJA_EXPORT AJA_MakeUnPacked10BitYCbCrBuffer(uint16_t* buffer, uint16_t Y , uint16_t Cb , uint16_t Cr,uint32_t numPixels); +void AJA_EXPORT AJA_ConvertLineto8BitYCbCr(uint16_t * ycbcr10BitBuffer, uint8_t * ycbcr8BitBuffer, uint32_t numPixels); +void AJA_EXPORT AJA_ConvertLineToYCbCr422(AJA_RGBAlphaPixel * RGBLine, uint16_t* YCbCrLine, int32_t numPixels , int32_t startPixel, bool fUseSDMatrix); +void AJA_EXPORT AJA_ConvertLineto10BitRGB(uint16_t * ycbcrBuffer, AJA_RGBAlpha10BitPixel * rgbaBuffer,uint32_t numPixels,bool fUseSDMatrix); +void AJA_EXPORT AJA_ConvertLinetoRGB(uint8_t * ycbcrBuffer, AJA_RGBAlphaPixel * rgbaBuffer, uint32_t numPixels, bool fUseSDMatrix); +void AJA_EXPORT AJA_ConvertLinetoRGB(uint16_t * ycbcrBuffer, AJA_RGBAlphaPixel * rgbaBuffer, uint32_t numPixels, bool fUseSDMatrix); +void AJA_EXPORT AJA_ConvertLineto16BitRGB(uint16_t * ycbcrBuffer, AJA_RGBAlpha16BitPixel * rgbaBuffer, uint32_t numPixels, bool fUseSDMatrix); +void AJA_EXPORT AJA_Convert16BitRGBtoBayer10BitDPXLJ(AJA_RGBAlpha16BitPixel * rgbaBuffer, uint32_t * bayerBuffer, + uint32_t numPixels, uint32_t line, AJA_BayerColorPhase phase = AJA_BayerColorPhase_RedGreen); +void AJA_EXPORT AJA_Convert16BitRGBtoBayer12BitDPXLJ(AJA_RGBAlpha16BitPixel * rgbaBuffer, uint32_t * bayerBuffer, + uint32_t numPixels, uint32_t line, AJA_BayerColorPhase phase = AJA_BayerColorPhase_RedGreen); +void AJA_EXPORT AJA_Convert16BitRGBtoBayer10BitDPXPacked(AJA_RGBAlpha16BitPixel * rgbaBuffer, uint8_t * bayerBuffer, + uint32_t numPixels, uint32_t line, AJA_BayerColorPhase phase = AJA_BayerColorPhase_RedGreen); +void AJA_EXPORT AJA_Convert16BitRGBtoBayer12BitDPXPacked(AJA_RGBAlpha16BitPixel * rgbaBuffer, uint8_t * bayerBuffer, + uint32_t numPixels, uint32_t line, AJA_BayerColorPhase phase = AJA_BayerColorPhase_RedGreen); +void AJA_EXPORT AJA_ConvertARGBToRGBA(uint8_t* rgbaBuffer,uint32_t numPixels); +void AJA_EXPORT AJA_ConvertARGBToABGR(uint8_t* rgbaBuffer,uint32_t numPixels); +void AJA_EXPORT AJA_ConvertARGBToRGB(uint8_t* rgbaBuffer,uint32_t numPixels); +void AJA_EXPORT AJA_ConvertARGBToBGR(uint8_t* rgbaBuffer,uint32_t numPixels); +void AJA_EXPORT AJA_Convert16BitARGBTo16BitRGB(AJA_RGBAlpha16BitPixel *rgbaLineBuffer ,uint16_t * rgbLineBuffer,uint32_t numPixels); +void AJA_EXPORT AJA_Convert16BitARGBTo12BitRGBPacked(AJA_RGBAlpha16BitPixel *rgbaLineBuffer ,uint8_t * rgbLineBuffer,uint32_t numPixels); +void AJA_EXPORT AJA_Convert8BitYCbCrToYUY2(uint8_t * ycbcrBuffer, uint32_t numPixels); +void AJA_EXPORT AJA_ConvertUnpacked10BitYCbCrToPixelFormat(uint16_t *unPackedBuffer, uint32_t *packedBuffer, uint32_t numPixels, AJA_PixelFormat pixelFormat); +void AJA_EXPORT AJA_ConvertPixelFormatToRGBA(uint32_t *buffer, AJA_RGBAlphaPixel* rgbBuffer, uint32_t numPixels, AJA_PixelFormat pixelFormat,bool bIsSD = false); +void AJA_EXPORT AJA_MaskUnPacked10BitYCbCrBuffer(uint16_t* ycbcrUnPackedBuffer, uint16_t signalMask , uint32_t numPixels); + +void AJA_EXPORT AJA_ReSampleLine(AJA_RGBAlphaPixel *Input, AJA_RGBAlphaPixel *Output, uint16_t startPixel, uint16_t endPixel, int32_t numInputPixels, int32_t numOutputPixels); +void AJA_EXPORT AJA_ReSampleLine(int16_t *Input, int16_t *Output, uint16_t startPixel, uint16_t endPixel, int32_t numInputPixels, int32_t numOutputPixels); +void AJA_EXPORT AJA_ReSampleYCbCrSampleLine(int16_t *Input, int16_t *Output, int32_t numInputPixels, int32_t numOutputPixels); +void AJA_EXPORT AJA_ReSampleAudio(int16_t *Input, int16_t *Output, uint16_t startPixel, uint16_t endPixel, int32_t numInputPixels, int32_t numOutputPixels, int16_t channelInterleaveMulitplier=1); + +void AJA_EXPORT WriteLineToBuffer(AJA_PixelFormat pixelFormat, uint32_t currentLine, uint32_t numPixels, uint32_t linePitch, + uint8_t* pOutputBuffer,uint32_t* pPackedLineBuffer); +void AJA_EXPORT WriteLineToBuffer(AJA_PixelFormat pixelFormat, AJA_BayerColorPhase bayerPhase, uint32_t currentLine, + uint32_t numPixels, uint32_t linePitch, uint8_t* pOutputBuffer,uint32_t* pPackedLineBuffer); + +void AJA_EXPORT AJA_ConvertRGBAlpha10LineToYCbCr422(AJA_RGBAlpha10BitPixel * RGBLine, + uint16_t* YCbCrLine, + int32_t numPixels , + int32_t startPixel, + bool fUseRGBFullRange=false); + +inline int16_t AJA_FixedRound(int32_t inFix) +{ + int16_t retValue; + + if ( inFix < 0 ) + { + retValue = (int16_t)(-((-inFix+0x8000)>>16)); + } + else + { + retValue = (int16_t)((inFix + 0x8000)>>16); + } + return retValue; +} + +inline void AJA_SDConvert10BitYCbCrto10BitRGB(AJA_YCbCr10BitAlphaPixel *pSource, + AJA_RGBAlpha10BitPixel *pTarget) +{ + int32_t Red,Green,Blue; + int32_t ConvertedY; + + ConvertedY = 0x12A15*((int32_t)pSource->y - CCIR601_10BIT_BLACK); + + Red = AJA_FixedRound(ConvertedY + + 0x19895*((int32_t)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET))); + + pTarget->Red = (uint16_t)ClipRGB_10BIT(Red); + + Blue = AJA_FixedRound(ConvertedY + + 0x20469*((int32_t)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) )); + + pTarget->Blue = (uint16_t)ClipRGB_10BIT(Blue); + + Green = AJA_FixedRound(ConvertedY - + 0x644A*((int32_t)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) ) - + 0xD01F*((int32_t)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET) )); + + pTarget->Green = (uint16_t)ClipRGB_10BIT(Green); + + pTarget->Alpha = pSource->Alpha; +} + +inline void AJA_HDConvert10BitYCbCrto10BitRGB(AJA_YCbCr10BitAlphaPixel *pSource, + AJA_RGBAlpha10BitPixel *pTarget) +{ + int32_t Red,Green,Blue; + int32_t ConvertedY; + + ConvertedY = 0x12ACF*((int32_t)pSource->y - CCIR601_10BIT_BLACK); + + Red = AJA_FixedRound(ConvertedY + + 0x1DF71*((int32_t)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET))); + + pTarget->Red = (uint16_t)ClipRGB_10BIT(Red); + + Blue = AJA_FixedRound(ConvertedY + + 0x22A86*((int32_t)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) )); + + pTarget->Blue = (uint16_t)ClipRGB_10BIT(Blue); + + Green = AJA_FixedRound(ConvertedY - + 0x3806*((int32_t)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) ) - + 0x8C32*((int32_t)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET) )); + + pTarget->Green = (uint16_t)ClipRGB_10BIT(Green); + + pTarget->Alpha = pSource->Alpha; +} + +inline void AJA_SDConvert10BitYCbCrtoRGB(AJA_YCbCr10BitAlphaPixel *pSource, + AJA_RGBAlphaPixel *pTarget) +{ + int32_t Red,Green,Blue; + int32_t ConvertedY; + + ConvertedY = 0x4A86*((int32_t)pSource->y - CCIR601_10BIT_BLACK); + + Red = AJA_FixedRound(ConvertedY + + 0x6626*((int32_t)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET))); + + pTarget->Red = (uint8_t)ClipRGB_8BIT(Red); + + Blue = AJA_FixedRound(ConvertedY + + 0x811B*((int32_t)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) )); + + pTarget->Blue = (uint8_t)ClipRGB_8BIT(Blue); + + Green = AJA_FixedRound(ConvertedY - + 0x1913*((int32_t)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) ) - + 0x3408*((int32_t)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET) )); + + pTarget->Green = (uint8_t)ClipRGB_8BIT(Green); + + pTarget->Alpha = (uint8_t)pSource->Alpha; +} + +inline void AJA_HDConvert10BitYCbCrtoRGB(AJA_YCbCr10BitAlphaPixel *pSource, + AJA_RGBAlphaPixel *pTarget) +{ + int32_t Red,Green,Blue; + int32_t ConvertedY; + + ConvertedY = (0x12ACF>>2)*((int32_t)pSource->y - CCIR601_10BIT_BLACK); + + Red = AJA_FixedRound(ConvertedY + + (0x1DF71>>2)*((int32_t)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET))); + + pTarget->Red = (uint8_t)ClipRGB_8BIT(Red); + + Blue = AJA_FixedRound(ConvertedY + + (0x22A86>>2)*((int32_t)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) )); + + pTarget->Blue = (uint8_t)ClipRGB_8BIT(Blue); + + Green = AJA_FixedRound(ConvertedY - + (0x3806>>2)*((int32_t)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) ) - + (0x8C32>>2)*((int32_t)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET) )); + + pTarget->Green = (uint8_t)ClipRGB_8BIT(Green); + + pTarget->Alpha = (uint8_t)pSource->Alpha; +} + +typedef void (*AJA_ConvertRGBAlphatoYCbCr)(AJA_RGBAlphaPixel * pSource, AJA_YCbCr10BitPixel * pTarget); + +inline void AJA_SDConvertRGBAlphatoYCbCr(AJA_RGBAlphaPixel * pSource, AJA_YCbCr10BitPixel * pTarget) +{ + int32_t Y,Cb,Cr; + + Y = CCIR601_10BIT_BLACK + (((int32_t)0x41BC*pSource->Red + + (int32_t)0x810F*pSource->Green + + (int32_t)0x1910*pSource->Blue )>>14); + pTarget->y = (uint16_t)Y; + + Cb = CCIR601_10BIT_CHROMAOFFSET + (((int32_t)-0x25F1*pSource->Red - + (int32_t)0x4A7E*pSource->Green + + (int32_t)0x7070*pSource->Blue )>>14); + + pTarget->cb = uint16_t(Cb&0x3FF); + + Cr = CCIR601_10BIT_CHROMAOFFSET + (((int32_t)0x7070*pSource->Red - + (int32_t)0x5E27*pSource->Green - + (int32_t)0x1249*pSource->Blue )>>14); + + pTarget->cr = uint16_t(Cr&0x3FF); +} + +inline void AJA_HDConvertRGBAlphatoYCbCr(AJA_RGBAlphaPixel * pSource, AJA_YCbCr10BitPixel * pTarget) +{ + int32_t Y,Cb,Cr; + + Y = CCIR601_10BIT_BLACK + (((int32_t)0x2E8A*pSource->Red + + (int32_t)0x9C9F*pSource->Green + + (int32_t)0x0FD2*pSource->Blue )>>14); + pTarget->y = (uint16_t)Y; + + Cb = CCIR601_10BIT_CHROMAOFFSET + (((int32_t)-0x18F4*pSource->Red - + (int32_t)0x545B*pSource->Green + + (int32_t)0x6DA9*pSource->Blue )>>14); + + pTarget->cb = uint16_t(Cb&0x3FF); + + Cr = CCIR601_10BIT_CHROMAOFFSET + (((int32_t)0x6D71*pSource->Red - + (int32_t)0x6305*pSource->Green - + (int32_t)0x0A06*pSource->Blue )>>14); + + pTarget->cr = uint16_t(Cr&0x3FF); +} + +inline void AJA_HDConvertRGBAlpha10toYCbCr(AJA_RGBAlpha10BitPixel * pSource, AJA_YCbCr10BitPixel * pTarget,bool rgbFullRange) +{ + double dY,dCb,dCr; + int32_t Y,Cb,Cr; + if ( rgbFullRange) + { + dY = (double(pSource->Red ) * 0.182068) + + (double(pSource->Green) * 0.612427) + + (double(pSource->Blue ) * 0.061829); + Y = CCIR601_10BIT_BLACK + int32_t(dY); /// should do rounding + pTarget->y = uint16_t(Y&0x3FF); + + dCb = (double(pSource->Red ) * (-0.100342)) + + (double(pSource->Green) * (-0.337585)) + + (double(pSource->Blue ) * (0.437927)); + Cb = CCIR601_10BIT_CHROMAOFFSET + int32_t(dCb); + pTarget->cb = uint16_t(Cb&0x3FF); + + dCr = (double(pSource->Red ) * (0.437927)) + + (double(pSource->Green) * (-0.397766)) + + (double(pSource->Blue ) * (-0.040161)); + Cr = CCIR601_10BIT_CHROMAOFFSET + int32_t(dCr); + pTarget->cr = uint16_t(Cr&0x3FF); + + } + else + { + dY = (double(pSource->Red ) * 0.212585) + + (double(pSource->Green) * 0.715210) + + (double(pSource->Blue ) * 0.072205); + Y = int32_t(dY); + pTarget->y = uint16_t(Y&0x3FF); + + dCb = (double(pSource->Red ) * (-0.117188)) + + (double(pSource->Green) * (-0.394226)) + + (double(pSource->Blue ) * (0.511414)); + Cb = CCIR601_10BIT_CHROMAOFFSET + int32_t(dCb); + pTarget->cb = uint16_t(Cb&0x3FF); + + dCr = (double(pSource->Red ) * (0.511414)) + + (double(pSource->Green) * (-0.464508)) + + (double(pSource->Blue ) * (-0.046906)); + Cr = CCIR601_10BIT_CHROMAOFFSET + int32_t(dCr); + pTarget->cr = uint16_t(Cr&0x3FF); + } +} + +#endif // AJA_VIDEOUTILS_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/common/wavewriter.h b/build_dependencies/aja/include/ajalibraries/ajabase/common/wavewriter.h new file mode 100644 index 0000000..1bf19f5 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/common/wavewriter.h @@ -0,0 +1,83 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file wavewriter.h + @brief Declares the AJAWavWriter class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJAWAVEWRITER_H +#define AJAWAVEWRITER_H + +#include "public.h" +#include "ajabase/system/file_io.h" + + +class AJA_EXPORT AJAWavWriterAudioFormat +{ +public: + AJAWavWriterAudioFormat(const int inChannelCount = 2, const int inSampleRate = 48000, const int inSampleSizeBits = 16) + : channelCount (inChannelCount), + sampleRate (inSampleRate), + sampleSize (inSampleSizeBits) + { + } + int channelCount; + int sampleRate; + int sampleSize; +}; + + +class AJA_EXPORT AJAWavWriterVideoFormat +{ +public: + AJAWavWriterVideoFormat() { rateDuration = 30000; rateScale = 1001; } + uint32_t rateDuration; + uint32_t rateScale; +}; + + +enum AJAWavWriterChunkFlag +{ + AJAWavWriterChunkFlagStandard = 1 << 0, + AJAWavWriterChunkFlagBextV1 = 1 << 1 +}; + + +class AJA_EXPORT AJAWavWriter : public AJAFileIO +{ + +public: + AJAWavWriter(const std::string & name, + const AJAWavWriterAudioFormat & audioFormat = AJAWavWriterAudioFormat(), + const AJAWavWriterVideoFormat & videoFormat = AJAWavWriterVideoFormat(), + const std::string & startTimecode = "00:00:00;00", AJAWavWriterChunkFlag flags = AJAWavWriterChunkFlagStandard, + bool useFloatNotPCM = false); + bool open(); + void close(); + + uint32_t write(const char* data, uint32_t len); + +protected: + AJAStatus Open(const std::string& fileName, int flags, AJAFileProperties properties); + AJAStatus Close(void); + +private: + uint32_t writeRawData(const char* data,uint32_t len); + uint32_t writeRawData(char* data,uint32_t len); + uint32_t writeRaw_uint8_t(uint8_t value, uint32_t count=1); + uint32_t writeRaw_uint16_t(uint16_t value, uint32_t count=1); + uint32_t writeRaw_uint32_t(uint32_t value, uint32_t count=1); + + void writeHeader(); + + std::string mFileName; + AJAWavWriterAudioFormat mAudioFormat; + AJAWavWriterVideoFormat mVideoFormat; + std::string mStartTimecode; + AJAWavWriterChunkFlag mFlags; + bool mLittleEndian; + int32_t mSizeOfHeader; + bool mUseFloatData; +}; + +#endif // AJAWAVEWRITER_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/network/ip_socket.h b/build_dependencies/aja/include/ajalibraries/ajabase/network/ip_socket.h new file mode 100644 index 0000000..184ad39 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/network/ip_socket.h @@ -0,0 +1,92 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ip_socket.h + @brief Declares the AJAIPSocket class. + @copyright (C) 2011-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_IP_SOCKET_H +#define AJA_IP_SOCKET_H + +///////////////////////////// +// Includes +///////////////////////////// +#include "ajabase/common/public.h" +#include "ajabase/system/system.h" +#include "ajabase/system/lock.h" +#include +#include + +#if defined(AJA_LINUX) || defined(AJA_MAC) + #include + #include + #include + #include + #include + #include +#elif defined(AJA_WINDOWS) + typedef int socklen_t; +#endif + +///////////////////////////// +// Typedefs +///////////////////////////// +// The key is the IP address, while the second member is the interface name +typedef std::map IPAddressContainerType; + + +///////////////////////////// +// Declarations +///////////////////////////// +/** + * Class which initializes any TCP/IP stack requirements for the target OS. + */ +class AJA_EXPORT AJAIPSocket +{ + public: + AJAIPSocket(void); + virtual ~AJAIPSocket(void); + + bool Initialize(void); + bool Deinitialize(void); + + virtual AJAStatus Open(const std::string& ipAddress, uint16_t port); + bool IsOpen(void); + + bool Shutdown(int how); + bool Close(void); + bool SetSocketOption(int option, const void* pValue); + + bool GetHostIPAddresses( + IPAddressContainerType& ipv4AddressContainer, + IPAddressContainerType& ipv6AddressContainer); + + virtual uint32_t Poll( + uint8_t* pData, + uint32_t dataLength, + struct sockaddr_in& client, + int timeout); + virtual uint32_t Read( + uint8_t* pData, + uint32_t dataLength, + struct sockaddr_in& client); + virtual uint32_t Write( + const uint8_t* pData, + uint32_t dataLength, + struct sockaddr_in& targetAddress); + + + protected: + struct sockaddr_in mSocketAddress; + socklen_t mSocketLength; + int mSocket; + + bool IsInstantiated(void); + + private: + static AJALock mMutex; + static uint32_t mInstantiationCount; +}; + + +#endif // AJA_IP_SOCKET_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/network/tcp_socket.h b/build_dependencies/aja/include/ajalibraries/ajabase/network/tcp_socket.h new file mode 100644 index 0000000..08fed84 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/network/tcp_socket.h @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file tcp_socket.h + @brief Declares the AJATCPSocket class. + @copyright (C) 2011-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_TCP_SOCKET_H +#define AJA_TCP_SOCKET_H + +///////////////////////////// +// Includes +///////////////////////////// +#include "ajabase/network/ip_socket.h" + + +///////////////////////////// +// Declarations +///////////////////////////// +class AJA_EXPORT AJATCPSocket : public AJAIPSocket +{ + public: + AJATCPSocket(void); + virtual ~AJATCPSocket(void); + + AJAStatus Open(const std::string& ipAddress, uint16_t port); + + AJAStatus Connect(const std::string& ipAddress, uint16_t port); + AJAStatus Listen(void); + int Accept(void); + + uint32_t Read(uint8_t* pData, uint32_t dataLength); + uint32_t Write(const uint8_t* pData, uint32_t dataLength); + + private: + uint32_t Read(uint8_t* pData, uint32_t dataLength, struct sockaddr_in& client); + uint32_t Write(const uint8_t* pData, uint32_t dataLength, struct sockaddr_in& targetAddress); +}; + + +#endif // AJA_TCP_SOCKET_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/network/udp_socket.h b/build_dependencies/aja/include/ajalibraries/ajabase/network/udp_socket.h new file mode 100644 index 0000000..0cb2c81 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/network/udp_socket.h @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file udp_socket.h + @brief Declares the AJAUDPSocket class. + @copyright (C) 2011-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_UDP_SOCKET_H +#define AJA_UDP_SOCKET_H + +///////////////////////////// +// Includes +///////////////////////////// +#include "ajabase/network/ip_socket.h" + + +///////////////////////////// +// Declarations +///////////////////////////// +class AJA_EXPORT AJAUDPSocket : public AJAIPSocket +{ + public: + AJAUDPSocket(void); + virtual ~AJAUDPSocket(void); + + AJAStatus Open(const std::string& ipAddress, uint16_t port); + + uint32_t Poll( + uint8_t* pData, + uint32_t dataLength, + struct sockaddr_in& client, + int timeout); + uint32_t Read(uint8_t* pData, uint32_t dataLength, struct sockaddr_in& client); + uint32_t Write( + const uint8_t* pData, + uint32_t dataLength, + struct sockaddr_in& targetAddress); + + + private: +}; + +#endif // AJA_UDP_SOCKET_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/persistence/persistence.h b/build_dependencies/aja/include/ajalibraries/ajabase/persistence/persistence.h new file mode 100644 index 0000000..e0cc336 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/persistence/persistence.h @@ -0,0 +1,64 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file persistence/persistence.h + @brief Declares the AJAPersistence class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJAPersistence_H +#define AJAPersistence_H + +#include +#include +#include "ajabase/system/info.h" + +enum AJAPersistenceType +{ + AJAPersistenceTypeInt, + AJAPersistenceTypeBool, + AJAPersistenceTypeDouble, + AJAPersistenceTypeString, //std::string not C string + AJAPersistenceTypeBlob, + + //add any new ones above here + AJAPersistenceTypeEnd +}; + +/** + * Class used to talk to the board in such a way as to maintain a persistant state + * across apps and reboots. + */ +class AJAPersistence +{ +public: + AJAPersistence(); + AJAPersistence(const std::string& appID, const std::string& deviceType="", const std::string& deviceNumber="", bool bSharePrefFile=false); + + virtual ~AJAPersistence(); + + void SetParams(const std::string& appID="", const std::string& deviceType="", const std::string& deviceNumber="", bool bSharePrefFile=false); + void GetParams(std::string& appID, std::string& deviceType, std::string& deviceNumber, bool& bSharePrefFile); + + bool SetValue(const std::string& key, void *value, AJAPersistenceType type, size_t blobBytes = 0); + bool GetValue(const std::string& key, void *value, AJAPersistenceType type, size_t blobBytes = 0); + bool FileExists(); + bool ClearPrefFile(); + bool DeletePrefFile(); + + bool GetValuesInt(const std::string& keyQuery, std::vector& keys, std::vector& values); + bool GetValuesBool(const std::string& keyQuery, std::vector& keys, std::vector& values); + bool GetValuesDouble(const std::string& keyQuery, std::vector& keys, std::vector& values); + bool GetValuesString(const std::string& keyQuery, std::vector& keys, std::vector& values); + +private: + + std::string mappId; + std::string mboardId; + bool mSharedPrefFile; + std::string mserialNumber; + std::string mstateKeyName; + + AJASystemInfo mSysInfo; +}; + +#endif // AJAPersistence_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/persistence/sqlite3.h b/build_dependencies/aja/include/ajalibraries/ajabase/persistence/sqlite3.h new file mode 100644 index 0000000..4427d2f --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/persistence/sqlite3.h @@ -0,0 +1,11434 @@ +/* +** 2001-09-15 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** This header file defines the interface that the SQLite library +** presents to client programs. If a C-function, structure, datatype, +** or constant definition does not appear in this file, then it is +** not a published API of SQLite, is subject to change without +** notice, and should not be referenced by programs that use SQLite. +** +** Some of the definitions that are in this file are marked as +** "experimental". Experimental interfaces are normally new +** features recently added to SQLite. We do not anticipate changes +** to experimental interfaces but reserve the right to make minor changes +** if experience from use "in the wild" suggest such changes are prudent. +** +** The official C-language API documentation for SQLite is derived +** from comments in this file. This file is the authoritative source +** on how SQLite interfaces are supposed to operate. +** +** The name of this file under configuration management is "sqlite.h.in". +** The makefile makes some minor changes to this file (such as inserting +** the version number) and changes its name to "sqlite3.h" as +** part of the build process. +*/ +#ifndef SQLITE3_H +#define SQLITE3_H +#include /* Needed for the definition of va_list */ + +/* +** Make sure we can call this stuff from C++. +*/ +#ifdef __cplusplus +extern "C" { +#endif + + +/* +** Provide the ability to override linkage features of the interface. +*/ +#ifndef SQLITE_EXTERN +# define SQLITE_EXTERN extern +#endif +#ifndef SQLITE_API +# define SQLITE_API +#endif +#ifndef SQLITE_CDECL +# define SQLITE_CDECL +#endif +#ifndef SQLITE_APICALL +# define SQLITE_APICALL +#endif +#ifndef SQLITE_STDCALL +# define SQLITE_STDCALL SQLITE_APICALL +#endif +#ifndef SQLITE_CALLBACK +# define SQLITE_CALLBACK +#endif +#ifndef SQLITE_SYSAPI +# define SQLITE_SYSAPI +#endif + +/* +** These no-op macros are used in front of interfaces to mark those +** interfaces as either deprecated or experimental. New applications +** should not use deprecated interfaces - they are supported for backwards +** compatibility only. Application writers should be aware that +** experimental interfaces are subject to change in point releases. +** +** These macros used to resolve to various kinds of compiler magic that +** would generate warning messages when they were used. But that +** compiler magic ended up generating such a flurry of bug reports +** that we have taken it all out and gone back to using simple +** noop macros. +*/ +#define SQLITE_DEPRECATED +#define SQLITE_EXPERIMENTAL + +/* +** Ensure these symbols were not defined by some previous header file. +*/ +#ifdef SQLITE_VERSION +# undef SQLITE_VERSION +#endif +#ifdef SQLITE_VERSION_NUMBER +# undef SQLITE_VERSION_NUMBER +#endif + +/* +** CAPI3REF: Compile-Time Library Version Numbers +** +** ^(The [SQLITE_VERSION] C preprocessor macro in the sqlite3.h header +** evaluates to a string literal that is the SQLite version in the +** format "X.Y.Z" where X is the major version number (always 3 for +** SQLite3) and Y is the minor version number and Z is the release number.)^ +** ^(The [SQLITE_VERSION_NUMBER] C preprocessor macro resolves to an integer +** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same +** numbers used in [SQLITE_VERSION].)^ +** The SQLITE_VERSION_NUMBER for any given release of SQLite will also +** be larger than the release from which it is derived. Either Y will +** be held constant and Z will be incremented or else Y will be incremented +** and Z will be reset to zero. +** +** Since [version 3.6.18] ([dateof:3.6.18]), +** SQLite source code has been stored in the +** Fossil configuration management +** system. ^The SQLITE_SOURCE_ID macro evaluates to +** a string which identifies a particular check-in of SQLite +** within its configuration management system. ^The SQLITE_SOURCE_ID +** string contains the date and time of the check-in (UTC) and a SHA1 +** or SHA3-256 hash of the entire source tree. If the source code has +** been edited in any way since it was last checked in, then the last +** four hexadecimal digits of the hash may be modified. +** +** See also: [sqlite3_libversion()], +** [sqlite3_libversion_number()], [sqlite3_sourceid()], +** [sqlite_version()] and [sqlite_source_id()]. +*/ +#define SQLITE_VERSION "3.24.0" +#define SQLITE_VERSION_NUMBER 3024000 +#define SQLITE_SOURCE_ID "2018-06-04 19:24:41 c7ee0833225bfd8c5ec2f9bf62b97c4e04d03bd9566366d5221ac8fb199a87ca" + +/* +** CAPI3REF: Run-Time Library Version Numbers +** KEYWORDS: sqlite3_version sqlite3_sourceid +** +** These interfaces provide the same information as the [SQLITE_VERSION], +** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros +** but are associated with the library instead of the header file. ^(Cautious +** programmers might include assert() statements in their application to +** verify that values returned by these interfaces match the macros in +** the header, and thus ensure that the application is +** compiled with matching library and header files. +** +**
+** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
+** assert( strncmp(sqlite3_sourceid(),SQLITE_SOURCE_ID,80)==0 );
+** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
+** 
)^ +** +** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION] +** macro. ^The sqlite3_libversion() function returns a pointer to the +** to the sqlite3_version[] string constant. The sqlite3_libversion() +** function is provided for use in DLLs since DLL users usually do not have +** direct access to string constants within the DLL. ^The +** sqlite3_libversion_number() function returns an integer equal to +** [SQLITE_VERSION_NUMBER]. ^(The sqlite3_sourceid() function returns +** a pointer to a string constant whose value is the same as the +** [SQLITE_SOURCE_ID] C preprocessor macro. Except if SQLite is built +** using an edited copy of [the amalgamation], then the last four characters +** of the hash might be different from [SQLITE_SOURCE_ID].)^ +** +** See also: [sqlite_version()] and [sqlite_source_id()]. +*/ +SQLITE_API SQLITE_EXTERN const char sqlite3_version[]; +SQLITE_API const char *sqlite3_libversion(void); +SQLITE_API const char *sqlite3_sourceid(void); +SQLITE_API int sqlite3_libversion_number(void); + +/* +** CAPI3REF: Run-Time Library Compilation Options Diagnostics +** +** ^The sqlite3_compileoption_used() function returns 0 or 1 +** indicating whether the specified option was defined at +** compile time. ^The SQLITE_ prefix may be omitted from the +** option name passed to sqlite3_compileoption_used(). +** +** ^The sqlite3_compileoption_get() function allows iterating +** over the list of options that were defined at compile time by +** returning the N-th compile time option string. ^If N is out of range, +** sqlite3_compileoption_get() returns a NULL pointer. ^The SQLITE_ +** prefix is omitted from any strings returned by +** sqlite3_compileoption_get(). +** +** ^Support for the diagnostic functions sqlite3_compileoption_used() +** and sqlite3_compileoption_get() may be omitted by specifying the +** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time. +** +** See also: SQL functions [sqlite_compileoption_used()] and +** [sqlite_compileoption_get()] and the [compile_options pragma]. +*/ +#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS +SQLITE_API int sqlite3_compileoption_used(const char *zOptName); +SQLITE_API const char *sqlite3_compileoption_get(int N); +#endif + +/* +** CAPI3REF: Test To See If The Library Is Threadsafe +** +** ^The sqlite3_threadsafe() function returns zero if and only if +** SQLite was compiled with mutexing code omitted due to the +** [SQLITE_THREADSAFE] compile-time option being set to 0. +** +** SQLite can be compiled with or without mutexes. When +** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes +** are enabled and SQLite is threadsafe. When the +** [SQLITE_THREADSAFE] macro is 0, +** the mutexes are omitted. Without the mutexes, it is not safe +** to use SQLite concurrently from more than one thread. +** +** Enabling mutexes incurs a measurable performance penalty. +** So if speed is of utmost importance, it makes sense to disable +** the mutexes. But for maximum safety, mutexes should be enabled. +** ^The default behavior is for mutexes to be enabled. +** +** This interface can be used by an application to make sure that the +** version of SQLite that it is linking against was compiled with +** the desired setting of the [SQLITE_THREADSAFE] macro. +** +** This interface only reports on the compile-time mutex setting +** of the [SQLITE_THREADSAFE] flag. If SQLite is compiled with +** SQLITE_THREADSAFE=1 or =2 then mutexes are enabled by default but +** can be fully or partially disabled using a call to [sqlite3_config()] +** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD], +** or [SQLITE_CONFIG_SERIALIZED]. ^(The return value of the +** sqlite3_threadsafe() function shows only the compile-time setting of +** thread safety, not any run-time changes to that setting made by +** sqlite3_config(). In other words, the return value from sqlite3_threadsafe() +** is unchanged by calls to sqlite3_config().)^ +** +** See the [threading mode] documentation for additional information. +*/ +SQLITE_API int sqlite3_threadsafe(void); + +/* +** CAPI3REF: Database Connection Handle +** KEYWORDS: {database connection} {database connections} +** +** Each open SQLite database is represented by a pointer to an instance of +** the opaque structure named "sqlite3". It is useful to think of an sqlite3 +** pointer as an object. The [sqlite3_open()], [sqlite3_open16()], and +** [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()] +** and [sqlite3_close_v2()] are its destructors. There are many other +** interfaces (such as +** [sqlite3_prepare_v2()], [sqlite3_create_function()], and +** [sqlite3_busy_timeout()] to name but three) that are methods on an +** sqlite3 object. +*/ +typedef struct sqlite3 sqlite3; + +/* +** CAPI3REF: 64-Bit Integer Types +** KEYWORDS: sqlite_int64 sqlite_uint64 +** +** Because there is no cross-platform way to specify 64-bit integer types +** SQLite includes typedefs for 64-bit signed and unsigned integers. +** +** The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions. +** The sqlite_int64 and sqlite_uint64 types are supported for backwards +** compatibility only. +** +** ^The sqlite3_int64 and sqlite_int64 types can store integer values +** between -9223372036854775808 and +9223372036854775807 inclusive. ^The +** sqlite3_uint64 and sqlite_uint64 types can store integer values +** between 0 and +18446744073709551615 inclusive. +*/ +#ifdef SQLITE_INT64_TYPE + typedef SQLITE_INT64_TYPE sqlite_int64; +# ifdef SQLITE_UINT64_TYPE + typedef SQLITE_UINT64_TYPE sqlite_uint64; +# else + typedef unsigned SQLITE_INT64_TYPE sqlite_uint64; +# endif +#elif defined(_MSC_VER) || defined(__BORLANDC__) + typedef __int64 sqlite_int64; + typedef unsigned __int64 sqlite_uint64; +#else + typedef long long int sqlite_int64; + typedef unsigned long long int sqlite_uint64; +#endif +typedef sqlite_int64 sqlite3_int64; +typedef sqlite_uint64 sqlite3_uint64; + +/* +** If compiling for a processor that lacks floating point support, +** substitute integer for floating-point. +*/ +#ifdef SQLITE_OMIT_FLOATING_POINT +# define double sqlite3_int64 +#endif + +/* +** CAPI3REF: Closing A Database Connection +** DESTRUCTOR: sqlite3 +** +** ^The sqlite3_close() and sqlite3_close_v2() routines are destructors +** for the [sqlite3] object. +** ^Calls to sqlite3_close() and sqlite3_close_v2() return [SQLITE_OK] if +** the [sqlite3] object is successfully destroyed and all associated +** resources are deallocated. +** +** ^If the database connection is associated with unfinalized prepared +** statements or unfinished sqlite3_backup objects then sqlite3_close() +** will leave the database connection open and return [SQLITE_BUSY]. +** ^If sqlite3_close_v2() is called with unfinalized prepared statements +** and/or unfinished sqlite3_backups, then the database connection becomes +** an unusable "zombie" which will automatically be deallocated when the +** last prepared statement is finalized or the last sqlite3_backup is +** finished. The sqlite3_close_v2() interface is intended for use with +** host languages that are garbage collected, and where the order in which +** destructors are called is arbitrary. +** +** Applications should [sqlite3_finalize | finalize] all [prepared statements], +** [sqlite3_blob_close | close] all [BLOB handles], and +** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated +** with the [sqlite3] object prior to attempting to close the object. ^If +** sqlite3_close_v2() is called on a [database connection] that still has +** outstanding [prepared statements], [BLOB handles], and/or +** [sqlite3_backup] objects then it returns [SQLITE_OK] and the deallocation +** of resources is deferred until all [prepared statements], [BLOB handles], +** and [sqlite3_backup] objects are also destroyed. +** +** ^If an [sqlite3] object is destroyed while a transaction is open, +** the transaction is automatically rolled back. +** +** The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)] +** must be either a NULL +** pointer or an [sqlite3] object pointer obtained +** from [sqlite3_open()], [sqlite3_open16()], or +** [sqlite3_open_v2()], and not previously closed. +** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer +** argument is a harmless no-op. +*/ +SQLITE_API int sqlite3_close(sqlite3*); +SQLITE_API int sqlite3_close_v2(sqlite3*); + +/* +** The type for a callback function. +** This is legacy and deprecated. It is included for historical +** compatibility and is not documented. +*/ +typedef int (*sqlite3_callback)(void*,int,char**, char**); + +/* +** CAPI3REF: One-Step Query Execution Interface +** METHOD: sqlite3 +** +** The sqlite3_exec() interface is a convenience wrapper around +** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()], +** that allows an application to run multiple statements of SQL +** without having to use a lot of C code. +** +** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded, +** semicolon-separate SQL statements passed into its 2nd argument, +** in the context of the [database connection] passed in as its 1st +** argument. ^If the callback function of the 3rd argument to +** sqlite3_exec() is not NULL, then it is invoked for each result row +** coming out of the evaluated SQL statements. ^The 4th argument to +** sqlite3_exec() is relayed through to the 1st argument of each +** callback invocation. ^If the callback pointer to sqlite3_exec() +** is NULL, then no callback is ever invoked and result rows are +** ignored. +** +** ^If an error occurs while evaluating the SQL statements passed into +** sqlite3_exec(), then execution of the current statement stops and +** subsequent statements are skipped. ^If the 5th parameter to sqlite3_exec() +** is not NULL then any error message is written into memory obtained +** from [sqlite3_malloc()] and passed back through the 5th parameter. +** To avoid memory leaks, the application should invoke [sqlite3_free()] +** on error message strings returned through the 5th parameter of +** sqlite3_exec() after the error message string is no longer needed. +** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors +** occur, then sqlite3_exec() sets the pointer in its 5th parameter to +** NULL before returning. +** +** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec() +** routine returns SQLITE_ABORT without invoking the callback again and +** without running any subsequent SQL statements. +** +** ^The 2nd argument to the sqlite3_exec() callback function is the +** number of columns in the result. ^The 3rd argument to the sqlite3_exec() +** callback is an array of pointers to strings obtained as if from +** [sqlite3_column_text()], one for each column. ^If an element of a +** result row is NULL then the corresponding string pointer for the +** sqlite3_exec() callback is a NULL pointer. ^The 4th argument to the +** sqlite3_exec() callback is an array of pointers to strings where each +** entry represents the name of corresponding result column as obtained +** from [sqlite3_column_name()]. +** +** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer +** to an empty string, or a pointer that contains only whitespace and/or +** SQL comments, then no SQL statements are evaluated and the database +** is not changed. +** +** Restrictions: +** +**
    +**
  • The application must ensure that the 1st parameter to sqlite3_exec() +** is a valid and open [database connection]. +**
  • The application must not close the [database connection] specified by +** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running. +**
  • The application must not modify the SQL statement text passed into +** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running. +**
+*/ +SQLITE_API int sqlite3_exec( + sqlite3*, /* An open database */ + const char *sql, /* SQL to be evaluated */ + int (*callback)(void*,int,char**,char**), /* Callback function */ + void *, /* 1st argument to callback */ + char **errmsg /* Error msg written here */ +); + +/* +** CAPI3REF: Result Codes +** KEYWORDS: {result code definitions} +** +** Many SQLite functions return an integer result code from the set shown +** here in order to indicate success or failure. +** +** New error codes may be added in future versions of SQLite. +** +** See also: [extended result code definitions] +*/ +#define SQLITE_OK 0 /* Successful result */ +/* beginning-of-error-codes */ +#define SQLITE_ERROR 1 /* Generic error */ +#define SQLITE_INTERNAL 2 /* Internal logic error in SQLite */ +#define SQLITE_PERM 3 /* Access permission denied */ +#define SQLITE_ABORT 4 /* Callback routine requested an abort */ +#define SQLITE_BUSY 5 /* The database file is locked */ +#define SQLITE_LOCKED 6 /* A table in the database is locked */ +#define SQLITE_NOMEM 7 /* A malloc() failed */ +#define SQLITE_READONLY 8 /* Attempt to write a readonly database */ +#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite3_interrupt()*/ +#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */ +#define SQLITE_CORRUPT 11 /* The database disk image is malformed */ +#define SQLITE_NOTFOUND 12 /* Unknown opcode in sqlite3_file_control() */ +#define SQLITE_FULL 13 /* Insertion failed because database is full */ +#define SQLITE_CANTOPEN 14 /* Unable to open the database file */ +#define SQLITE_PROTOCOL 15 /* Database lock protocol error */ +#define SQLITE_EMPTY 16 /* Internal use only */ +#define SQLITE_SCHEMA 17 /* The database schema changed */ +#define SQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */ +#define SQLITE_CONSTRAINT 19 /* Abort due to constraint violation */ +#define SQLITE_MISMATCH 20 /* Data type mismatch */ +#define SQLITE_MISUSE 21 /* Library used incorrectly */ +#define SQLITE_NOLFS 22 /* Uses OS features not supported on host */ +#define SQLITE_AUTH 23 /* Authorization denied */ +#define SQLITE_FORMAT 24 /* Not used */ +#define SQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */ +#define SQLITE_NOTADB 26 /* File opened that is not a database file */ +#define SQLITE_NOTICE 27 /* Notifications from sqlite3_log() */ +#define SQLITE_WARNING 28 /* Warnings from sqlite3_log() */ +#define SQLITE_ROW 100 /* sqlite3_step() has another row ready */ +#define SQLITE_DONE 101 /* sqlite3_step() has finished executing */ +/* end-of-error-codes */ + +/* +** CAPI3REF: Extended Result Codes +** KEYWORDS: {extended result code definitions} +** +** In its default configuration, SQLite API routines return one of 30 integer +** [result codes]. However, experience has shown that many of +** these result codes are too coarse-grained. They do not provide as +** much information about problems as programmers might like. In an effort to +** address this, newer versions of SQLite (version 3.3.8 [dateof:3.3.8] +** and later) include +** support for additional result codes that provide more detailed information +** about errors. These [extended result codes] are enabled or disabled +** on a per database connection basis using the +** [sqlite3_extended_result_codes()] API. Or, the extended code for +** the most recent error can be obtained using +** [sqlite3_extended_errcode()]. +*/ +#define SQLITE_ERROR_MISSING_COLLSEQ (SQLITE_ERROR | (1<<8)) +#define SQLITE_ERROR_RETRY (SQLITE_ERROR | (2<<8)) +#define SQLITE_IOERR_READ (SQLITE_IOERR | (1<<8)) +#define SQLITE_IOERR_SHORT_READ (SQLITE_IOERR | (2<<8)) +#define SQLITE_IOERR_WRITE (SQLITE_IOERR | (3<<8)) +#define SQLITE_IOERR_FSYNC (SQLITE_IOERR | (4<<8)) +#define SQLITE_IOERR_DIR_FSYNC (SQLITE_IOERR | (5<<8)) +#define SQLITE_IOERR_TRUNCATE (SQLITE_IOERR | (6<<8)) +#define SQLITE_IOERR_FSTAT (SQLITE_IOERR | (7<<8)) +#define SQLITE_IOERR_UNLOCK (SQLITE_IOERR | (8<<8)) +#define SQLITE_IOERR_RDLOCK (SQLITE_IOERR | (9<<8)) +#define SQLITE_IOERR_DELETE (SQLITE_IOERR | (10<<8)) +#define SQLITE_IOERR_BLOCKED (SQLITE_IOERR | (11<<8)) +#define SQLITE_IOERR_NOMEM (SQLITE_IOERR | (12<<8)) +#define SQLITE_IOERR_ACCESS (SQLITE_IOERR | (13<<8)) +#define SQLITE_IOERR_CHECKRESERVEDLOCK (SQLITE_IOERR | (14<<8)) +#define SQLITE_IOERR_LOCK (SQLITE_IOERR | (15<<8)) +#define SQLITE_IOERR_CLOSE (SQLITE_IOERR | (16<<8)) +#define SQLITE_IOERR_DIR_CLOSE (SQLITE_IOERR | (17<<8)) +#define SQLITE_IOERR_SHMOPEN (SQLITE_IOERR | (18<<8)) +#define SQLITE_IOERR_SHMSIZE (SQLITE_IOERR | (19<<8)) +#define SQLITE_IOERR_SHMLOCK (SQLITE_IOERR | (20<<8)) +#define SQLITE_IOERR_SHMMAP (SQLITE_IOERR | (21<<8)) +#define SQLITE_IOERR_SEEK (SQLITE_IOERR | (22<<8)) +#define SQLITE_IOERR_DELETE_NOENT (SQLITE_IOERR | (23<<8)) +#define SQLITE_IOERR_MMAP (SQLITE_IOERR | (24<<8)) +#define SQLITE_IOERR_GETTEMPPATH (SQLITE_IOERR | (25<<8)) +#define SQLITE_IOERR_CONVPATH (SQLITE_IOERR | (26<<8)) +#define SQLITE_IOERR_VNODE (SQLITE_IOERR | (27<<8)) +#define SQLITE_IOERR_AUTH (SQLITE_IOERR | (28<<8)) +#define SQLITE_IOERR_BEGIN_ATOMIC (SQLITE_IOERR | (29<<8)) +#define SQLITE_IOERR_COMMIT_ATOMIC (SQLITE_IOERR | (30<<8)) +#define SQLITE_IOERR_ROLLBACK_ATOMIC (SQLITE_IOERR | (31<<8)) +#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) +#define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2<<8)) +#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) +#define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2<<8)) +#define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) +#define SQLITE_CANTOPEN_ISDIR (SQLITE_CANTOPEN | (2<<8)) +#define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8)) +#define SQLITE_CANTOPEN_CONVPATH (SQLITE_CANTOPEN | (4<<8)) +#define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8)) +#define SQLITE_CORRUPT_SEQUENCE (SQLITE_CORRUPT | (2<<8)) +#define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8)) +#define SQLITE_READONLY_CANTLOCK (SQLITE_READONLY | (2<<8)) +#define SQLITE_READONLY_ROLLBACK (SQLITE_READONLY | (3<<8)) +#define SQLITE_READONLY_DBMOVED (SQLITE_READONLY | (4<<8)) +#define SQLITE_READONLY_CANTINIT (SQLITE_READONLY | (5<<8)) +#define SQLITE_READONLY_DIRECTORY (SQLITE_READONLY | (6<<8)) +#define SQLITE_ABORT_ROLLBACK (SQLITE_ABORT | (2<<8)) +#define SQLITE_CONSTRAINT_CHECK (SQLITE_CONSTRAINT | (1<<8)) +#define SQLITE_CONSTRAINT_COMMITHOOK (SQLITE_CONSTRAINT | (2<<8)) +#define SQLITE_CONSTRAINT_FOREIGNKEY (SQLITE_CONSTRAINT | (3<<8)) +#define SQLITE_CONSTRAINT_FUNCTION (SQLITE_CONSTRAINT | (4<<8)) +#define SQLITE_CONSTRAINT_NOTNULL (SQLITE_CONSTRAINT | (5<<8)) +#define SQLITE_CONSTRAINT_PRIMARYKEY (SQLITE_CONSTRAINT | (6<<8)) +#define SQLITE_CONSTRAINT_TRIGGER (SQLITE_CONSTRAINT | (7<<8)) +#define SQLITE_CONSTRAINT_UNIQUE (SQLITE_CONSTRAINT | (8<<8)) +#define SQLITE_CONSTRAINT_VTAB (SQLITE_CONSTRAINT | (9<<8)) +#define SQLITE_CONSTRAINT_ROWID (SQLITE_CONSTRAINT |(10<<8)) +#define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8)) +#define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8)) +#define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8)) +#define SQLITE_AUTH_USER (SQLITE_AUTH | (1<<8)) +#define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1<<8)) + +/* +** CAPI3REF: Flags For File Open Operations +** +** These bit values are intended for use in the +** 3rd parameter to the [sqlite3_open_v2()] interface and +** in the 4th parameter to the [sqlite3_vfs.xOpen] method. +*/ +#define SQLITE_OPEN_READONLY 0x00000001 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_READWRITE 0x00000002 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_CREATE 0x00000004 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_DELETEONCLOSE 0x00000008 /* VFS only */ +#define SQLITE_OPEN_EXCLUSIVE 0x00000010 /* VFS only */ +#define SQLITE_OPEN_AUTOPROXY 0x00000020 /* VFS only */ +#define SQLITE_OPEN_URI 0x00000040 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_MEMORY 0x00000080 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_MAIN_DB 0x00000100 /* VFS only */ +#define SQLITE_OPEN_TEMP_DB 0x00000200 /* VFS only */ +#define SQLITE_OPEN_TRANSIENT_DB 0x00000400 /* VFS only */ +#define SQLITE_OPEN_MAIN_JOURNAL 0x00000800 /* VFS only */ +#define SQLITE_OPEN_TEMP_JOURNAL 0x00001000 /* VFS only */ +#define SQLITE_OPEN_SUBJOURNAL 0x00002000 /* VFS only */ +#define SQLITE_OPEN_MASTER_JOURNAL 0x00004000 /* VFS only */ +#define SQLITE_OPEN_NOMUTEX 0x00008000 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_FULLMUTEX 0x00010000 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_SHAREDCACHE 0x00020000 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_PRIVATECACHE 0x00040000 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_WAL 0x00080000 /* VFS only */ + +/* Reserved: 0x00F00000 */ + +/* +** CAPI3REF: Device Characteristics +** +** The xDeviceCharacteristics method of the [sqlite3_io_methods] +** object returns an integer which is a vector of these +** bit values expressing I/O characteristics of the mass storage +** device that holds the file that the [sqlite3_io_methods] +** refers to. +** +** The SQLITE_IOCAP_ATOMIC property means that all writes of +** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values +** mean that writes of blocks that are nnn bytes in size and +** are aligned to an address which is an integer multiple of +** nnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value means +** that when data is appended to a file, the data is appended +** first then the size of the file is extended, never the other +** way around. The SQLITE_IOCAP_SEQUENTIAL property means that +** information is written to disk in the same order as calls +** to xWrite(). The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that +** after reboot following a crash or power loss, the only bytes in a +** file that were written at the application level might have changed +** and that adjacent bytes, even bytes within the same sector are +** guaranteed to be unchanged. The SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN +** flag indicates that a file cannot be deleted when open. The +** SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on +** read-only media and cannot be changed even by processes with +** elevated privileges. +** +** The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying +** filesystem supports doing multiple write operations atomically when those +** write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and +** [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. +*/ +#define SQLITE_IOCAP_ATOMIC 0x00000001 +#define SQLITE_IOCAP_ATOMIC512 0x00000002 +#define SQLITE_IOCAP_ATOMIC1K 0x00000004 +#define SQLITE_IOCAP_ATOMIC2K 0x00000008 +#define SQLITE_IOCAP_ATOMIC4K 0x00000010 +#define SQLITE_IOCAP_ATOMIC8K 0x00000020 +#define SQLITE_IOCAP_ATOMIC16K 0x00000040 +#define SQLITE_IOCAP_ATOMIC32K 0x00000080 +#define SQLITE_IOCAP_ATOMIC64K 0x00000100 +#define SQLITE_IOCAP_SAFE_APPEND 0x00000200 +#define SQLITE_IOCAP_SEQUENTIAL 0x00000400 +#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800 +#define SQLITE_IOCAP_POWERSAFE_OVERWRITE 0x00001000 +#define SQLITE_IOCAP_IMMUTABLE 0x00002000 +#define SQLITE_IOCAP_BATCH_ATOMIC 0x00004000 + +/* +** CAPI3REF: File Locking Levels +** +** SQLite uses one of these integer values as the second +** argument to calls it makes to the xLock() and xUnlock() methods +** of an [sqlite3_io_methods] object. +*/ +#define SQLITE_LOCK_NONE 0 +#define SQLITE_LOCK_SHARED 1 +#define SQLITE_LOCK_RESERVED 2 +#define SQLITE_LOCK_PENDING 3 +#define SQLITE_LOCK_EXCLUSIVE 4 + +/* +** CAPI3REF: Synchronization Type Flags +** +** When SQLite invokes the xSync() method of an +** [sqlite3_io_methods] object it uses a combination of +** these integer values as the second argument. +** +** When the SQLITE_SYNC_DATAONLY flag is used, it means that the +** sync operation only needs to flush data to mass storage. Inode +** information need not be flushed. If the lower four bits of the flag +** equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics. +** If the lower four bits equal SQLITE_SYNC_FULL, that means +** to use Mac OS X style fullsync instead of fsync(). +** +** Do not confuse the SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags +** with the [PRAGMA synchronous]=NORMAL and [PRAGMA synchronous]=FULL +** settings. The [synchronous pragma] determines when calls to the +** xSync VFS method occur and applies uniformly across all platforms. +** The SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags determine how +** energetic or rigorous or forceful the sync operations are and +** only make a difference on Mac OSX for the default SQLite code. +** (Third-party VFS implementations might also make the distinction +** between SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL, but among the +** operating systems natively supported by SQLite, only Mac OSX +** cares about the difference.) +*/ +#define SQLITE_SYNC_NORMAL 0x00002 +#define SQLITE_SYNC_FULL 0x00003 +#define SQLITE_SYNC_DATAONLY 0x00010 + +/* +** CAPI3REF: OS Interface Open File Handle +** +** An [sqlite3_file] object represents an open file in the +** [sqlite3_vfs | OS interface layer]. Individual OS interface +** implementations will +** want to subclass this object by appending additional fields +** for their own use. The pMethods entry is a pointer to an +** [sqlite3_io_methods] object that defines methods for performing +** I/O operations on the open file. +*/ +typedef struct sqlite3_file sqlite3_file; +struct sqlite3_file { + const struct sqlite3_io_methods *pMethods; /* Methods for an open file */ +}; + +/* +** CAPI3REF: OS Interface File Virtual Methods Object +** +** Every file opened by the [sqlite3_vfs.xOpen] method populates an +** [sqlite3_file] object (or, more commonly, a subclass of the +** [sqlite3_file] object) with a pointer to an instance of this object. +** This object defines the methods used to perform various operations +** against the open file represented by the [sqlite3_file] object. +** +** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element +** to a non-NULL pointer, then the sqlite3_io_methods.xClose method +** may be invoked even if the [sqlite3_vfs.xOpen] reported that it failed. The +** only way to prevent a call to xClose following a failed [sqlite3_vfs.xOpen] +** is for the [sqlite3_vfs.xOpen] to set the sqlite3_file.pMethods element +** to NULL. +** +** The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or +** [SQLITE_SYNC_FULL]. The first choice is the normal fsync(). +** The second choice is a Mac OS X style fullsync. The [SQLITE_SYNC_DATAONLY] +** flag may be ORed in to indicate that only the data of the file +** and not its inode needs to be synced. +** +** The integer values to xLock() and xUnlock() are one of +**
    +**
  • [SQLITE_LOCK_NONE], +**
  • [SQLITE_LOCK_SHARED], +**
  • [SQLITE_LOCK_RESERVED], +**
  • [SQLITE_LOCK_PENDING], or +**
  • [SQLITE_LOCK_EXCLUSIVE]. +**
+** xLock() increases the lock. xUnlock() decreases the lock. +** The xCheckReservedLock() method checks whether any database connection, +** either in this process or in some other process, is holding a RESERVED, +** PENDING, or EXCLUSIVE lock on the file. It returns true +** if such a lock exists and false otherwise. +** +** The xFileControl() method is a generic interface that allows custom +** VFS implementations to directly control an open file using the +** [sqlite3_file_control()] interface. The second "op" argument is an +** integer opcode. The third argument is a generic pointer intended to +** point to a structure that may contain arguments or space in which to +** write return values. Potential uses for xFileControl() might be +** functions to enable blocking locks with timeouts, to change the +** locking strategy (for example to use dot-file locks), to inquire +** about the status of a lock, or to break stale locks. The SQLite +** core reserves all opcodes less than 100 for its own use. +** A [file control opcodes | list of opcodes] less than 100 is available. +** Applications that define a custom xFileControl method should use opcodes +** greater than 100 to avoid conflicts. VFS implementations should +** return [SQLITE_NOTFOUND] for file control opcodes that they do not +** recognize. +** +** The xSectorSize() method returns the sector size of the +** device that underlies the file. The sector size is the +** minimum write that can be performed without disturbing +** other bytes in the file. The xDeviceCharacteristics() +** method returns a bit vector describing behaviors of the +** underlying device: +** +**
    +**
  • [SQLITE_IOCAP_ATOMIC] +**
  • [SQLITE_IOCAP_ATOMIC512] +**
  • [SQLITE_IOCAP_ATOMIC1K] +**
  • [SQLITE_IOCAP_ATOMIC2K] +**
  • [SQLITE_IOCAP_ATOMIC4K] +**
  • [SQLITE_IOCAP_ATOMIC8K] +**
  • [SQLITE_IOCAP_ATOMIC16K] +**
  • [SQLITE_IOCAP_ATOMIC32K] +**
  • [SQLITE_IOCAP_ATOMIC64K] +**
  • [SQLITE_IOCAP_SAFE_APPEND] +**
  • [SQLITE_IOCAP_SEQUENTIAL] +**
  • [SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN] +**
  • [SQLITE_IOCAP_POWERSAFE_OVERWRITE] +**
  • [SQLITE_IOCAP_IMMUTABLE] +**
  • [SQLITE_IOCAP_BATCH_ATOMIC] +**
+** +** The SQLITE_IOCAP_ATOMIC property means that all writes of +** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values +** mean that writes of blocks that are nnn bytes in size and +** are aligned to an address which is an integer multiple of +** nnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value means +** that when data is appended to a file, the data is appended +** first then the size of the file is extended, never the other +** way around. The SQLITE_IOCAP_SEQUENTIAL property means that +** information is written to disk in the same order as calls +** to xWrite(). +** +** If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill +** in the unread portions of the buffer with zeros. A VFS that +** fails to zero-fill short reads might seem to work. However, +** failure to zero-fill short reads will eventually lead to +** database corruption. +*/ +typedef struct sqlite3_io_methods sqlite3_io_methods; +struct sqlite3_io_methods { + int iVersion; + int (*xClose)(sqlite3_file*); + int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst); + int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst); + int (*xTruncate)(sqlite3_file*, sqlite3_int64 size); + int (*xSync)(sqlite3_file*, int flags); + int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize); + int (*xLock)(sqlite3_file*, int); + int (*xUnlock)(sqlite3_file*, int); + int (*xCheckReservedLock)(sqlite3_file*, int *pResOut); + int (*xFileControl)(sqlite3_file*, int op, void *pArg); + int (*xSectorSize)(sqlite3_file*); + int (*xDeviceCharacteristics)(sqlite3_file*); + /* Methods above are valid for version 1 */ + int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**); + int (*xShmLock)(sqlite3_file*, int offset, int n, int flags); + void (*xShmBarrier)(sqlite3_file*); + int (*xShmUnmap)(sqlite3_file*, int deleteFlag); + /* Methods above are valid for version 2 */ + int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp); + int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p); + /* Methods above are valid for version 3 */ + /* Additional methods may be added in future releases */ +}; + +/* +** CAPI3REF: Standard File Control Opcodes +** KEYWORDS: {file control opcodes} {file control opcode} +** +** These integer constants are opcodes for the xFileControl method +** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()] +** interface. +** +**
    +**
  • [[SQLITE_FCNTL_LOCKSTATE]] +** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This +** opcode causes the xFileControl method to write the current state of +** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], +** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) +** into an integer that the pArg argument points to. This capability +** is used during testing and is only available when the SQLITE_TEST +** compile-time option is used. +** +**
  • [[SQLITE_FCNTL_SIZE_HINT]] +** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS +** layer a hint of how large the database file will grow to be during the +** current transaction. This hint is not guaranteed to be accurate but it +** is often close. The underlying VFS might choose to preallocate database +** file space based on this hint in order to help writes to the database +** file run faster. +** +**
  • [[SQLITE_FCNTL_CHUNK_SIZE]] +** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS +** extends and truncates the database file in chunks of a size specified +** by the user. The fourth argument to [sqlite3_file_control()] should +** point to an integer (type int) containing the new chunk-size to use +** for the nominated database. Allocating database file space in large +** chunks (say 1MB at a time), may reduce file-system fragmentation and +** improve performance on some systems. +** +**
  • [[SQLITE_FCNTL_FILE_POINTER]] +** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer +** to the [sqlite3_file] object associated with a particular database +** connection. See also [SQLITE_FCNTL_JOURNAL_POINTER]. +** +**
  • [[SQLITE_FCNTL_JOURNAL_POINTER]] +** The [SQLITE_FCNTL_JOURNAL_POINTER] opcode is used to obtain a pointer +** to the [sqlite3_file] object associated with the journal file (either +** the [rollback journal] or the [write-ahead log]) for a particular database +** connection. See also [SQLITE_FCNTL_FILE_POINTER]. +** +**
  • [[SQLITE_FCNTL_SYNC_OMITTED]] +** No longer in use. +** +**
  • [[SQLITE_FCNTL_SYNC]] +** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and +** sent to the VFS immediately before the xSync method is invoked on a +** database file descriptor. Or, if the xSync method is not invoked +** because the user has configured SQLite with +** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place +** of the xSync method. In most cases, the pointer argument passed with +** this file-control is NULL. However, if the database file is being synced +** as part of a multi-database commit, the argument points to a nul-terminated +** string containing the transactions master-journal file name. VFSes that +** do not need this signal should silently ignore this opcode. Applications +** should not call [sqlite3_file_control()] with this opcode as doing so may +** disrupt the operation of the specialized VFSes that do require it. +** +**
  • [[SQLITE_FCNTL_COMMIT_PHASETWO]] +** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite +** and sent to the VFS after a transaction has been committed immediately +** but before the database is unlocked. VFSes that do not need this signal +** should silently ignore this opcode. Applications should not call +** [sqlite3_file_control()] with this opcode as doing so may disrupt the +** operation of the specialized VFSes that do require it. +** +**
  • [[SQLITE_FCNTL_WIN32_AV_RETRY]] +** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic +** retry counts and intervals for certain disk I/O operations for the +** windows [VFS] in order to provide robustness in the presence of +** anti-virus programs. By default, the windows VFS will retry file read, +** file write, and file delete operations up to 10 times, with a delay +** of 25 milliseconds before the first retry and with the delay increasing +** by an additional 25 milliseconds with each subsequent retry. This +** opcode allows these two values (10 retries and 25 milliseconds of delay) +** to be adjusted. The values are changed for all database connections +** within the same process. The argument is a pointer to an array of two +** integers where the first integer is the new retry count and the second +** integer is the delay. If either integer is negative, then the setting +** is not changed but instead the prior value of that setting is written +** into the array entry, allowing the current retry settings to be +** interrogated. The zDbName parameter is ignored. +** +**
  • [[SQLITE_FCNTL_PERSIST_WAL]] +** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the +** persistent [WAL | Write Ahead Log] setting. By default, the auxiliary +** write ahead log and shared memory files used for transaction control +** are automatically deleted when the latest connection to the database +** closes. Setting persistent WAL mode causes those files to persist after +** close. Persisting the files is useful when other processes that do not +** have write permission on the directory containing the database file want +** to read the database file, as the WAL and shared memory files must exist +** in order for the database to be readable. The fourth parameter to +** [sqlite3_file_control()] for this opcode should be a pointer to an integer. +** That integer is 0 to disable persistent WAL mode or 1 to enable persistent +** WAL mode. If the integer is -1, then it is overwritten with the current +** WAL persistence setting. +** +**
  • [[SQLITE_FCNTL_POWERSAFE_OVERWRITE]] +** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the +** persistent "powersafe-overwrite" or "PSOW" setting. The PSOW setting +** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the +** xDeviceCharacteristics methods. The fourth parameter to +** [sqlite3_file_control()] for this opcode should be a pointer to an integer. +** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage +** mode. If the integer is -1, then it is overwritten with the current +** zero-damage mode setting. +** +**
  • [[SQLITE_FCNTL_OVERWRITE]] +** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening +** a write transaction to indicate that, unless it is rolled back for some +** reason, the entire database file will be overwritten by the current +** transaction. This is used by VACUUM operations. +** +**
  • [[SQLITE_FCNTL_VFSNAME]] +** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of +** all [VFSes] in the VFS stack. The names are of all VFS shims and the +** final bottom-level VFS are written into memory obtained from +** [sqlite3_malloc()] and the result is stored in the char* variable +** that the fourth parameter of [sqlite3_file_control()] points to. +** The caller is responsible for freeing the memory when done. As with +** all file-control actions, there is no guarantee that this will actually +** do anything. Callers should initialize the char* variable to a NULL +** pointer in case this file-control is not implemented. This file-control +** is intended for diagnostic use only. +** +**
  • [[SQLITE_FCNTL_VFS_POINTER]] +** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level +** [VFSes] currently in use. ^(The argument X in +** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be +** of type "[sqlite3_vfs] **". This opcodes will set *X +** to a pointer to the top-level VFS.)^ +** ^When there are multiple VFS shims in the stack, this opcode finds the +** upper-most shim only. +** +**
  • [[SQLITE_FCNTL_PRAGMA]] +** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] +** file control is sent to the open [sqlite3_file] object corresponding +** to the database file to which the pragma statement refers. ^The argument +** to the [SQLITE_FCNTL_PRAGMA] file control is an array of +** pointers to strings (char**) in which the second element of the array +** is the name of the pragma and the third element is the argument to the +** pragma or NULL if the pragma has no argument. ^The handler for an +** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element +** of the char** argument point to a string obtained from [sqlite3_mprintf()] +** or the equivalent and that string will become the result of the pragma or +** the error message if the pragma fails. ^If the +** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal +** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA] +** file control returns [SQLITE_OK], then the parser assumes that the +** VFS has handled the PRAGMA itself and the parser generates a no-op +** prepared statement if result string is NULL, or that returns a copy +** of the result string if the string is non-NULL. +** ^If the [SQLITE_FCNTL_PRAGMA] file control returns +** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means +** that the VFS encountered an error while handling the [PRAGMA] and the +** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA] +** file control occurs at the beginning of pragma statement analysis and so +** it is able to override built-in [PRAGMA] statements. +** +**
  • [[SQLITE_FCNTL_BUSYHANDLER]] +** ^The [SQLITE_FCNTL_BUSYHANDLER] +** file-control may be invoked by SQLite on the database file handle +** shortly after it is opened in order to provide a custom VFS with access +** to the connections busy-handler callback. The argument is of type (void **) +** - an array of two (void *) values. The first (void *) actually points +** to a function of type (int (*)(void *)). In order to invoke the connections +** busy-handler, this function should be invoked with the second (void *) in +** the array as the only argument. If it returns non-zero, then the operation +** should be retried. If it returns zero, the custom VFS should abandon the +** current operation. +** +**
  • [[SQLITE_FCNTL_TEMPFILENAME]] +** ^Application can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control +** to have SQLite generate a +** temporary filename using the same algorithm that is followed to generate +** temporary filenames for TEMP tables and other internal uses. The +** argument should be a char** which will be filled with the filename +** written into memory obtained from [sqlite3_malloc()]. The caller should +** invoke [sqlite3_free()] on the result to avoid a memory leak. +** +**
  • [[SQLITE_FCNTL_MMAP_SIZE]] +** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the +** maximum number of bytes that will be used for memory-mapped I/O. +** The argument is a pointer to a value of type sqlite3_int64 that +** is an advisory maximum number of bytes in the file to memory map. The +** pointer is overwritten with the old value. The limit is not changed if +** the value originally pointed to is negative, and so the current limit +** can be queried by passing in a pointer to a negative number. This +** file-control is used internally to implement [PRAGMA mmap_size]. +** +**
  • [[SQLITE_FCNTL_TRACE]] +** The [SQLITE_FCNTL_TRACE] file control provides advisory information +** to the VFS about what the higher layers of the SQLite stack are doing. +** This file control is used by some VFS activity tracing [shims]. +** The argument is a zero-terminated string. Higher layers in the +** SQLite stack may generate instances of this file control if +** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled. +** +**
  • [[SQLITE_FCNTL_HAS_MOVED]] +** The [SQLITE_FCNTL_HAS_MOVED] file control interprets its argument as a +** pointer to an integer and it writes a boolean into that integer depending +** on whether or not the file has been renamed, moved, or deleted since it +** was first opened. +** +**
  • [[SQLITE_FCNTL_WIN32_GET_HANDLE]] +** The [SQLITE_FCNTL_WIN32_GET_HANDLE] opcode can be used to obtain the +** underlying native file handle associated with a file handle. This file +** control interprets its argument as a pointer to a native file handle and +** writes the resulting value there. +** +**
  • [[SQLITE_FCNTL_WIN32_SET_HANDLE]] +** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging. This +** opcode causes the xFileControl method to swap the file handle with the one +** pointed to by the pArg argument. This capability is used during testing +** and only needs to be supported when SQLITE_TEST is defined. +** +**
  • [[SQLITE_FCNTL_WAL_BLOCK]] +** The [SQLITE_FCNTL_WAL_BLOCK] is a signal to the VFS layer that it might +** be advantageous to block on the next WAL lock if the lock is not immediately +** available. The WAL subsystem issues this signal during rare +** circumstances in order to fix a problem with priority inversion. +** Applications should not use this file-control. +** +**
  • [[SQLITE_FCNTL_ZIPVFS]] +** The [SQLITE_FCNTL_ZIPVFS] opcode is implemented by zipvfs only. All other +** VFS should return SQLITE_NOTFOUND for this opcode. +** +**
  • [[SQLITE_FCNTL_RBU]] +** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by +** the RBU extension only. All other VFS should return SQLITE_NOTFOUND for +** this opcode. +** +**
  • [[SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]] +** If the [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] opcode returns SQLITE_OK, then +** the file descriptor is placed in "batch write mode", which +** means all subsequent write operations will be deferred and done +** atomically at the next [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. Systems +** that do not support batch atomic writes will return SQLITE_NOTFOUND. +** ^Following a successful SQLITE_FCNTL_BEGIN_ATOMIC_WRITE and prior to +** the closing [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] or +** [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE], SQLite will make +** no VFS interface calls on the same [sqlite3_file] file descriptor +** except for calls to the xWrite method and the xFileControl method +** with [SQLITE_FCNTL_SIZE_HINT]. +** +**
  • [[SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]] +** The [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be performed atomically. +** This file control returns [SQLITE_OK] if and only if the writes were +** all performed successfully and have been committed to persistent storage. +** ^Regardless of whether or not it is successful, this file control takes +** the file descriptor out of batch write mode so that all subsequent +** write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_COMMIT_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. +** +**
  • [[SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE]] +** The [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back. +** ^This file control takes the file descriptor out of batch write mode +** so that all subsequent write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. +** +**
  • [[SQLITE_FCNTL_LOCK_TIMEOUT]] +** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode causes attempts to obtain +** a file lock using the xLock or xShmLock methods of the VFS to wait +** for up to M milliseconds before failing, where M is the single +** unsigned integer parameter. +**
+*/ +#define SQLITE_FCNTL_LOCKSTATE 1 +#define SQLITE_FCNTL_GET_LOCKPROXYFILE 2 +#define SQLITE_FCNTL_SET_LOCKPROXYFILE 3 +#define SQLITE_FCNTL_LAST_ERRNO 4 +#define SQLITE_FCNTL_SIZE_HINT 5 +#define SQLITE_FCNTL_CHUNK_SIZE 6 +#define SQLITE_FCNTL_FILE_POINTER 7 +#define SQLITE_FCNTL_SYNC_OMITTED 8 +#define SQLITE_FCNTL_WIN32_AV_RETRY 9 +#define SQLITE_FCNTL_PERSIST_WAL 10 +#define SQLITE_FCNTL_OVERWRITE 11 +#define SQLITE_FCNTL_VFSNAME 12 +#define SQLITE_FCNTL_POWERSAFE_OVERWRITE 13 +#define SQLITE_FCNTL_PRAGMA 14 +#define SQLITE_FCNTL_BUSYHANDLER 15 +#define SQLITE_FCNTL_TEMPFILENAME 16 +#define SQLITE_FCNTL_MMAP_SIZE 18 +#define SQLITE_FCNTL_TRACE 19 +#define SQLITE_FCNTL_HAS_MOVED 20 +#define SQLITE_FCNTL_SYNC 21 +#define SQLITE_FCNTL_COMMIT_PHASETWO 22 +#define SQLITE_FCNTL_WIN32_SET_HANDLE 23 +#define SQLITE_FCNTL_WAL_BLOCK 24 +#define SQLITE_FCNTL_ZIPVFS 25 +#define SQLITE_FCNTL_RBU 26 +#define SQLITE_FCNTL_VFS_POINTER 27 +#define SQLITE_FCNTL_JOURNAL_POINTER 28 +#define SQLITE_FCNTL_WIN32_GET_HANDLE 29 +#define SQLITE_FCNTL_PDB 30 +#define SQLITE_FCNTL_BEGIN_ATOMIC_WRITE 31 +#define SQLITE_FCNTL_COMMIT_ATOMIC_WRITE 32 +#define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE 33 +#define SQLITE_FCNTL_LOCK_TIMEOUT 34 + +/* deprecated names */ +#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE +#define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE +#define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO + + +/* +** CAPI3REF: Mutex Handle +** +** The mutex module within SQLite defines [sqlite3_mutex] to be an +** abstract type for a mutex object. The SQLite core never looks +** at the internal representation of an [sqlite3_mutex]. It only +** deals with pointers to the [sqlite3_mutex] object. +** +** Mutexes are created using [sqlite3_mutex_alloc()]. +*/ +typedef struct sqlite3_mutex sqlite3_mutex; + +/* +** CAPI3REF: Loadable Extension Thunk +** +** A pointer to the opaque sqlite3_api_routines structure is passed as +** the third parameter to entry points of [loadable extensions]. This +** structure must be typedefed in order to work around compiler warnings +** on some platforms. +*/ +typedef struct sqlite3_api_routines sqlite3_api_routines; + +/* +** CAPI3REF: OS Interface Object +** +** An instance of the sqlite3_vfs object defines the interface between +** the SQLite core and the underlying operating system. The "vfs" +** in the name of the object stands for "virtual file system". See +** the [VFS | VFS documentation] for further information. +** +** The VFS interface is sometimes extended by adding new methods onto +** the end. Each time such an extension occurs, the iVersion field +** is incremented. The iVersion value started out as 1 in +** SQLite [version 3.5.0] on [dateof:3.5.0], then increased to 2 +** with SQLite [version 3.7.0] on [dateof:3.7.0], and then increased +** to 3 with SQLite [version 3.7.6] on [dateof:3.7.6]. Additional fields +** may be appended to the sqlite3_vfs object and the iVersion value +** may increase again in future versions of SQLite. +** Note that the structure +** of the sqlite3_vfs object changes in the transition from +** SQLite [version 3.5.9] to [version 3.6.0] on [dateof:3.6.0] +** and yet the iVersion field was not modified. +** +** The szOsFile field is the size of the subclassed [sqlite3_file] +** structure used by this VFS. mxPathname is the maximum length of +** a pathname in this VFS. +** +** Registered sqlite3_vfs objects are kept on a linked list formed by +** the pNext pointer. The [sqlite3_vfs_register()] +** and [sqlite3_vfs_unregister()] interfaces manage this list +** in a thread-safe way. The [sqlite3_vfs_find()] interface +** searches the list. Neither the application code nor the VFS +** implementation should use the pNext pointer. +** +** The pNext field is the only field in the sqlite3_vfs +** structure that SQLite will ever modify. SQLite will only access +** or modify this field while holding a particular static mutex. +** The application should never modify anything within the sqlite3_vfs +** object once the object has been registered. +** +** The zName field holds the name of the VFS module. The name must +** be unique across all VFS modules. +** +** [[sqlite3_vfs.xOpen]] +** ^SQLite guarantees that the zFilename parameter to xOpen +** is either a NULL pointer or string obtained +** from xFullPathname() with an optional suffix added. +** ^If a suffix is added to the zFilename parameter, it will +** consist of a single "-" character followed by no more than +** 11 alphanumeric and/or "-" characters. +** ^SQLite further guarantees that +** the string will be valid and unchanged until xClose() is +** called. Because of the previous sentence, +** the [sqlite3_file] can safely store a pointer to the +** filename if it needs to remember the filename for some reason. +** If the zFilename parameter to xOpen is a NULL pointer then xOpen +** must invent its own temporary name for the file. ^Whenever the +** xFilename parameter is NULL it will also be the case that the +** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE]. +** +** The flags argument to xOpen() includes all bits set in +** the flags argument to [sqlite3_open_v2()]. Or if [sqlite3_open()] +** or [sqlite3_open16()] is used, then flags includes at least +** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. +** If xOpen() opens a file read-only then it sets *pOutFlags to +** include [SQLITE_OPEN_READONLY]. Other bits in *pOutFlags may be set. +** +** ^(SQLite will also add one of the following flags to the xOpen() +** call, depending on the object being opened: +** +**
    +**
  • [SQLITE_OPEN_MAIN_DB] +**
  • [SQLITE_OPEN_MAIN_JOURNAL] +**
  • [SQLITE_OPEN_TEMP_DB] +**
  • [SQLITE_OPEN_TEMP_JOURNAL] +**
  • [SQLITE_OPEN_TRANSIENT_DB] +**
  • [SQLITE_OPEN_SUBJOURNAL] +**
  • [SQLITE_OPEN_MASTER_JOURNAL] +**
  • [SQLITE_OPEN_WAL] +**
)^ +** +** The file I/O implementation can use the object type flags to +** change the way it deals with files. For example, an application +** that does not care about crash recovery or rollback might make +** the open of a journal file a no-op. Writes to this journal would +** also be no-ops, and any attempt to read the journal would return +** SQLITE_IOERR. Or the implementation might recognize that a database +** file will be doing page-aligned sector reads and writes in a random +** order and set up its I/O subsystem accordingly. +** +** SQLite might also add one of the following flags to the xOpen method: +** +**
    +**
  • [SQLITE_OPEN_DELETEONCLOSE] +**
  • [SQLITE_OPEN_EXCLUSIVE] +**
+** +** The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be +** deleted when it is closed. ^The [SQLITE_OPEN_DELETEONCLOSE] +** will be set for TEMP databases and their journals, transient +** databases, and subjournals. +** +** ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction +** with the [SQLITE_OPEN_CREATE] flag, which are both directly +** analogous to the O_EXCL and O_CREAT flags of the POSIX open() +** API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the +** SQLITE_OPEN_CREATE, is used to indicate that file should always +** be created, and that it is an error if it already exists. +** It is not used to indicate the file should be opened +** for exclusive access. +** +** ^At least szOsFile bytes of memory are allocated by SQLite +** to hold the [sqlite3_file] structure passed as the third +** argument to xOpen. The xOpen method does not have to +** allocate the structure; it should just fill it in. Note that +** the xOpen method must set the sqlite3_file.pMethods to either +** a valid [sqlite3_io_methods] object or to NULL. xOpen must do +** this even if the open fails. SQLite expects that the sqlite3_file.pMethods +** element will be valid after xOpen returns regardless of the success +** or failure of the xOpen call. +** +** [[sqlite3_vfs.xAccess]] +** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS] +** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to +** test whether a file is readable and writable, or [SQLITE_ACCESS_READ] +** to test whether a file is at least readable. The file can be a +** directory. +** +** ^SQLite will always allocate at least mxPathname+1 bytes for the +** output buffer xFullPathname. The exact size of the output buffer +** is also passed as a parameter to both methods. If the output buffer +** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is +** handled as a fatal error by SQLite, vfs implementations should endeavor +** to prevent this by setting mxPathname to a sufficiently large value. +** +** The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64() +** interfaces are not strictly a part of the filesystem, but they are +** included in the VFS structure for completeness. +** The xRandomness() function attempts to return nBytes bytes +** of good-quality randomness into zOut. The return value is +** the actual number of bytes of randomness obtained. +** The xSleep() method causes the calling thread to sleep for at +** least the number of microseconds given. ^The xCurrentTime() +** method returns a Julian Day Number for the current date and time as +** a floating point value. +** ^The xCurrentTimeInt64() method returns, as an integer, the Julian +** Day Number multiplied by 86400000 (the number of milliseconds in +** a 24-hour day). +** ^SQLite will use the xCurrentTimeInt64() method to get the current +** date and time if that method is available (if iVersion is 2 or +** greater and the function pointer is not NULL) and will fall back +** to xCurrentTime() if xCurrentTimeInt64() is unavailable. +** +** ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces +** are not used by the SQLite core. These optional interfaces are provided +** by some VFSes to facilitate testing of the VFS code. By overriding +** system calls with functions under its control, a test program can +** simulate faults and error conditions that would otherwise be difficult +** or impossible to induce. The set of system calls that can be overridden +** varies from one VFS to another, and from one version of the same VFS to the +** next. Applications that use these interfaces must be prepared for any +** or all of these interfaces to be NULL or for their behavior to change +** from one release to the next. Applications must not attempt to access +** any of these methods if the iVersion of the VFS is less than 3. +*/ +typedef struct sqlite3_vfs sqlite3_vfs; +typedef void (*sqlite3_syscall_ptr)(void); +struct sqlite3_vfs { + int iVersion; /* Structure version number (currently 3) */ + int szOsFile; /* Size of subclassed sqlite3_file */ + int mxPathname; /* Maximum file pathname length */ + sqlite3_vfs *pNext; /* Next registered VFS */ + const char *zName; /* Name of this virtual file system */ + void *pAppData; /* Pointer to application-specific data */ + int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, + int flags, int *pOutFlags); + int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir); + int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut); + int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut); + void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename); + void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); + void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void); + void (*xDlClose)(sqlite3_vfs*, void*); + int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut); + int (*xSleep)(sqlite3_vfs*, int microseconds); + int (*xCurrentTime)(sqlite3_vfs*, double*); + int (*xGetLastError)(sqlite3_vfs*, int, char *); + /* + ** The methods above are in version 1 of the sqlite_vfs object + ** definition. Those that follow are added in version 2 or later + */ + int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); + /* + ** The methods above are in versions 1 and 2 of the sqlite_vfs object. + ** Those below are for version 3 and greater. + */ + int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr); + sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName); + const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName); + /* + ** The methods above are in versions 1 through 3 of the sqlite_vfs object. + ** New fields may be appended in future versions. The iVersion + ** value will increment whenever this happens. + */ +}; + +/* +** CAPI3REF: Flags for the xAccess VFS method +** +** These integer constants can be used as the third parameter to +** the xAccess method of an [sqlite3_vfs] object. They determine +** what kind of permissions the xAccess method is looking for. +** With SQLITE_ACCESS_EXISTS, the xAccess method +** simply checks whether the file exists. +** With SQLITE_ACCESS_READWRITE, the xAccess method +** checks whether the named directory is both readable and writable +** (in other words, if files can be added, removed, and renamed within +** the directory). +** The SQLITE_ACCESS_READWRITE constant is currently used only by the +** [temp_store_directory pragma], though this could change in a future +** release of SQLite. +** With SQLITE_ACCESS_READ, the xAccess method +** checks whether the file is readable. The SQLITE_ACCESS_READ constant is +** currently unused, though it might be used in a future release of +** SQLite. +*/ +#define SQLITE_ACCESS_EXISTS 0 +#define SQLITE_ACCESS_READWRITE 1 /* Used by PRAGMA temp_store_directory */ +#define SQLITE_ACCESS_READ 2 /* Unused */ + +/* +** CAPI3REF: Flags for the xShmLock VFS method +** +** These integer constants define the various locking operations +** allowed by the xShmLock method of [sqlite3_io_methods]. The +** following are the only legal combinations of flags to the +** xShmLock method: +** +**
    +**
  • SQLITE_SHM_LOCK | SQLITE_SHM_SHARED +**
  • SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE +**
  • SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED +**
  • SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE +**
+** +** When unlocking, the same SHARED or EXCLUSIVE flag must be supplied as +** was given on the corresponding lock. +** +** The xShmLock method can transition between unlocked and SHARED or +** between unlocked and EXCLUSIVE. It cannot transition between SHARED +** and EXCLUSIVE. +*/ +#define SQLITE_SHM_UNLOCK 1 +#define SQLITE_SHM_LOCK 2 +#define SQLITE_SHM_SHARED 4 +#define SQLITE_SHM_EXCLUSIVE 8 + +/* +** CAPI3REF: Maximum xShmLock index +** +** The xShmLock method on [sqlite3_io_methods] may use values +** between 0 and this upper bound as its "offset" argument. +** The SQLite core will never attempt to acquire or release a +** lock outside of this range +*/ +#define SQLITE_SHM_NLOCK 8 + + +/* +** CAPI3REF: Initialize The SQLite Library +** +** ^The sqlite3_initialize() routine initializes the +** SQLite library. ^The sqlite3_shutdown() routine +** deallocates any resources that were allocated by sqlite3_initialize(). +** These routines are designed to aid in process initialization and +** shutdown on embedded systems. Workstation applications using +** SQLite normally do not need to invoke either of these routines. +** +** A call to sqlite3_initialize() is an "effective" call if it is +** the first time sqlite3_initialize() is invoked during the lifetime of +** the process, or if it is the first time sqlite3_initialize() is invoked +** following a call to sqlite3_shutdown(). ^(Only an effective call +** of sqlite3_initialize() does any initialization. All other calls +** are harmless no-ops.)^ +** +** A call to sqlite3_shutdown() is an "effective" call if it is the first +** call to sqlite3_shutdown() since the last sqlite3_initialize(). ^(Only +** an effective call to sqlite3_shutdown() does any deinitialization. +** All other valid calls to sqlite3_shutdown() are harmless no-ops.)^ +** +** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown() +** is not. The sqlite3_shutdown() interface must only be called from a +** single thread. All open [database connections] must be closed and all +** other SQLite resources must be deallocated prior to invoking +** sqlite3_shutdown(). +** +** Among other things, ^sqlite3_initialize() will invoke +** sqlite3_os_init(). Similarly, ^sqlite3_shutdown() +** will invoke sqlite3_os_end(). +** +** ^The sqlite3_initialize() routine returns [SQLITE_OK] on success. +** ^If for some reason, sqlite3_initialize() is unable to initialize +** the library (perhaps it is unable to allocate a needed resource such +** as a mutex) it returns an [error code] other than [SQLITE_OK]. +** +** ^The sqlite3_initialize() routine is called internally by many other +** SQLite interfaces so that an application usually does not need to +** invoke sqlite3_initialize() directly. For example, [sqlite3_open()] +** calls sqlite3_initialize() so the SQLite library will be automatically +** initialized when [sqlite3_open()] is called if it has not be initialized +** already. ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT] +** compile-time option, then the automatic calls to sqlite3_initialize() +** are omitted and the application must call sqlite3_initialize() directly +** prior to using any other SQLite interface. For maximum portability, +** it is recommended that applications always invoke sqlite3_initialize() +** directly prior to using any other SQLite interface. Future releases +** of SQLite may require this. In other words, the behavior exhibited +** when SQLite is compiled with [SQLITE_OMIT_AUTOINIT] might become the +** default behavior in some future release of SQLite. +** +** The sqlite3_os_init() routine does operating-system specific +** initialization of the SQLite library. The sqlite3_os_end() +** routine undoes the effect of sqlite3_os_init(). Typical tasks +** performed by these routines include allocation or deallocation +** of static resources, initialization of global variables, +** setting up a default [sqlite3_vfs] module, or setting up +** a default configuration using [sqlite3_config()]. +** +** The application should never invoke either sqlite3_os_init() +** or sqlite3_os_end() directly. The application should only invoke +** sqlite3_initialize() and sqlite3_shutdown(). The sqlite3_os_init() +** interface is called automatically by sqlite3_initialize() and +** sqlite3_os_end() is called by sqlite3_shutdown(). Appropriate +** implementations for sqlite3_os_init() and sqlite3_os_end() +** are built into SQLite when it is compiled for Unix, Windows, or OS/2. +** When [custom builds | built for other platforms] +** (using the [SQLITE_OS_OTHER=1] compile-time +** option) the application must supply a suitable implementation for +** sqlite3_os_init() and sqlite3_os_end(). An application-supplied +** implementation of sqlite3_os_init() or sqlite3_os_end() +** must return [SQLITE_OK] on success and some other [error code] upon +** failure. +*/ +SQLITE_API int sqlite3_initialize(void); +SQLITE_API int sqlite3_shutdown(void); +SQLITE_API int sqlite3_os_init(void); +SQLITE_API int sqlite3_os_end(void); + +/* +** CAPI3REF: Configuring The SQLite Library +** +** The sqlite3_config() interface is used to make global configuration +** changes to SQLite in order to tune SQLite to the specific needs of +** the application. The default configuration is recommended for most +** applications and so this routine is usually not necessary. It is +** provided to support rare applications with unusual needs. +** +** The sqlite3_config() interface is not threadsafe. The application +** must ensure that no other SQLite interfaces are invoked by other +** threads while sqlite3_config() is running. +** +** The sqlite3_config() interface +** may only be invoked prior to library initialization using +** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()]. +** ^If sqlite3_config() is called after [sqlite3_initialize()] and before +** [sqlite3_shutdown()] then it will return SQLITE_MISUSE. +** Note, however, that ^sqlite3_config() can be called as part of the +** implementation of an application-defined [sqlite3_os_init()]. +** +** The first argument to sqlite3_config() is an integer +** [configuration option] that determines +** what property of SQLite is to be configured. Subsequent arguments +** vary depending on the [configuration option] +** in the first argument. +** +** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK]. +** ^If the option is unknown or SQLite is unable to set the option +** then this routine returns a non-zero [error code]. +*/ +SQLITE_API int sqlite3_config(int, ...); + +/* +** CAPI3REF: Configure database connections +** METHOD: sqlite3 +** +** The sqlite3_db_config() interface is used to make configuration +** changes to a [database connection]. The interface is similar to +** [sqlite3_config()] except that the changes apply to a single +** [database connection] (specified in the first argument). +** +** The second argument to sqlite3_db_config(D,V,...) is the +** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code +** that indicates what aspect of the [database connection] is being configured. +** Subsequent arguments vary depending on the configuration verb. +** +** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if +** the call is considered successful. +*/ +SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...); + +/* +** CAPI3REF: Memory Allocation Routines +** +** An instance of this object defines the interface between SQLite +** and low-level memory allocation routines. +** +** This object is used in only one place in the SQLite interface. +** A pointer to an instance of this object is the argument to +** [sqlite3_config()] when the configuration option is +** [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC]. +** By creating an instance of this object +** and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC]) +** during configuration, an application can specify an alternative +** memory allocation subsystem for SQLite to use for all of its +** dynamic memory needs. +** +** Note that SQLite comes with several [built-in memory allocators] +** that are perfectly adequate for the overwhelming majority of applications +** and that this object is only useful to a tiny minority of applications +** with specialized memory allocation requirements. This object is +** also used during testing of SQLite in order to specify an alternative +** memory allocator that simulates memory out-of-memory conditions in +** order to verify that SQLite recovers gracefully from such +** conditions. +** +** The xMalloc, xRealloc, and xFree methods must work like the +** malloc(), realloc() and free() functions from the standard C library. +** ^SQLite guarantees that the second argument to +** xRealloc is always a value returned by a prior call to xRoundup. +** +** xSize should return the allocated size of a memory allocation +** previously obtained from xMalloc or xRealloc. The allocated size +** is always at least as big as the requested size but may be larger. +** +** The xRoundup method returns what would be the allocated size of +** a memory allocation given a particular requested size. Most memory +** allocators round up memory allocations at least to the next multiple +** of 8. Some allocators round up to a larger multiple or to a power of 2. +** Every memory allocation request coming in through [sqlite3_malloc()] +** or [sqlite3_realloc()] first calls xRoundup. If xRoundup returns 0, +** that causes the corresponding memory allocation to fail. +** +** The xInit method initializes the memory allocator. For example, +** it might allocate any require mutexes or initialize internal data +** structures. The xShutdown method is invoked (indirectly) by +** [sqlite3_shutdown()] and should deallocate any resources acquired +** by xInit. The pAppData pointer is used as the only parameter to +** xInit and xShutdown. +** +** SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes +** the xInit method, so the xInit method need not be threadsafe. The +** xShutdown method is only called from [sqlite3_shutdown()] so it does +** not need to be threadsafe either. For all other methods, SQLite +** holds the [SQLITE_MUTEX_STATIC_MEM] mutex as long as the +** [SQLITE_CONFIG_MEMSTATUS] configuration option is turned on (which +** it is by default) and so the methods are automatically serialized. +** However, if [SQLITE_CONFIG_MEMSTATUS] is disabled, then the other +** methods must be threadsafe or else make their own arrangements for +** serialization. +** +** SQLite will never invoke xInit() more than once without an intervening +** call to xShutdown(). +*/ +typedef struct sqlite3_mem_methods sqlite3_mem_methods; +struct sqlite3_mem_methods { + void *(*xMalloc)(int); /* Memory allocation function */ + void (*xFree)(void*); /* Free a prior allocation */ + void *(*xRealloc)(void*,int); /* Resize an allocation */ + int (*xSize)(void*); /* Return the size of an allocation */ + int (*xRoundup)(int); /* Round up request size to allocation size */ + int (*xInit)(void*); /* Initialize the memory allocator */ + void (*xShutdown)(void*); /* Deinitialize the memory allocator */ + void *pAppData; /* Argument to xInit() and xShutdown() */ +}; + +/* +** CAPI3REF: Configuration Options +** KEYWORDS: {configuration option} +** +** These constants are the available integer configuration options that +** can be passed as the first argument to the [sqlite3_config()] interface. +** +** New configuration options may be added in future releases of SQLite. +** Existing configuration options might be discontinued. Applications +** should check the return code from [sqlite3_config()] to make sure that +** the call worked. The [sqlite3_config()] interface will return a +** non-zero [error code] if a discontinued or unsupported configuration option +** is invoked. +** +**
+** [[SQLITE_CONFIG_SINGLETHREAD]]
SQLITE_CONFIG_SINGLETHREAD
+**
There are no arguments to this option. ^This option sets the +** [threading mode] to Single-thread. In other words, it disables +** all mutexing and puts SQLite into a mode where it can only be used +** by a single thread. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** it is not possible to change the [threading mode] from its default +** value of Single-thread and so [sqlite3_config()] will return +** [SQLITE_ERROR] if called with the SQLITE_CONFIG_SINGLETHREAD +** configuration option.
+** +** [[SQLITE_CONFIG_MULTITHREAD]]
SQLITE_CONFIG_MULTITHREAD
+**
There are no arguments to this option. ^This option sets the +** [threading mode] to Multi-thread. In other words, it disables +** mutexing on [database connection] and [prepared statement] objects. +** The application is responsible for serializing access to +** [database connections] and [prepared statements]. But other mutexes +** are enabled so that SQLite will be safe to use in a multi-threaded +** environment as long as no two threads attempt to use the same +** [database connection] at the same time. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** it is not possible to set the Multi-thread [threading mode] and +** [sqlite3_config()] will return [SQLITE_ERROR] if called with the +** SQLITE_CONFIG_MULTITHREAD configuration option.
+** +** [[SQLITE_CONFIG_SERIALIZED]]
SQLITE_CONFIG_SERIALIZED
+**
There are no arguments to this option. ^This option sets the +** [threading mode] to Serialized. In other words, this option enables +** all mutexes including the recursive +** mutexes on [database connection] and [prepared statement] objects. +** In this mode (which is the default when SQLite is compiled with +** [SQLITE_THREADSAFE=1]) the SQLite library will itself serialize access +** to [database connections] and [prepared statements] so that the +** application is free to use the same [database connection] or the +** same [prepared statement] in different threads at the same time. +** ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** it is not possible to set the Serialized [threading mode] and +** [sqlite3_config()] will return [SQLITE_ERROR] if called with the +** SQLITE_CONFIG_SERIALIZED configuration option.
+** +** [[SQLITE_CONFIG_MALLOC]]
SQLITE_CONFIG_MALLOC
+**
^(The SQLITE_CONFIG_MALLOC option takes a single argument which is +** a pointer to an instance of the [sqlite3_mem_methods] structure. +** The argument specifies +** alternative low-level memory allocation routines to be used in place of +** the memory allocation routines built into SQLite.)^ ^SQLite makes +** its own private copy of the content of the [sqlite3_mem_methods] structure +** before the [sqlite3_config()] call returns.
+** +** [[SQLITE_CONFIG_GETMALLOC]]
SQLITE_CONFIG_GETMALLOC
+**
^(The SQLITE_CONFIG_GETMALLOC option takes a single argument which +** is a pointer to an instance of the [sqlite3_mem_methods] structure. +** The [sqlite3_mem_methods] +** structure is filled with the currently defined memory allocation routines.)^ +** This option can be used to overload the default memory allocation +** routines with a wrapper that simulations memory allocation failure or +** tracks memory usage, for example.
+** +** [[SQLITE_CONFIG_SMALL_MALLOC]]
SQLITE_CONFIG_SMALL_MALLOC
+**
^The SQLITE_CONFIG_SMALL_MALLOC option takes single argument of +** type int, interpreted as a boolean, which if true provides a hint to +** SQLite that it should avoid large memory allocations if possible. +** SQLite will run faster if it is free to make large memory allocations, +** but some application might prefer to run slower in exchange for +** guarantees about memory fragmentation that are possible if large +** allocations are avoided. This hint is normally off. +**
+** +** [[SQLITE_CONFIG_MEMSTATUS]]
SQLITE_CONFIG_MEMSTATUS
+**
^The SQLITE_CONFIG_MEMSTATUS option takes single argument of type int, +** interpreted as a boolean, which enables or disables the collection of +** memory allocation statistics. ^(When memory allocation statistics are +** disabled, the following SQLite interfaces become non-operational: +**
    +**
  • [sqlite3_memory_used()] +**
  • [sqlite3_memory_highwater()] +**
  • [sqlite3_soft_heap_limit64()] +**
  • [sqlite3_status64()] +**
)^ +** ^Memory allocation statistics are enabled by default unless SQLite is +** compiled with [SQLITE_DEFAULT_MEMSTATUS]=0 in which case memory +** allocation statistics are disabled by default. +**
+** +** [[SQLITE_CONFIG_SCRATCH]]
SQLITE_CONFIG_SCRATCH
+**
The SQLITE_CONFIG_SCRATCH option is no longer used. +**
+** +** [[SQLITE_CONFIG_PAGECACHE]]
SQLITE_CONFIG_PAGECACHE
+**
^The SQLITE_CONFIG_PAGECACHE option specifies a memory pool +** that SQLite can use for the database page cache with the default page +** cache implementation. +** This configuration option is a no-op if an application-define page +** cache implementation is loaded using the [SQLITE_CONFIG_PCACHE2]. +** ^There are three arguments to SQLITE_CONFIG_PAGECACHE: A pointer to +** 8-byte aligned memory (pMem), the size of each page cache line (sz), +** and the number of cache lines (N). +** The sz argument should be the size of the largest database page +** (a power of two between 512 and 65536) plus some extra bytes for each +** page header. ^The number of extra bytes needed by the page header +** can be determined using [SQLITE_CONFIG_PCACHE_HDRSZ]. +** ^It is harmless, apart from the wasted memory, +** for the sz parameter to be larger than necessary. The pMem +** argument must be either a NULL pointer or a pointer to an 8-byte +** aligned block of memory of at least sz*N bytes, otherwise +** subsequent behavior is undefined. +** ^When pMem is not NULL, SQLite will strive to use the memory provided +** to satisfy page cache needs, falling back to [sqlite3_malloc()] if +** a page cache line is larger than sz bytes or if all of the pMem buffer +** is exhausted. +** ^If pMem is NULL and N is non-zero, then each database connection +** does an initial bulk allocation for page cache memory +** from [sqlite3_malloc()] sufficient for N cache lines if N is positive or +** of -1024*N bytes if N is negative, . ^If additional +** page cache memory is needed beyond what is provided by the initial +** allocation, then SQLite goes to [sqlite3_malloc()] separately for each +** additional cache line.
+** +** [[SQLITE_CONFIG_HEAP]]
SQLITE_CONFIG_HEAP
+**
^The SQLITE_CONFIG_HEAP option specifies a static memory buffer +** that SQLite will use for all of its dynamic memory allocation needs +** beyond those provided for by [SQLITE_CONFIG_PAGECACHE]. +** ^The SQLITE_CONFIG_HEAP option is only available if SQLite is compiled +** with either [SQLITE_ENABLE_MEMSYS3] or [SQLITE_ENABLE_MEMSYS5] and returns +** [SQLITE_ERROR] if invoked otherwise. +** ^There are three arguments to SQLITE_CONFIG_HEAP: +** An 8-byte aligned pointer to the memory, +** the number of bytes in the memory buffer, and the minimum allocation size. +** ^If the first pointer (the memory pointer) is NULL, then SQLite reverts +** to using its default memory allocator (the system malloc() implementation), +** undoing any prior invocation of [SQLITE_CONFIG_MALLOC]. ^If the +** memory pointer is not NULL then the alternative memory +** allocator is engaged to handle all of SQLites memory allocation needs. +** The first pointer (the memory pointer) must be aligned to an 8-byte +** boundary or subsequent behavior of SQLite will be undefined. +** The minimum allocation size is capped at 2**12. Reasonable values +** for the minimum allocation size are 2**5 through 2**8.
+** +** [[SQLITE_CONFIG_MUTEX]]
SQLITE_CONFIG_MUTEX
+**
^(The SQLITE_CONFIG_MUTEX option takes a single argument which is a +** pointer to an instance of the [sqlite3_mutex_methods] structure. +** The argument specifies alternative low-level mutex routines to be used +** in place the mutex routines built into SQLite.)^ ^SQLite makes a copy of +** the content of the [sqlite3_mutex_methods] structure before the call to +** [sqlite3_config()] returns. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** the entire mutexing subsystem is omitted from the build and hence calls to +** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will +** return [SQLITE_ERROR].
+** +** [[SQLITE_CONFIG_GETMUTEX]]
SQLITE_CONFIG_GETMUTEX
+**
^(The SQLITE_CONFIG_GETMUTEX option takes a single argument which +** is a pointer to an instance of the [sqlite3_mutex_methods] structure. The +** [sqlite3_mutex_methods] +** structure is filled with the currently defined mutex routines.)^ +** This option can be used to overload the default mutex allocation +** routines with a wrapper used to track mutex usage for performance +** profiling or testing, for example. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** the entire mutexing subsystem is omitted from the build and hence calls to +** [sqlite3_config()] with the SQLITE_CONFIG_GETMUTEX configuration option will +** return [SQLITE_ERROR].
+** +** [[SQLITE_CONFIG_LOOKASIDE]]
SQLITE_CONFIG_LOOKASIDE
+**
^(The SQLITE_CONFIG_LOOKASIDE option takes two arguments that determine +** the default size of lookaside memory on each [database connection]. +** The first argument is the +** size of each lookaside buffer slot and the second is the number of +** slots allocated to each database connection.)^ ^(SQLITE_CONFIG_LOOKASIDE +** sets the default lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE] +** option to [sqlite3_db_config()] can be used to change the lookaside +** configuration on individual connections.)^
+** +** [[SQLITE_CONFIG_PCACHE2]]
SQLITE_CONFIG_PCACHE2
+**
^(The SQLITE_CONFIG_PCACHE2 option takes a single argument which is +** a pointer to an [sqlite3_pcache_methods2] object. This object specifies +** the interface to a custom page cache implementation.)^ +** ^SQLite makes a copy of the [sqlite3_pcache_methods2] object.
+** +** [[SQLITE_CONFIG_GETPCACHE2]]
SQLITE_CONFIG_GETPCACHE2
+**
^(The SQLITE_CONFIG_GETPCACHE2 option takes a single argument which +** is a pointer to an [sqlite3_pcache_methods2] object. SQLite copies of +** the current page cache implementation into that object.)^
+** +** [[SQLITE_CONFIG_LOG]]
SQLITE_CONFIG_LOG
+**
The SQLITE_CONFIG_LOG option is used to configure the SQLite +** global [error log]. +** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a +** function with a call signature of void(*)(void*,int,const char*), +** and a pointer to void. ^If the function pointer is not NULL, it is +** invoked by [sqlite3_log()] to process each logging event. ^If the +** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op. +** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is +** passed through as the first parameter to the application-defined logger +** function whenever that function is invoked. ^The second parameter to +** the logger function is a copy of the first parameter to the corresponding +** [sqlite3_log()] call and is intended to be a [result code] or an +** [extended result code]. ^The third parameter passed to the logger is +** log message after formatting via [sqlite3_snprintf()]. +** The SQLite logging interface is not reentrant; the logger function +** supplied by the application must not invoke any SQLite interface. +** In a multi-threaded application, the application-defined logger +** function must be threadsafe.
+** +** [[SQLITE_CONFIG_URI]]
SQLITE_CONFIG_URI +**
^(The SQLITE_CONFIG_URI option takes a single argument of type int. +** If non-zero, then URI handling is globally enabled. If the parameter is zero, +** then URI handling is globally disabled.)^ ^If URI handling is globally +** enabled, all filenames passed to [sqlite3_open()], [sqlite3_open_v2()], +** [sqlite3_open16()] or +** specified as part of [ATTACH] commands are interpreted as URIs, regardless +** of whether or not the [SQLITE_OPEN_URI] flag is set when the database +** connection is opened. ^If it is globally disabled, filenames are +** only interpreted as URIs if the SQLITE_OPEN_URI flag is set when the +** database connection is opened. ^(By default, URI handling is globally +** disabled. The default value may be changed by compiling with the +** [SQLITE_USE_URI] symbol defined.)^ +** +** [[SQLITE_CONFIG_COVERING_INDEX_SCAN]]
SQLITE_CONFIG_COVERING_INDEX_SCAN +**
^The SQLITE_CONFIG_COVERING_INDEX_SCAN option takes a single integer +** argument which is interpreted as a boolean in order to enable or disable +** the use of covering indices for full table scans in the query optimizer. +** ^The default setting is determined +** by the [SQLITE_ALLOW_COVERING_INDEX_SCAN] compile-time option, or is "on" +** if that compile-time option is omitted. +** The ability to disable the use of covering indices for full table scans +** is because some incorrectly coded legacy applications might malfunction +** when the optimization is enabled. Providing the ability to +** disable the optimization allows the older, buggy application code to work +** without change even with newer versions of SQLite. +** +** [[SQLITE_CONFIG_PCACHE]] [[SQLITE_CONFIG_GETPCACHE]] +**
SQLITE_CONFIG_PCACHE and SQLITE_CONFIG_GETPCACHE +**
These options are obsolete and should not be used by new code. +** They are retained for backwards compatibility but are now no-ops. +**
+** +** [[SQLITE_CONFIG_SQLLOG]] +**
SQLITE_CONFIG_SQLLOG +**
This option is only available if sqlite is compiled with the +** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should +** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int). +** The second should be of type (void*). The callback is invoked by the library +** in three separate circumstances, identified by the value passed as the +** fourth parameter. If the fourth parameter is 0, then the database connection +** passed as the second argument has just been opened. The third argument +** points to a buffer containing the name of the main database file. If the +** fourth parameter is 1, then the SQL statement that the third parameter +** points to has just been executed. Or, if the fourth parameter is 2, then +** the connection being passed as the second parameter is being closed. The +** third parameter is passed NULL In this case. An example of using this +** configuration option can be seen in the "test_sqllog.c" source file in +** the canonical SQLite source tree.
+** +** [[SQLITE_CONFIG_MMAP_SIZE]] +**
SQLITE_CONFIG_MMAP_SIZE +**
^SQLITE_CONFIG_MMAP_SIZE takes two 64-bit integer (sqlite3_int64) values +** that are the default mmap size limit (the default setting for +** [PRAGMA mmap_size]) and the maximum allowed mmap size limit. +** ^The default setting can be overridden by each database connection using +** either the [PRAGMA mmap_size] command, or by using the +** [SQLITE_FCNTL_MMAP_SIZE] file control. ^(The maximum allowed mmap size +** will be silently truncated if necessary so that it does not exceed the +** compile-time maximum mmap size set by the +** [SQLITE_MAX_MMAP_SIZE] compile-time option.)^ +** ^If either argument to this option is negative, then that argument is +** changed to its compile-time default. +** +** [[SQLITE_CONFIG_WIN32_HEAPSIZE]] +**
SQLITE_CONFIG_WIN32_HEAPSIZE +**
^The SQLITE_CONFIG_WIN32_HEAPSIZE option is only available if SQLite is +** compiled for Windows with the [SQLITE_WIN32_MALLOC] pre-processor macro +** defined. ^SQLITE_CONFIG_WIN32_HEAPSIZE takes a 32-bit unsigned integer value +** that specifies the maximum size of the created heap. +** +** [[SQLITE_CONFIG_PCACHE_HDRSZ]] +**
SQLITE_CONFIG_PCACHE_HDRSZ +**
^The SQLITE_CONFIG_PCACHE_HDRSZ option takes a single parameter which +** is a pointer to an integer and writes into that integer the number of extra +** bytes per page required for each page in [SQLITE_CONFIG_PAGECACHE]. +** The amount of extra space required can change depending on the compiler, +** target platform, and SQLite version. +** +** [[SQLITE_CONFIG_PMASZ]] +**
SQLITE_CONFIG_PMASZ +**
^The SQLITE_CONFIG_PMASZ option takes a single parameter which +** is an unsigned integer and sets the "Minimum PMA Size" for the multithreaded +** sorter to that integer. The default minimum PMA Size is set by the +** [SQLITE_SORTER_PMASZ] compile-time option. New threads are launched +** to help with sort operations when multithreaded sorting +** is enabled (using the [PRAGMA threads] command) and the amount of content +** to be sorted exceeds the page size times the minimum of the +** [PRAGMA cache_size] setting and this value. +** +** [[SQLITE_CONFIG_STMTJRNL_SPILL]] +**
SQLITE_CONFIG_STMTJRNL_SPILL +**
^The SQLITE_CONFIG_STMTJRNL_SPILL option takes a single parameter which +** becomes the [statement journal] spill-to-disk threshold. +** [Statement journals] are held in memory until their size (in bytes) +** exceeds this threshold, at which point they are written to disk. +** Or if the threshold is -1, statement journals are always held +** exclusively in memory. +** Since many statement journals never become large, setting the spill +** threshold to a value such as 64KiB can greatly reduce the amount of +** I/O required to support statement rollback. +** The default value for this setting is controlled by the +** [SQLITE_STMTJRNL_SPILL] compile-time option. +** +** [[SQLITE_CONFIG_SORTERREF_SIZE]] +**
SQLITE_CONFIG_SORTERREF_SIZE +**
The SQLITE_CONFIG_SORTERREF_SIZE option accepts a single parameter +** of type (int) - the new value of the sorter-reference size threshold. +** Usually, when SQLite uses an external sort to order records according +** to an ORDER BY clause, all fields required by the caller are present in the +** sorted records. However, if SQLite determines based on the declared type +** of a table column that its values are likely to be very large - larger +** than the configured sorter-reference size threshold - then a reference +** is stored in each sorted record and the required column values loaded +** from the database as records are returned in sorted order. The default +** value for this option is to never use this optimization. Specifying a +** negative value for this option restores the default behaviour. +** This option is only available if SQLite is compiled with the +** [SQLITE_ENABLE_SORTER_REFERENCES] compile-time option. +**
+*/ +#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */ +#define SQLITE_CONFIG_MULTITHREAD 2 /* nil */ +#define SQLITE_CONFIG_SERIALIZED 3 /* nil */ +#define SQLITE_CONFIG_MALLOC 4 /* sqlite3_mem_methods* */ +#define SQLITE_CONFIG_GETMALLOC 5 /* sqlite3_mem_methods* */ +#define SQLITE_CONFIG_SCRATCH 6 /* No longer used */ +#define SQLITE_CONFIG_PAGECACHE 7 /* void*, int sz, int N */ +#define SQLITE_CONFIG_HEAP 8 /* void*, int nByte, int min */ +#define SQLITE_CONFIG_MEMSTATUS 9 /* boolean */ +#define SQLITE_CONFIG_MUTEX 10 /* sqlite3_mutex_methods* */ +#define SQLITE_CONFIG_GETMUTEX 11 /* sqlite3_mutex_methods* */ +/* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ +#define SQLITE_CONFIG_LOOKASIDE 13 /* int int */ +#define SQLITE_CONFIG_PCACHE 14 /* no-op */ +#define SQLITE_CONFIG_GETPCACHE 15 /* no-op */ +#define SQLITE_CONFIG_LOG 16 /* xFunc, void* */ +#define SQLITE_CONFIG_URI 17 /* int */ +#define SQLITE_CONFIG_PCACHE2 18 /* sqlite3_pcache_methods2* */ +#define SQLITE_CONFIG_GETPCACHE2 19 /* sqlite3_pcache_methods2* */ +#define SQLITE_CONFIG_COVERING_INDEX_SCAN 20 /* int */ +#define SQLITE_CONFIG_SQLLOG 21 /* xSqllog, void* */ +#define SQLITE_CONFIG_MMAP_SIZE 22 /* sqlite3_int64, sqlite3_int64 */ +#define SQLITE_CONFIG_WIN32_HEAPSIZE 23 /* int nByte */ +#define SQLITE_CONFIG_PCACHE_HDRSZ 24 /* int *psz */ +#define SQLITE_CONFIG_PMASZ 25 /* unsigned int szPma */ +#define SQLITE_CONFIG_STMTJRNL_SPILL 26 /* int nByte */ +#define SQLITE_CONFIG_SMALL_MALLOC 27 /* boolean */ +#define SQLITE_CONFIG_SORTERREF_SIZE 28 /* int nByte */ + +/* +** CAPI3REF: Database Connection Configuration Options +** +** These constants are the available integer configuration options that +** can be passed as the second argument to the [sqlite3_db_config()] interface. +** +** New configuration options may be added in future releases of SQLite. +** Existing configuration options might be discontinued. Applications +** should check the return code from [sqlite3_db_config()] to make sure that +** the call worked. ^The [sqlite3_db_config()] interface will return a +** non-zero [error code] if a discontinued or unsupported configuration option +** is invoked. +** +**
+**
SQLITE_DBCONFIG_LOOKASIDE
+**
^This option takes three additional arguments that determine the +** [lookaside memory allocator] configuration for the [database connection]. +** ^The first argument (the third parameter to [sqlite3_db_config()] is a +** pointer to a memory buffer to use for lookaside memory. +** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb +** may be NULL in which case SQLite will allocate the +** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the +** size of each lookaside buffer slot. ^The third argument is the number of +** slots. The size of the buffer in the first argument must be greater than +** or equal to the product of the second and third arguments. The buffer +** must be aligned to an 8-byte boundary. ^If the second argument to +** SQLITE_DBCONFIG_LOOKASIDE is not a multiple of 8, it is internally +** rounded down to the next smaller multiple of 8. ^(The lookaside memory +** configuration for a database connection can only be changed when that +** connection is not currently using lookaside memory, or in other words +** when the "current value" returned by +** [sqlite3_db_status](D,[SQLITE_CONFIG_LOOKASIDE],...) is zero. +** Any attempt to change the lookaside memory configuration when lookaside +** memory is in use leaves the configuration unchanged and returns +** [SQLITE_BUSY].)^
+** +**
SQLITE_DBCONFIG_ENABLE_FKEY
+**
^This option is used to enable or disable the enforcement of +** [foreign key constraints]. There should be two additional arguments. +** The first argument is an integer which is 0 to disable FK enforcement, +** positive to enable FK enforcement or negative to leave FK enforcement +** unchanged. The second parameter is a pointer to an integer into which +** is written 0 or 1 to indicate whether FK enforcement is off or on +** following this call. The second parameter may be a NULL pointer, in +** which case the FK enforcement setting is not reported back.
+** +**
SQLITE_DBCONFIG_ENABLE_TRIGGER
+**
^This option is used to enable or disable [CREATE TRIGGER | triggers]. +** There should be two additional arguments. +** The first argument is an integer which is 0 to disable triggers, +** positive to enable triggers or negative to leave the setting unchanged. +** The second parameter is a pointer to an integer into which +** is written 0 or 1 to indicate whether triggers are disabled or enabled +** following this call. The second parameter may be a NULL pointer, in +** which case the trigger setting is not reported back.
+** +**
SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
+**
^This option is used to enable or disable the two-argument +** version of the [fts3_tokenizer()] function which is part of the +** [FTS3] full-text search engine extension. +** There should be two additional arguments. +** The first argument is an integer which is 0 to disable fts3_tokenizer() or +** positive to enable fts3_tokenizer() or negative to leave the setting +** unchanged. +** The second parameter is a pointer to an integer into which +** is written 0 or 1 to indicate whether fts3_tokenizer is disabled or enabled +** following this call. The second parameter may be a NULL pointer, in +** which case the new setting is not reported back.
+** +**
SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION
+**
^This option is used to enable or disable the [sqlite3_load_extension()] +** interface independently of the [load_extension()] SQL function. +** The [sqlite3_enable_load_extension()] API enables or disables both the +** C-API [sqlite3_load_extension()] and the SQL function [load_extension()]. +** There should be two additional arguments. +** When the first argument to this interface is 1, then only the C-API is +** enabled and the SQL function remains disabled. If the first argument to +** this interface is 0, then both the C-API and the SQL function are disabled. +** If the first argument is -1, then no changes are made to state of either the +** C-API or the SQL function. +** The second parameter is a pointer to an integer into which +** is written 0 or 1 to indicate whether [sqlite3_load_extension()] interface +** is disabled or enabled following this call. The second parameter may +** be a NULL pointer, in which case the new setting is not reported back. +**
+** +**
SQLITE_DBCONFIG_MAINDBNAME
+**
^This option is used to change the name of the "main" database +** schema. ^The sole argument is a pointer to a constant UTF8 string +** which will become the new schema name in place of "main". ^SQLite +** does not make a copy of the new main schema name string, so the application +** must ensure that the argument passed into this DBCONFIG option is unchanged +** until after the database connection closes. +**
+** +**
SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE
+**
Usually, when a database in wal mode is closed or detached from a +** database handle, SQLite checks if this will mean that there are now no +** connections at all to the database. If so, it performs a checkpoint +** operation before closing the connection. This option may be used to +** override this behaviour. The first parameter passed to this operation +** is an integer - positive to disable checkpoints-on-close, or zero (the +** default) to enable them, and negative to leave the setting unchanged. +** The second parameter is a pointer to an integer +** into which is written 0 or 1 to indicate whether checkpoints-on-close +** have been disabled - 0 if they are not disabled, 1 if they are. +**
+** +**
SQLITE_DBCONFIG_ENABLE_QPSG
+**
^(The SQLITE_DBCONFIG_ENABLE_QPSG option activates or deactivates +** the [query planner stability guarantee] (QPSG). When the QPSG is active, +** a single SQL query statement will always use the same algorithm regardless +** of values of [bound parameters].)^ The QPSG disables some query optimizations +** that look at the values of bound parameters, which can make some queries +** slower. But the QPSG has the advantage of more predictable behavior. With +** the QPSG active, SQLite will always use the same query plan in the field as +** was used during testing in the lab. +** The first argument to this setting is an integer which is 0 to disable +** the QPSG, positive to enable QPSG, or negative to leave the setting +** unchanged. The second parameter is a pointer to an integer into which +** is written 0 or 1 to indicate whether the QPSG is disabled or enabled +** following this call. +**
+** +**
SQLITE_DBCONFIG_TRIGGER_EQP
+**
By default, the output of EXPLAIN QUERY PLAN commands does not +** include output for any operations performed by trigger programs. This +** option is used to set or clear (the default) a flag that governs this +** behavior. The first parameter passed to this operation is an integer - +** positive to enable output for trigger programs, or zero to disable it, +** or negative to leave the setting unchanged. +** The second parameter is a pointer to an integer into which is written +** 0 or 1 to indicate whether output-for-triggers has been disabled - 0 if +** it is not disabled, 1 if it is. +**
+** +**
SQLITE_DBCONFIG_RESET_DATABASE
+**
Set the SQLITE_DBCONFIG_RESET_DATABASE flag and then run +** [VACUUM] in order to reset a database back to an empty database +** with no schema and no content. The following process works even for +** a badly corrupted database file: +**
    +**
  1. sqlite3_db_config(db, SQLITE_DBCONFIG_RESET_DATABASE, 1, 0); +**
  2. [sqlite3_exec](db, "[VACUUM]", 0, 0, 0); +**
  3. sqlite3_db_config(db, SQLITE_DBCONFIG_RESET_DATABASE, 0, 0); +**
+** Because resetting a database is destructive and irreversible, the +** process requires the use of this obscure API and multiple steps to help +** ensure that it does not happen by accident. +**
+**
+*/ +#define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */ +#define SQLITE_DBCONFIG_LOOKASIDE 1001 /* void* int int */ +#define SQLITE_DBCONFIG_ENABLE_FKEY 1002 /* int int* */ +#define SQLITE_DBCONFIG_ENABLE_TRIGGER 1003 /* int int* */ +#define SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER 1004 /* int int* */ +#define SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION 1005 /* int int* */ +#define SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE 1006 /* int int* */ +#define SQLITE_DBCONFIG_ENABLE_QPSG 1007 /* int int* */ +#define SQLITE_DBCONFIG_TRIGGER_EQP 1008 /* int int* */ +#define SQLITE_DBCONFIG_RESET_DATABASE 1009 /* int int* */ +#define SQLITE_DBCONFIG_MAX 1009 /* Largest DBCONFIG */ + +/* +** CAPI3REF: Enable Or Disable Extended Result Codes +** METHOD: sqlite3 +** +** ^The sqlite3_extended_result_codes() routine enables or disables the +** [extended result codes] feature of SQLite. ^The extended result +** codes are disabled by default for historical compatibility. +*/ +SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff); + +/* +** CAPI3REF: Last Insert Rowid +** METHOD: sqlite3 +** +** ^Each entry in most SQLite tables (except for [WITHOUT ROWID] tables) +** has a unique 64-bit signed +** integer key called the [ROWID | "rowid"]. ^The rowid is always available +** as an undeclared column named ROWID, OID, or _ROWID_ as long as those +** names are not also used by explicitly declared columns. ^If +** the table has a column of type [INTEGER PRIMARY KEY] then that column +** is another alias for the rowid. +** +** ^The sqlite3_last_insert_rowid(D) interface usually returns the [rowid] of +** the most recent successful [INSERT] into a rowid table or [virtual table] +** on database connection D. ^Inserts into [WITHOUT ROWID] tables are not +** recorded. ^If no successful [INSERT]s into rowid tables have ever occurred +** on the database connection D, then sqlite3_last_insert_rowid(D) returns +** zero. +** +** As well as being set automatically as rows are inserted into database +** tables, the value returned by this function may be set explicitly by +** [sqlite3_set_last_insert_rowid()] +** +** Some virtual table implementations may INSERT rows into rowid tables as +** part of committing a transaction (e.g. to flush data accumulated in memory +** to disk). In this case subsequent calls to this function return the rowid +** associated with these internal INSERT operations, which leads to +** unintuitive results. Virtual table implementations that do write to rowid +** tables in this way can avoid this problem by restoring the original +** rowid value using [sqlite3_set_last_insert_rowid()] before returning +** control to the user. +** +** ^(If an [INSERT] occurs within a trigger then this routine will +** return the [rowid] of the inserted row as long as the trigger is +** running. Once the trigger program ends, the value returned +** by this routine reverts to what it was before the trigger was fired.)^ +** +** ^An [INSERT] that fails due to a constraint violation is not a +** successful [INSERT] and does not change the value returned by this +** routine. ^Thus INSERT OR FAIL, INSERT OR IGNORE, INSERT OR ROLLBACK, +** and INSERT OR ABORT make no changes to the return value of this +** routine when their insertion fails. ^(When INSERT OR REPLACE +** encounters a constraint violation, it does not fail. The +** INSERT continues to completion after deleting rows that caused +** the constraint problem so INSERT OR REPLACE will always change +** the return value of this interface.)^ +** +** ^For the purposes of this routine, an [INSERT] is considered to +** be successful even if it is subsequently rolled back. +** +** This function is accessible to SQL statements via the +** [last_insert_rowid() SQL function]. +** +** If a separate thread performs a new [INSERT] on the same +** database connection while the [sqlite3_last_insert_rowid()] +** function is running and thus changes the last insert [rowid], +** then the value returned by [sqlite3_last_insert_rowid()] is +** unpredictable and might not equal either the old or the new +** last insert [rowid]. +*/ +SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); + +/* +** CAPI3REF: Set the Last Insert Rowid value. +** METHOD: sqlite3 +** +** The sqlite3_set_last_insert_rowid(D, R) method allows the application to +** set the value returned by calling sqlite3_last_insert_rowid(D) to R +** without inserting a row into the database. +*/ +SQLITE_API void sqlite3_set_last_insert_rowid(sqlite3*,sqlite3_int64); + +/* +** CAPI3REF: Count The Number Of Rows Modified +** METHOD: sqlite3 +** +** ^This function returns the number of rows modified, inserted or +** deleted by the most recently completed INSERT, UPDATE or DELETE +** statement on the database connection specified by the only parameter. +** ^Executing any other type of SQL statement does not modify the value +** returned by this function. +** +** ^Only changes made directly by the INSERT, UPDATE or DELETE statement are +** considered - auxiliary changes caused by [CREATE TRIGGER | triggers], +** [foreign key actions] or [REPLACE] constraint resolution are not counted. +** +** Changes to a view that are intercepted by +** [INSTEAD OF trigger | INSTEAD OF triggers] are not counted. ^The value +** returned by sqlite3_changes() immediately after an INSERT, UPDATE or +** DELETE statement run on a view is always zero. Only changes made to real +** tables are counted. +** +** Things are more complicated if the sqlite3_changes() function is +** executed while a trigger program is running. This may happen if the +** program uses the [changes() SQL function], or if some other callback +** function invokes sqlite3_changes() directly. Essentially: +** +**
    +**
  • ^(Before entering a trigger program the value returned by +** sqlite3_changes() function is saved. After the trigger program +** has finished, the original value is restored.)^ +** +**
  • ^(Within a trigger program each INSERT, UPDATE and DELETE +** statement sets the value returned by sqlite3_changes() +** upon completion as normal. Of course, this value will not include +** any changes performed by sub-triggers, as the sqlite3_changes() +** value will be saved and restored after each sub-trigger has run.)^ +**
+** +** ^This means that if the changes() SQL function (or similar) is used +** by the first INSERT, UPDATE or DELETE statement within a trigger, it +** returns the value as set when the calling statement began executing. +** ^If it is used by the second or subsequent such statement within a trigger +** program, the value returned reflects the number of rows modified by the +** previous INSERT, UPDATE or DELETE statement within the same trigger. +** +** See also the [sqlite3_total_changes()] interface, the +** [count_changes pragma], and the [changes() SQL function]. +** +** If a separate thread makes changes on the same database connection +** while [sqlite3_changes()] is running then the value returned +** is unpredictable and not meaningful. +*/ +SQLITE_API int sqlite3_changes(sqlite3*); + +/* +** CAPI3REF: Total Number Of Rows Modified +** METHOD: sqlite3 +** +** ^This function returns the total number of rows inserted, modified or +** deleted by all [INSERT], [UPDATE] or [DELETE] statements completed +** since the database connection was opened, including those executed as +** part of trigger programs. ^Executing any other type of SQL statement +** does not affect the value returned by sqlite3_total_changes(). +** +** ^Changes made as part of [foreign key actions] are included in the +** count, but those made as part of REPLACE constraint resolution are +** not. ^Changes to a view that are intercepted by INSTEAD OF triggers +** are not counted. +** +** See also the [sqlite3_changes()] interface, the +** [count_changes pragma], and the [total_changes() SQL function]. +** +** If a separate thread makes changes on the same database connection +** while [sqlite3_total_changes()] is running then the value +** returned is unpredictable and not meaningful. +*/ +SQLITE_API int sqlite3_total_changes(sqlite3*); + +/* +** CAPI3REF: Interrupt A Long-Running Query +** METHOD: sqlite3 +** +** ^This function causes any pending database operation to abort and +** return at its earliest opportunity. This routine is typically +** called in response to a user action such as pressing "Cancel" +** or Ctrl-C where the user wants a long query operation to halt +** immediately. +** +** ^It is safe to call this routine from a thread different from the +** thread that is currently running the database operation. But it +** is not safe to call this routine with a [database connection] that +** is closed or might close before sqlite3_interrupt() returns. +** +** ^If an SQL operation is very nearly finished at the time when +** sqlite3_interrupt() is called, then it might not have an opportunity +** to be interrupted and might continue to completion. +** +** ^An SQL operation that is interrupted will return [SQLITE_INTERRUPT]. +** ^If the interrupted SQL operation is an INSERT, UPDATE, or DELETE +** that is inside an explicit transaction, then the entire transaction +** will be rolled back automatically. +** +** ^The sqlite3_interrupt(D) call is in effect until all currently running +** SQL statements on [database connection] D complete. ^Any new SQL statements +** that are started after the sqlite3_interrupt() call and before the +** running statements reaches zero are interrupted as if they had been +** running prior to the sqlite3_interrupt() call. ^New SQL statements +** that are started after the running statement count reaches zero are +** not effected by the sqlite3_interrupt(). +** ^A call to sqlite3_interrupt(D) that occurs when there are no running +** SQL statements is a no-op and has no effect on SQL statements +** that are started after the sqlite3_interrupt() call returns. +*/ +SQLITE_API void sqlite3_interrupt(sqlite3*); + +/* +** CAPI3REF: Determine If An SQL Statement Is Complete +** +** These routines are useful during command-line input to determine if the +** currently entered text seems to form a complete SQL statement or +** if additional input is needed before sending the text into +** SQLite for parsing. ^These routines return 1 if the input string +** appears to be a complete SQL statement. ^A statement is judged to be +** complete if it ends with a semicolon token and is not a prefix of a +** well-formed CREATE TRIGGER statement. ^Semicolons that are embedded within +** string literals or quoted identifier names or comments are not +** independent tokens (they are part of the token in which they are +** embedded) and thus do not count as a statement terminator. ^Whitespace +** and comments that follow the final semicolon are ignored. +** +** ^These routines return 0 if the statement is incomplete. ^If a +** memory allocation fails, then SQLITE_NOMEM is returned. +** +** ^These routines do not parse the SQL statements thus +** will not detect syntactically incorrect SQL. +** +** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior +** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked +** automatically by sqlite3_complete16(). If that initialization fails, +** then the return value from sqlite3_complete16() will be non-zero +** regardless of whether or not the input SQL is complete.)^ +** +** The input to [sqlite3_complete()] must be a zero-terminated +** UTF-8 string. +** +** The input to [sqlite3_complete16()] must be a zero-terminated +** UTF-16 string in native byte order. +*/ +SQLITE_API int sqlite3_complete(const char *sql); +SQLITE_API int sqlite3_complete16(const void *sql); + +/* +** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors +** KEYWORDS: {busy-handler callback} {busy handler} +** METHOD: sqlite3 +** +** ^The sqlite3_busy_handler(D,X,P) routine sets a callback function X +** that might be invoked with argument P whenever +** an attempt is made to access a database table associated with +** [database connection] D when another thread +** or process has the table locked. +** The sqlite3_busy_handler() interface is used to implement +** [sqlite3_busy_timeout()] and [PRAGMA busy_timeout]. +** +** ^If the busy callback is NULL, then [SQLITE_BUSY] +** is returned immediately upon encountering the lock. ^If the busy callback +** is not NULL, then the callback might be invoked with two arguments. +** +** ^The first argument to the busy handler is a copy of the void* pointer which +** is the third argument to sqlite3_busy_handler(). ^The second argument to +** the busy handler callback is the number of times that the busy handler has +** been invoked previously for the same locking event. ^If the +** busy callback returns 0, then no additional attempts are made to +** access the database and [SQLITE_BUSY] is returned +** to the application. +** ^If the callback returns non-zero, then another attempt +** is made to access the database and the cycle repeats. +** +** The presence of a busy handler does not guarantee that it will be invoked +** when there is lock contention. ^If SQLite determines that invoking the busy +** handler could result in a deadlock, it will go ahead and return [SQLITE_BUSY] +** to the application instead of invoking the +** busy handler. +** Consider a scenario where one process is holding a read lock that +** it is trying to promote to a reserved lock and +** a second process is holding a reserved lock that it is trying +** to promote to an exclusive lock. The first process cannot proceed +** because it is blocked by the second and the second process cannot +** proceed because it is blocked by the first. If both processes +** invoke the busy handlers, neither will make any progress. Therefore, +** SQLite returns [SQLITE_BUSY] for the first process, hoping that this +** will induce the first process to release its read lock and allow +** the second process to proceed. +** +** ^The default busy callback is NULL. +** +** ^(There can only be a single busy handler defined for each +** [database connection]. Setting a new busy handler clears any +** previously set handler.)^ ^Note that calling [sqlite3_busy_timeout()] +** or evaluating [PRAGMA busy_timeout=N] will change the +** busy handler and thus clear any previously set busy handler. +** +** The busy callback should not take any actions which modify the +** database connection that invoked the busy handler. In other words, +** the busy handler is not reentrant. Any such actions +** result in undefined behavior. +** +** A busy handler must not close the database connection +** or [prepared statement] that invoked the busy handler. +*/ +SQLITE_API int sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*); + +/* +** CAPI3REF: Set A Busy Timeout +** METHOD: sqlite3 +** +** ^This routine sets a [sqlite3_busy_handler | busy handler] that sleeps +** for a specified amount of time when a table is locked. ^The handler +** will sleep multiple times until at least "ms" milliseconds of sleeping +** have accumulated. ^After at least "ms" milliseconds of sleeping, +** the handler returns 0 which causes [sqlite3_step()] to return +** [SQLITE_BUSY]. +** +** ^Calling this routine with an argument less than or equal to zero +** turns off all busy handlers. +** +** ^(There can only be a single busy handler for a particular +** [database connection] at any given moment. If another busy handler +** was defined (using [sqlite3_busy_handler()]) prior to calling +** this routine, that other busy handler is cleared.)^ +** +** See also: [PRAGMA busy_timeout] +*/ +SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); + +/* +** CAPI3REF: Convenience Routines For Running Queries +** METHOD: sqlite3 +** +** This is a legacy interface that is preserved for backwards compatibility. +** Use of this interface is not recommended. +** +** Definition: A result table is memory data structure created by the +** [sqlite3_get_table()] interface. A result table records the +** complete query results from one or more queries. +** +** The table conceptually has a number of rows and columns. But +** these numbers are not part of the result table itself. These +** numbers are obtained separately. Let N be the number of rows +** and M be the number of columns. +** +** A result table is an array of pointers to zero-terminated UTF-8 strings. +** There are (N+1)*M elements in the array. The first M pointers point +** to zero-terminated strings that contain the names of the columns. +** The remaining entries all point to query results. NULL values result +** in NULL pointers. All other values are in their UTF-8 zero-terminated +** string representation as returned by [sqlite3_column_text()]. +** +** A result table might consist of one or more memory allocations. +** It is not safe to pass a result table directly to [sqlite3_free()]. +** A result table should be deallocated using [sqlite3_free_table()]. +** +** ^(As an example of the result table format, suppose a query result +** is as follows: +** +**
+**        Name        | Age
+**        -----------------------
+**        Alice       | 43
+**        Bob         | 28
+**        Cindy       | 21
+** 
+** +** There are two column (M==2) and three rows (N==3). Thus the +** result table has 8 entries. Suppose the result table is stored +** in an array names azResult. Then azResult holds this content: +** +**
+**        azResult[0] = "Name";
+**        azResult[1] = "Age";
+**        azResult[2] = "Alice";
+**        azResult[3] = "43";
+**        azResult[4] = "Bob";
+**        azResult[5] = "28";
+**        azResult[6] = "Cindy";
+**        azResult[7] = "21";
+** 
)^ +** +** ^The sqlite3_get_table() function evaluates one or more +** semicolon-separated SQL statements in the zero-terminated UTF-8 +** string of its 2nd parameter and returns a result table to the +** pointer given in its 3rd parameter. +** +** After the application has finished with the result from sqlite3_get_table(), +** it must pass the result table pointer to sqlite3_free_table() in order to +** release the memory that was malloced. Because of the way the +** [sqlite3_malloc()] happens within sqlite3_get_table(), the calling +** function must not try to call [sqlite3_free()] directly. Only +** [sqlite3_free_table()] is able to release the memory properly and safely. +** +** The sqlite3_get_table() interface is implemented as a wrapper around +** [sqlite3_exec()]. The sqlite3_get_table() routine does not have access +** to any internal data structures of SQLite. It uses only the public +** interface defined here. As a consequence, errors that occur in the +** wrapper layer outside of the internal [sqlite3_exec()] call are not +** reflected in subsequent calls to [sqlite3_errcode()] or +** [sqlite3_errmsg()]. +*/ +SQLITE_API int sqlite3_get_table( + sqlite3 *db, /* An open database */ + const char *zSql, /* SQL to be evaluated */ + char ***pazResult, /* Results of the query */ + int *pnRow, /* Number of result rows written here */ + int *pnColumn, /* Number of result columns written here */ + char **pzErrmsg /* Error msg written here */ +); +SQLITE_API void sqlite3_free_table(char **result); + +/* +** CAPI3REF: Formatted String Printing Functions +** +** These routines are work-alikes of the "printf()" family of functions +** from the standard C library. +** These routines understand most of the common formatting options from +** the standard library printf() +** plus some additional non-standard formats ([%q], [%Q], [%w], and [%z]). +** See the [built-in printf()] documentation for details. +** +** ^The sqlite3_mprintf() and sqlite3_vmprintf() routines write their +** results into memory obtained from [sqlite3_malloc64()]. +** The strings returned by these two routines should be +** released by [sqlite3_free()]. ^Both routines return a +** NULL pointer if [sqlite3_malloc64()] is unable to allocate enough +** memory to hold the resulting string. +** +** ^(The sqlite3_snprintf() routine is similar to "snprintf()" from +** the standard C library. The result is written into the +** buffer supplied as the second parameter whose size is given by +** the first parameter. Note that the order of the +** first two parameters is reversed from snprintf().)^ This is an +** historical accident that cannot be fixed without breaking +** backwards compatibility. ^(Note also that sqlite3_snprintf() +** returns a pointer to its buffer instead of the number of +** characters actually written into the buffer.)^ We admit that +** the number of characters written would be a more useful return +** value but we cannot change the implementation of sqlite3_snprintf() +** now without breaking compatibility. +** +** ^As long as the buffer size is greater than zero, sqlite3_snprintf() +** guarantees that the buffer is always zero-terminated. ^The first +** parameter "n" is the total size of the buffer, including space for +** the zero terminator. So the longest string that can be completely +** written will be n-1 characters. +** +** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). +** +** See also: [built-in printf()], [printf() SQL function] +*/ +SQLITE_API char *sqlite3_mprintf(const char*,...); +SQLITE_API char *sqlite3_vmprintf(const char*, va_list); +SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); +SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list); + +/* +** CAPI3REF: Memory Allocation Subsystem +** +** The SQLite core uses these three routines for all of its own +** internal memory allocation needs. "Core" in the previous sentence +** does not include operating-system specific VFS implementation. The +** Windows VFS uses native malloc() and free() for some operations. +** +** ^The sqlite3_malloc() routine returns a pointer to a block +** of memory at least N bytes in length, where N is the parameter. +** ^If sqlite3_malloc() is unable to obtain sufficient free +** memory, it returns a NULL pointer. ^If the parameter N to +** sqlite3_malloc() is zero or negative then sqlite3_malloc() returns +** a NULL pointer. +** +** ^The sqlite3_malloc64(N) routine works just like +** sqlite3_malloc(N) except that N is an unsigned 64-bit integer instead +** of a signed 32-bit integer. +** +** ^Calling sqlite3_free() with a pointer previously returned +** by sqlite3_malloc() or sqlite3_realloc() releases that memory so +** that it might be reused. ^The sqlite3_free() routine is +** a no-op if is called with a NULL pointer. Passing a NULL pointer +** to sqlite3_free() is harmless. After being freed, memory +** should neither be read nor written. Even reading previously freed +** memory might result in a segmentation fault or other severe error. +** Memory corruption, a segmentation fault, or other severe error +** might result if sqlite3_free() is called with a non-NULL pointer that +** was not obtained from sqlite3_malloc() or sqlite3_realloc(). +** +** ^The sqlite3_realloc(X,N) interface attempts to resize a +** prior memory allocation X to be at least N bytes. +** ^If the X parameter to sqlite3_realloc(X,N) +** is a NULL pointer then its behavior is identical to calling +** sqlite3_malloc(N). +** ^If the N parameter to sqlite3_realloc(X,N) is zero or +** negative then the behavior is exactly the same as calling +** sqlite3_free(X). +** ^sqlite3_realloc(X,N) returns a pointer to a memory allocation +** of at least N bytes in size or NULL if insufficient memory is available. +** ^If M is the size of the prior allocation, then min(N,M) bytes +** of the prior allocation are copied into the beginning of buffer returned +** by sqlite3_realloc(X,N) and the prior allocation is freed. +** ^If sqlite3_realloc(X,N) returns NULL and N is positive, then the +** prior allocation is not freed. +** +** ^The sqlite3_realloc64(X,N) interfaces works the same as +** sqlite3_realloc(X,N) except that N is a 64-bit unsigned integer instead +** of a 32-bit signed integer. +** +** ^If X is a memory allocation previously obtained from sqlite3_malloc(), +** sqlite3_malloc64(), sqlite3_realloc(), or sqlite3_realloc64(), then +** sqlite3_msize(X) returns the size of that memory allocation in bytes. +** ^The value returned by sqlite3_msize(X) might be larger than the number +** of bytes requested when X was allocated. ^If X is a NULL pointer then +** sqlite3_msize(X) returns zero. If X points to something that is not +** the beginning of memory allocation, or if it points to a formerly +** valid memory allocation that has now been freed, then the behavior +** of sqlite3_msize(X) is undefined and possibly harmful. +** +** ^The memory returned by sqlite3_malloc(), sqlite3_realloc(), +** sqlite3_malloc64(), and sqlite3_realloc64() +** is always aligned to at least an 8 byte boundary, or to a +** 4 byte boundary if the [SQLITE_4_BYTE_ALIGNED_MALLOC] compile-time +** option is used. +** +** In SQLite version 3.5.0 and 3.5.1, it was possible to define +** the SQLITE_OMIT_MEMORY_ALLOCATION which would cause the built-in +** implementation of these routines to be omitted. That capability +** is no longer provided. Only built-in memory allocators can be used. +** +** Prior to SQLite version 3.7.10, the Windows OS interface layer called +** the system malloc() and free() directly when converting +** filenames between the UTF-8 encoding used by SQLite +** and whatever filename encoding is used by the particular Windows +** installation. Memory allocation errors were detected, but +** they were reported back as [SQLITE_CANTOPEN] or +** [SQLITE_IOERR] rather than [SQLITE_NOMEM]. +** +** The pointer arguments to [sqlite3_free()] and [sqlite3_realloc()] +** must be either NULL or else pointers obtained from a prior +** invocation of [sqlite3_malloc()] or [sqlite3_realloc()] that have +** not yet been released. +** +** The application must not read or write any part of +** a block of memory after it has been released using +** [sqlite3_free()] or [sqlite3_realloc()]. +*/ +SQLITE_API void *sqlite3_malloc(int); +SQLITE_API void *sqlite3_malloc64(sqlite3_uint64); +SQLITE_API void *sqlite3_realloc(void*, int); +SQLITE_API void *sqlite3_realloc64(void*, sqlite3_uint64); +SQLITE_API void sqlite3_free(void*); +SQLITE_API sqlite3_uint64 sqlite3_msize(void*); + +/* +** CAPI3REF: Memory Allocator Statistics +** +** SQLite provides these two interfaces for reporting on the status +** of the [sqlite3_malloc()], [sqlite3_free()], and [sqlite3_realloc()] +** routines, which form the built-in memory allocation subsystem. +** +** ^The [sqlite3_memory_used()] routine returns the number of bytes +** of memory currently outstanding (malloced but not freed). +** ^The [sqlite3_memory_highwater()] routine returns the maximum +** value of [sqlite3_memory_used()] since the high-water mark +** was last reset. ^The values returned by [sqlite3_memory_used()] and +** [sqlite3_memory_highwater()] include any overhead +** added by SQLite in its implementation of [sqlite3_malloc()], +** but not overhead added by the any underlying system library +** routines that [sqlite3_malloc()] may call. +** +** ^The memory high-water mark is reset to the current value of +** [sqlite3_memory_used()] if and only if the parameter to +** [sqlite3_memory_highwater()] is true. ^The value returned +** by [sqlite3_memory_highwater(1)] is the high-water mark +** prior to the reset. +*/ +SQLITE_API sqlite3_int64 sqlite3_memory_used(void); +SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag); + +/* +** CAPI3REF: Pseudo-Random Number Generator +** +** SQLite contains a high-quality pseudo-random number generator (PRNG) used to +** select random [ROWID | ROWIDs] when inserting new records into a table that +** already uses the largest possible [ROWID]. The PRNG is also used for +** the build-in random() and randomblob() SQL functions. This interface allows +** applications to access the same PRNG for other purposes. +** +** ^A call to this routine stores N bytes of randomness into buffer P. +** ^The P parameter can be a NULL pointer. +** +** ^If this routine has not been previously called or if the previous +** call had N less than one or a NULL pointer for P, then the PRNG is +** seeded using randomness obtained from the xRandomness method of +** the default [sqlite3_vfs] object. +** ^If the previous call to this routine had an N of 1 or more and a +** non-NULL P then the pseudo-randomness is generated +** internally and without recourse to the [sqlite3_vfs] xRandomness +** method. +*/ +SQLITE_API void sqlite3_randomness(int N, void *P); + +/* +** CAPI3REF: Compile-Time Authorization Callbacks +** METHOD: sqlite3 +** KEYWORDS: {authorizer callback} +** +** ^This routine registers an authorizer callback with a particular +** [database connection], supplied in the first argument. +** ^The authorizer callback is invoked as SQL statements are being compiled +** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()], +** [sqlite3_prepare_v3()], [sqlite3_prepare16()], [sqlite3_prepare16_v2()], +** and [sqlite3_prepare16_v3()]. ^At various +** points during the compilation process, as logic is being created +** to perform various actions, the authorizer callback is invoked to +** see if those actions are allowed. ^The authorizer callback should +** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the +** specific action but allow the SQL statement to continue to be +** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be +** rejected with an error. ^If the authorizer callback returns +** any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY] +** then the [sqlite3_prepare_v2()] or equivalent call that triggered +** the authorizer will fail with an error message. +** +** When the callback returns [SQLITE_OK], that means the operation +** requested is ok. ^When the callback returns [SQLITE_DENY], the +** [sqlite3_prepare_v2()] or equivalent call that triggered the +** authorizer will fail with an error message explaining that +** access is denied. +** +** ^The first parameter to the authorizer callback is a copy of the third +** parameter to the sqlite3_set_authorizer() interface. ^The second parameter +** to the callback is an integer [SQLITE_COPY | action code] that specifies +** the particular action to be authorized. ^The third through sixth parameters +** to the callback are either NULL pointers or zero-terminated strings +** that contain additional details about the action to be authorized. +** Applications must always be prepared to encounter a NULL pointer in any +** of the third through the sixth parameters of the authorization callback. +** +** ^If the action code is [SQLITE_READ] +** and the callback returns [SQLITE_IGNORE] then the +** [prepared statement] statement is constructed to substitute +** a NULL value in place of the table column that would have +** been read if [SQLITE_OK] had been returned. The [SQLITE_IGNORE] +** return can be used to deny an untrusted user access to individual +** columns of a table. +** ^When a table is referenced by a [SELECT] but no column values are +** extracted from that table (for example in a query like +** "SELECT count(*) FROM tab") then the [SQLITE_READ] authorizer callback +** is invoked once for that table with a column name that is an empty string. +** ^If the action code is [SQLITE_DELETE] and the callback returns +** [SQLITE_IGNORE] then the [DELETE] operation proceeds but the +** [truncate optimization] is disabled and all rows are deleted individually. +** +** An authorizer is used when [sqlite3_prepare | preparing] +** SQL statements from an untrusted source, to ensure that the SQL statements +** do not try to access data they are not allowed to see, or that they do not +** try to execute malicious statements that damage the database. For +** example, an application may allow a user to enter arbitrary +** SQL queries for evaluation by a database. But the application does +** not want the user to be able to make arbitrary changes to the +** database. An authorizer could then be put in place while the +** user-entered SQL is being [sqlite3_prepare | prepared] that +** disallows everything except [SELECT] statements. +** +** Applications that need to process SQL from untrusted sources +** might also consider lowering resource limits using [sqlite3_limit()] +** and limiting database size using the [max_page_count] [PRAGMA] +** in addition to using an authorizer. +** +** ^(Only a single authorizer can be in place on a database connection +** at a time. Each call to sqlite3_set_authorizer overrides the +** previous call.)^ ^Disable the authorizer by installing a NULL callback. +** The authorizer is disabled by default. +** +** The authorizer callback must not do anything that will modify +** the database connection that invoked the authorizer callback. +** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their +** database connections for the meaning of "modify" in this paragraph. +** +** ^When [sqlite3_prepare_v2()] is used to prepare a statement, the +** statement might be re-prepared during [sqlite3_step()] due to a +** schema change. Hence, the application should ensure that the +** correct authorizer callback remains in place during the [sqlite3_step()]. +** +** ^Note that the authorizer callback is invoked only during +** [sqlite3_prepare()] or its variants. Authorization is not +** performed during statement evaluation in [sqlite3_step()], unless +** as stated in the previous paragraph, sqlite3_step() invokes +** sqlite3_prepare_v2() to reprepare a statement after a schema change. +*/ +SQLITE_API int sqlite3_set_authorizer( + sqlite3*, + int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), + void *pUserData +); + +/* +** CAPI3REF: Authorizer Return Codes +** +** The [sqlite3_set_authorizer | authorizer callback function] must +** return either [SQLITE_OK] or one of these two constants in order +** to signal SQLite whether or not the action is permitted. See the +** [sqlite3_set_authorizer | authorizer documentation] for additional +** information. +** +** Note that SQLITE_IGNORE is also used as a [conflict resolution mode] +** returned from the [sqlite3_vtab_on_conflict()] interface. +*/ +#define SQLITE_DENY 1 /* Abort the SQL statement with an error */ +#define SQLITE_IGNORE 2 /* Don't allow access, but don't generate an error */ + +/* +** CAPI3REF: Authorizer Action Codes +** +** The [sqlite3_set_authorizer()] interface registers a callback function +** that is invoked to authorize certain SQL statement actions. The +** second parameter to the callback is an integer code that specifies +** what action is being authorized. These are the integer action codes that +** the authorizer callback may be passed. +** +** These action code values signify what kind of operation is to be +** authorized. The 3rd and 4th parameters to the authorization +** callback function will be parameters or NULL depending on which of these +** codes is used as the second parameter. ^(The 5th parameter to the +** authorizer callback is the name of the database ("main", "temp", +** etc.) if applicable.)^ ^The 6th parameter to the authorizer callback +** is the name of the inner-most trigger or view that is responsible for +** the access attempt or NULL if this access attempt is directly from +** top-level SQL code. +*/ +/******************************************* 3rd ************ 4th ***********/ +#define SQLITE_CREATE_INDEX 1 /* Index Name Table Name */ +#define SQLITE_CREATE_TABLE 2 /* Table Name NULL */ +#define SQLITE_CREATE_TEMP_INDEX 3 /* Index Name Table Name */ +#define SQLITE_CREATE_TEMP_TABLE 4 /* Table Name NULL */ +#define SQLITE_CREATE_TEMP_TRIGGER 5 /* Trigger Name Table Name */ +#define SQLITE_CREATE_TEMP_VIEW 6 /* View Name NULL */ +#define SQLITE_CREATE_TRIGGER 7 /* Trigger Name Table Name */ +#define SQLITE_CREATE_VIEW 8 /* View Name NULL */ +#define SQLITE_DELETE 9 /* Table Name NULL */ +#define SQLITE_DROP_INDEX 10 /* Index Name Table Name */ +#define SQLITE_DROP_TABLE 11 /* Table Name NULL */ +#define SQLITE_DROP_TEMP_INDEX 12 /* Index Name Table Name */ +#define SQLITE_DROP_TEMP_TABLE 13 /* Table Name NULL */ +#define SQLITE_DROP_TEMP_TRIGGER 14 /* Trigger Name Table Name */ +#define SQLITE_DROP_TEMP_VIEW 15 /* View Name NULL */ +#define SQLITE_DROP_TRIGGER 16 /* Trigger Name Table Name */ +#define SQLITE_DROP_VIEW 17 /* View Name NULL */ +#define SQLITE_INSERT 18 /* Table Name NULL */ +#define SQLITE_PRAGMA 19 /* Pragma Name 1st arg or NULL */ +#define SQLITE_READ 20 /* Table Name Column Name */ +#define SQLITE_SELECT 21 /* NULL NULL */ +#define SQLITE_TRANSACTION 22 /* Operation NULL */ +#define SQLITE_UPDATE 23 /* Table Name Column Name */ +#define SQLITE_ATTACH 24 /* Filename NULL */ +#define SQLITE_DETACH 25 /* Database Name NULL */ +#define SQLITE_ALTER_TABLE 26 /* Database Name Table Name */ +#define SQLITE_REINDEX 27 /* Index Name NULL */ +#define SQLITE_ANALYZE 28 /* Table Name NULL */ +#define SQLITE_CREATE_VTABLE 29 /* Table Name Module Name */ +#define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */ +#define SQLITE_FUNCTION 31 /* NULL Function Name */ +#define SQLITE_SAVEPOINT 32 /* Operation Savepoint Name */ +#define SQLITE_COPY 0 /* No longer used */ +#define SQLITE_RECURSIVE 33 /* NULL NULL */ + +/* +** CAPI3REF: Tracing And Profiling Functions +** METHOD: sqlite3 +** +** These routines are deprecated. Use the [sqlite3_trace_v2()] interface +** instead of the routines described here. +** +** These routines register callback functions that can be used for +** tracing and profiling the execution of SQL statements. +** +** ^The callback function registered by sqlite3_trace() is invoked at +** various times when an SQL statement is being run by [sqlite3_step()]. +** ^The sqlite3_trace() callback is invoked with a UTF-8 rendering of the +** SQL statement text as the statement first begins executing. +** ^(Additional sqlite3_trace() callbacks might occur +** as each triggered subprogram is entered. The callbacks for triggers +** contain a UTF-8 SQL comment that identifies the trigger.)^ +** +** The [SQLITE_TRACE_SIZE_LIMIT] compile-time option can be used to limit +** the length of [bound parameter] expansion in the output of sqlite3_trace(). +** +** ^The callback function registered by sqlite3_profile() is invoked +** as each SQL statement finishes. ^The profile callback contains +** the original statement text and an estimate of wall-clock time +** of how long that statement took to run. ^The profile callback +** time is in units of nanoseconds, however the current implementation +** is only capable of millisecond resolution so the six least significant +** digits in the time are meaningless. Future versions of SQLite +** might provide greater resolution on the profiler callback. The +** sqlite3_profile() function is considered experimental and is +** subject to change in future versions of SQLite. +*/ +SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(sqlite3*, + void(*xTrace)(void*,const char*), void*); +SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, + void(*xProfile)(void*,const char*,sqlite3_uint64), void*); + +/* +** CAPI3REF: SQL Trace Event Codes +** KEYWORDS: SQLITE_TRACE +** +** These constants identify classes of events that can be monitored +** using the [sqlite3_trace_v2()] tracing logic. The M argument +** to [sqlite3_trace_v2(D,M,X,P)] is an OR-ed combination of one or more of +** the following constants. ^The first argument to the trace callback +** is one of the following constants. +** +** New tracing constants may be added in future releases. +** +** ^A trace callback has four arguments: xCallback(T,C,P,X). +** ^The T argument is one of the integer type codes above. +** ^The C argument is a copy of the context pointer passed in as the +** fourth argument to [sqlite3_trace_v2()]. +** The P and X arguments are pointers whose meanings depend on T. +** +**
+** [[SQLITE_TRACE_STMT]]
SQLITE_TRACE_STMT
+**
^An SQLITE_TRACE_STMT callback is invoked when a prepared statement +** first begins running and possibly at other times during the +** execution of the prepared statement, such as at the start of each +** trigger subprogram. ^The P argument is a pointer to the +** [prepared statement]. ^The X argument is a pointer to a string which +** is the unexpanded SQL text of the prepared statement or an SQL comment +** that indicates the invocation of a trigger. ^The callback can compute +** the same text that would have been returned by the legacy [sqlite3_trace()] +** interface by using the X argument when X begins with "--" and invoking +** [sqlite3_expanded_sql(P)] otherwise. +** +** [[SQLITE_TRACE_PROFILE]]
SQLITE_TRACE_PROFILE
+**
^An SQLITE_TRACE_PROFILE callback provides approximately the same +** information as is provided by the [sqlite3_profile()] callback. +** ^The P argument is a pointer to the [prepared statement] and the +** X argument points to a 64-bit integer which is the estimated of +** the number of nanosecond that the prepared statement took to run. +** ^The SQLITE_TRACE_PROFILE callback is invoked when the statement finishes. +** +** [[SQLITE_TRACE_ROW]]
SQLITE_TRACE_ROW
+**
^An SQLITE_TRACE_ROW callback is invoked whenever a prepared +** statement generates a single row of result. +** ^The P argument is a pointer to the [prepared statement] and the +** X argument is unused. +** +** [[SQLITE_TRACE_CLOSE]]
SQLITE_TRACE_CLOSE
+**
^An SQLITE_TRACE_CLOSE callback is invoked when a database +** connection closes. +** ^The P argument is a pointer to the [database connection] object +** and the X argument is unused. +**
+*/ +#define SQLITE_TRACE_STMT 0x01 +#define SQLITE_TRACE_PROFILE 0x02 +#define SQLITE_TRACE_ROW 0x04 +#define SQLITE_TRACE_CLOSE 0x08 + +/* +** CAPI3REF: SQL Trace Hook +** METHOD: sqlite3 +** +** ^The sqlite3_trace_v2(D,M,X,P) interface registers a trace callback +** function X against [database connection] D, using property mask M +** and context pointer P. ^If the X callback is +** NULL or if the M mask is zero, then tracing is disabled. The +** M argument should be the bitwise OR-ed combination of +** zero or more [SQLITE_TRACE] constants. +** +** ^Each call to either sqlite3_trace() or sqlite3_trace_v2() overrides +** (cancels) any prior calls to sqlite3_trace() or sqlite3_trace_v2(). +** +** ^The X callback is invoked whenever any of the events identified by +** mask M occur. ^The integer return value from the callback is currently +** ignored, though this may change in future releases. Callback +** implementations should return zero to ensure future compatibility. +** +** ^A trace callback is invoked with four arguments: callback(T,C,P,X). +** ^The T argument is one of the [SQLITE_TRACE] +** constants to indicate why the callback was invoked. +** ^The C argument is a copy of the context pointer. +** The P and X arguments are pointers whose meanings depend on T. +** +** The sqlite3_trace_v2() interface is intended to replace the legacy +** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which +** are deprecated. +*/ +SQLITE_API int sqlite3_trace_v2( + sqlite3*, + unsigned uMask, + int(*xCallback)(unsigned,void*,void*,void*), + void *pCtx +); + +/* +** CAPI3REF: Query Progress Callbacks +** METHOD: sqlite3 +** +** ^The sqlite3_progress_handler(D,N,X,P) interface causes the callback +** function X to be invoked periodically during long running calls to +** [sqlite3_exec()], [sqlite3_step()] and [sqlite3_get_table()] for +** database connection D. An example use for this +** interface is to keep a GUI updated during a large query. +** +** ^The parameter P is passed through as the only parameter to the +** callback function X. ^The parameter N is the approximate number of +** [virtual machine instructions] that are evaluated between successive +** invocations of the callback X. ^If N is less than one then the progress +** handler is disabled. +** +** ^Only a single progress handler may be defined at one time per +** [database connection]; setting a new progress handler cancels the +** old one. ^Setting parameter X to NULL disables the progress handler. +** ^The progress handler is also disabled by setting N to a value less +** than 1. +** +** ^If the progress callback returns non-zero, the operation is +** interrupted. This feature can be used to implement a +** "Cancel" button on a GUI progress dialog box. +** +** The progress handler callback must not do anything that will modify +** the database connection that invoked the progress handler. +** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their +** database connections for the meaning of "modify" in this paragraph. +** +*/ +SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); + +/* +** CAPI3REF: Opening A New Database Connection +** CONSTRUCTOR: sqlite3 +** +** ^These routines open an SQLite database file as specified by the +** filename argument. ^The filename argument is interpreted as UTF-8 for +** sqlite3_open() and sqlite3_open_v2() and as UTF-16 in the native byte +** order for sqlite3_open16(). ^(A [database connection] handle is usually +** returned in *ppDb, even if an error occurs. The only exception is that +** if SQLite is unable to allocate memory to hold the [sqlite3] object, +** a NULL will be written into *ppDb instead of a pointer to the [sqlite3] +** object.)^ ^(If the database is opened (and/or created) successfully, then +** [SQLITE_OK] is returned. Otherwise an [error code] is returned.)^ ^The +** [sqlite3_errmsg()] or [sqlite3_errmsg16()] routines can be used to obtain +** an English language description of the error following a failure of any +** of the sqlite3_open() routines. +** +** ^The default encoding will be UTF-8 for databases created using +** sqlite3_open() or sqlite3_open_v2(). ^The default encoding for databases +** created using sqlite3_open16() will be UTF-16 in the native byte order. +** +** Whether or not an error occurs when it is opened, resources +** associated with the [database connection] handle should be released by +** passing it to [sqlite3_close()] when it is no longer required. +** +** The sqlite3_open_v2() interface works like sqlite3_open() +** except that it accepts two additional parameters for additional control +** over the new database connection. ^(The flags parameter to +** sqlite3_open_v2() can take one of +** the following three values, optionally combined with the +** [SQLITE_OPEN_NOMUTEX], [SQLITE_OPEN_FULLMUTEX], [SQLITE_OPEN_SHAREDCACHE], +** [SQLITE_OPEN_PRIVATECACHE], and/or [SQLITE_OPEN_URI] flags:)^ +** +**
+** ^(
[SQLITE_OPEN_READONLY]
+**
The database is opened in read-only mode. If the database does not +** already exist, an error is returned.
)^ +** +** ^(
[SQLITE_OPEN_READWRITE]
+**
The database is opened for reading and writing if possible, or reading +** only if the file is write protected by the operating system. In either +** case the database must already exist, otherwise an error is returned.
)^ +** +** ^(
[SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]
+**
The database is opened for reading and writing, and is created if +** it does not already exist. This is the behavior that is always used for +** sqlite3_open() and sqlite3_open16().
)^ +**
+** +** If the 3rd parameter to sqlite3_open_v2() is not one of the +** combinations shown above optionally combined with other +** [SQLITE_OPEN_READONLY | SQLITE_OPEN_* bits] +** then the behavior is undefined. +** +** ^If the [SQLITE_OPEN_NOMUTEX] flag is set, then the database connection +** opens in the multi-thread [threading mode] as long as the single-thread +** mode has not been set at compile-time or start-time. ^If the +** [SQLITE_OPEN_FULLMUTEX] flag is set then the database connection opens +** in the serialized [threading mode] unless single-thread was +** previously selected at compile-time or start-time. +** ^The [SQLITE_OPEN_SHAREDCACHE] flag causes the database connection to be +** eligible to use [shared cache mode], regardless of whether or not shared +** cache is enabled using [sqlite3_enable_shared_cache()]. ^The +** [SQLITE_OPEN_PRIVATECACHE] flag causes the database connection to not +** participate in [shared cache mode] even if it is enabled. +** +** ^The fourth parameter to sqlite3_open_v2() is the name of the +** [sqlite3_vfs] object that defines the operating system interface that +** the new database connection should use. ^If the fourth parameter is +** a NULL pointer then the default [sqlite3_vfs] object is used. +** +** ^If the filename is ":memory:", then a private, temporary in-memory database +** is created for the connection. ^This in-memory database will vanish when +** the database connection is closed. Future versions of SQLite might +** make use of additional special filenames that begin with the ":" character. +** It is recommended that when a database filename actually does begin with +** a ":" character you should prefix the filename with a pathname such as +** "./" to avoid ambiguity. +** +** ^If the filename is an empty string, then a private, temporary +** on-disk database will be created. ^This private database will be +** automatically deleted as soon as the database connection is closed. +** +** [[URI filenames in sqlite3_open()]]

URI Filenames

+** +** ^If [URI filename] interpretation is enabled, and the filename argument +** begins with "file:", then the filename is interpreted as a URI. ^URI +** filename interpretation is enabled if the [SQLITE_OPEN_URI] flag is +** set in the third argument to sqlite3_open_v2(), or if it has +** been enabled globally using the [SQLITE_CONFIG_URI] option with the +** [sqlite3_config()] method or by the [SQLITE_USE_URI] compile-time option. +** URI filename interpretation is turned off +** by default, but future releases of SQLite might enable URI filename +** interpretation by default. See "[URI filenames]" for additional +** information. +** +** URI filenames are parsed according to RFC 3986. ^If the URI contains an +** authority, then it must be either an empty string or the string +** "localhost". ^If the authority is not an empty string or "localhost", an +** error is returned to the caller. ^The fragment component of a URI, if +** present, is ignored. +** +** ^SQLite uses the path component of the URI as the name of the disk file +** which contains the database. ^If the path begins with a '/' character, +** then it is interpreted as an absolute path. ^If the path does not begin +** with a '/' (meaning that the authority section is omitted from the URI) +** then the path is interpreted as a relative path. +** ^(On windows, the first component of an absolute path +** is a drive specification (e.g. "C:").)^ +** +** [[core URI query parameters]] +** The query component of a URI may contain parameters that are interpreted +** either by SQLite itself, or by a [VFS | custom VFS implementation]. +** SQLite and its built-in [VFSes] interpret the +** following query parameters: +** +**
    +**
  • vfs: ^The "vfs" parameter may be used to specify the name of +** a VFS object that provides the operating system interface that should +** be used to access the database file on disk. ^If this option is set to +** an empty string the default VFS object is used. ^Specifying an unknown +** VFS is an error. ^If sqlite3_open_v2() is used and the vfs option is +** present, then the VFS specified by the option takes precedence over +** the value passed as the fourth parameter to sqlite3_open_v2(). +** +**
  • mode: ^(The mode parameter may be set to either "ro", "rw", +** "rwc", or "memory". Attempting to set it to any other value is +** an error)^. +** ^If "ro" is specified, then the database is opened for read-only +** access, just as if the [SQLITE_OPEN_READONLY] flag had been set in the +** third argument to sqlite3_open_v2(). ^If the mode option is set to +** "rw", then the database is opened for read-write (but not create) +** access, as if SQLITE_OPEN_READWRITE (but not SQLITE_OPEN_CREATE) had +** been set. ^Value "rwc" is equivalent to setting both +** SQLITE_OPEN_READWRITE and SQLITE_OPEN_CREATE. ^If the mode option is +** set to "memory" then a pure [in-memory database] that never reads +** or writes from disk is used. ^It is an error to specify a value for +** the mode parameter that is less restrictive than that specified by +** the flags passed in the third parameter to sqlite3_open_v2(). +** +**
  • cache: ^The cache parameter may be set to either "shared" or +** "private". ^Setting it to "shared" is equivalent to setting the +** SQLITE_OPEN_SHAREDCACHE bit in the flags argument passed to +** sqlite3_open_v2(). ^Setting the cache parameter to "private" is +** equivalent to setting the SQLITE_OPEN_PRIVATECACHE bit. +** ^If sqlite3_open_v2() is used and the "cache" parameter is present in +** a URI filename, its value overrides any behavior requested by setting +** SQLITE_OPEN_PRIVATECACHE or SQLITE_OPEN_SHAREDCACHE flag. +** +**
  • psow: ^The psow parameter indicates whether or not the +** [powersafe overwrite] property does or does not apply to the +** storage media on which the database file resides. +** +**
  • nolock: ^The nolock parameter is a boolean query parameter +** which if set disables file locking in rollback journal modes. This +** is useful for accessing a database on a filesystem that does not +** support locking. Caution: Database corruption might result if two +** or more processes write to the same database and any one of those +** processes uses nolock=1. +** +**
  • immutable: ^The immutable parameter is a boolean query +** parameter that indicates that the database file is stored on +** read-only media. ^When immutable is set, SQLite assumes that the +** database file cannot be changed, even by a process with higher +** privilege, and so the database is opened read-only and all locking +** and change detection is disabled. Caution: Setting the immutable +** property on a database file that does in fact change can result +** in incorrect query results and/or [SQLITE_CORRUPT] errors. +** See also: [SQLITE_IOCAP_IMMUTABLE]. +** +**
+** +** ^Specifying an unknown parameter in the query component of a URI is not an +** error. Future versions of SQLite might understand additional query +** parameters. See "[query parameters with special meaning to SQLite]" for +** additional information. +** +** [[URI filename examples]]

URI filename examples

+** +** +**
URI filenames Results +**
file:data.db +** Open the file "data.db" in the current directory. +**
file:/home/fred/data.db
+** file:///home/fred/data.db
+** file://localhost/home/fred/data.db
+** Open the database file "/home/fred/data.db". +**
file://darkstar/home/fred/data.db +** An error. "darkstar" is not a recognized authority. +**
+** file:///C:/Documents%20and%20Settings/fred/Desktop/data.db +** Windows only: Open the file "data.db" on fred's desktop on drive +** C:. Note that the %20 escaping in this example is not strictly +** necessary - space characters can be used literally +** in URI filenames. +**
file:data.db?mode=ro&cache=private +** Open file "data.db" in the current directory for read-only access. +** Regardless of whether or not shared-cache mode is enabled by +** default, use a private cache. +**
file:/home/fred/data.db?vfs=unix-dotfile +** Open file "/home/fred/data.db". Use the special VFS "unix-dotfile" +** that uses dot-files in place of posix advisory locking. +**
file:data.db?mode=readonly +** An error. "readonly" is not a valid option for the "mode" parameter. +**
+** +** ^URI hexadecimal escape sequences (%HH) are supported within the path and +** query components of a URI. A hexadecimal escape sequence consists of a +** percent sign - "%" - followed by exactly two hexadecimal digits +** specifying an octet value. ^Before the path or query components of a +** URI filename are interpreted, they are encoded using UTF-8 and all +** hexadecimal escape sequences replaced by a single byte containing the +** corresponding octet. If this process generates an invalid UTF-8 encoding, +** the results are undefined. +** +** Note to Windows users: The encoding used for the filename argument +** of sqlite3_open() and sqlite3_open_v2() must be UTF-8, not whatever +** codepage is currently defined. Filenames containing international +** characters must be converted to UTF-8 prior to passing them into +** sqlite3_open() or sqlite3_open_v2(). +** +** Note to Windows Runtime users: The temporary directory must be set +** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various +** features that require the use of temporary files may fail. +** +** See also: [sqlite3_temp_directory] +*/ +SQLITE_API int sqlite3_open( + const char *filename, /* Database filename (UTF-8) */ + sqlite3 **ppDb /* OUT: SQLite db handle */ +); +SQLITE_API int sqlite3_open16( + const void *filename, /* Database filename (UTF-16) */ + sqlite3 **ppDb /* OUT: SQLite db handle */ +); +SQLITE_API int sqlite3_open_v2( + const char *filename, /* Database filename (UTF-8) */ + sqlite3 **ppDb, /* OUT: SQLite db handle */ + int flags, /* Flags */ + const char *zVfs /* Name of VFS module to use */ +); + +/* +** CAPI3REF: Obtain Values For URI Parameters +** +** These are utility routines, useful to VFS implementations, that check +** to see if a database file was a URI that contained a specific query +** parameter, and if so obtains the value of that query parameter. +** +** If F is the database filename pointer passed into the xOpen() method of +** a VFS implementation when the flags parameter to xOpen() has one or +** more of the [SQLITE_OPEN_URI] or [SQLITE_OPEN_MAIN_DB] bits set and +** P is the name of the query parameter, then +** sqlite3_uri_parameter(F,P) returns the value of the P +** parameter if it exists or a NULL pointer if P does not appear as a +** query parameter on F. If P is a query parameter of F +** has no explicit value, then sqlite3_uri_parameter(F,P) returns +** a pointer to an empty string. +** +** The sqlite3_uri_boolean(F,P,B) routine assumes that P is a boolean +** parameter and returns true (1) or false (0) according to the value +** of P. The sqlite3_uri_boolean(F,P,B) routine returns true (1) if the +** value of query parameter P is one of "yes", "true", or "on" in any +** case or if the value begins with a non-zero number. The +** sqlite3_uri_boolean(F,P,B) routines returns false (0) if the value of +** query parameter P is one of "no", "false", or "off" in any case or +** if the value begins with a numeric zero. If P is not a query +** parameter on F or if the value of P is does not match any of the +** above, then sqlite3_uri_boolean(F,P,B) returns (B!=0). +** +** The sqlite3_uri_int64(F,P,D) routine converts the value of P into a +** 64-bit signed integer and returns that integer, or D if P does not +** exist. If the value of P is something other than an integer, then +** zero is returned. +** +** If F is a NULL pointer, then sqlite3_uri_parameter(F,P) returns NULL and +** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and +** is not a database file pathname pointer that SQLite passed into the xOpen +** VFS method, then the behavior of this routine is undefined and probably +** undesirable. +*/ +SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam); +SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault); +SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int64); + + +/* +** CAPI3REF: Error Codes And Messages +** METHOD: sqlite3 +** +** ^If the most recent sqlite3_* API call associated with +** [database connection] D failed, then the sqlite3_errcode(D) interface +** returns the numeric [result code] or [extended result code] for that +** API call. +** If the most recent API call was successful, +** then the return value from sqlite3_errcode() is undefined. +** ^The sqlite3_extended_errcode() +** interface is the same except that it always returns the +** [extended result code] even when extended result codes are +** disabled. +** +** ^The sqlite3_errmsg() and sqlite3_errmsg16() return English-language +** text that describes the error, as either UTF-8 or UTF-16 respectively. +** ^(Memory to hold the error message string is managed internally. +** The application does not need to worry about freeing the result. +** However, the error string might be overwritten or deallocated by +** subsequent calls to other SQLite interface functions.)^ +** +** ^The sqlite3_errstr() interface returns the English-language text +** that describes the [result code], as UTF-8. +** ^(Memory to hold the error message string is managed internally +** and must not be freed by the application)^. +** +** When the serialized [threading mode] is in use, it might be the +** case that a second error occurs on a separate thread in between +** the time of the first error and the call to these interfaces. +** When that happens, the second error will be reported since these +** interfaces always report the most recent result. To avoid +** this, each thread can obtain exclusive use of the [database connection] D +** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning +** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after +** all calls to the interfaces listed here are completed. +** +** If an interface fails with SQLITE_MISUSE, that means the interface +** was invoked incorrectly by the application. In that case, the +** error code and message may or may not be set. +*/ +SQLITE_API int sqlite3_errcode(sqlite3 *db); +SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); +SQLITE_API const char *sqlite3_errmsg(sqlite3*); +SQLITE_API const void *sqlite3_errmsg16(sqlite3*); +SQLITE_API const char *sqlite3_errstr(int); + +/* +** CAPI3REF: Prepared Statement Object +** KEYWORDS: {prepared statement} {prepared statements} +** +** An instance of this object represents a single SQL statement that +** has been compiled into binary form and is ready to be evaluated. +** +** Think of each SQL statement as a separate computer program. The +** original SQL text is source code. A prepared statement object +** is the compiled object code. All SQL must be converted into a +** prepared statement before it can be run. +** +** The life-cycle of a prepared statement object usually goes like this: +** +**
    +**
  1. Create the prepared statement object using [sqlite3_prepare_v2()]. +**
  2. Bind values to [parameters] using the sqlite3_bind_*() +** interfaces. +**
  3. Run the SQL by calling [sqlite3_step()] one or more times. +**
  4. Reset the prepared statement using [sqlite3_reset()] then go back +** to step 2. Do this zero or more times. +**
  5. Destroy the object using [sqlite3_finalize()]. +**
+*/ +typedef struct sqlite3_stmt sqlite3_stmt; + +/* +** CAPI3REF: Run-time Limits +** METHOD: sqlite3 +** +** ^(This interface allows the size of various constructs to be limited +** on a connection by connection basis. The first parameter is the +** [database connection] whose limit is to be set or queried. The +** second parameter is one of the [limit categories] that define a +** class of constructs to be size limited. The third parameter is the +** new limit for that construct.)^ +** +** ^If the new limit is a negative number, the limit is unchanged. +** ^(For each limit category SQLITE_LIMIT_NAME there is a +** [limits | hard upper bound] +** set at compile-time by a C preprocessor macro called +** [limits | SQLITE_MAX_NAME]. +** (The "_LIMIT_" in the name is changed to "_MAX_".))^ +** ^Attempts to increase a limit above its hard upper bound are +** silently truncated to the hard upper bound. +** +** ^Regardless of whether or not the limit was changed, the +** [sqlite3_limit()] interface returns the prior value of the limit. +** ^Hence, to find the current value of a limit without changing it, +** simply invoke this interface with the third parameter set to -1. +** +** Run-time limits are intended for use in applications that manage +** both their own internal database and also databases that are controlled +** by untrusted external sources. An example application might be a +** web browser that has its own databases for storing history and +** separate databases controlled by JavaScript applications downloaded +** off the Internet. The internal databases can be given the +** large, default limits. Databases managed by external sources can +** be given much smaller limits designed to prevent a denial of service +** attack. Developers might also want to use the [sqlite3_set_authorizer()] +** interface to further control untrusted SQL. The size of the database +** created by an untrusted script can be contained using the +** [max_page_count] [PRAGMA]. +** +** New run-time limit categories may be added in future releases. +*/ +SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); + +/* +** CAPI3REF: Run-Time Limit Categories +** KEYWORDS: {limit category} {*limit categories} +** +** These constants define various performance limits +** that can be lowered at run-time using [sqlite3_limit()]. +** The synopsis of the meanings of the various limits is shown below. +** Additional information is available at [limits | Limits in SQLite]. +** +**
+** [[SQLITE_LIMIT_LENGTH]] ^(
SQLITE_LIMIT_LENGTH
+**
The maximum size of any string or BLOB or table row, in bytes.
)^ +** +** [[SQLITE_LIMIT_SQL_LENGTH]] ^(
SQLITE_LIMIT_SQL_LENGTH
+**
The maximum length of an SQL statement, in bytes.
)^ +** +** [[SQLITE_LIMIT_COLUMN]] ^(
SQLITE_LIMIT_COLUMN
+**
The maximum number of columns in a table definition or in the +** result set of a [SELECT] or the maximum number of columns in an index +** or in an ORDER BY or GROUP BY clause.
)^ +** +** [[SQLITE_LIMIT_EXPR_DEPTH]] ^(
SQLITE_LIMIT_EXPR_DEPTH
+**
The maximum depth of the parse tree on any expression.
)^ +** +** [[SQLITE_LIMIT_COMPOUND_SELECT]] ^(
SQLITE_LIMIT_COMPOUND_SELECT
+**
The maximum number of terms in a compound SELECT statement.
)^ +** +** [[SQLITE_LIMIT_VDBE_OP]] ^(
SQLITE_LIMIT_VDBE_OP
+**
The maximum number of instructions in a virtual machine program +** used to implement an SQL statement. If [sqlite3_prepare_v2()] or +** the equivalent tries to allocate space for more than this many opcodes +** in a single prepared statement, an SQLITE_NOMEM error is returned.
)^ +** +** [[SQLITE_LIMIT_FUNCTION_ARG]] ^(
SQLITE_LIMIT_FUNCTION_ARG
+**
The maximum number of arguments on a function.
)^ +** +** [[SQLITE_LIMIT_ATTACHED]] ^(
SQLITE_LIMIT_ATTACHED
+**
The maximum number of [ATTACH | attached databases].)^
+** +** [[SQLITE_LIMIT_LIKE_PATTERN_LENGTH]] +** ^(
SQLITE_LIMIT_LIKE_PATTERN_LENGTH
+**
The maximum length of the pattern argument to the [LIKE] or +** [GLOB] operators.
)^ +** +** [[SQLITE_LIMIT_VARIABLE_NUMBER]] +** ^(
SQLITE_LIMIT_VARIABLE_NUMBER
+**
The maximum index number of any [parameter] in an SQL statement.)^ +** +** [[SQLITE_LIMIT_TRIGGER_DEPTH]] ^(
SQLITE_LIMIT_TRIGGER_DEPTH
+**
The maximum depth of recursion for triggers.
)^ +** +** [[SQLITE_LIMIT_WORKER_THREADS]] ^(
SQLITE_LIMIT_WORKER_THREADS
+**
The maximum number of auxiliary worker threads that a single +** [prepared statement] may start.
)^ +**
+*/ +#define SQLITE_LIMIT_LENGTH 0 +#define SQLITE_LIMIT_SQL_LENGTH 1 +#define SQLITE_LIMIT_COLUMN 2 +#define SQLITE_LIMIT_EXPR_DEPTH 3 +#define SQLITE_LIMIT_COMPOUND_SELECT 4 +#define SQLITE_LIMIT_VDBE_OP 5 +#define SQLITE_LIMIT_FUNCTION_ARG 6 +#define SQLITE_LIMIT_ATTACHED 7 +#define SQLITE_LIMIT_LIKE_PATTERN_LENGTH 8 +#define SQLITE_LIMIT_VARIABLE_NUMBER 9 +#define SQLITE_LIMIT_TRIGGER_DEPTH 10 +#define SQLITE_LIMIT_WORKER_THREADS 11 + +/* +** CAPI3REF: Prepare Flags +** +** These constants define various flags that can be passed into +** "prepFlags" parameter of the [sqlite3_prepare_v3()] and +** [sqlite3_prepare16_v3()] interfaces. +** +** New flags may be added in future releases of SQLite. +** +**
+** [[SQLITE_PREPARE_PERSISTENT]] ^(
SQLITE_PREPARE_PERSISTENT
+**
The SQLITE_PREPARE_PERSISTENT flag is a hint to the query planner +** that the prepared statement will be retained for a long time and +** probably reused many times.)^ ^Without this flag, [sqlite3_prepare_v3()] +** and [sqlite3_prepare16_v3()] assume that the prepared statement will +** be used just once or at most a few times and then destroyed using +** [sqlite3_finalize()] relatively soon. The current implementation acts +** on this hint by avoiding the use of [lookaside memory] so as not to +** deplete the limited store of lookaside memory. Future versions of +** SQLite may act on this hint differently. +**
+*/ +#define SQLITE_PREPARE_PERSISTENT 0x01 + +/* +** CAPI3REF: Compiling An SQL Statement +** KEYWORDS: {SQL statement compiler} +** METHOD: sqlite3 +** CONSTRUCTOR: sqlite3_stmt +** +** To execute an SQL statement, it must first be compiled into a byte-code +** program using one of these routines. Or, in other words, these routines +** are constructors for the [prepared statement] object. +** +** The preferred routine to use is [sqlite3_prepare_v2()]. The +** [sqlite3_prepare()] interface is legacy and should be avoided. +** [sqlite3_prepare_v3()] has an extra "prepFlags" option that is used +** for special purposes. +** +** The use of the UTF-8 interfaces is preferred, as SQLite currently +** does all parsing using UTF-8. The UTF-16 interfaces are provided +** as a convenience. The UTF-16 interfaces work by converting the +** input text into UTF-8, then invoking the corresponding UTF-8 interface. +** +** The first argument, "db", is a [database connection] obtained from a +** prior successful call to [sqlite3_open()], [sqlite3_open_v2()] or +** [sqlite3_open16()]. The database connection must not have been closed. +** +** The second argument, "zSql", is the statement to be compiled, encoded +** as either UTF-8 or UTF-16. The sqlite3_prepare(), sqlite3_prepare_v2(), +** and sqlite3_prepare_v3() +** interfaces use UTF-8, and sqlite3_prepare16(), sqlite3_prepare16_v2(), +** and sqlite3_prepare16_v3() use UTF-16. +** +** ^If the nByte argument is negative, then zSql is read up to the +** first zero terminator. ^If nByte is positive, then it is the +** number of bytes read from zSql. ^If nByte is zero, then no prepared +** statement is generated. +** If the caller knows that the supplied string is nul-terminated, then +** there is a small performance advantage to passing an nByte parameter that +** is the number of bytes in the input string including +** the nul-terminator. +** +** ^If pzTail is not NULL then *pzTail is made to point to the first byte +** past the end of the first SQL statement in zSql. These routines only +** compile the first statement in zSql, so *pzTail is left pointing to +** what remains uncompiled. +** +** ^*ppStmt is left pointing to a compiled [prepared statement] that can be +** executed using [sqlite3_step()]. ^If there is an error, *ppStmt is set +** to NULL. ^If the input text contains no SQL (if the input is an empty +** string or a comment) then *ppStmt is set to NULL. +** The calling procedure is responsible for deleting the compiled +** SQL statement using [sqlite3_finalize()] after it has finished with it. +** ppStmt may not be NULL. +** +** ^On success, the sqlite3_prepare() family of routines return [SQLITE_OK]; +** otherwise an [error code] is returned. +** +** The sqlite3_prepare_v2(), sqlite3_prepare_v3(), sqlite3_prepare16_v2(), +** and sqlite3_prepare16_v3() interfaces are recommended for all new programs. +** The older interfaces (sqlite3_prepare() and sqlite3_prepare16()) +** are retained for backwards compatibility, but their use is discouraged. +** ^In the "vX" interfaces, the prepared statement +** that is returned (the [sqlite3_stmt] object) contains a copy of the +** original SQL text. This causes the [sqlite3_step()] interface to +** behave differently in three ways: +** +**
    +**
  1. +** ^If the database schema changes, instead of returning [SQLITE_SCHEMA] as it +** always used to do, [sqlite3_step()] will automatically recompile the SQL +** statement and try to run it again. As many as [SQLITE_MAX_SCHEMA_RETRY] +** retries will occur before sqlite3_step() gives up and returns an error. +**
  2. +** +**
  3. +** ^When an error occurs, [sqlite3_step()] will return one of the detailed +** [error codes] or [extended error codes]. ^The legacy behavior was that +** [sqlite3_step()] would only return a generic [SQLITE_ERROR] result code +** and the application would have to make a second call to [sqlite3_reset()] +** in order to find the underlying cause of the problem. With the "v2" prepare +** interfaces, the underlying reason for the error is returned immediately. +**
  4. +** +**
  5. +** ^If the specific value bound to [parameter | host parameter] in the +** WHERE clause might influence the choice of query plan for a statement, +** then the statement will be automatically recompiled, as if there had been +** a schema change, on the first [sqlite3_step()] call following any change +** to the [sqlite3_bind_text | bindings] of that [parameter]. +** ^The specific value of WHERE-clause [parameter] might influence the +** choice of query plan if the parameter is the left-hand side of a [LIKE] +** or [GLOB] operator or if the parameter is compared to an indexed column +** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled. +**
  6. +**
+** +**

^sqlite3_prepare_v3() differs from sqlite3_prepare_v2() only in having +** the extra prepFlags parameter, which is a bit array consisting of zero or +** more of the [SQLITE_PREPARE_PERSISTENT|SQLITE_PREPARE_*] flags. ^The +** sqlite3_prepare_v2() interface works exactly the same as +** sqlite3_prepare_v3() with a zero prepFlags parameter. +*/ +SQLITE_API int sqlite3_prepare( + sqlite3 *db, /* Database handle */ + const char *zSql, /* SQL statement, UTF-8 encoded */ + int nByte, /* Maximum length of zSql in bytes. */ + sqlite3_stmt **ppStmt, /* OUT: Statement handle */ + const char **pzTail /* OUT: Pointer to unused portion of zSql */ +); +SQLITE_API int sqlite3_prepare_v2( + sqlite3 *db, /* Database handle */ + const char *zSql, /* SQL statement, UTF-8 encoded */ + int nByte, /* Maximum length of zSql in bytes. */ + sqlite3_stmt **ppStmt, /* OUT: Statement handle */ + const char **pzTail /* OUT: Pointer to unused portion of zSql */ +); +SQLITE_API int sqlite3_prepare_v3( + sqlite3 *db, /* Database handle */ + const char *zSql, /* SQL statement, UTF-8 encoded */ + int nByte, /* Maximum length of zSql in bytes. */ + unsigned int prepFlags, /* Zero or more SQLITE_PREPARE_ flags */ + sqlite3_stmt **ppStmt, /* OUT: Statement handle */ + const char **pzTail /* OUT: Pointer to unused portion of zSql */ +); +SQLITE_API int sqlite3_prepare16( + sqlite3 *db, /* Database handle */ + const void *zSql, /* SQL statement, UTF-16 encoded */ + int nByte, /* Maximum length of zSql in bytes. */ + sqlite3_stmt **ppStmt, /* OUT: Statement handle */ + const void **pzTail /* OUT: Pointer to unused portion of zSql */ +); +SQLITE_API int sqlite3_prepare16_v2( + sqlite3 *db, /* Database handle */ + const void *zSql, /* SQL statement, UTF-16 encoded */ + int nByte, /* Maximum length of zSql in bytes. */ + sqlite3_stmt **ppStmt, /* OUT: Statement handle */ + const void **pzTail /* OUT: Pointer to unused portion of zSql */ +); +SQLITE_API int sqlite3_prepare16_v3( + sqlite3 *db, /* Database handle */ + const void *zSql, /* SQL statement, UTF-16 encoded */ + int nByte, /* Maximum length of zSql in bytes. */ + unsigned int prepFlags, /* Zero or more SQLITE_PREPARE_ flags */ + sqlite3_stmt **ppStmt, /* OUT: Statement handle */ + const void **pzTail /* OUT: Pointer to unused portion of zSql */ +); + +/* +** CAPI3REF: Retrieving Statement SQL +** METHOD: sqlite3_stmt +** +** ^The sqlite3_sql(P) interface returns a pointer to a copy of the UTF-8 +** SQL text used to create [prepared statement] P if P was +** created by [sqlite3_prepare_v2()], [sqlite3_prepare_v3()], +** [sqlite3_prepare16_v2()], or [sqlite3_prepare16_v3()]. +** ^The sqlite3_expanded_sql(P) interface returns a pointer to a UTF-8 +** string containing the SQL text of prepared statement P with +** [bound parameters] expanded. +** +** ^(For example, if a prepared statement is created using the SQL +** text "SELECT $abc,:xyz" and if parameter $abc is bound to integer 2345 +** and parameter :xyz is unbound, then sqlite3_sql() will return +** the original string, "SELECT $abc,:xyz" but sqlite3_expanded_sql() +** will return "SELECT 2345,NULL".)^ +** +** ^The sqlite3_expanded_sql() interface returns NULL if insufficient memory +** is available to hold the result, or if the result would exceed the +** the maximum string length determined by the [SQLITE_LIMIT_LENGTH]. +** +** ^The [SQLITE_TRACE_SIZE_LIMIT] compile-time option limits the size of +** bound parameter expansions. ^The [SQLITE_OMIT_TRACE] compile-time +** option causes sqlite3_expanded_sql() to always return NULL. +** +** ^The string returned by sqlite3_sql(P) is managed by SQLite and is +** automatically freed when the prepared statement is finalized. +** ^The string returned by sqlite3_expanded_sql(P), on the other hand, +** is obtained from [sqlite3_malloc()] and must be free by the application +** by passing it to [sqlite3_free()]. +*/ +SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt); +SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt); + +/* +** CAPI3REF: Determine If An SQL Statement Writes The Database +** METHOD: sqlite3_stmt +** +** ^The sqlite3_stmt_readonly(X) interface returns true (non-zero) if +** and only if the [prepared statement] X makes no direct changes to +** the content of the database file. +** +** Note that [application-defined SQL functions] or +** [virtual tables] might change the database indirectly as a side effect. +** ^(For example, if an application defines a function "eval()" that +** calls [sqlite3_exec()], then the following SQL statement would +** change the database file through side-effects: +** +**

+**    SELECT eval('DELETE FROM t1') FROM t2;
+** 
+** +** But because the [SELECT] statement does not change the database file +** directly, sqlite3_stmt_readonly() would still return true.)^ +** +** ^Transaction control statements such as [BEGIN], [COMMIT], [ROLLBACK], +** [SAVEPOINT], and [RELEASE] cause sqlite3_stmt_readonly() to return true, +** since the statements themselves do not actually modify the database but +** rather they control the timing of when other statements modify the +** database. ^The [ATTACH] and [DETACH] statements also cause +** sqlite3_stmt_readonly() to return true since, while those statements +** change the configuration of a database connection, they do not make +** changes to the content of the database files on disk. +** ^The sqlite3_stmt_readonly() interface returns true for [BEGIN] since +** [BEGIN] merely sets internal flags, but the [BEGIN|BEGIN IMMEDIATE] and +** [BEGIN|BEGIN EXCLUSIVE] commands do touch the database and so +** sqlite3_stmt_readonly() returns false for those commands. +*/ +SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt); + +/* +** CAPI3REF: Determine If A Prepared Statement Has Been Reset +** METHOD: sqlite3_stmt +** +** ^The sqlite3_stmt_busy(S) interface returns true (non-zero) if the +** [prepared statement] S has been stepped at least once using +** [sqlite3_step(S)] but has neither run to completion (returned +** [SQLITE_DONE] from [sqlite3_step(S)]) nor +** been reset using [sqlite3_reset(S)]. ^The sqlite3_stmt_busy(S) +** interface returns false if S is a NULL pointer. If S is not a +** NULL pointer and is not a pointer to a valid [prepared statement] +** object, then the behavior is undefined and probably undesirable. +** +** This interface can be used in combination [sqlite3_next_stmt()] +** to locate all prepared statements associated with a database +** connection that are in need of being reset. This can be used, +** for example, in diagnostic routines to search for prepared +** statements that are holding a transaction open. +*/ +SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*); + +/* +** CAPI3REF: Dynamically Typed Value Object +** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} +** +** SQLite uses the sqlite3_value object to represent all values +** that can be stored in a database table. SQLite uses dynamic typing +** for the values it stores. ^Values stored in sqlite3_value objects +** can be integers, floating point values, strings, BLOBs, or NULL. +** +** An sqlite3_value object may be either "protected" or "unprotected". +** Some interfaces require a protected sqlite3_value. Other interfaces +** will accept either a protected or an unprotected sqlite3_value. +** Every interface that accepts sqlite3_value arguments specifies +** whether or not it requires a protected sqlite3_value. The +** [sqlite3_value_dup()] interface can be used to construct a new +** protected sqlite3_value from an unprotected sqlite3_value. +** +** The terms "protected" and "unprotected" refer to whether or not +** a mutex is held. An internal mutex is held for a protected +** sqlite3_value object but no mutex is held for an unprotected +** sqlite3_value object. If SQLite is compiled to be single-threaded +** (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0) +** or if SQLite is run in one of reduced mutex modes +** [SQLITE_CONFIG_SINGLETHREAD] or [SQLITE_CONFIG_MULTITHREAD] +** then there is no distinction between protected and unprotected +** sqlite3_value objects and they can be used interchangeably. However, +** for maximum code portability it is recommended that applications +** still make the distinction between protected and unprotected +** sqlite3_value objects even when not strictly required. +** +** ^The sqlite3_value objects that are passed as parameters into the +** implementation of [application-defined SQL functions] are protected. +** ^The sqlite3_value object returned by +** [sqlite3_column_value()] is unprotected. +** Unprotected sqlite3_value objects may only be used as arguments +** to [sqlite3_result_value()], [sqlite3_bind_value()], and +** [sqlite3_value_dup()]. +** The [sqlite3_value_blob | sqlite3_value_type()] family of +** interfaces require protected sqlite3_value objects. +*/ +typedef struct sqlite3_value sqlite3_value; + +/* +** CAPI3REF: SQL Function Context Object +** +** The context in which an SQL function executes is stored in an +** sqlite3_context object. ^A pointer to an sqlite3_context object +** is always first parameter to [application-defined SQL functions]. +** The application-defined SQL function implementation will pass this +** pointer through into calls to [sqlite3_result_int | sqlite3_result()], +** [sqlite3_aggregate_context()], [sqlite3_user_data()], +** [sqlite3_context_db_handle()], [sqlite3_get_auxdata()], +** and/or [sqlite3_set_auxdata()]. +*/ +typedef struct sqlite3_context sqlite3_context; + +/* +** CAPI3REF: Binding Values To Prepared Statements +** KEYWORDS: {host parameter} {host parameters} {host parameter name} +** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding} +** METHOD: sqlite3_stmt +** +** ^(In the SQL statement text input to [sqlite3_prepare_v2()] and its variants, +** literals may be replaced by a [parameter] that matches one of following +** templates: +** +**
    +**
  • ? +**
  • ?NNN +**
  • :VVV +**
  • @VVV +**
  • $VVV +**
+** +** In the templates above, NNN represents an integer literal, +** and VVV represents an alphanumeric identifier.)^ ^The values of these +** parameters (also called "host parameter names" or "SQL parameters") +** can be set using the sqlite3_bind_*() routines defined here. +** +** ^The first argument to the sqlite3_bind_*() routines is always +** a pointer to the [sqlite3_stmt] object returned from +** [sqlite3_prepare_v2()] or its variants. +** +** ^The second argument is the index of the SQL parameter to be set. +** ^The leftmost SQL parameter has an index of 1. ^When the same named +** SQL parameter is used more than once, second and subsequent +** occurrences have the same index as the first occurrence. +** ^The index for named parameters can be looked up using the +** [sqlite3_bind_parameter_index()] API if desired. ^The index +** for "?NNN" parameters is the value of NNN. +** ^The NNN value must be between 1 and the [sqlite3_limit()] +** parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 999). +** +** ^The third argument is the value to bind to the parameter. +** ^If the third parameter to sqlite3_bind_text() or sqlite3_bind_text16() +** or sqlite3_bind_blob() is a NULL pointer then the fourth parameter +** is ignored and the end result is the same as sqlite3_bind_null(). +** +** ^(In those routines that have a fourth argument, its value is the +** number of bytes in the parameter. To be clear: the value is the +** number of bytes in the value, not the number of characters.)^ +** ^If the fourth parameter to sqlite3_bind_text() or sqlite3_bind_text16() +** is negative, then the length of the string is +** the number of bytes up to the first zero terminator. +** If the fourth parameter to sqlite3_bind_blob() is negative, then +** the behavior is undefined. +** If a non-negative fourth parameter is provided to sqlite3_bind_text() +** or sqlite3_bind_text16() or sqlite3_bind_text64() then +** that parameter must be the byte offset +** where the NUL terminator would occur assuming the string were NUL +** terminated. If any NUL characters occur at byte offsets less than +** the value of the fourth parameter then the resulting string value will +** contain embedded NULs. The result of expressions involving strings +** with embedded NULs is undefined. +** +** ^The fifth argument to the BLOB and string binding interfaces +** is a destructor used to dispose of the BLOB or +** string after SQLite has finished with it. ^The destructor is called +** to dispose of the BLOB or string even if the call to bind API fails. +** ^If the fifth argument is +** the special value [SQLITE_STATIC], then SQLite assumes that the +** information is in static, unmanaged space and does not need to be freed. +** ^If the fifth argument has the value [SQLITE_TRANSIENT], then +** SQLite makes its own private copy of the data immediately, before +** the sqlite3_bind_*() routine returns. +** +** ^The sixth argument to sqlite3_bind_text64() must be one of +** [SQLITE_UTF8], [SQLITE_UTF16], [SQLITE_UTF16BE], or [SQLITE_UTF16LE] +** to specify the encoding of the text in the third parameter. If +** the sixth argument to sqlite3_bind_text64() is not one of the +** allowed values shown above, or if the text encoding is different +** from the encoding specified by the sixth parameter, then the behavior +** is undefined. +** +** ^The sqlite3_bind_zeroblob() routine binds a BLOB of length N that +** is filled with zeroes. ^A zeroblob uses a fixed amount of memory +** (just an integer to hold its size) while it is being processed. +** Zeroblobs are intended to serve as placeholders for BLOBs whose +** content is later written using +** [sqlite3_blob_open | incremental BLOB I/O] routines. +** ^A negative value for the zeroblob results in a zero-length BLOB. +** +** ^The sqlite3_bind_pointer(S,I,P,T,D) routine causes the I-th parameter in +** [prepared statement] S to have an SQL value of NULL, but to also be +** associated with the pointer P of type T. ^D is either a NULL pointer or +** a pointer to a destructor function for P. ^SQLite will invoke the +** destructor D with a single argument of P when it is finished using +** P. The T parameter should be a static string, preferably a string +** literal. The sqlite3_bind_pointer() routine is part of the +** [pointer passing interface] added for SQLite 3.20.0. +** +** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer +** for the [prepared statement] or with a prepared statement for which +** [sqlite3_step()] has been called more recently than [sqlite3_reset()], +** then the call will return [SQLITE_MISUSE]. If any sqlite3_bind_() +** routine is passed a [prepared statement] that has been finalized, the +** result is undefined and probably harmful. +** +** ^Bindings are not cleared by the [sqlite3_reset()] routine. +** ^Unbound parameters are interpreted as NULL. +** +** ^The sqlite3_bind_* routines return [SQLITE_OK] on success or an +** [error code] if anything goes wrong. +** ^[SQLITE_TOOBIG] might be returned if the size of a string or BLOB +** exceeds limits imposed by [sqlite3_limit]([SQLITE_LIMIT_LENGTH]) or +** [SQLITE_MAX_LENGTH]. +** ^[SQLITE_RANGE] is returned if the parameter +** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails. +** +** See also: [sqlite3_bind_parameter_count()], +** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()]. +*/ +SQLITE_API int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); +SQLITE_API int sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64, + void(*)(void*)); +SQLITE_API int sqlite3_bind_double(sqlite3_stmt*, int, double); +SQLITE_API int sqlite3_bind_int(sqlite3_stmt*, int, int); +SQLITE_API int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64); +SQLITE_API int sqlite3_bind_null(sqlite3_stmt*, int); +SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*)); +SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); +SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, + void(*)(void*), unsigned char encoding); +SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); +SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt*, int, void*, const char*,void(*)(void*)); +SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); +SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64); + +/* +** CAPI3REF: Number Of SQL Parameters +** METHOD: sqlite3_stmt +** +** ^This routine can be used to find the number of [SQL parameters] +** in a [prepared statement]. SQL parameters are tokens of the +** form "?", "?NNN", ":AAA", "$AAA", or "@AAA" that serve as +** placeholders for values that are [sqlite3_bind_blob | bound] +** to the parameters at a later time. +** +** ^(This routine actually returns the index of the largest (rightmost) +** parameter. For all forms except ?NNN, this will correspond to the +** number of unique parameters. If parameters of the ?NNN form are used, +** there may be gaps in the list.)^ +** +** See also: [sqlite3_bind_blob|sqlite3_bind()], +** [sqlite3_bind_parameter_name()], and +** [sqlite3_bind_parameter_index()]. +*/ +SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*); + +/* +** CAPI3REF: Name Of A Host Parameter +** METHOD: sqlite3_stmt +** +** ^The sqlite3_bind_parameter_name(P,N) interface returns +** the name of the N-th [SQL parameter] in the [prepared statement] P. +** ^(SQL parameters of the form "?NNN" or ":AAA" or "@AAA" or "$AAA" +** have a name which is the string "?NNN" or ":AAA" or "@AAA" or "$AAA" +** respectively. +** In other words, the initial ":" or "$" or "@" or "?" +** is included as part of the name.)^ +** ^Parameters of the form "?" without a following integer have no name +** and are referred to as "nameless" or "anonymous parameters". +** +** ^The first host parameter has an index of 1, not 0. +** +** ^If the value N is out of range or if the N-th parameter is +** nameless, then NULL is returned. ^The returned string is +** always in UTF-8 encoding even if the named parameter was +** originally specified as UTF-16 in [sqlite3_prepare16()], +** [sqlite3_prepare16_v2()], or [sqlite3_prepare16_v3()]. +** +** See also: [sqlite3_bind_blob|sqlite3_bind()], +** [sqlite3_bind_parameter_count()], and +** [sqlite3_bind_parameter_index()]. +*/ +SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int); + +/* +** CAPI3REF: Index Of A Parameter With A Given Name +** METHOD: sqlite3_stmt +** +** ^Return the index of an SQL parameter given its name. ^The +** index value returned is suitable for use as the second +** parameter to [sqlite3_bind_blob|sqlite3_bind()]. ^A zero +** is returned if no matching parameter is found. ^The parameter +** name must be given in UTF-8 even if the original statement +** was prepared from UTF-16 text using [sqlite3_prepare16_v2()] or +** [sqlite3_prepare16_v3()]. +** +** See also: [sqlite3_bind_blob|sqlite3_bind()], +** [sqlite3_bind_parameter_count()], and +** [sqlite3_bind_parameter_name()]. +*/ +SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName); + +/* +** CAPI3REF: Reset All Bindings On A Prepared Statement +** METHOD: sqlite3_stmt +** +** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset +** the [sqlite3_bind_blob | bindings] on a [prepared statement]. +** ^Use this routine to reset all host parameters to NULL. +*/ +SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*); + +/* +** CAPI3REF: Number Of Columns In A Result Set +** METHOD: sqlite3_stmt +** +** ^Return the number of columns in the result set returned by the +** [prepared statement]. ^If this routine returns 0, that means the +** [prepared statement] returns no data (for example an [UPDATE]). +** ^However, just because this routine returns a positive number does not +** mean that one or more rows of data will be returned. ^A SELECT statement +** will always have a positive sqlite3_column_count() but depending on the +** WHERE clause constraints and the table content, it might return no rows. +** +** See also: [sqlite3_data_count()] +*/ +SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt); + +/* +** CAPI3REF: Column Names In A Result Set +** METHOD: sqlite3_stmt +** +** ^These routines return the name assigned to a particular column +** in the result set of a [SELECT] statement. ^The sqlite3_column_name() +** interface returns a pointer to a zero-terminated UTF-8 string +** and sqlite3_column_name16() returns a pointer to a zero-terminated +** UTF-16 string. ^The first parameter is the [prepared statement] +** that implements the [SELECT] statement. ^The second parameter is the +** column number. ^The leftmost column is number 0. +** +** ^The returned string pointer is valid until either the [prepared statement] +** is destroyed by [sqlite3_finalize()] or until the statement is automatically +** reprepared by the first call to [sqlite3_step()] for a particular run +** or until the next call to +** sqlite3_column_name() or sqlite3_column_name16() on the same column. +** +** ^If sqlite3_malloc() fails during the processing of either routine +** (for example during a conversion from UTF-8 to UTF-16) then a +** NULL pointer is returned. +** +** ^The name of a result column is the value of the "AS" clause for +** that column, if there is an AS clause. If there is no AS clause +** then the name of the column is unspecified and may change from +** one release of SQLite to the next. +*/ +SQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N); +SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N); + +/* +** CAPI3REF: Source Of Data In A Query Result +** METHOD: sqlite3_stmt +** +** ^These routines provide a means to determine the database, table, and +** table column that is the origin of a particular result column in +** [SELECT] statement. +** ^The name of the database or table or column can be returned as +** either a UTF-8 or UTF-16 string. ^The _database_ routines return +** the database name, the _table_ routines return the table name, and +** the origin_ routines return the column name. +** ^The returned string is valid until the [prepared statement] is destroyed +** using [sqlite3_finalize()] or until the statement is automatically +** reprepared by the first call to [sqlite3_step()] for a particular run +** or until the same information is requested +** again in a different encoding. +** +** ^The names returned are the original un-aliased names of the +** database, table, and column. +** +** ^The first argument to these interfaces is a [prepared statement]. +** ^These functions return information about the Nth result column returned by +** the statement, where N is the second function argument. +** ^The left-most column is column 0 for these routines. +** +** ^If the Nth column returned by the statement is an expression or +** subquery and is not a column value, then all of these functions return +** NULL. ^These routine might also return NULL if a memory allocation error +** occurs. ^Otherwise, they return the name of the attached database, table, +** or column that query result column was extracted from. +** +** ^As with all other SQLite APIs, those whose names end with "16" return +** UTF-16 encoded strings and the other functions return UTF-8. +** +** ^These APIs are only available if the library was compiled with the +** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. +** +** If two or more threads call one or more of these routines against the same +** prepared statement and column at the same time then the results are +** undefined. +** +** If two or more threads call one or more +** [sqlite3_column_database_name | column metadata interfaces] +** for the same [prepared statement] and result column +** at the same time then the results are undefined. +*/ +SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); +SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); +SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); +SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); +SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); +SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int); + +/* +** CAPI3REF: Declared Datatype Of A Query Result +** METHOD: sqlite3_stmt +** +** ^(The first parameter is a [prepared statement]. +** If this statement is a [SELECT] statement and the Nth column of the +** returned result set of that [SELECT] is a table column (not an +** expression or subquery) then the declared type of the table +** column is returned.)^ ^If the Nth column of the result set is an +** expression or subquery, then a NULL pointer is returned. +** ^The returned string is always UTF-8 encoded. +** +** ^(For example, given the database schema: +** +** CREATE TABLE t1(c1 VARIANT); +** +** and the following statement to be compiled: +** +** SELECT c1 + 1, c1 FROM t1; +** +** this routine would return the string "VARIANT" for the second result +** column (i==1), and a NULL pointer for the first result column (i==0).)^ +** +** ^SQLite uses dynamic run-time typing. ^So just because a column +** is declared to contain a particular type does not mean that the +** data stored in that column is of the declared type. SQLite is +** strongly typed, but the typing is dynamic not static. ^Type +** is associated with individual values, not with the containers +** used to hold those values. +*/ +SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt*,int); +SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); + +/* +** CAPI3REF: Evaluate An SQL Statement +** METHOD: sqlite3_stmt +** +** After a [prepared statement] has been prepared using any of +** [sqlite3_prepare_v2()], [sqlite3_prepare_v3()], [sqlite3_prepare16_v2()], +** or [sqlite3_prepare16_v3()] or one of the legacy +** interfaces [sqlite3_prepare()] or [sqlite3_prepare16()], this function +** must be called one or more times to evaluate the statement. +** +** The details of the behavior of the sqlite3_step() interface depend +** on whether the statement was prepared using the newer "vX" interfaces +** [sqlite3_prepare_v3()], [sqlite3_prepare_v2()], [sqlite3_prepare16_v3()], +** [sqlite3_prepare16_v2()] or the older legacy +** interfaces [sqlite3_prepare()] and [sqlite3_prepare16()]. The use of the +** new "vX" interface is recommended for new applications but the legacy +** interface will continue to be supported. +** +** ^In the legacy interface, the return value will be either [SQLITE_BUSY], +** [SQLITE_DONE], [SQLITE_ROW], [SQLITE_ERROR], or [SQLITE_MISUSE]. +** ^With the "v2" interface, any of the other [result codes] or +** [extended result codes] might be returned as well. +** +** ^[SQLITE_BUSY] means that the database engine was unable to acquire the +** database locks it needs to do its job. ^If the statement is a [COMMIT] +** or occurs outside of an explicit transaction, then you can retry the +** statement. If the statement is not a [COMMIT] and occurs within an +** explicit transaction then you should rollback the transaction before +** continuing. +** +** ^[SQLITE_DONE] means that the statement has finished executing +** successfully. sqlite3_step() should not be called again on this virtual +** machine without first calling [sqlite3_reset()] to reset the virtual +** machine back to its initial state. +** +** ^If the SQL statement being executed returns any data, then [SQLITE_ROW] +** is returned each time a new row of data is ready for processing by the +** caller. The values may be accessed using the [column access functions]. +** sqlite3_step() is called again to retrieve the next row of data. +** +** ^[SQLITE_ERROR] means that a run-time error (such as a constraint +** violation) has occurred. sqlite3_step() should not be called again on +** the VM. More information may be found by calling [sqlite3_errmsg()]. +** ^With the legacy interface, a more specific error code (for example, +** [SQLITE_INTERRUPT], [SQLITE_SCHEMA], [SQLITE_CORRUPT], and so forth) +** can be obtained by calling [sqlite3_reset()] on the +** [prepared statement]. ^In the "v2" interface, +** the more specific error code is returned directly by sqlite3_step(). +** +** [SQLITE_MISUSE] means that the this routine was called inappropriately. +** Perhaps it was called on a [prepared statement] that has +** already been [sqlite3_finalize | finalized] or on one that had +** previously returned [SQLITE_ERROR] or [SQLITE_DONE]. Or it could +** be the case that the same database connection is being used by two or +** more threads at the same moment in time. +** +** For all versions of SQLite up to and including 3.6.23.1, a call to +** [sqlite3_reset()] was required after sqlite3_step() returned anything +** other than [SQLITE_ROW] before any subsequent invocation of +** sqlite3_step(). Failure to reset the prepared statement using +** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from +** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1], +** sqlite3_step() began +** calling [sqlite3_reset()] automatically in this circumstance rather +** than returning [SQLITE_MISUSE]. This is not considered a compatibility +** break because any application that ever receives an SQLITE_MISUSE error +** is broken by definition. The [SQLITE_OMIT_AUTORESET] compile-time option +** can be used to restore the legacy behavior. +** +** Goofy Interface Alert: In the legacy interface, the sqlite3_step() +** API always returns a generic error code, [SQLITE_ERROR], following any +** error other than [SQLITE_BUSY] and [SQLITE_MISUSE]. You must call +** [sqlite3_reset()] or [sqlite3_finalize()] in order to find one of the +** specific [error codes] that better describes the error. +** We admit that this is a goofy design. The problem has been fixed +** with the "v2" interface. If you prepare all of your SQL statements +** using [sqlite3_prepare_v3()] or [sqlite3_prepare_v2()] +** or [sqlite3_prepare16_v2()] or [sqlite3_prepare16_v3()] instead +** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces, +** then the more specific [error codes] are returned directly +** by sqlite3_step(). The use of the "vX" interfaces is recommended. +*/ +SQLITE_API int sqlite3_step(sqlite3_stmt*); + +/* +** CAPI3REF: Number of columns in a result set +** METHOD: sqlite3_stmt +** +** ^The sqlite3_data_count(P) interface returns the number of columns in the +** current row of the result set of [prepared statement] P. +** ^If prepared statement P does not have results ready to return +** (via calls to the [sqlite3_column_int | sqlite3_column_*()] of +** interfaces) then sqlite3_data_count(P) returns 0. +** ^The sqlite3_data_count(P) routine also returns 0 if P is a NULL pointer. +** ^The sqlite3_data_count(P) routine returns 0 if the previous call to +** [sqlite3_step](P) returned [SQLITE_DONE]. ^The sqlite3_data_count(P) +** will return non-zero if previous call to [sqlite3_step](P) returned +** [SQLITE_ROW], except in the case of the [PRAGMA incremental_vacuum] +** where it always returns zero since each step of that multi-step +** pragma returns 0 columns of data. +** +** See also: [sqlite3_column_count()] +*/ +SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); + +/* +** CAPI3REF: Fundamental Datatypes +** KEYWORDS: SQLITE_TEXT +** +** ^(Every value in SQLite has one of five fundamental datatypes: +** +**
    +**
  • 64-bit signed integer +**
  • 64-bit IEEE floating point number +**
  • string +**
  • BLOB +**
  • NULL +**
)^ +** +** These constants are codes for each of those types. +** +** Note that the SQLITE_TEXT constant was also used in SQLite version 2 +** for a completely different meaning. Software that links against both +** SQLite version 2 and SQLite version 3 should use SQLITE3_TEXT, not +** SQLITE_TEXT. +*/ +#define SQLITE_INTEGER 1 +#define SQLITE_FLOAT 2 +#define SQLITE_BLOB 4 +#define SQLITE_NULL 5 +#ifdef SQLITE_TEXT +# undef SQLITE_TEXT +#else +# define SQLITE_TEXT 3 +#endif +#define SQLITE3_TEXT 3 + +/* +** CAPI3REF: Result Values From A Query +** KEYWORDS: {column access functions} +** METHOD: sqlite3_stmt +** +** Summary: +**
+**
sqlite3_column_blobBLOB result +**
sqlite3_column_doubleREAL result +**
sqlite3_column_int32-bit INTEGER result +**
sqlite3_column_int6464-bit INTEGER result +**
sqlite3_column_textUTF-8 TEXT result +**
sqlite3_column_text16UTF-16 TEXT result +**
sqlite3_column_valueThe result as an +** [sqlite3_value|unprotected sqlite3_value] object. +**
    +**
sqlite3_column_bytesSize of a BLOB +** or a UTF-8 TEXT result in bytes +**
sqlite3_column_bytes16   +** →  Size of UTF-16 +** TEXT in bytes +**
sqlite3_column_typeDefault +** datatype of the result +**
+** +** Details: +** +** ^These routines return information about a single column of the current +** result row of a query. ^In every case the first argument is a pointer +** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*] +** that was returned from [sqlite3_prepare_v2()] or one of its variants) +** and the second argument is the index of the column for which information +** should be returned. ^The leftmost column of the result set has the index 0. +** ^The number of columns in the result can be determined using +** [sqlite3_column_count()]. +** +** If the SQL statement does not currently point to a valid row, or if the +** column index is out of range, the result is undefined. +** These routines may only be called when the most recent call to +** [sqlite3_step()] has returned [SQLITE_ROW] and neither +** [sqlite3_reset()] nor [sqlite3_finalize()] have been called subsequently. +** If any of these routines are called after [sqlite3_reset()] or +** [sqlite3_finalize()] or after [sqlite3_step()] has returned +** something other than [SQLITE_ROW], the results are undefined. +** If [sqlite3_step()] or [sqlite3_reset()] or [sqlite3_finalize()] +** are called from a different thread while any of these routines +** are pending, then the results are undefined. +** +** The first six interfaces (_blob, _double, _int, _int64, _text, and _text16) +** each return the value of a result column in a specific data format. If +** the result column is not initially in the requested format (for example, +** if the query returns an integer but the sqlite3_column_text() interface +** is used to extract the value) then an automatic type conversion is performed. +** +** ^The sqlite3_column_type() routine returns the +** [SQLITE_INTEGER | datatype code] for the initial data type +** of the result column. ^The returned value is one of [SQLITE_INTEGER], +** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL]. +** The return value of sqlite3_column_type() can be used to decide which +** of the first six interface should be used to extract the column value. +** The value returned by sqlite3_column_type() is only meaningful if no +** automatic type conversions have occurred for the value in question. +** After a type conversion, the result of calling sqlite3_column_type() +** is undefined, though harmless. Future +** versions of SQLite may change the behavior of sqlite3_column_type() +** following a type conversion. +** +** If the result is a BLOB or a TEXT string, then the sqlite3_column_bytes() +** or sqlite3_column_bytes16() interfaces can be used to determine the size +** of that BLOB or string. +** +** ^If the result is a BLOB or UTF-8 string then the sqlite3_column_bytes() +** routine returns the number of bytes in that BLOB or string. +** ^If the result is a UTF-16 string, then sqlite3_column_bytes() converts +** the string to UTF-8 and then returns the number of bytes. +** ^If the result is a numeric value then sqlite3_column_bytes() uses +** [sqlite3_snprintf()] to convert that value to a UTF-8 string and returns +** the number of bytes in that string. +** ^If the result is NULL, then sqlite3_column_bytes() returns zero. +** +** ^If the result is a BLOB or UTF-16 string then the sqlite3_column_bytes16() +** routine returns the number of bytes in that BLOB or string. +** ^If the result is a UTF-8 string, then sqlite3_column_bytes16() converts +** the string to UTF-16 and then returns the number of bytes. +** ^If the result is a numeric value then sqlite3_column_bytes16() uses +** [sqlite3_snprintf()] to convert that value to a UTF-16 string and returns +** the number of bytes in that string. +** ^If the result is NULL, then sqlite3_column_bytes16() returns zero. +** +** ^The values returned by [sqlite3_column_bytes()] and +** [sqlite3_column_bytes16()] do not include the zero terminators at the end +** of the string. ^For clarity: the values returned by +** [sqlite3_column_bytes()] and [sqlite3_column_bytes16()] are the number of +** bytes in the string, not the number of characters. +** +** ^Strings returned by sqlite3_column_text() and sqlite3_column_text16(), +** even empty strings, are always zero-terminated. ^The return +** value from sqlite3_column_blob() for a zero-length BLOB is a NULL pointer. +** +** Warning: ^The object returned by [sqlite3_column_value()] is an +** [unprotected sqlite3_value] object. In a multithreaded environment, +** an unprotected sqlite3_value object may only be used safely with +** [sqlite3_bind_value()] and [sqlite3_result_value()]. +** If the [unprotected sqlite3_value] object returned by +** [sqlite3_column_value()] is used in any other way, including calls +** to routines like [sqlite3_value_int()], [sqlite3_value_text()], +** or [sqlite3_value_bytes()], the behavior is not threadsafe. +** Hence, the sqlite3_column_value() interface +** is normally only useful within the implementation of +** [application-defined SQL functions] or [virtual tables], not within +** top-level application code. +** +** The these routines may attempt to convert the datatype of the result. +** ^For example, if the internal representation is FLOAT and a text result +** is requested, [sqlite3_snprintf()] is used internally to perform the +** conversion automatically. ^(The following table details the conversions +** that are applied: +** +**
+** +**
Internal
Type
Requested
Type
Conversion +** +**
NULL INTEGER Result is 0 +**
NULL FLOAT Result is 0.0 +**
NULL TEXT Result is a NULL pointer +**
NULL BLOB Result is a NULL pointer +**
INTEGER FLOAT Convert from integer to float +**
INTEGER TEXT ASCII rendering of the integer +**
INTEGER BLOB Same as INTEGER->TEXT +**
FLOAT INTEGER [CAST] to INTEGER +**
FLOAT TEXT ASCII rendering of the float +**
FLOAT BLOB [CAST] to BLOB +**
TEXT INTEGER [CAST] to INTEGER +**
TEXT FLOAT [CAST] to REAL +**
TEXT BLOB No change +**
BLOB INTEGER [CAST] to INTEGER +**
BLOB FLOAT [CAST] to REAL +**
BLOB TEXT Add a zero terminator if needed +**
+**
)^ +** +** Note that when type conversions occur, pointers returned by prior +** calls to sqlite3_column_blob(), sqlite3_column_text(), and/or +** sqlite3_column_text16() may be invalidated. +** Type conversions and pointer invalidations might occur +** in the following cases: +** +**
    +**
  • The initial content is a BLOB and sqlite3_column_text() or +** sqlite3_column_text16() is called. A zero-terminator might +** need to be added to the string.
  • +**
  • The initial content is UTF-8 text and sqlite3_column_bytes16() or +** sqlite3_column_text16() is called. The content must be converted +** to UTF-16.
  • +**
  • The initial content is UTF-16 text and sqlite3_column_bytes() or +** sqlite3_column_text() is called. The content must be converted +** to UTF-8.
  • +**
+** +** ^Conversions between UTF-16be and UTF-16le are always done in place and do +** not invalidate a prior pointer, though of course the content of the buffer +** that the prior pointer references will have been modified. Other kinds +** of conversion are done in place when it is possible, but sometimes they +** are not possible and in those cases prior pointers are invalidated. +** +** The safest policy is to invoke these routines +** in one of the following ways: +** +**
    +**
  • sqlite3_column_text() followed by sqlite3_column_bytes()
  • +**
  • sqlite3_column_blob() followed by sqlite3_column_bytes()
  • +**
  • sqlite3_column_text16() followed by sqlite3_column_bytes16()
  • +**
+** +** In other words, you should call sqlite3_column_text(), +** sqlite3_column_blob(), or sqlite3_column_text16() first to force the result +** into the desired format, then invoke sqlite3_column_bytes() or +** sqlite3_column_bytes16() to find the size of the result. Do not mix calls +** to sqlite3_column_text() or sqlite3_column_blob() with calls to +** sqlite3_column_bytes16(), and do not mix calls to sqlite3_column_text16() +** with calls to sqlite3_column_bytes(). +** +** ^The pointers returned are valid until a type conversion occurs as +** described above, or until [sqlite3_step()] or [sqlite3_reset()] or +** [sqlite3_finalize()] is called. ^The memory space used to hold strings +** and BLOBs is freed automatically. Do not pass the pointers returned +** from [sqlite3_column_blob()], [sqlite3_column_text()], etc. into +** [sqlite3_free()]. +** +** ^(If a memory allocation error occurs during the evaluation of any +** of these routines, a default value is returned. The default value +** is either the integer 0, the floating point number 0.0, or a NULL +** pointer. Subsequent calls to [sqlite3_errcode()] will return +** [SQLITE_NOMEM].)^ +*/ +SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt*, int iCol); +SQLITE_API double sqlite3_column_double(sqlite3_stmt*, int iCol); +SQLITE_API int sqlite3_column_int(sqlite3_stmt*, int iCol); +SQLITE_API sqlite3_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol); +SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol); +SQLITE_API const void *sqlite3_column_text16(sqlite3_stmt*, int iCol); +SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol); +SQLITE_API int sqlite3_column_bytes(sqlite3_stmt*, int iCol); +SQLITE_API int sqlite3_column_bytes16(sqlite3_stmt*, int iCol); +SQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol); + +/* +** CAPI3REF: Destroy A Prepared Statement Object +** DESTRUCTOR: sqlite3_stmt +** +** ^The sqlite3_finalize() function is called to delete a [prepared statement]. +** ^If the most recent evaluation of the statement encountered no errors +** or if the statement is never been evaluated, then sqlite3_finalize() returns +** SQLITE_OK. ^If the most recent evaluation of statement S failed, then +** sqlite3_finalize(S) returns the appropriate [error code] or +** [extended error code]. +** +** ^The sqlite3_finalize(S) routine can be called at any point during +** the life cycle of [prepared statement] S: +** before statement S is ever evaluated, after +** one or more calls to [sqlite3_reset()], or after any call +** to [sqlite3_step()] regardless of whether or not the statement has +** completed execution. +** +** ^Invoking sqlite3_finalize() on a NULL pointer is a harmless no-op. +** +** The application must finalize every [prepared statement] in order to avoid +** resource leaks. It is a grievous error for the application to try to use +** a prepared statement after it has been finalized. Any use of a prepared +** statement after it has been finalized can result in undefined and +** undesirable behavior such as segfaults and heap corruption. +*/ +SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt); + +/* +** CAPI3REF: Reset A Prepared Statement Object +** METHOD: sqlite3_stmt +** +** The sqlite3_reset() function is called to reset a [prepared statement] +** object back to its initial state, ready to be re-executed. +** ^Any SQL statement variables that had values bound to them using +** the [sqlite3_bind_blob | sqlite3_bind_*() API] retain their values. +** Use [sqlite3_clear_bindings()] to reset the bindings. +** +** ^The [sqlite3_reset(S)] interface resets the [prepared statement] S +** back to the beginning of its program. +** +** ^If the most recent call to [sqlite3_step(S)] for the +** [prepared statement] S returned [SQLITE_ROW] or [SQLITE_DONE], +** or if [sqlite3_step(S)] has never before been called on S, +** then [sqlite3_reset(S)] returns [SQLITE_OK]. +** +** ^If the most recent call to [sqlite3_step(S)] for the +** [prepared statement] S indicated an error, then +** [sqlite3_reset(S)] returns an appropriate [error code]. +** +** ^The [sqlite3_reset(S)] interface does not change the values +** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. +*/ +SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); + +/* +** CAPI3REF: Create Or Redefine SQL Functions +** KEYWORDS: {function creation routines} +** KEYWORDS: {application-defined SQL function} +** KEYWORDS: {application-defined SQL functions} +** METHOD: sqlite3 +** +** ^These functions (collectively known as "function creation routines") +** are used to add SQL functions or aggregates or to redefine the behavior +** of existing SQL functions or aggregates. The only differences between +** these routines are the text encoding expected for +** the second parameter (the name of the function being created) +** and the presence or absence of a destructor callback for +** the application data pointer. +** +** ^The first parameter is the [database connection] to which the SQL +** function is to be added. ^If an application uses more than one database +** connection then application-defined SQL functions must be added +** to each database connection separately. +** +** ^The second parameter is the name of the SQL function to be created or +** redefined. ^The length of the name is limited to 255 bytes in a UTF-8 +** representation, exclusive of the zero-terminator. ^Note that the name +** length limit is in UTF-8 bytes, not characters nor UTF-16 bytes. +** ^Any attempt to create a function with a longer name +** will result in [SQLITE_MISUSE] being returned. +** +** ^The third parameter (nArg) +** is the number of arguments that the SQL function or +** aggregate takes. ^If this parameter is -1, then the SQL function or +** aggregate may take any number of arguments between 0 and the limit +** set by [sqlite3_limit]([SQLITE_LIMIT_FUNCTION_ARG]). If the third +** parameter is less than -1 or greater than 127 then the behavior is +** undefined. +** +** ^The fourth parameter, eTextRep, specifies what +** [SQLITE_UTF8 | text encoding] this SQL function prefers for +** its parameters. The application should set this parameter to +** [SQLITE_UTF16LE] if the function implementation invokes +** [sqlite3_value_text16le()] on an input, or [SQLITE_UTF16BE] if the +** implementation invokes [sqlite3_value_text16be()] on an input, or +** [SQLITE_UTF16] if [sqlite3_value_text16()] is used, or [SQLITE_UTF8] +** otherwise. ^The same SQL function may be registered multiple times using +** different preferred text encodings, with different implementations for +** each encoding. +** ^When multiple implementations of the same function are available, SQLite +** will pick the one that involves the least amount of data conversion. +** +** ^The fourth parameter may optionally be ORed with [SQLITE_DETERMINISTIC] +** to signal that the function will always return the same result given +** the same inputs within a single SQL statement. Most SQL functions are +** deterministic. The built-in [random()] SQL function is an example of a +** function that is not deterministic. The SQLite query planner is able to +** perform additional optimizations on deterministic functions, so use +** of the [SQLITE_DETERMINISTIC] flag is recommended where possible. +** +** ^(The fifth parameter is an arbitrary pointer. The implementation of the +** function can gain access to this pointer using [sqlite3_user_data()].)^ +** +** ^The sixth, seventh and eighth parameters, xFunc, xStep and xFinal, are +** pointers to C-language functions that implement the SQL function or +** aggregate. ^A scalar SQL function requires an implementation of the xFunc +** callback only; NULL pointers must be passed as the xStep and xFinal +** parameters. ^An aggregate SQL function requires an implementation of xStep +** and xFinal and NULL pointer must be passed for xFunc. ^To delete an existing +** SQL function or aggregate, pass NULL pointers for all three function +** callbacks. +** +** ^(If the ninth parameter to sqlite3_create_function_v2() is not NULL, +** then it is destructor for the application data pointer. +** The destructor is invoked when the function is deleted, either by being +** overloaded or when the database connection closes.)^ +** ^The destructor is also invoked if the call to +** sqlite3_create_function_v2() fails. +** ^When the destructor callback of the tenth parameter is invoked, it +** is passed a single argument which is a copy of the application data +** pointer which was the fifth parameter to sqlite3_create_function_v2(). +** +** ^It is permitted to register multiple implementations of the same +** functions with the same name but with either differing numbers of +** arguments or differing preferred text encodings. ^SQLite will use +** the implementation that most closely matches the way in which the +** SQL function is used. ^A function implementation with a non-negative +** nArg parameter is a better match than a function implementation with +** a negative nArg. ^A function where the preferred text encoding +** matches the database encoding is a better +** match than a function where the encoding is different. +** ^A function where the encoding difference is between UTF16le and UTF16be +** is a closer match than a function where the encoding difference is +** between UTF8 and UTF16. +** +** ^Built-in functions may be overloaded by new application-defined functions. +** +** ^An application-defined function is permitted to call other +** SQLite interfaces. However, such calls must not +** close the database connection nor finalize or reset the prepared +** statement in which the function is running. +*/ +SQLITE_API int sqlite3_create_function( + sqlite3 *db, + const char *zFunctionName, + int nArg, + int eTextRep, + void *pApp, + void (*xFunc)(sqlite3_context*,int,sqlite3_value**), + void (*xStep)(sqlite3_context*,int,sqlite3_value**), + void (*xFinal)(sqlite3_context*) +); +SQLITE_API int sqlite3_create_function16( + sqlite3 *db, + const void *zFunctionName, + int nArg, + int eTextRep, + void *pApp, + void (*xFunc)(sqlite3_context*,int,sqlite3_value**), + void (*xStep)(sqlite3_context*,int,sqlite3_value**), + void (*xFinal)(sqlite3_context*) +); +SQLITE_API int sqlite3_create_function_v2( + sqlite3 *db, + const char *zFunctionName, + int nArg, + int eTextRep, + void *pApp, + void (*xFunc)(sqlite3_context*,int,sqlite3_value**), + void (*xStep)(sqlite3_context*,int,sqlite3_value**), + void (*xFinal)(sqlite3_context*), + void(*xDestroy)(void*) +); + +/* +** CAPI3REF: Text Encodings +** +** These constant define integer codes that represent the various +** text encodings supported by SQLite. +*/ +#define SQLITE_UTF8 1 /* IMP: R-37514-35566 */ +#define SQLITE_UTF16LE 2 /* IMP: R-03371-37637 */ +#define SQLITE_UTF16BE 3 /* IMP: R-51971-34154 */ +#define SQLITE_UTF16 4 /* Use native byte order */ +#define SQLITE_ANY 5 /* Deprecated */ +#define SQLITE_UTF16_ALIGNED 8 /* sqlite3_create_collation only */ + +/* +** CAPI3REF: Function Flags +** +** These constants may be ORed together with the +** [SQLITE_UTF8 | preferred text encoding] as the fourth argument +** to [sqlite3_create_function()], [sqlite3_create_function16()], or +** [sqlite3_create_function_v2()]. +*/ +#define SQLITE_DETERMINISTIC 0x800 + +/* +** CAPI3REF: Deprecated Functions +** DEPRECATED +** +** These functions are [deprecated]. In order to maintain +** backwards compatibility with older code, these functions continue +** to be supported. However, new applications should avoid +** the use of these functions. To encourage programmers to avoid +** these functions, we will not explain what they do. +*/ +#ifndef SQLITE_OMIT_DEPRECATED +SQLITE_API SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*); +SQLITE_API SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*); +SQLITE_API SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); +SQLITE_API SQLITE_DEPRECATED int sqlite3_global_recover(void); +SQLITE_API SQLITE_DEPRECATED void sqlite3_thread_cleanup(void); +SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int), + void*,sqlite3_int64); +#endif + +/* +** CAPI3REF: Obtaining SQL Values +** METHOD: sqlite3_value +** +** Summary: +**
+**
sqlite3_value_blobBLOB value +**
sqlite3_value_doubleREAL value +**
sqlite3_value_int32-bit INTEGER value +**
sqlite3_value_int6464-bit INTEGER value +**
sqlite3_value_pointerPointer value +**
sqlite3_value_textUTF-8 TEXT value +**
sqlite3_value_text16UTF-16 TEXT value in +** the native byteorder +**
sqlite3_value_text16beUTF-16be TEXT value +**
sqlite3_value_text16leUTF-16le TEXT value +**
    +**
sqlite3_value_bytesSize of a BLOB +** or a UTF-8 TEXT in bytes +**
sqlite3_value_bytes16   +** →  Size of UTF-16 +** TEXT in bytes +**
sqlite3_value_typeDefault +** datatype of the value +**
sqlite3_value_numeric_type   +** →  Best numeric datatype of the value +**
sqlite3_value_nochange   +** →  True if the column is unchanged in an UPDATE +** against a virtual table. +**
+** +** Details: +** +** These routines extract type, size, and content information from +** [protected sqlite3_value] objects. Protected sqlite3_value objects +** are used to pass parameter information into implementation of +** [application-defined SQL functions] and [virtual tables]. +** +** These routines work only with [protected sqlite3_value] objects. +** Any attempt to use these routines on an [unprotected sqlite3_value] +** is not threadsafe. +** +** ^These routines work just like the corresponding [column access functions] +** except that these routines take a single [protected sqlite3_value] object +** pointer instead of a [sqlite3_stmt*] pointer and an integer column number. +** +** ^The sqlite3_value_text16() interface extracts a UTF-16 string +** in the native byte-order of the host machine. ^The +** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces +** extract UTF-16 strings as big-endian and little-endian respectively. +** +** ^If [sqlite3_value] object V was initialized +** using [sqlite3_bind_pointer(S,I,P,X,D)] or [sqlite3_result_pointer(C,P,X,D)] +** and if X and Y are strings that compare equal according to strcmp(X,Y), +** then sqlite3_value_pointer(V,Y) will return the pointer P. ^Otherwise, +** sqlite3_value_pointer(V,Y) returns a NULL. The sqlite3_bind_pointer() +** routine is part of the [pointer passing interface] added for SQLite 3.20.0. +** +** ^(The sqlite3_value_type(V) interface returns the +** [SQLITE_INTEGER | datatype code] for the initial datatype of the +** [sqlite3_value] object V. The returned value is one of [SQLITE_INTEGER], +** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL].)^ +** Other interfaces might change the datatype for an sqlite3_value object. +** For example, if the datatype is initially SQLITE_INTEGER and +** sqlite3_value_text(V) is called to extract a text value for that +** integer, then subsequent calls to sqlite3_value_type(V) might return +** SQLITE_TEXT. Whether or not a persistent internal datatype conversion +** occurs is undefined and may change from one release of SQLite to the next. +** +** ^(The sqlite3_value_numeric_type() interface attempts to apply +** numeric affinity to the value. This means that an attempt is +** made to convert the value to an integer or floating point. If +** such a conversion is possible without loss of information (in other +** words, if the value is a string that looks like a number) +** then the conversion is performed. Otherwise no conversion occurs. +** The [SQLITE_INTEGER | datatype] after conversion is returned.)^ +** +** ^Within the [xUpdate] method of a [virtual table], the +** sqlite3_value_nochange(X) interface returns true if and only if +** the column corresponding to X is unchanged by the UPDATE operation +** that the xUpdate method call was invoked to implement and if +** and the prior [xColumn] method call that was invoked to extracted +** the value for that column returned without setting a result (probably +** because it queried [sqlite3_vtab_nochange()] and found that the column +** was unchanging). ^Within an [xUpdate] method, any value for which +** sqlite3_value_nochange(X) is true will in all other respects appear +** to be a NULL value. If sqlite3_value_nochange(X) is invoked anywhere other +** than within an [xUpdate] method call for an UPDATE statement, then +** the return value is arbitrary and meaningless. +** +** Please pay particular attention to the fact that the pointer returned +** from [sqlite3_value_blob()], [sqlite3_value_text()], or +** [sqlite3_value_text16()] can be invalidated by a subsequent call to +** [sqlite3_value_bytes()], [sqlite3_value_bytes16()], [sqlite3_value_text()], +** or [sqlite3_value_text16()]. +** +** These routines must be called from the same thread as +** the SQL function that supplied the [sqlite3_value*] parameters. +*/ +SQLITE_API const void *sqlite3_value_blob(sqlite3_value*); +SQLITE_API double sqlite3_value_double(sqlite3_value*); +SQLITE_API int sqlite3_value_int(sqlite3_value*); +SQLITE_API sqlite3_int64 sqlite3_value_int64(sqlite3_value*); +SQLITE_API void *sqlite3_value_pointer(sqlite3_value*, const char*); +SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value*); +SQLITE_API const void *sqlite3_value_text16(sqlite3_value*); +SQLITE_API const void *sqlite3_value_text16le(sqlite3_value*); +SQLITE_API const void *sqlite3_value_text16be(sqlite3_value*); +SQLITE_API int sqlite3_value_bytes(sqlite3_value*); +SQLITE_API int sqlite3_value_bytes16(sqlite3_value*); +SQLITE_API int sqlite3_value_type(sqlite3_value*); +SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*); +SQLITE_API int sqlite3_value_nochange(sqlite3_value*); + +/* +** CAPI3REF: Finding The Subtype Of SQL Values +** METHOD: sqlite3_value +** +** The sqlite3_value_subtype(V) function returns the subtype for +** an [application-defined SQL function] argument V. The subtype +** information can be used to pass a limited amount of context from +** one SQL function to another. Use the [sqlite3_result_subtype()] +** routine to set the subtype for the return value of an SQL function. +*/ +SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value*); + +/* +** CAPI3REF: Copy And Free SQL Values +** METHOD: sqlite3_value +** +** ^The sqlite3_value_dup(V) interface makes a copy of the [sqlite3_value] +** object D and returns a pointer to that copy. ^The [sqlite3_value] returned +** is a [protected sqlite3_value] object even if the input is not. +** ^The sqlite3_value_dup(V) interface returns NULL if V is NULL or if a +** memory allocation fails. +** +** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object +** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer +** then sqlite3_value_free(V) is a harmless no-op. +*/ +SQLITE_API sqlite3_value *sqlite3_value_dup(const sqlite3_value*); +SQLITE_API void sqlite3_value_free(sqlite3_value*); + +/* +** CAPI3REF: Obtain Aggregate Function Context +** METHOD: sqlite3_context +** +** Implementations of aggregate SQL functions use this +** routine to allocate memory for storing their state. +** +** ^The first time the sqlite3_aggregate_context(C,N) routine is called +** for a particular aggregate function, SQLite +** allocates N of memory, zeroes out that memory, and returns a pointer +** to the new memory. ^On second and subsequent calls to +** sqlite3_aggregate_context() for the same aggregate function instance, +** the same buffer is returned. Sqlite3_aggregate_context() is normally +** called once for each invocation of the xStep callback and then one +** last time when the xFinal callback is invoked. ^(When no rows match +** an aggregate query, the xStep() callback of the aggregate function +** implementation is never called and xFinal() is called exactly once. +** In those cases, sqlite3_aggregate_context() might be called for the +** first time from within xFinal().)^ +** +** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer +** when first called if N is less than or equal to zero or if a memory +** allocate error occurs. +** +** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is +** determined by the N parameter on first successful call. Changing the +** value of N in subsequent call to sqlite3_aggregate_context() within +** the same aggregate function instance will not resize the memory +** allocation.)^ Within the xFinal callback, it is customary to set +** N=0 in calls to sqlite3_aggregate_context(C,N) so that no +** pointless memory allocations occur. +** +** ^SQLite automatically frees the memory allocated by +** sqlite3_aggregate_context() when the aggregate query concludes. +** +** The first parameter must be a copy of the +** [sqlite3_context | SQL function context] that is the first parameter +** to the xStep or xFinal callback routine that implements the aggregate +** function. +** +** This routine must be called from the same thread in which +** the aggregate SQL function is running. +*/ +SQLITE_API void *sqlite3_aggregate_context(sqlite3_context*, int nBytes); + +/* +** CAPI3REF: User Data For Functions +** METHOD: sqlite3_context +** +** ^The sqlite3_user_data() interface returns a copy of +** the pointer that was the pUserData parameter (the 5th parameter) +** of the [sqlite3_create_function()] +** and [sqlite3_create_function16()] routines that originally +** registered the application defined function. +** +** This routine must be called from the same thread in which +** the application-defined function is running. +*/ +SQLITE_API void *sqlite3_user_data(sqlite3_context*); + +/* +** CAPI3REF: Database Connection For Functions +** METHOD: sqlite3_context +** +** ^The sqlite3_context_db_handle() interface returns a copy of +** the pointer to the [database connection] (the 1st parameter) +** of the [sqlite3_create_function()] +** and [sqlite3_create_function16()] routines that originally +** registered the application defined function. +*/ +SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*); + +/* +** CAPI3REF: Function Auxiliary Data +** METHOD: sqlite3_context +** +** These functions may be used by (non-aggregate) SQL functions to +** associate metadata with argument values. If the same value is passed to +** multiple invocations of the same SQL function during query execution, under +** some circumstances the associated metadata may be preserved. An example +** of where this might be useful is in a regular-expression matching +** function. The compiled version of the regular expression can be stored as +** metadata associated with the pattern string. +** Then as long as the pattern string remains the same, +** the compiled regular expression can be reused on multiple +** invocations of the same function. +** +** ^The sqlite3_get_auxdata(C,N) interface returns a pointer to the metadata +** associated by the sqlite3_set_auxdata(C,N,P,X) function with the Nth argument +** value to the application-defined function. ^N is zero for the left-most +** function argument. ^If there is no metadata +** associated with the function argument, the sqlite3_get_auxdata(C,N) interface +** returns a NULL pointer. +** +** ^The sqlite3_set_auxdata(C,N,P,X) interface saves P as metadata for the N-th +** argument of the application-defined function. ^Subsequent +** calls to sqlite3_get_auxdata(C,N) return P from the most recent +** sqlite3_set_auxdata(C,N,P,X) call if the metadata is still valid or +** NULL if the metadata has been discarded. +** ^After each call to sqlite3_set_auxdata(C,N,P,X) where X is not NULL, +** SQLite will invoke the destructor function X with parameter P exactly +** once, when the metadata is discarded. +** SQLite is free to discard the metadata at any time, including:
    +**
  • ^(when the corresponding function parameter changes)^, or +**
  • ^(when [sqlite3_reset()] or [sqlite3_finalize()] is called for the +** SQL statement)^, or +**
  • ^(when sqlite3_set_auxdata() is invoked again on the same +** parameter)^, or +**
  • ^(during the original sqlite3_set_auxdata() call when a memory +** allocation error occurs.)^
+** +** Note the last bullet in particular. The destructor X in +** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the +** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata() +** should be called near the end of the function implementation and the +** function implementation should not make any use of P after +** sqlite3_set_auxdata() has been called. +** +** ^(In practice, metadata is preserved between function calls for +** function parameters that are compile-time constants, including literal +** values and [parameters] and expressions composed from the same.)^ +** +** The value of the N parameter to these interfaces should be non-negative. +** Future enhancements may make use of negative N values to define new +** kinds of function caching behavior. +** +** These routines must be called from the same thread in which +** the SQL function is running. +*/ +SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N); +SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*)); + + +/* +** CAPI3REF: Constants Defining Special Destructor Behavior +** +** These are special values for the destructor that is passed in as the +** final argument to routines like [sqlite3_result_blob()]. ^If the destructor +** argument is SQLITE_STATIC, it means that the content pointer is constant +** and will never change. It does not need to be destroyed. ^The +** SQLITE_TRANSIENT value means that the content will likely change in +** the near future and that SQLite should make its own private copy of +** the content before returning. +** +** The typedef is necessary to work around problems in certain +** C++ compilers. +*/ +typedef void (*sqlite3_destructor_type)(void*); +#define SQLITE_STATIC ((sqlite3_destructor_type)0) +#define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) + +/* +** CAPI3REF: Setting The Result Of An SQL Function +** METHOD: sqlite3_context +** +** These routines are used by the xFunc or xFinal callbacks that +** implement SQL functions and aggregates. See +** [sqlite3_create_function()] and [sqlite3_create_function16()] +** for additional information. +** +** These functions work very much like the [parameter binding] family of +** functions used to bind values to host parameters in prepared statements. +** Refer to the [SQL parameter] documentation for additional information. +** +** ^The sqlite3_result_blob() interface sets the result from +** an application-defined function to be the BLOB whose content is pointed +** to by the second parameter and which is N bytes long where N is the +** third parameter. +** +** ^The sqlite3_result_zeroblob(C,N) and sqlite3_result_zeroblob64(C,N) +** interfaces set the result of the application-defined function to be +** a BLOB containing all zero bytes and N bytes in size. +** +** ^The sqlite3_result_double() interface sets the result from +** an application-defined function to be a floating point value specified +** by its 2nd argument. +** +** ^The sqlite3_result_error() and sqlite3_result_error16() functions +** cause the implemented SQL function to throw an exception. +** ^SQLite uses the string pointed to by the +** 2nd parameter of sqlite3_result_error() or sqlite3_result_error16() +** as the text of an error message. ^SQLite interprets the error +** message string from sqlite3_result_error() as UTF-8. ^SQLite +** interprets the string from sqlite3_result_error16() as UTF-16 in native +** byte order. ^If the third parameter to sqlite3_result_error() +** or sqlite3_result_error16() is negative then SQLite takes as the error +** message all text up through the first zero character. +** ^If the third parameter to sqlite3_result_error() or +** sqlite3_result_error16() is non-negative then SQLite takes that many +** bytes (not characters) from the 2nd parameter as the error message. +** ^The sqlite3_result_error() and sqlite3_result_error16() +** routines make a private copy of the error message text before +** they return. Hence, the calling function can deallocate or +** modify the text after they return without harm. +** ^The sqlite3_result_error_code() function changes the error code +** returned by SQLite as a result of an error in a function. ^By default, +** the error code is SQLITE_ERROR. ^A subsequent call to sqlite3_result_error() +** or sqlite3_result_error16() resets the error code to SQLITE_ERROR. +** +** ^The sqlite3_result_error_toobig() interface causes SQLite to throw an +** error indicating that a string or BLOB is too long to represent. +** +** ^The sqlite3_result_error_nomem() interface causes SQLite to throw an +** error indicating that a memory allocation failed. +** +** ^The sqlite3_result_int() interface sets the return value +** of the application-defined function to be the 32-bit signed integer +** value given in the 2nd argument. +** ^The sqlite3_result_int64() interface sets the return value +** of the application-defined function to be the 64-bit signed integer +** value given in the 2nd argument. +** +** ^The sqlite3_result_null() interface sets the return value +** of the application-defined function to be NULL. +** +** ^The sqlite3_result_text(), sqlite3_result_text16(), +** sqlite3_result_text16le(), and sqlite3_result_text16be() interfaces +** set the return value of the application-defined function to be +** a text string which is represented as UTF-8, UTF-16 native byte order, +** UTF-16 little endian, or UTF-16 big endian, respectively. +** ^The sqlite3_result_text64() interface sets the return value of an +** application-defined function to be a text string in an encoding +** specified by the fifth (and last) parameter, which must be one +** of [SQLITE_UTF8], [SQLITE_UTF16], [SQLITE_UTF16BE], or [SQLITE_UTF16LE]. +** ^SQLite takes the text result from the application from +** the 2nd parameter of the sqlite3_result_text* interfaces. +** ^If the 3rd parameter to the sqlite3_result_text* interfaces +** is negative, then SQLite takes result text from the 2nd parameter +** through the first zero character. +** ^If the 3rd parameter to the sqlite3_result_text* interfaces +** is non-negative, then as many bytes (not characters) of the text +** pointed to by the 2nd parameter are taken as the application-defined +** function result. If the 3rd parameter is non-negative, then it +** must be the byte offset into the string where the NUL terminator would +** appear if the string where NUL terminated. If any NUL characters occur +** in the string at a byte offset that is less than the value of the 3rd +** parameter, then the resulting string will contain embedded NULs and the +** result of expressions operating on strings with embedded NULs is undefined. +** ^If the 4th parameter to the sqlite3_result_text* interfaces +** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that +** function as the destructor on the text or BLOB result when it has +** finished using that result. +** ^If the 4th parameter to the sqlite3_result_text* interfaces or to +** sqlite3_result_blob is the special constant SQLITE_STATIC, then SQLite +** assumes that the text or BLOB result is in constant space and does not +** copy the content of the parameter nor call a destructor on the content +** when it has finished using that result. +** ^If the 4th parameter to the sqlite3_result_text* interfaces +** or sqlite3_result_blob is the special constant SQLITE_TRANSIENT +** then SQLite makes a copy of the result into space obtained +** from [sqlite3_malloc()] before it returns. +** +** ^The sqlite3_result_value() interface sets the result of +** the application-defined function to be a copy of the +** [unprotected sqlite3_value] object specified by the 2nd parameter. ^The +** sqlite3_result_value() interface makes a copy of the [sqlite3_value] +** so that the [sqlite3_value] specified in the parameter may change or +** be deallocated after sqlite3_result_value() returns without harm. +** ^A [protected sqlite3_value] object may always be used where an +** [unprotected sqlite3_value] object is required, so either +** kind of [sqlite3_value] object can be used with this interface. +** +** ^The sqlite3_result_pointer(C,P,T,D) interface sets the result to an +** SQL NULL value, just like [sqlite3_result_null(C)], except that it +** also associates the host-language pointer P or type T with that +** NULL value such that the pointer can be retrieved within an +** [application-defined SQL function] using [sqlite3_value_pointer()]. +** ^If the D parameter is not NULL, then it is a pointer to a destructor +** for the P parameter. ^SQLite invokes D with P as its only argument +** when SQLite is finished with P. The T parameter should be a static +** string and preferably a string literal. The sqlite3_result_pointer() +** routine is part of the [pointer passing interface] added for SQLite 3.20.0. +** +** If these routines are called from within the different thread +** than the one containing the application-defined function that received +** the [sqlite3_context] pointer, the results are undefined. +*/ +SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); +SQLITE_API void sqlite3_result_blob64(sqlite3_context*,const void*, + sqlite3_uint64,void(*)(void*)); +SQLITE_API void sqlite3_result_double(sqlite3_context*, double); +SQLITE_API void sqlite3_result_error(sqlite3_context*, const char*, int); +SQLITE_API void sqlite3_result_error16(sqlite3_context*, const void*, int); +SQLITE_API void sqlite3_result_error_toobig(sqlite3_context*); +SQLITE_API void sqlite3_result_error_nomem(sqlite3_context*); +SQLITE_API void sqlite3_result_error_code(sqlite3_context*, int); +SQLITE_API void sqlite3_result_int(sqlite3_context*, int); +SQLITE_API void sqlite3_result_int64(sqlite3_context*, sqlite3_int64); +SQLITE_API void sqlite3_result_null(sqlite3_context*); +SQLITE_API void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*)); +SQLITE_API void sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64, + void(*)(void*), unsigned char encoding); +SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*)); +SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*)); +SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*)); +SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*); +SQLITE_API void sqlite3_result_pointer(sqlite3_context*, void*,const char*,void(*)(void*)); +SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n); +SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); + + +/* +** CAPI3REF: Setting The Subtype Of An SQL Function +** METHOD: sqlite3_context +** +** The sqlite3_result_subtype(C,T) function causes the subtype of +** the result from the [application-defined SQL function] with +** [sqlite3_context] C to be the value T. Only the lower 8 bits +** of the subtype T are preserved in current versions of SQLite; +** higher order bits are discarded. +** The number of subtype bytes preserved by SQLite might increase +** in future releases of SQLite. +*/ +SQLITE_API void sqlite3_result_subtype(sqlite3_context*,unsigned int); + +/* +** CAPI3REF: Define New Collating Sequences +** METHOD: sqlite3 +** +** ^These functions add, remove, or modify a [collation] associated +** with the [database connection] specified as the first argument. +** +** ^The name of the collation is a UTF-8 string +** for sqlite3_create_collation() and sqlite3_create_collation_v2() +** and a UTF-16 string in native byte order for sqlite3_create_collation16(). +** ^Collation names that compare equal according to [sqlite3_strnicmp()] are +** considered to be the same name. +** +** ^(The third argument (eTextRep) must be one of the constants: +**
    +**
  • [SQLITE_UTF8], +**
  • [SQLITE_UTF16LE], +**
  • [SQLITE_UTF16BE], +**
  • [SQLITE_UTF16], or +**
  • [SQLITE_UTF16_ALIGNED]. +**
)^ +** ^The eTextRep argument determines the encoding of strings passed +** to the collating function callback, xCallback. +** ^The [SQLITE_UTF16] and [SQLITE_UTF16_ALIGNED] values for eTextRep +** force strings to be UTF16 with native byte order. +** ^The [SQLITE_UTF16_ALIGNED] value for eTextRep forces strings to begin +** on an even byte address. +** +** ^The fourth argument, pArg, is an application data pointer that is passed +** through as the first argument to the collating function callback. +** +** ^The fifth argument, xCallback, is a pointer to the collating function. +** ^Multiple collating functions can be registered using the same name but +** with different eTextRep parameters and SQLite will use whichever +** function requires the least amount of data transformation. +** ^If the xCallback argument is NULL then the collating function is +** deleted. ^When all collating functions having the same name are deleted, +** that collation is no longer usable. +** +** ^The collating function callback is invoked with a copy of the pArg +** application data pointer and with two strings in the encoding specified +** by the eTextRep argument. The collating function must return an +** integer that is negative, zero, or positive +** if the first string is less than, equal to, or greater than the second, +** respectively. A collating function must always return the same answer +** given the same inputs. If two or more collating functions are registered +** to the same collation name (using different eTextRep values) then all +** must give an equivalent answer when invoked with equivalent strings. +** The collating function must obey the following properties for all +** strings A, B, and C: +** +**
    +**
  1. If A==B then B==A. +**
  2. If A==B and B==C then A==C. +**
  3. If A<B THEN B>A. +**
  4. If A<B and B<C then A<C. +**
+** +** If a collating function fails any of the above constraints and that +** collating function is registered and used, then the behavior of SQLite +** is undefined. +** +** ^The sqlite3_create_collation_v2() works like sqlite3_create_collation() +** with the addition that the xDestroy callback is invoked on pArg when +** the collating function is deleted. +** ^Collating functions are deleted when they are overridden by later +** calls to the collation creation functions or when the +** [database connection] is closed using [sqlite3_close()]. +** +** ^The xDestroy callback is not called if the +** sqlite3_create_collation_v2() function fails. Applications that invoke +** sqlite3_create_collation_v2() with a non-NULL xDestroy argument should +** check the return code and dispose of the application data pointer +** themselves rather than expecting SQLite to deal with it for them. +** This is different from every other SQLite interface. The inconsistency +** is unfortunate but cannot be changed without breaking backwards +** compatibility. +** +** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. +*/ +SQLITE_API int sqlite3_create_collation( + sqlite3*, + const char *zName, + int eTextRep, + void *pArg, + int(*xCompare)(void*,int,const void*,int,const void*) +); +SQLITE_API int sqlite3_create_collation_v2( + sqlite3*, + const char *zName, + int eTextRep, + void *pArg, + int(*xCompare)(void*,int,const void*,int,const void*), + void(*xDestroy)(void*) +); +SQLITE_API int sqlite3_create_collation16( + sqlite3*, + const void *zName, + int eTextRep, + void *pArg, + int(*xCompare)(void*,int,const void*,int,const void*) +); + +/* +** CAPI3REF: Collation Needed Callbacks +** METHOD: sqlite3 +** +** ^To avoid having to register all collation sequences before a database +** can be used, a single callback function may be registered with the +** [database connection] to be invoked whenever an undefined collation +** sequence is required. +** +** ^If the function is registered using the sqlite3_collation_needed() API, +** then it is passed the names of undefined collation sequences as strings +** encoded in UTF-8. ^If sqlite3_collation_needed16() is used, +** the names are passed as UTF-16 in machine native byte order. +** ^A call to either function replaces the existing collation-needed callback. +** +** ^(When the callback is invoked, the first argument passed is a copy +** of the second argument to sqlite3_collation_needed() or +** sqlite3_collation_needed16(). The second argument is the database +** connection. The third argument is one of [SQLITE_UTF8], [SQLITE_UTF16BE], +** or [SQLITE_UTF16LE], indicating the most desirable form of the collation +** sequence function required. The fourth parameter is the name of the +** required collation sequence.)^ +** +** The callback function should register the desired collation using +** [sqlite3_create_collation()], [sqlite3_create_collation16()], or +** [sqlite3_create_collation_v2()]. +*/ +SQLITE_API int sqlite3_collation_needed( + sqlite3*, + void*, + void(*)(void*,sqlite3*,int eTextRep,const char*) +); +SQLITE_API int sqlite3_collation_needed16( + sqlite3*, + void*, + void(*)(void*,sqlite3*,int eTextRep,const void*) +); + +#ifdef SQLITE_HAS_CODEC +/* +** Specify the key for an encrypted database. This routine should be +** called right after sqlite3_open(). +** +** The code to implement this API is not available in the public release +** of SQLite. +*/ +SQLITE_API int sqlite3_key( + sqlite3 *db, /* Database to be rekeyed */ + const void *pKey, int nKey /* The key */ +); +SQLITE_API int sqlite3_key_v2( + sqlite3 *db, /* Database to be rekeyed */ + const char *zDbName, /* Name of the database */ + const void *pKey, int nKey /* The key */ +); + +/* +** Change the key on an open database. If the current database is not +** encrypted, this routine will encrypt it. If pNew==0 or nNew==0, the +** database is decrypted. +** +** The code to implement this API is not available in the public release +** of SQLite. +*/ +SQLITE_API int sqlite3_rekey( + sqlite3 *db, /* Database to be rekeyed */ + const void *pKey, int nKey /* The new key */ +); +SQLITE_API int sqlite3_rekey_v2( + sqlite3 *db, /* Database to be rekeyed */ + const char *zDbName, /* Name of the database */ + const void *pKey, int nKey /* The new key */ +); + +/* +** Specify the activation key for a SEE database. Unless +** activated, none of the SEE routines will work. +*/ +SQLITE_API void sqlite3_activate_see( + const char *zPassPhrase /* Activation phrase */ +); +#endif + +#ifdef SQLITE_ENABLE_CEROD +/* +** Specify the activation key for a CEROD database. Unless +** activated, none of the CEROD routines will work. +*/ +SQLITE_API void sqlite3_activate_cerod( + const char *zPassPhrase /* Activation phrase */ +); +#endif + +/* +** CAPI3REF: Suspend Execution For A Short Time +** +** The sqlite3_sleep() function causes the current thread to suspend execution +** for at least a number of milliseconds specified in its parameter. +** +** If the operating system does not support sleep requests with +** millisecond time resolution, then the time will be rounded up to +** the nearest second. The number of milliseconds of sleep actually +** requested from the operating system is returned. +** +** ^SQLite implements this interface by calling the xSleep() +** method of the default [sqlite3_vfs] object. If the xSleep() method +** of the default VFS is not implemented correctly, or not implemented at +** all, then the behavior of sqlite3_sleep() may deviate from the description +** in the previous paragraphs. +*/ +SQLITE_API int sqlite3_sleep(int); + +/* +** CAPI3REF: Name Of The Folder Holding Temporary Files +** +** ^(If this global variable is made to point to a string which is +** the name of a folder (a.k.a. directory), then all temporary files +** created by SQLite when using a built-in [sqlite3_vfs | VFS] +** will be placed in that directory.)^ ^If this variable +** is a NULL pointer, then SQLite performs a search for an appropriate +** temporary file directory. +** +** Applications are strongly discouraged from using this global variable. +** It is required to set a temporary folder on Windows Runtime (WinRT). +** But for all other platforms, it is highly recommended that applications +** neither read nor write this variable. This global variable is a relic +** that exists for backwards compatibility of legacy applications and should +** be avoided in new projects. +** +** It is not safe to read or modify this variable in more than one +** thread at a time. It is not safe to read or modify this variable +** if a [database connection] is being used at the same time in a separate +** thread. +** It is intended that this variable be set once +** as part of process initialization and before any SQLite interface +** routines have been called and that this variable remain unchanged +** thereafter. +** +** ^The [temp_store_directory pragma] may modify this variable and cause +** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, +** the [temp_store_directory pragma] always assumes that any string +** that this variable points to is held in memory obtained from +** [sqlite3_malloc] and the pragma may attempt to free that memory +** using [sqlite3_free]. +** Hence, if this variable is modified directly, either it should be +** made NULL or made to point to memory obtained from [sqlite3_malloc] +** or else the use of the [temp_store_directory pragma] should be avoided. +** Except when requested by the [temp_store_directory pragma], SQLite +** does not free the memory that sqlite3_temp_directory points to. If +** the application wants that memory to be freed, it must do +** so itself, taking care to only do so after all [database connection] +** objects have been destroyed. +** +** Note to Windows Runtime users: The temporary directory must be set +** prior to calling [sqlite3_open] or [sqlite3_open_v2]. Otherwise, various +** features that require the use of temporary files may fail. Here is an +** example of how to do this using C++ with the Windows Runtime: +** +**
+** LPCWSTR zPath = Windows::Storage::ApplicationData::Current->
+**       TemporaryFolder->Path->Data();
+** char zPathBuf[MAX_PATH + 1];
+** memset(zPathBuf, 0, sizeof(zPathBuf));
+** WideCharToMultiByte(CP_UTF8, 0, zPath, -1, zPathBuf, sizeof(zPathBuf),
+**       NULL, NULL);
+** sqlite3_temp_directory = sqlite3_mprintf("%s", zPathBuf);
+** 
+*/ +SQLITE_API SQLITE_EXTERN char *sqlite3_temp_directory; + +/* +** CAPI3REF: Name Of The Folder Holding Database Files +** +** ^(If this global variable is made to point to a string which is +** the name of a folder (a.k.a. directory), then all database files +** specified with a relative pathname and created or accessed by +** SQLite when using a built-in windows [sqlite3_vfs | VFS] will be assumed +** to be relative to that directory.)^ ^If this variable is a NULL +** pointer, then SQLite assumes that all database files specified +** with a relative pathname are relative to the current directory +** for the process. Only the windows VFS makes use of this global +** variable; it is ignored by the unix VFS. +** +** Changing the value of this variable while a database connection is +** open can result in a corrupt database. +** +** It is not safe to read or modify this variable in more than one +** thread at a time. It is not safe to read or modify this variable +** if a [database connection] is being used at the same time in a separate +** thread. +** It is intended that this variable be set once +** as part of process initialization and before any SQLite interface +** routines have been called and that this variable remain unchanged +** thereafter. +** +** ^The [data_store_directory pragma] may modify this variable and cause +** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, +** the [data_store_directory pragma] always assumes that any string +** that this variable points to is held in memory obtained from +** [sqlite3_malloc] and the pragma may attempt to free that memory +** using [sqlite3_free]. +** Hence, if this variable is modified directly, either it should be +** made NULL or made to point to memory obtained from [sqlite3_malloc] +** or else the use of the [data_store_directory pragma] should be avoided. +*/ +SQLITE_API SQLITE_EXTERN char *sqlite3_data_directory; + +/* +** CAPI3REF: Win32 Specific Interface +** +** These interfaces are available only on Windows. The +** [sqlite3_win32_set_directory] interface is used to set the value associated +** with the [sqlite3_temp_directory] or [sqlite3_data_directory] variable, to +** zValue, depending on the value of the type parameter. The zValue parameter +** should be NULL to cause the previous value to be freed via [sqlite3_free]; +** a non-NULL value will be copied into memory obtained from [sqlite3_malloc] +** prior to being used. The [sqlite3_win32_set_directory] interface returns +** [SQLITE_OK] to indicate success, [SQLITE_ERROR] if the type is unsupported, +** or [SQLITE_NOMEM] if memory could not be allocated. The value of the +** [sqlite3_data_directory] variable is intended to act as a replacement for +** the current directory on the sub-platforms of Win32 where that concept is +** not present, e.g. WinRT and UWP. The [sqlite3_win32_set_directory8] and +** [sqlite3_win32_set_directory16] interfaces behave exactly the same as the +** sqlite3_win32_set_directory interface except the string parameter must be +** UTF-8 or UTF-16, respectively. +*/ +SQLITE_API int sqlite3_win32_set_directory( + unsigned long type, /* Identifier for directory being set or reset */ + void *zValue /* New value for directory being set or reset */ +); +SQLITE_API int sqlite3_win32_set_directory8(unsigned long type, const char *zValue); +SQLITE_API int sqlite3_win32_set_directory16(unsigned long type, const void *zValue); + +/* +** CAPI3REF: Win32 Directory Types +** +** These macros are only available on Windows. They define the allowed values +** for the type argument to the [sqlite3_win32_set_directory] interface. +*/ +#define SQLITE_WIN32_DATA_DIRECTORY_TYPE 1 +#define SQLITE_WIN32_TEMP_DIRECTORY_TYPE 2 + +/* +** CAPI3REF: Test For Auto-Commit Mode +** KEYWORDS: {autocommit mode} +** METHOD: sqlite3 +** +** ^The sqlite3_get_autocommit() interface returns non-zero or +** zero if the given database connection is or is not in autocommit mode, +** respectively. ^Autocommit mode is on by default. +** ^Autocommit mode is disabled by a [BEGIN] statement. +** ^Autocommit mode is re-enabled by a [COMMIT] or [ROLLBACK]. +** +** If certain kinds of errors occur on a statement within a multi-statement +** transaction (errors including [SQLITE_FULL], [SQLITE_IOERR], +** [SQLITE_NOMEM], [SQLITE_BUSY], and [SQLITE_INTERRUPT]) then the +** transaction might be rolled back automatically. The only way to +** find out whether SQLite automatically rolled back the transaction after +** an error is to use this function. +** +** If another thread changes the autocommit status of the database +** connection while this routine is running, then the return value +** is undefined. +*/ +SQLITE_API int sqlite3_get_autocommit(sqlite3*); + +/* +** CAPI3REF: Find The Database Handle Of A Prepared Statement +** METHOD: sqlite3_stmt +** +** ^The sqlite3_db_handle interface returns the [database connection] handle +** to which a [prepared statement] belongs. ^The [database connection] +** returned by sqlite3_db_handle is the same [database connection] +** that was the first argument +** to the [sqlite3_prepare_v2()] call (or its variants) that was used to +** create the statement in the first place. +*/ +SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*); + +/* +** CAPI3REF: Return The Filename For A Database Connection +** METHOD: sqlite3 +** +** ^The sqlite3_db_filename(D,N) interface returns a pointer to a filename +** associated with database N of connection D. ^The main database file +** has the name "main". If there is no attached database N on the database +** connection D, or if database N is a temporary or in-memory database, then +** a NULL pointer is returned. +** +** ^The filename returned by this function is the output of the +** xFullPathname method of the [VFS]. ^In other words, the filename +** will be an absolute pathname, even if the filename used +** to open the database originally was a URI or relative pathname. +*/ +SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName); + +/* +** CAPI3REF: Determine if a database is read-only +** METHOD: sqlite3 +** +** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N +** of connection D is read-only, 0 if it is read/write, or -1 if N is not +** the name of a database on connection D. +*/ +SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName); + +/* +** CAPI3REF: Find the next prepared statement +** METHOD: sqlite3 +** +** ^This interface returns a pointer to the next [prepared statement] after +** pStmt associated with the [database connection] pDb. ^If pStmt is NULL +** then this interface returns a pointer to the first prepared statement +** associated with the database connection pDb. ^If no prepared statement +** satisfies the conditions of this routine, it returns NULL. +** +** The [database connection] pointer D in a call to +** [sqlite3_next_stmt(D,S)] must refer to an open database +** connection and in particular must not be a NULL pointer. +*/ +SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); + +/* +** CAPI3REF: Commit And Rollback Notification Callbacks +** METHOD: sqlite3 +** +** ^The sqlite3_commit_hook() interface registers a callback +** function to be invoked whenever a transaction is [COMMIT | committed]. +** ^Any callback set by a previous call to sqlite3_commit_hook() +** for the same database connection is overridden. +** ^The sqlite3_rollback_hook() interface registers a callback +** function to be invoked whenever a transaction is [ROLLBACK | rolled back]. +** ^Any callback set by a previous call to sqlite3_rollback_hook() +** for the same database connection is overridden. +** ^The pArg argument is passed through to the callback. +** ^If the callback on a commit hook function returns non-zero, +** then the commit is converted into a rollback. +** +** ^The sqlite3_commit_hook(D,C,P) and sqlite3_rollback_hook(D,C,P) functions +** return the P argument from the previous call of the same function +** on the same [database connection] D, or NULL for +** the first call for each function on D. +** +** The commit and rollback hook callbacks are not reentrant. +** The callback implementation must not do anything that will modify +** the database connection that invoked the callback. Any actions +** to modify the database connection must be deferred until after the +** completion of the [sqlite3_step()] call that triggered the commit +** or rollback hook in the first place. +** Note that running any other SQL statements, including SELECT statements, +** or merely calling [sqlite3_prepare_v2()] and [sqlite3_step()] will modify +** the database connections for the meaning of "modify" in this paragraph. +** +** ^Registering a NULL function disables the callback. +** +** ^When the commit hook callback routine returns zero, the [COMMIT] +** operation is allowed to continue normally. ^If the commit hook +** returns non-zero, then the [COMMIT] is converted into a [ROLLBACK]. +** ^The rollback hook is invoked on a rollback that results from a commit +** hook returning non-zero, just as it would be with any other rollback. +** +** ^For the purposes of this API, a transaction is said to have been +** rolled back if an explicit "ROLLBACK" statement is executed, or +** an error or constraint causes an implicit rollback to occur. +** ^The rollback callback is not invoked if a transaction is +** automatically rolled back because the database connection is closed. +** +** See also the [sqlite3_update_hook()] interface. +*/ +SQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*); +SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); + +/* +** CAPI3REF: Data Change Notification Callbacks +** METHOD: sqlite3 +** +** ^The sqlite3_update_hook() interface registers a callback function +** with the [database connection] identified by the first argument +** to be invoked whenever a row is updated, inserted or deleted in +** a [rowid table]. +** ^Any callback set by a previous call to this function +** for the same database connection is overridden. +** +** ^The second argument is a pointer to the function to invoke when a +** row is updated, inserted or deleted in a rowid table. +** ^The first argument to the callback is a copy of the third argument +** to sqlite3_update_hook(). +** ^The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE], +** or [SQLITE_UPDATE], depending on the operation that caused the callback +** to be invoked. +** ^The third and fourth arguments to the callback contain pointers to the +** database and table name containing the affected row. +** ^The final callback parameter is the [rowid] of the row. +** ^In the case of an update, this is the [rowid] after the update takes place. +** +** ^(The update hook is not invoked when internal system tables are +** modified (i.e. sqlite_master and sqlite_sequence).)^ +** ^The update hook is not invoked when [WITHOUT ROWID] tables are modified. +** +** ^In the current implementation, the update hook +** is not invoked when conflicting rows are deleted because of an +** [ON CONFLICT | ON CONFLICT REPLACE] clause. ^Nor is the update hook +** invoked when rows are deleted using the [truncate optimization]. +** The exceptions defined in this paragraph might change in a future +** release of SQLite. +** +** The update hook implementation must not do anything that will modify +** the database connection that invoked the update hook. Any actions +** to modify the database connection must be deferred until after the +** completion of the [sqlite3_step()] call that triggered the update hook. +** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their +** database connections for the meaning of "modify" in this paragraph. +** +** ^The sqlite3_update_hook(D,C,P) function +** returns the P argument from the previous call +** on the same [database connection] D, or NULL for +** the first call on D. +** +** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()], +** and [sqlite3_preupdate_hook()] interfaces. +*/ +SQLITE_API void *sqlite3_update_hook( + sqlite3*, + void(*)(void *,int ,char const *,char const *,sqlite3_int64), + void* +); + +/* +** CAPI3REF: Enable Or Disable Shared Pager Cache +** +** ^(This routine enables or disables the sharing of the database cache +** and schema data structures between [database connection | connections] +** to the same database. Sharing is enabled if the argument is true +** and disabled if the argument is false.)^ +** +** ^Cache sharing is enabled and disabled for an entire process. +** This is a change as of SQLite [version 3.5.0] ([dateof:3.5.0]). +** In prior versions of SQLite, +** sharing was enabled or disabled for each thread separately. +** +** ^(The cache sharing mode set by this interface effects all subsequent +** calls to [sqlite3_open()], [sqlite3_open_v2()], and [sqlite3_open16()]. +** Existing database connections continue use the sharing mode +** that was in effect at the time they were opened.)^ +** +** ^(This routine returns [SQLITE_OK] if shared cache was enabled or disabled +** successfully. An [error code] is returned otherwise.)^ +** +** ^Shared cache is disabled by default. But this might change in +** future releases of SQLite. Applications that care about shared +** cache setting should set it explicitly. +** +** Note: This method is disabled on MacOS X 10.7 and iOS version 5.0 +** and will always return SQLITE_MISUSE. On those systems, +** shared cache mode should be enabled per-database connection via +** [sqlite3_open_v2()] with [SQLITE_OPEN_SHAREDCACHE]. +** +** This interface is threadsafe on processors where writing a +** 32-bit integer is atomic. +** +** See Also: [SQLite Shared-Cache Mode] +*/ +SQLITE_API int sqlite3_enable_shared_cache(int); + +/* +** CAPI3REF: Attempt To Free Heap Memory +** +** ^The sqlite3_release_memory() interface attempts to free N bytes +** of heap memory by deallocating non-essential memory allocations +** held by the database library. Memory used to cache database +** pages to improve performance is an example of non-essential memory. +** ^sqlite3_release_memory() returns the number of bytes actually freed, +** which might be more or less than the amount requested. +** ^The sqlite3_release_memory() routine is a no-op returning zero +** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT]. +** +** See also: [sqlite3_db_release_memory()] +*/ +SQLITE_API int sqlite3_release_memory(int); + +/* +** CAPI3REF: Free Memory Used By A Database Connection +** METHOD: sqlite3 +** +** ^The sqlite3_db_release_memory(D) interface attempts to free as much heap +** memory as possible from database connection D. Unlike the +** [sqlite3_release_memory()] interface, this interface is in effect even +** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is +** omitted. +** +** See also: [sqlite3_release_memory()] +*/ +SQLITE_API int sqlite3_db_release_memory(sqlite3*); + +/* +** CAPI3REF: Impose A Limit On Heap Size +** +** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the +** soft limit on the amount of heap memory that may be allocated by SQLite. +** ^SQLite strives to keep heap memory utilization below the soft heap +** limit by reducing the number of pages held in the page cache +** as heap memory usages approaches the limit. +** ^The soft heap limit is "soft" because even though SQLite strives to stay +** below the limit, it will exceed the limit rather than generate +** an [SQLITE_NOMEM] error. In other words, the soft heap limit +** is advisory only. +** +** ^The return value from sqlite3_soft_heap_limit64() is the size of +** the soft heap limit prior to the call, or negative in the case of an +** error. ^If the argument N is negative +** then no change is made to the soft heap limit. Hence, the current +** size of the soft heap limit can be determined by invoking +** sqlite3_soft_heap_limit64() with a negative argument. +** +** ^If the argument N is zero then the soft heap limit is disabled. +** +** ^(The soft heap limit is not enforced in the current implementation +** if one or more of following conditions are true: +** +**
    +**
  • The soft heap limit is set to zero. +**
  • Memory accounting is disabled using a combination of the +** [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and +** the [SQLITE_DEFAULT_MEMSTATUS] compile-time option. +**
  • An alternative page cache implementation is specified using +** [sqlite3_config]([SQLITE_CONFIG_PCACHE2],...). +**
  • The page cache allocates from its own memory pool supplied +** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than +** from the heap. +**
)^ +** +** Beginning with SQLite [version 3.7.3] ([dateof:3.7.3]), +** the soft heap limit is enforced +** regardless of whether or not the [SQLITE_ENABLE_MEMORY_MANAGEMENT] +** compile-time option is invoked. With [SQLITE_ENABLE_MEMORY_MANAGEMENT], +** the soft heap limit is enforced on every memory allocation. Without +** [SQLITE_ENABLE_MEMORY_MANAGEMENT], the soft heap limit is only enforced +** when memory is allocated by the page cache. Testing suggests that because +** the page cache is the predominate memory user in SQLite, most +** applications will achieve adequate soft heap limit enforcement without +** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT]. +** +** The circumstances under which SQLite will enforce the soft heap limit may +** changes in future releases of SQLite. +*/ +SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N); + +/* +** CAPI3REF: Deprecated Soft Heap Limit Interface +** DEPRECATED +** +** This is a deprecated version of the [sqlite3_soft_heap_limit64()] +** interface. This routine is provided for historical compatibility +** only. All new applications should use the +** [sqlite3_soft_heap_limit64()] interface rather than this one. +*/ +SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N); + + +/* +** CAPI3REF: Extract Metadata About A Column Of A Table +** METHOD: sqlite3 +** +** ^(The sqlite3_table_column_metadata(X,D,T,C,....) routine returns +** information about column C of table T in database D +** on [database connection] X.)^ ^The sqlite3_table_column_metadata() +** interface returns SQLITE_OK and fills in the non-NULL pointers in +** the final five arguments with appropriate values if the specified +** column exists. ^The sqlite3_table_column_metadata() interface returns +** SQLITE_ERROR and if the specified column does not exist. +** ^If the column-name parameter to sqlite3_table_column_metadata() is a +** NULL pointer, then this routine simply checks for the existence of the +** table and returns SQLITE_OK if the table exists and SQLITE_ERROR if it +** does not. If the table name parameter T in a call to +** sqlite3_table_column_metadata(X,D,T,C,...) is NULL then the result is +** undefined behavior. +** +** ^The column is identified by the second, third and fourth parameters to +** this function. ^(The second parameter is either the name of the database +** (i.e. "main", "temp", or an attached database) containing the specified +** table or NULL.)^ ^If it is NULL, then all attached databases are searched +** for the table using the same algorithm used by the database engine to +** resolve unqualified table references. +** +** ^The third and fourth parameters to this function are the table and column +** name of the desired column, respectively. +** +** ^Metadata is returned by writing to the memory locations passed as the 5th +** and subsequent parameters to this function. ^Any of these arguments may be +** NULL, in which case the corresponding element of metadata is omitted. +** +** ^(
+** +**
Parameter Output
Type
Description +** +**
5th const char* Data type +**
6th const char* Name of default collation sequence +**
7th int True if column has a NOT NULL constraint +**
8th int True if column is part of the PRIMARY KEY +**
9th int True if column is [AUTOINCREMENT] +**
+**
)^ +** +** ^The memory pointed to by the character pointers returned for the +** declaration type and collation sequence is valid until the next +** call to any SQLite API function. +** +** ^If the specified table is actually a view, an [error code] is returned. +** +** ^If the specified column is "rowid", "oid" or "_rowid_" and the table +** is not a [WITHOUT ROWID] table and an +** [INTEGER PRIMARY KEY] column has been explicitly declared, then the output +** parameters are set for the explicitly declared column. ^(If there is no +** [INTEGER PRIMARY KEY] column, then the outputs +** for the [rowid] are set as follows: +** +**
+**     data type: "INTEGER"
+**     collation sequence: "BINARY"
+**     not null: 0
+**     primary key: 1
+**     auto increment: 0
+** 
)^ +** +** ^This function causes all database schemas to be read from disk and +** parsed, if that has not already been done, and returns an error if +** any errors are encountered while loading the schema. +*/ +SQLITE_API int sqlite3_table_column_metadata( + sqlite3 *db, /* Connection handle */ + const char *zDbName, /* Database name or NULL */ + const char *zTableName, /* Table name */ + const char *zColumnName, /* Column name */ + char const **pzDataType, /* OUTPUT: Declared data type */ + char const **pzCollSeq, /* OUTPUT: Collation sequence name */ + int *pNotNull, /* OUTPUT: True if NOT NULL constraint exists */ + int *pPrimaryKey, /* OUTPUT: True if column part of PK */ + int *pAutoinc /* OUTPUT: True if column is auto-increment */ +); + +/* +** CAPI3REF: Load An Extension +** METHOD: sqlite3 +** +** ^This interface loads an SQLite extension library from the named file. +** +** ^The sqlite3_load_extension() interface attempts to load an +** [SQLite extension] library contained in the file zFile. If +** the file cannot be loaded directly, attempts are made to load +** with various operating-system specific extensions added. +** So for example, if "samplelib" cannot be loaded, then names like +** "samplelib.so" or "samplelib.dylib" or "samplelib.dll" might +** be tried also. +** +** ^The entry point is zProc. +** ^(zProc may be 0, in which case SQLite will try to come up with an +** entry point name on its own. It first tries "sqlite3_extension_init". +** If that does not work, it constructs a name "sqlite3_X_init" where the +** X is consists of the lower-case equivalent of all ASCII alphabetic +** characters in the filename from the last "/" to the first following +** "." and omitting any initial "lib".)^ +** ^The sqlite3_load_extension() interface returns +** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong. +** ^If an error occurs and pzErrMsg is not 0, then the +** [sqlite3_load_extension()] interface shall attempt to +** fill *pzErrMsg with error message text stored in memory +** obtained from [sqlite3_malloc()]. The calling function +** should free this memory by calling [sqlite3_free()]. +** +** ^Extension loading must be enabled using +** [sqlite3_enable_load_extension()] or +** [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],1,NULL) +** prior to calling this API, +** otherwise an error will be returned. +** +** Security warning: It is recommended that the +** [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method be used to enable only this +** interface. The use of the [sqlite3_enable_load_extension()] interface +** should be avoided. This will keep the SQL function [load_extension()] +** disabled and prevent SQL injections from giving attackers +** access to extension loading capabilities. +** +** See also the [load_extension() SQL function]. +*/ +SQLITE_API int sqlite3_load_extension( + sqlite3 *db, /* Load the extension into this database connection */ + const char *zFile, /* Name of the shared library containing extension */ + const char *zProc, /* Entry point. Derived from zFile if 0 */ + char **pzErrMsg /* Put error message here if not 0 */ +); + +/* +** CAPI3REF: Enable Or Disable Extension Loading +** METHOD: sqlite3 +** +** ^So as not to open security holes in older applications that are +** unprepared to deal with [extension loading], and as a means of disabling +** [extension loading] while evaluating user-entered SQL, the following API +** is provided to turn the [sqlite3_load_extension()] mechanism on and off. +** +** ^Extension loading is off by default. +** ^Call the sqlite3_enable_load_extension() routine with onoff==1 +** to turn extension loading on and call it with onoff==0 to turn +** it back off again. +** +** ^This interface enables or disables both the C-API +** [sqlite3_load_extension()] and the SQL function [load_extension()]. +** ^(Use [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],..) +** to enable or disable only the C-API.)^ +** +** Security warning: It is recommended that extension loading +** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method +** rather than this interface, so the [load_extension()] SQL function +** remains disabled. This will prevent SQL injections from giving attackers +** access to extension loading capabilities. +*/ +SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff); + +/* +** CAPI3REF: Automatically Load Statically Linked Extensions +** +** ^This interface causes the xEntryPoint() function to be invoked for +** each new [database connection] that is created. The idea here is that +** xEntryPoint() is the entry point for a statically linked [SQLite extension] +** that is to be automatically loaded into all new database connections. +** +** ^(Even though the function prototype shows that xEntryPoint() takes +** no arguments and returns void, SQLite invokes xEntryPoint() with three +** arguments and expects an integer result as if the signature of the +** entry point where as follows: +** +**
+**    int xEntryPoint(
+**      sqlite3 *db,
+**      const char **pzErrMsg,
+**      const struct sqlite3_api_routines *pThunk
+**    );
+** 
)^ +** +** If the xEntryPoint routine encounters an error, it should make *pzErrMsg +** point to an appropriate error message (obtained from [sqlite3_mprintf()]) +** and return an appropriate [error code]. ^SQLite ensures that *pzErrMsg +** is NULL before calling the xEntryPoint(). ^SQLite will invoke +** [sqlite3_free()] on *pzErrMsg after xEntryPoint() returns. ^If any +** xEntryPoint() returns an error, the [sqlite3_open()], [sqlite3_open16()], +** or [sqlite3_open_v2()] call that provoked the xEntryPoint() will fail. +** +** ^Calling sqlite3_auto_extension(X) with an entry point X that is already +** on the list of automatic extensions is a harmless no-op. ^No entry point +** will be called more than once for each database connection that is opened. +** +** See also: [sqlite3_reset_auto_extension()] +** and [sqlite3_cancel_auto_extension()] +*/ +SQLITE_API int sqlite3_auto_extension(void(*xEntryPoint)(void)); + +/* +** CAPI3REF: Cancel Automatic Extension Loading +** +** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the +** initialization routine X that was registered using a prior call to +** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)] +** routine returns 1 if initialization routine X was successfully +** unregistered and it returns 0 if X was not on the list of initialization +** routines. +*/ +SQLITE_API int sqlite3_cancel_auto_extension(void(*xEntryPoint)(void)); + +/* +** CAPI3REF: Reset Automatic Extension Loading +** +** ^This interface disables all automatic extensions previously +** registered using [sqlite3_auto_extension()]. +*/ +SQLITE_API void sqlite3_reset_auto_extension(void); + +/* +** The interface to the virtual-table mechanism is currently considered +** to be experimental. The interface might change in incompatible ways. +** If this is a problem for you, do not use the interface at this time. +** +** When the virtual-table mechanism stabilizes, we will declare the +** interface fixed, support it indefinitely, and remove this comment. +*/ + +/* +** Structures used by the virtual table interface +*/ +typedef struct sqlite3_vtab sqlite3_vtab; +typedef struct sqlite3_index_info sqlite3_index_info; +typedef struct sqlite3_vtab_cursor sqlite3_vtab_cursor; +typedef struct sqlite3_module sqlite3_module; + +/* +** CAPI3REF: Virtual Table Object +** KEYWORDS: sqlite3_module {virtual table module} +** +** This structure, sometimes called a "virtual table module", +** defines the implementation of a [virtual tables]. +** This structure consists mostly of methods for the module. +** +** ^A virtual table module is created by filling in a persistent +** instance of this structure and passing a pointer to that instance +** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. +** ^The registration remains valid until it is replaced by a different +** module or until the [database connection] closes. The content +** of this structure must not change while it is registered with +** any database connection. +*/ +struct sqlite3_module { + int iVersion; + int (*xCreate)(sqlite3*, void *pAux, + int argc, const char *const*argv, + sqlite3_vtab **ppVTab, char**); + int (*xConnect)(sqlite3*, void *pAux, + int argc, const char *const*argv, + sqlite3_vtab **ppVTab, char**); + int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); + int (*xDisconnect)(sqlite3_vtab *pVTab); + int (*xDestroy)(sqlite3_vtab *pVTab); + int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor); + int (*xClose)(sqlite3_vtab_cursor*); + int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr, + int argc, sqlite3_value **argv); + int (*xNext)(sqlite3_vtab_cursor*); + int (*xEof)(sqlite3_vtab_cursor*); + int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int); + int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid); + int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *); + int (*xBegin)(sqlite3_vtab *pVTab); + int (*xSync)(sqlite3_vtab *pVTab); + int (*xCommit)(sqlite3_vtab *pVTab); + int (*xRollback)(sqlite3_vtab *pVTab); + int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName, + void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), + void **ppArg); + int (*xRename)(sqlite3_vtab *pVtab, const char *zNew); + /* The methods above are in version 1 of the sqlite_module object. Those + ** below are for version 2 and greater. */ + int (*xSavepoint)(sqlite3_vtab *pVTab, int); + int (*xRelease)(sqlite3_vtab *pVTab, int); + int (*xRollbackTo)(sqlite3_vtab *pVTab, int); +}; + +/* +** CAPI3REF: Virtual Table Indexing Information +** KEYWORDS: sqlite3_index_info +** +** The sqlite3_index_info structure and its substructures is used as part +** of the [virtual table] interface to +** pass information into and receive the reply from the [xBestIndex] +** method of a [virtual table module]. The fields under **Inputs** are the +** inputs to xBestIndex and are read-only. xBestIndex inserts its +** results into the **Outputs** fields. +** +** ^(The aConstraint[] array records WHERE clause constraints of the form: +** +**
column OP expr
+** +** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is +** stored in aConstraint[].op using one of the +** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ +** ^(The index of the column is stored in +** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the +** expr on the right-hand side can be evaluated (and thus the constraint +** is usable) and false if it cannot.)^ +** +** ^The optimizer automatically inverts terms of the form "expr OP column" +** and makes other simplifications to the WHERE clause in an attempt to +** get as many WHERE clause terms into the form shown above as possible. +** ^The aConstraint[] array only reports WHERE clause terms that are +** relevant to the particular virtual table being queried. +** +** ^Information about the ORDER BY clause is stored in aOrderBy[]. +** ^Each term of aOrderBy records a column of the ORDER BY clause. +** +** The colUsed field indicates which columns of the virtual table may be +** required by the current scan. Virtual table columns are numbered from +** zero in the order in which they appear within the CREATE TABLE statement +** passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), +** the corresponding bit is set within the colUsed mask if the column may be +** required by SQLite. If the table has at least 64 columns and any column +** to the right of the first 63 is required, then bit 63 of colUsed is also +** set. In other words, column iCol may be required if the expression +** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to +** non-zero. +** +** The [xBestIndex] method must fill aConstraintUsage[] with information +** about what parameters to pass to xFilter. ^If argvIndex>0 then +** the right-hand side of the corresponding aConstraint[] is evaluated +** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit +** is true, then the constraint is assumed to be fully handled by the +** virtual table and is not checked again by SQLite.)^ +** +** ^The idxNum and idxPtr values are recorded and passed into the +** [xFilter] method. +** ^[sqlite3_free()] is used to free idxPtr if and only if +** needToFreeIdxPtr is true. +** +** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in +** the correct order to satisfy the ORDER BY clause so that no separate +** sorting step is required. +** +** ^The estimatedCost value is an estimate of the cost of a particular +** strategy. A cost of N indicates that the cost of the strategy is similar +** to a linear scan of an SQLite table with N rows. A cost of log(N) +** indicates that the expense of the operation is similar to that of a +** binary search on a unique indexed field of an SQLite table with N rows. +** +** ^The estimatedRows value is an estimate of the number of rows that +** will be returned by the strategy. +** +** The xBestIndex method may optionally populate the idxFlags field with a +** mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag - +** SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite +** assumes that the strategy may visit at most one row. +** +** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then +** SQLite also assumes that if a call to the xUpdate() method is made as +** part of the same statement to delete or update a virtual table row and the +** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback +** any database changes. In other words, if the xUpdate() returns +** SQLITE_CONSTRAINT, the database contents must be exactly as they were +** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not +** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by +** the xUpdate method are automatically rolled back by SQLite. +** +** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info +** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). +** If a virtual table extension is +** used with an SQLite version earlier than 3.8.2, the results of attempting +** to read or write the estimatedRows field are undefined (but are likely +** to included crashing the application). The estimatedRows field should +** therefore only be used if [sqlite3_libversion_number()] returns a +** value greater than or equal to 3008002. Similarly, the idxFlags field +** was added for [version 3.9.0] ([dateof:3.9.0]). +** It may therefore only be used if +** sqlite3_libversion_number() returns a value greater than or equal to +** 3009000. +*/ +struct sqlite3_index_info { + /* Inputs */ + int nConstraint; /* Number of entries in aConstraint */ + struct sqlite3_index_constraint { + int iColumn; /* Column constrained. -1 for ROWID */ + unsigned char op; /* Constraint operator */ + unsigned char usable; /* True if this constraint is usable */ + int iTermOffset; /* Used internally - xBestIndex should ignore */ + } *aConstraint; /* Table of WHERE clause constraints */ + int nOrderBy; /* Number of terms in the ORDER BY clause */ + struct sqlite3_index_orderby { + int iColumn; /* Column number */ + unsigned char desc; /* True for DESC. False for ASC. */ + } *aOrderBy; /* The ORDER BY clause */ + /* Outputs */ + struct sqlite3_index_constraint_usage { + int argvIndex; /* if >0, constraint is part of argv to xFilter */ + unsigned char omit; /* Do not code a test for this constraint */ + } *aConstraintUsage; + int idxNum; /* Number used to identify the index */ + char *idxStr; /* String, possibly obtained from sqlite3_malloc */ + int needToFreeIdxStr; /* Free idxStr using sqlite3_free() if true */ + int orderByConsumed; /* True if output is already ordered */ + double estimatedCost; /* Estimated cost of using this index */ + /* Fields below are only available in SQLite 3.8.2 and later */ + sqlite3_int64 estimatedRows; /* Estimated number of rows returned */ + /* Fields below are only available in SQLite 3.9.0 and later */ + int idxFlags; /* Mask of SQLITE_INDEX_SCAN_* flags */ + /* Fields below are only available in SQLite 3.10.0 and later */ + sqlite3_uint64 colUsed; /* Input: Mask of columns used by statement */ +}; + +/* +** CAPI3REF: Virtual Table Scan Flags +** +** Virtual table implementations are allowed to set the +** [sqlite3_index_info].idxFlags field to some combination of +** these bits. +*/ +#define SQLITE_INDEX_SCAN_UNIQUE 1 /* Scan visits at most 1 row */ + +/* +** CAPI3REF: Virtual Table Constraint Operator Codes +** +** These macros defined the allowed values for the +** [sqlite3_index_info].aConstraint[].op field. Each value represents +** an operator that is part of a constraint term in the wHERE clause of +** a query that uses a [virtual table]. +*/ +#define SQLITE_INDEX_CONSTRAINT_EQ 2 +#define SQLITE_INDEX_CONSTRAINT_GT 4 +#define SQLITE_INDEX_CONSTRAINT_LE 8 +#define SQLITE_INDEX_CONSTRAINT_LT 16 +#define SQLITE_INDEX_CONSTRAINT_GE 32 +#define SQLITE_INDEX_CONSTRAINT_MATCH 64 +#define SQLITE_INDEX_CONSTRAINT_LIKE 65 +#define SQLITE_INDEX_CONSTRAINT_GLOB 66 +#define SQLITE_INDEX_CONSTRAINT_REGEXP 67 +#define SQLITE_INDEX_CONSTRAINT_NE 68 +#define SQLITE_INDEX_CONSTRAINT_ISNOT 69 +#define SQLITE_INDEX_CONSTRAINT_ISNOTNULL 70 +#define SQLITE_INDEX_CONSTRAINT_ISNULL 71 +#define SQLITE_INDEX_CONSTRAINT_IS 72 + +/* +** CAPI3REF: Register A Virtual Table Implementation +** METHOD: sqlite3 +** +** ^These routines are used to register a new [virtual table module] name. +** ^Module names must be registered before +** creating a new [virtual table] using the module and before using a +** preexisting [virtual table] for the module. +** +** ^The module name is registered on the [database connection] specified +** by the first parameter. ^The name of the module is given by the +** second parameter. ^The third parameter is a pointer to +** the implementation of the [virtual table module]. ^The fourth +** parameter is an arbitrary client data pointer that is passed through +** into the [xCreate] and [xConnect] methods of the virtual table module +** when a new virtual table is be being created or reinitialized. +** +** ^The sqlite3_create_module_v2() interface has a fifth parameter which +** is a pointer to a destructor for the pClientData. ^SQLite will +** invoke the destructor function (if it is not NULL) when SQLite +** no longer needs the pClientData pointer. ^The destructor will also +** be invoked if the call to sqlite3_create_module_v2() fails. +** ^The sqlite3_create_module() +** interface is equivalent to sqlite3_create_module_v2() with a NULL +** destructor. +*/ +SQLITE_API int sqlite3_create_module( + sqlite3 *db, /* SQLite connection to register module with */ + const char *zName, /* Name of the module */ + const sqlite3_module *p, /* Methods for the module */ + void *pClientData /* Client data for xCreate/xConnect */ +); +SQLITE_API int sqlite3_create_module_v2( + sqlite3 *db, /* SQLite connection to register module with */ + const char *zName, /* Name of the module */ + const sqlite3_module *p, /* Methods for the module */ + void *pClientData, /* Client data for xCreate/xConnect */ + void(*xDestroy)(void*) /* Module destructor function */ +); + +/* +** CAPI3REF: Virtual Table Instance Object +** KEYWORDS: sqlite3_vtab +** +** Every [virtual table module] implementation uses a subclass +** of this object to describe a particular instance +** of the [virtual table]. Each subclass will +** be tailored to the specific needs of the module implementation. +** The purpose of this superclass is to define certain fields that are +** common to all module implementations. +** +** ^Virtual tables methods can set an error message by assigning a +** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should +** take care that any prior string is freed by a call to [sqlite3_free()] +** prior to assigning a new string to zErrMsg. ^After the error message +** is delivered up to the client application, the string will be automatically +** freed by sqlite3_free() and the zErrMsg field will be zeroed. +*/ +struct sqlite3_vtab { + const sqlite3_module *pModule; /* The module for this virtual table */ + int nRef; /* Number of open cursors */ + char *zErrMsg; /* Error message from sqlite3_mprintf() */ + /* Virtual table implementations will typically add additional fields */ +}; + +/* +** CAPI3REF: Virtual Table Cursor Object +** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} +** +** Every [virtual table module] implementation uses a subclass of the +** following structure to describe cursors that point into the +** [virtual table] and are used +** to loop through the virtual table. Cursors are created using the +** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed +** by the [sqlite3_module.xClose | xClose] method. Cursors are used +** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods +** of the module. Each module implementation will define +** the content of a cursor structure to suit its own needs. +** +** This superclass exists in order to define fields of the cursor that +** are common to all implementations. +*/ +struct sqlite3_vtab_cursor { + sqlite3_vtab *pVtab; /* Virtual table of this cursor */ + /* Virtual table implementations will typically add additional fields */ +}; + +/* +** CAPI3REF: Declare The Schema Of A Virtual Table +** +** ^The [xCreate] and [xConnect] methods of a +** [virtual table module] call this interface +** to declare the format (the names and datatypes of the columns) of +** the virtual tables they implement. +*/ +SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL); + +/* +** CAPI3REF: Overload A Function For A Virtual Table +** METHOD: sqlite3 +** +** ^(Virtual tables can provide alternative implementations of functions +** using the [xFindFunction] method of the [virtual table module]. +** But global versions of those functions +** must exist in order to be overloaded.)^ +** +** ^(This API makes sure a global version of a function with a particular +** name and number of parameters exists. If no such function exists +** before this API is called, a new function is created.)^ ^The implementation +** of the new function always causes an exception to be thrown. So +** the new function is not good for anything by itself. Its only +** purpose is to be a placeholder function that can be overloaded +** by a [virtual table]. +*/ +SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); + +/* +** The interface to the virtual-table mechanism defined above (back up +** to a comment remarkably similar to this one) is currently considered +** to be experimental. The interface might change in incompatible ways. +** If this is a problem for you, do not use the interface at this time. +** +** When the virtual-table mechanism stabilizes, we will declare the +** interface fixed, support it indefinitely, and remove this comment. +*/ + +/* +** CAPI3REF: A Handle To An Open BLOB +** KEYWORDS: {BLOB handle} {BLOB handles} +** +** An instance of this object represents an open BLOB on which +** [sqlite3_blob_open | incremental BLOB I/O] can be performed. +** ^Objects of this type are created by [sqlite3_blob_open()] +** and destroyed by [sqlite3_blob_close()]. +** ^The [sqlite3_blob_read()] and [sqlite3_blob_write()] interfaces +** can be used to read or write small subsections of the BLOB. +** ^The [sqlite3_blob_bytes()] interface returns the size of the BLOB in bytes. +*/ +typedef struct sqlite3_blob sqlite3_blob; + +/* +** CAPI3REF: Open A BLOB For Incremental I/O +** METHOD: sqlite3 +** CONSTRUCTOR: sqlite3_blob +** +** ^(This interfaces opens a [BLOB handle | handle] to the BLOB located +** in row iRow, column zColumn, table zTable in database zDb; +** in other words, the same BLOB that would be selected by: +** +**
+**     SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow;
+** 
)^ +** +** ^(Parameter zDb is not the filename that contains the database, but +** rather the symbolic name of the database. For attached databases, this is +** the name that appears after the AS keyword in the [ATTACH] statement. +** For the main database file, the database name is "main". For TEMP +** tables, the database name is "temp".)^ +** +** ^If the flags parameter is non-zero, then the BLOB is opened for read +** and write access. ^If the flags parameter is zero, the BLOB is opened for +** read-only access. +** +** ^(On success, [SQLITE_OK] is returned and the new [BLOB handle] is stored +** in *ppBlob. Otherwise an [error code] is returned and, unless the error +** code is SQLITE_MISUSE, *ppBlob is set to NULL.)^ ^This means that, provided +** the API is not misused, it is always safe to call [sqlite3_blob_close()] +** on *ppBlob after this function it returns. +** +** This function fails with SQLITE_ERROR if any of the following are true: +**
    +**
  • ^(Database zDb does not exist)^, +**
  • ^(Table zTable does not exist within database zDb)^, +**
  • ^(Table zTable is a WITHOUT ROWID table)^, +**
  • ^(Column zColumn does not exist)^, +**
  • ^(Row iRow is not present in the table)^, +**
  • ^(The specified column of row iRow contains a value that is not +** a TEXT or BLOB value)^, +**
  • ^(Column zColumn is part of an index, PRIMARY KEY or UNIQUE +** constraint and the blob is being opened for read/write access)^, +**
  • ^([foreign key constraints | Foreign key constraints] are enabled, +** column zColumn is part of a [child key] definition and the blob is +** being opened for read/write access)^. +**
+** +** ^Unless it returns SQLITE_MISUSE, this function sets the +** [database connection] error code and message accessible via +** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. +** +** A BLOB referenced by sqlite3_blob_open() may be read using the +** [sqlite3_blob_read()] interface and modified by using +** [sqlite3_blob_write()]. The [BLOB handle] can be moved to a +** different row of the same table using the [sqlite3_blob_reopen()] +** interface. However, the column, table, or database of a [BLOB handle] +** cannot be changed after the [BLOB handle] is opened. +** +** ^(If the row that a BLOB handle points to is modified by an +** [UPDATE], [DELETE], or by [ON CONFLICT] side-effects +** then the BLOB handle is marked as "expired". +** This is true if any column of the row is changed, even a column +** other than the one the BLOB handle is open on.)^ +** ^Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for +** an expired BLOB handle fail with a return code of [SQLITE_ABORT]. +** ^(Changes written into a BLOB prior to the BLOB expiring are not +** rolled back by the expiration of the BLOB. Such changes will eventually +** commit if the transaction continues to completion.)^ +** +** ^Use the [sqlite3_blob_bytes()] interface to determine the size of +** the opened blob. ^The size of a blob may not be changed by this +** interface. Use the [UPDATE] SQL command to change the size of a +** blob. +** +** ^The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces +** and the built-in [zeroblob] SQL function may be used to create a +** zero-filled blob to read or write using the incremental-blob interface. +** +** To avoid a resource leak, every open [BLOB handle] should eventually +** be released by a call to [sqlite3_blob_close()]. +** +** See also: [sqlite3_blob_close()], +** [sqlite3_blob_reopen()], [sqlite3_blob_read()], +** [sqlite3_blob_bytes()], [sqlite3_blob_write()]. +*/ +SQLITE_API int sqlite3_blob_open( + sqlite3*, + const char *zDb, + const char *zTable, + const char *zColumn, + sqlite3_int64 iRow, + int flags, + sqlite3_blob **ppBlob +); + +/* +** CAPI3REF: Move a BLOB Handle to a New Row +** METHOD: sqlite3_blob +** +** ^This function is used to move an existing [BLOB handle] so that it points +** to a different row of the same database table. ^The new row is identified +** by the rowid value passed as the second argument. Only the row can be +** changed. ^The database, table and column on which the blob handle is open +** remain the same. Moving an existing [BLOB handle] to a new row is +** faster than closing the existing handle and opening a new one. +** +** ^(The new row must meet the same criteria as for [sqlite3_blob_open()] - +** it must exist and there must be either a blob or text value stored in +** the nominated column.)^ ^If the new row is not present in the table, or if +** it does not contain a blob or text value, or if another error occurs, an +** SQLite error code is returned and the blob handle is considered aborted. +** ^All subsequent calls to [sqlite3_blob_read()], [sqlite3_blob_write()] or +** [sqlite3_blob_reopen()] on an aborted blob handle immediately return +** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle +** always returns zero. +** +** ^This function sets the database handle error code and message. +*/ +SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); + +/* +** CAPI3REF: Close A BLOB Handle +** DESTRUCTOR: sqlite3_blob +** +** ^This function closes an open [BLOB handle]. ^(The BLOB handle is closed +** unconditionally. Even if this routine returns an error code, the +** handle is still closed.)^ +** +** ^If the blob handle being closed was opened for read-write access, and if +** the database is in auto-commit mode and there are no other open read-write +** blob handles or active write statements, the current transaction is +** committed. ^If an error occurs while committing the transaction, an error +** code is returned and the transaction rolled back. +** +** Calling this function with an argument that is not a NULL pointer or an +** open blob handle results in undefined behaviour. ^Calling this routine +** with a null pointer (such as would be returned by a failed call to +** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function +** is passed a valid open blob handle, the values returned by the +** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning. +*/ +SQLITE_API int sqlite3_blob_close(sqlite3_blob *); + +/* +** CAPI3REF: Return The Size Of An Open BLOB +** METHOD: sqlite3_blob +** +** ^Returns the size in bytes of the BLOB accessible via the +** successfully opened [BLOB handle] in its only argument. ^The +** incremental blob I/O routines can only read or overwriting existing +** blob content; they cannot change the size of a blob. +** +** This routine only works on a [BLOB handle] which has been created +** by a prior successful call to [sqlite3_blob_open()] and which has not +** been closed by [sqlite3_blob_close()]. Passing any other pointer in +** to this routine results in undefined and probably undesirable behavior. +*/ +SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *); + +/* +** CAPI3REF: Read Data From A BLOB Incrementally +** METHOD: sqlite3_blob +** +** ^(This function is used to read data from an open [BLOB handle] into a +** caller-supplied buffer. N bytes of data are copied into buffer Z +** from the open BLOB, starting at offset iOffset.)^ +** +** ^If offset iOffset is less than N bytes from the end of the BLOB, +** [SQLITE_ERROR] is returned and no data is read. ^If N or iOffset is +** less than zero, [SQLITE_ERROR] is returned and no data is read. +** ^The size of the blob (and hence the maximum value of N+iOffset) +** can be determined using the [sqlite3_blob_bytes()] interface. +** +** ^An attempt to read from an expired [BLOB handle] fails with an +** error code of [SQLITE_ABORT]. +** +** ^(On success, sqlite3_blob_read() returns SQLITE_OK. +** Otherwise, an [error code] or an [extended error code] is returned.)^ +** +** This routine only works on a [BLOB handle] which has been created +** by a prior successful call to [sqlite3_blob_open()] and which has not +** been closed by [sqlite3_blob_close()]. Passing any other pointer in +** to this routine results in undefined and probably undesirable behavior. +** +** See also: [sqlite3_blob_write()]. +*/ +SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); + +/* +** CAPI3REF: Write Data Into A BLOB Incrementally +** METHOD: sqlite3_blob +** +** ^(This function is used to write data into an open [BLOB handle] from a +** caller-supplied buffer. N bytes of data are copied from the buffer Z +** into the open BLOB, starting at offset iOffset.)^ +** +** ^(On success, sqlite3_blob_write() returns SQLITE_OK. +** Otherwise, an [error code] or an [extended error code] is returned.)^ +** ^Unless SQLITE_MISUSE is returned, this function sets the +** [database connection] error code and message accessible via +** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. +** +** ^If the [BLOB handle] passed as the first argument was not opened for +** writing (the flags parameter to [sqlite3_blob_open()] was zero), +** this function returns [SQLITE_READONLY]. +** +** This function may only modify the contents of the BLOB; it is +** not possible to increase the size of a BLOB using this API. +** ^If offset iOffset is less than N bytes from the end of the BLOB, +** [SQLITE_ERROR] is returned and no data is written. The size of the +** BLOB (and hence the maximum value of N+iOffset) can be determined +** using the [sqlite3_blob_bytes()] interface. ^If N or iOffset are less +** than zero [SQLITE_ERROR] is returned and no data is written. +** +** ^An attempt to write to an expired [BLOB handle] fails with an +** error code of [SQLITE_ABORT]. ^Writes to the BLOB that occurred +** before the [BLOB handle] expired are not rolled back by the +** expiration of the handle, though of course those changes might +** have been overwritten by the statement that expired the BLOB handle +** or by other independent statements. +** +** This routine only works on a [BLOB handle] which has been created +** by a prior successful call to [sqlite3_blob_open()] and which has not +** been closed by [sqlite3_blob_close()]. Passing any other pointer in +** to this routine results in undefined and probably undesirable behavior. +** +** See also: [sqlite3_blob_read()]. +*/ +SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset); + +/* +** CAPI3REF: Virtual File System Objects +** +** A virtual filesystem (VFS) is an [sqlite3_vfs] object +** that SQLite uses to interact +** with the underlying operating system. Most SQLite builds come with a +** single default VFS that is appropriate for the host computer. +** New VFSes can be registered and existing VFSes can be unregistered. +** The following interfaces are provided. +** +** ^The sqlite3_vfs_find() interface returns a pointer to a VFS given its name. +** ^Names are case sensitive. +** ^Names are zero-terminated UTF-8 strings. +** ^If there is no match, a NULL pointer is returned. +** ^If zVfsName is NULL then the default VFS is returned. +** +** ^New VFSes are registered with sqlite3_vfs_register(). +** ^Each new VFS becomes the default VFS if the makeDflt flag is set. +** ^The same VFS can be registered multiple times without injury. +** ^To make an existing VFS into the default VFS, register it again +** with the makeDflt flag set. If two different VFSes with the +** same name are registered, the behavior is undefined. If a +** VFS is registered with a name that is NULL or an empty string, +** then the behavior is undefined. +** +** ^Unregister a VFS with the sqlite3_vfs_unregister() interface. +** ^(If the default VFS is unregistered, another VFS is chosen as +** the default. The choice for the new VFS is arbitrary.)^ +*/ +SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName); +SQLITE_API int sqlite3_vfs_register(sqlite3_vfs*, int makeDflt); +SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); + +/* +** CAPI3REF: Mutexes +** +** The SQLite core uses these routines for thread +** synchronization. Though they are intended for internal +** use by SQLite, code that links against SQLite is +** permitted to use any of these routines. +** +** The SQLite source code contains multiple implementations +** of these mutex routines. An appropriate implementation +** is selected automatically at compile-time. The following +** implementations are available in the SQLite core: +** +**
    +**
  • SQLITE_MUTEX_PTHREADS +**
  • SQLITE_MUTEX_W32 +**
  • SQLITE_MUTEX_NOOP +**
+** +** The SQLITE_MUTEX_NOOP implementation is a set of routines +** that does no real locking and is appropriate for use in +** a single-threaded application. The SQLITE_MUTEX_PTHREADS and +** SQLITE_MUTEX_W32 implementations are appropriate for use on Unix +** and Windows. +** +** If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor +** macro defined (with "-DSQLITE_MUTEX_APPDEF=1"), then no mutex +** implementation is included with the library. In this case the +** application must supply a custom mutex implementation using the +** [SQLITE_CONFIG_MUTEX] option of the sqlite3_config() function +** before calling sqlite3_initialize() or any other public sqlite3_ +** function that calls sqlite3_initialize(). +** +** ^The sqlite3_mutex_alloc() routine allocates a new +** mutex and returns a pointer to it. ^The sqlite3_mutex_alloc() +** routine returns NULL if it is unable to allocate the requested +** mutex. The argument to sqlite3_mutex_alloc() must one of these +** integer constants: +** +**
    +**
  • SQLITE_MUTEX_FAST +**
  • SQLITE_MUTEX_RECURSIVE +**
  • SQLITE_MUTEX_STATIC_MASTER +**
  • SQLITE_MUTEX_STATIC_MEM +**
  • SQLITE_MUTEX_STATIC_OPEN +**
  • SQLITE_MUTEX_STATIC_PRNG +**
  • SQLITE_MUTEX_STATIC_LRU +**
  • SQLITE_MUTEX_STATIC_PMEM +**
  • SQLITE_MUTEX_STATIC_APP1 +**
  • SQLITE_MUTEX_STATIC_APP2 +**
  • SQLITE_MUTEX_STATIC_APP3 +**
  • SQLITE_MUTEX_STATIC_VFS1 +**
  • SQLITE_MUTEX_STATIC_VFS2 +**
  • SQLITE_MUTEX_STATIC_VFS3 +**
+** +** ^The first two constants (SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) +** cause sqlite3_mutex_alloc() to create +** a new mutex. ^The new mutex is recursive when SQLITE_MUTEX_RECURSIVE +** is used but not necessarily so when SQLITE_MUTEX_FAST is used. +** The mutex implementation does not need to make a distinction +** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does +** not want to. SQLite will only request a recursive mutex in +** cases where it really needs one. If a faster non-recursive mutex +** implementation is available on the host platform, the mutex subsystem +** might return such a mutex in response to SQLITE_MUTEX_FAST. +** +** ^The other allowed parameters to sqlite3_mutex_alloc() (anything other +** than SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) each return +** a pointer to a static preexisting mutex. ^Nine static mutexes are +** used by the current version of SQLite. Future versions of SQLite +** may add additional static mutexes. Static mutexes are for internal +** use by SQLite only. Applications that use SQLite mutexes should +** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or +** SQLITE_MUTEX_RECURSIVE. +** +** ^Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST +** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() +** returns a different mutex on every call. ^For the static +** mutex types, the same mutex is returned on every call that has +** the same type number. +** +** ^The sqlite3_mutex_free() routine deallocates a previously +** allocated dynamic mutex. Attempting to deallocate a static +** mutex results in undefined behavior. +** +** ^The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt +** to enter a mutex. ^If another thread is already within the mutex, +** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return +** SQLITE_BUSY. ^The sqlite3_mutex_try() interface returns [SQLITE_OK] +** upon successful entry. ^(Mutexes created using +** SQLITE_MUTEX_RECURSIVE can be entered multiple times by the same thread. +** In such cases, the +** mutex must be exited an equal number of times before another thread +** can enter.)^ If the same thread tries to enter any mutex other +** than an SQLITE_MUTEX_RECURSIVE more than once, the behavior is undefined. +** +** ^(Some systems (for example, Windows 95) do not support the operation +** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try() +** will always return SQLITE_BUSY. The SQLite core only ever uses +** sqlite3_mutex_try() as an optimization so this is acceptable +** behavior.)^ +** +** ^The sqlite3_mutex_leave() routine exits a mutex that was +** previously entered by the same thread. The behavior +** is undefined if the mutex is not currently entered by the +** calling thread or is not currently allocated. +** +** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or +** sqlite3_mutex_leave() is a NULL pointer, then all three routines +** behave as no-ops. +** +** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. +*/ +SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); +SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); +SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); +SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); +SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); + +/* +** CAPI3REF: Mutex Methods Object +** +** An instance of this structure defines the low-level routines +** used to allocate and use mutexes. +** +** Usually, the default mutex implementations provided by SQLite are +** sufficient, however the application has the option of substituting a custom +** implementation for specialized deployments or systems for which SQLite +** does not provide a suitable implementation. In this case, the application +** creates and populates an instance of this structure to pass +** to sqlite3_config() along with the [SQLITE_CONFIG_MUTEX] option. +** Additionally, an instance of this structure can be used as an +** output variable when querying the system for the current mutex +** implementation, using the [SQLITE_CONFIG_GETMUTEX] option. +** +** ^The xMutexInit method defined by this structure is invoked as +** part of system initialization by the sqlite3_initialize() function. +** ^The xMutexInit routine is called by SQLite exactly once for each +** effective call to [sqlite3_initialize()]. +** +** ^The xMutexEnd method defined by this structure is invoked as +** part of system shutdown by the sqlite3_shutdown() function. The +** implementation of this method is expected to release all outstanding +** resources obtained by the mutex methods implementation, especially +** those obtained by the xMutexInit method. ^The xMutexEnd() +** interface is invoked exactly once for each call to [sqlite3_shutdown()]. +** +** ^(The remaining seven methods defined by this structure (xMutexAlloc, +** xMutexFree, xMutexEnter, xMutexTry, xMutexLeave, xMutexHeld and +** xMutexNotheld) implement the following interfaces (respectively): +** +**
    +**
  • [sqlite3_mutex_alloc()]
  • +**
  • [sqlite3_mutex_free()]
  • +**
  • [sqlite3_mutex_enter()]
  • +**
  • [sqlite3_mutex_try()]
  • +**
  • [sqlite3_mutex_leave()]
  • +**
  • [sqlite3_mutex_held()]
  • +**
  • [sqlite3_mutex_notheld()]
  • +**
)^ +** +** The only difference is that the public sqlite3_XXX functions enumerated +** above silently ignore any invocations that pass a NULL pointer instead +** of a valid mutex handle. The implementations of the methods defined +** by this structure are not required to handle this case, the results +** of passing a NULL pointer instead of a valid mutex handle are undefined +** (i.e. it is acceptable to provide an implementation that segfaults if +** it is passed a NULL pointer). +** +** The xMutexInit() method must be threadsafe. It must be harmless to +** invoke xMutexInit() multiple times within the same process and without +** intervening calls to xMutexEnd(). Second and subsequent calls to +** xMutexInit() must be no-ops. +** +** xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()] +** and its associates). Similarly, xMutexAlloc() must not use SQLite memory +** allocation for a static mutex. ^However xMutexAlloc() may use SQLite +** memory allocation for a fast or recursive mutex. +** +** ^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is +** called, but only if the prior call to xMutexInit returned SQLITE_OK. +** If xMutexInit fails in any way, it is expected to clean up after itself +** prior to returning. +*/ +typedef struct sqlite3_mutex_methods sqlite3_mutex_methods; +struct sqlite3_mutex_methods { + int (*xMutexInit)(void); + int (*xMutexEnd)(void); + sqlite3_mutex *(*xMutexAlloc)(int); + void (*xMutexFree)(sqlite3_mutex *); + void (*xMutexEnter)(sqlite3_mutex *); + int (*xMutexTry)(sqlite3_mutex *); + void (*xMutexLeave)(sqlite3_mutex *); + int (*xMutexHeld)(sqlite3_mutex *); + int (*xMutexNotheld)(sqlite3_mutex *); +}; + +/* +** CAPI3REF: Mutex Verification Routines +** +** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routines +** are intended for use inside assert() statements. The SQLite core +** never uses these routines except inside an assert() and applications +** are advised to follow the lead of the core. The SQLite core only +** provides implementations for these routines when it is compiled +** with the SQLITE_DEBUG flag. External mutex implementations +** are only required to provide these routines if SQLITE_DEBUG is +** defined and if NDEBUG is not defined. +** +** These routines should return true if the mutex in their argument +** is held or not held, respectively, by the calling thread. +** +** The implementation is not required to provide versions of these +** routines that actually work. If the implementation does not provide working +** versions of these routines, it should at least provide stubs that always +** return true so that one does not get spurious assertion failures. +** +** If the argument to sqlite3_mutex_held() is a NULL pointer then +** the routine should return 1. This seems counter-intuitive since +** clearly the mutex cannot be held if it does not exist. But +** the reason the mutex does not exist is because the build is not +** using mutexes. And we do not want the assert() containing the +** call to sqlite3_mutex_held() to fail, so a non-zero return is +** the appropriate thing to do. The sqlite3_mutex_notheld() +** interface should also return 1 when given a NULL pointer. +*/ +#ifndef NDEBUG +SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*); +SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*); +#endif + +/* +** CAPI3REF: Mutex Types +** +** The [sqlite3_mutex_alloc()] interface takes a single argument +** which is one of these integer constants. +** +** The set of static mutexes may change from one SQLite release to the +** next. Applications that override the built-in mutex logic must be +** prepared to accommodate additional static mutexes. +*/ +#define SQLITE_MUTEX_FAST 0 +#define SQLITE_MUTEX_RECURSIVE 1 +#define SQLITE_MUTEX_STATIC_MASTER 2 +#define SQLITE_MUTEX_STATIC_MEM 3 /* sqlite3_malloc() */ +#define SQLITE_MUTEX_STATIC_MEM2 4 /* NOT USED */ +#define SQLITE_MUTEX_STATIC_OPEN 4 /* sqlite3BtreeOpen() */ +#define SQLITE_MUTEX_STATIC_PRNG 5 /* sqlite3_randomness() */ +#define SQLITE_MUTEX_STATIC_LRU 6 /* lru page list */ +#define SQLITE_MUTEX_STATIC_LRU2 7 /* NOT USED */ +#define SQLITE_MUTEX_STATIC_PMEM 7 /* sqlite3PageMalloc() */ +#define SQLITE_MUTEX_STATIC_APP1 8 /* For use by application */ +#define SQLITE_MUTEX_STATIC_APP2 9 /* For use by application */ +#define SQLITE_MUTEX_STATIC_APP3 10 /* For use by application */ +#define SQLITE_MUTEX_STATIC_VFS1 11 /* For use by built-in VFS */ +#define SQLITE_MUTEX_STATIC_VFS2 12 /* For use by extension VFS */ +#define SQLITE_MUTEX_STATIC_VFS3 13 /* For use by application VFS */ + +/* +** CAPI3REF: Retrieve the mutex for a database connection +** METHOD: sqlite3 +** +** ^This interface returns a pointer the [sqlite3_mutex] object that +** serializes access to the [database connection] given in the argument +** when the [threading mode] is Serialized. +** ^If the [threading mode] is Single-thread or Multi-thread then this +** routine returns a NULL pointer. +*/ +SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*); + +/* +** CAPI3REF: Low-Level Control Of Database Files +** METHOD: sqlite3 +** +** ^The [sqlite3_file_control()] interface makes a direct call to the +** xFileControl method for the [sqlite3_io_methods] object associated +** with a particular database identified by the second argument. ^The +** name of the database is "main" for the main database or "temp" for the +** TEMP database, or the name that appears after the AS keyword for +** databases that are added using the [ATTACH] SQL command. +** ^A NULL pointer can be used in place of "main" to refer to the +** main database file. +** ^The third and fourth parameters to this routine +** are passed directly through to the second and third parameters of +** the xFileControl method. ^The return value of the xFileControl +** method becomes the return value of this routine. +** +** ^The [SQLITE_FCNTL_FILE_POINTER] value for the op parameter causes +** a pointer to the underlying [sqlite3_file] object to be written into +** the space pointed to by the 4th parameter. ^The [SQLITE_FCNTL_FILE_POINTER] +** case is a short-circuit path which does not actually invoke the +** underlying sqlite3_io_methods.xFileControl method. +** +** ^If the second parameter (zDbName) does not match the name of any +** open database file, then SQLITE_ERROR is returned. ^This error +** code is not remembered and will not be recalled by [sqlite3_errcode()] +** or [sqlite3_errmsg()]. The underlying xFileControl method might +** also return SQLITE_ERROR. There is no way to distinguish between +** an incorrect zDbName and an SQLITE_ERROR return from the underlying +** xFileControl method. +** +** See also: [file control opcodes] +*/ +SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*); + +/* +** CAPI3REF: Testing Interface +** +** ^The sqlite3_test_control() interface is used to read out internal +** state of SQLite and to inject faults into SQLite for testing +** purposes. ^The first parameter is an operation code that determines +** the number, meaning, and operation of all subsequent parameters. +** +** This interface is not for use by applications. It exists solely +** for verifying the correct operation of the SQLite library. Depending +** on how the SQLite library is compiled, this interface might not exist. +** +** The details of the operation codes, their meanings, the parameters +** they take, and what they do are all subject to change without notice. +** Unlike most of the SQLite API, this function is not guaranteed to +** operate consistently from one release to the next. +*/ +SQLITE_API int sqlite3_test_control(int op, ...); + +/* +** CAPI3REF: Testing Interface Operation Codes +** +** These constants are the valid operation code parameters used +** as the first argument to [sqlite3_test_control()]. +** +** These parameters and their meanings are subject to change +** without notice. These values are for testing purposes only. +** Applications should not use any of these parameters or the +** [sqlite3_test_control()] interface. +*/ +#define SQLITE_TESTCTRL_FIRST 5 +#define SQLITE_TESTCTRL_PRNG_SAVE 5 +#define SQLITE_TESTCTRL_PRNG_RESTORE 6 +#define SQLITE_TESTCTRL_PRNG_RESET 7 +#define SQLITE_TESTCTRL_BITVEC_TEST 8 +#define SQLITE_TESTCTRL_FAULT_INSTALL 9 +#define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10 +#define SQLITE_TESTCTRL_PENDING_BYTE 11 +#define SQLITE_TESTCTRL_ASSERT 12 +#define SQLITE_TESTCTRL_ALWAYS 13 +#define SQLITE_TESTCTRL_RESERVE 14 +#define SQLITE_TESTCTRL_OPTIMIZATIONS 15 +#define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */ +#define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */ +#define SQLITE_TESTCTRL_LOCALTIME_FAULT 18 +#define SQLITE_TESTCTRL_EXPLAIN_STMT 19 /* NOT USED */ +#define SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD 19 +#define SQLITE_TESTCTRL_NEVER_CORRUPT 20 +#define SQLITE_TESTCTRL_VDBE_COVERAGE 21 +#define SQLITE_TESTCTRL_BYTEORDER 22 +#define SQLITE_TESTCTRL_ISINIT 23 +#define SQLITE_TESTCTRL_SORTER_MMAP 24 +#define SQLITE_TESTCTRL_IMPOSTER 25 +#define SQLITE_TESTCTRL_PARSER_COVERAGE 26 +#define SQLITE_TESTCTRL_LAST 26 /* Largest TESTCTRL */ + +/* +** CAPI3REF: SQL Keyword Checking +** +** These routines provide access to the set of SQL language keywords +** recognized by SQLite. Applications can uses these routines to determine +** whether or not a specific identifier needs to be escaped (for example, +** by enclosing in double-quotes) so as not to confuse the parser. +** +** The sqlite3_keyword_count() interface returns the number of distinct +** keywords understood by SQLite. +** +** The sqlite3_keyword_name(N,Z,L) interface finds the N-th keyword and +** makes *Z point to that keyword expressed as UTF8 and writes the number +** of bytes in the keyword into *L. The string that *Z points to is not +** zero-terminated. The sqlite3_keyword_name(N,Z,L) routine returns +** SQLITE_OK if N is within bounds and SQLITE_ERROR if not. If either Z +** or L are NULL or invalid pointers then calls to +** sqlite3_keyword_name(N,Z,L) result in undefined behavior. +** +** The sqlite3_keyword_check(Z,L) interface checks to see whether or not +** the L-byte UTF8 identifier that Z points to is a keyword, returning non-zero +** if it is and zero if not. +** +** The parser used by SQLite is forgiving. It is often possible to use +** a keyword as an identifier as long as such use does not result in a +** parsing ambiguity. For example, the statement +** "CREATE TABLE BEGIN(REPLACE,PRAGMA,END);" is accepted by SQLite, and +** creates a new table named "BEGIN" with three columns named +** "REPLACE", "PRAGMA", and "END". Nevertheless, best practice is to avoid +** using keywords as identifiers. Common techniques used to avoid keyword +** name collisions include: +**
    +**
  • Put all identifier names inside double-quotes. This is the official +** SQL way to escape identifier names. +**
  • Put identifier names inside [...]. This is not standard SQL, +** but it is what SQL Server does and so lots of programmers use this +** technique. +**
  • Begin every identifier with the letter "Z" as no SQL keywords start +** with "Z". +**
  • Include a digit somewhere in every identifier name. +**
+** +** Note that the number of keywords understood by SQLite can depend on +** compile-time options. For example, "VACUUM" is not a keyword if +** SQLite is compiled with the [-DSQLITE_OMIT_VACUUM] option. Also, +** new keywords may be added to future releases of SQLite. +*/ +SQLITE_API int sqlite3_keyword_count(void); +SQLITE_API int sqlite3_keyword_name(int,const char**,int*); +SQLITE_API int sqlite3_keyword_check(const char*,int); + +/* +** CAPI3REF: Dynamic String Object +** KEYWORDS: {dynamic string} +** +** An instance of the sqlite3_str object contains a dynamically-sized +** string under construction. +** +** The lifecycle of an sqlite3_str object is as follows: +**
    +**
  1. ^The sqlite3_str object is created using [sqlite3_str_new()]. +**
  2. ^Text is appended to the sqlite3_str object using various +** methods, such as [sqlite3_str_appendf()]. +**
  3. ^The sqlite3_str object is destroyed and the string it created +** is returned using the [sqlite3_str_finish()] interface. +**
+*/ +typedef struct sqlite3_str sqlite3_str; + +/* +** CAPI3REF: Create A New Dynamic String Object +** CONSTRUCTOR: sqlite3_str +** +** ^The [sqlite3_str_new(D)] interface allocates and initializes +** a new [sqlite3_str] object. To avoid memory leaks, the object returned by +** [sqlite3_str_new()] must be freed by a subsequent call to +** [sqlite3_str_finish(X)]. +** +** ^The [sqlite3_str_new(D)] interface always returns a pointer to a +** valid [sqlite3_str] object, though in the event of an out-of-memory +** error the returned object might be a special singleton that will +** silently reject new text, always return SQLITE_NOMEM from +** [sqlite3_str_errcode()], always return 0 for +** [sqlite3_str_length()], and always return NULL from +** [sqlite3_str_finish(X)]. It is always safe to use the value +** returned by [sqlite3_str_new(D)] as the sqlite3_str parameter +** to any of the other [sqlite3_str] methods. +** +** The D parameter to [sqlite3_str_new(D)] may be NULL. If the +** D parameter in [sqlite3_str_new(D)] is not NULL, then the maximum +** length of the string contained in the [sqlite3_str] object will be +** the value set for [sqlite3_limit](D,[SQLITE_LIMIT_LENGTH]) instead +** of [SQLITE_MAX_LENGTH]. +*/ +SQLITE_API sqlite3_str *sqlite3_str_new(sqlite3*); + +/* +** CAPI3REF: Finalize A Dynamic String +** DESTRUCTOR: sqlite3_str +** +** ^The [sqlite3_str_finish(X)] interface destroys the sqlite3_str object X +** and returns a pointer to a memory buffer obtained from [sqlite3_malloc64()] +** that contains the constructed string. The calling application should +** pass the returned value to [sqlite3_free()] to avoid a memory leak. +** ^The [sqlite3_str_finish(X)] interface may return a NULL pointer if any +** errors were encountered during construction of the string. ^The +** [sqlite3_str_finish(X)] interface will also return a NULL pointer if the +** string in [sqlite3_str] object X is zero bytes long. +*/ +SQLITE_API char *sqlite3_str_finish(sqlite3_str*); + +/* +** CAPI3REF: Add Content To A Dynamic String +** METHOD: sqlite3_str +** +** These interfaces add content to an sqlite3_str object previously obtained +** from [sqlite3_str_new()]. +** +** ^The [sqlite3_str_appendf(X,F,...)] and +** [sqlite3_str_vappendf(X,F,V)] interfaces uses the [built-in printf] +** functionality of SQLite to append formatted text onto the end of +** [sqlite3_str] object X. +** +** ^The [sqlite3_str_append(X,S,N)] method appends exactly N bytes from string S +** onto the end of the [sqlite3_str] object X. N must be non-negative. +** S must contain at least N non-zero bytes of content. To append a +** zero-terminated string in its entirety, use the [sqlite3_str_appendall()] +** method instead. +** +** ^The [sqlite3_str_appendall(X,S)] method appends the complete content of +** zero-terminated string S onto the end of [sqlite3_str] object X. +** +** ^The [sqlite3_str_appendchar(X,N,C)] method appends N copies of the +** single-byte character C onto the end of [sqlite3_str] object X. +** ^This method can be used, for example, to add whitespace indentation. +** +** ^The [sqlite3_str_reset(X)] method resets the string under construction +** inside [sqlite3_str] object X back to zero bytes in length. +** +** These methods do not return a result code. ^If an error occurs, that fact +** is recorded in the [sqlite3_str] object and can be recovered by a +** subsequent call to [sqlite3_str_errcode(X)]. +*/ +SQLITE_API void sqlite3_str_appendf(sqlite3_str*, const char *zFormat, ...); +SQLITE_API void sqlite3_str_vappendf(sqlite3_str*, const char *zFormat, va_list); +SQLITE_API void sqlite3_str_append(sqlite3_str*, const char *zIn, int N); +SQLITE_API void sqlite3_str_appendall(sqlite3_str*, const char *zIn); +SQLITE_API void sqlite3_str_appendchar(sqlite3_str*, int N, char C); +SQLITE_API void sqlite3_str_reset(sqlite3_str*); + +/* +** CAPI3REF: Status Of A Dynamic String +** METHOD: sqlite3_str +** +** These interfaces return the current status of an [sqlite3_str] object. +** +** ^If any prior errors have occurred while constructing the dynamic string +** in sqlite3_str X, then the [sqlite3_str_errcode(X)] method will return +** an appropriate error code. ^The [sqlite3_str_errcode(X)] method returns +** [SQLITE_NOMEM] following any out-of-memory error, or +** [SQLITE_TOOBIG] if the size of the dynamic string exceeds +** [SQLITE_MAX_LENGTH], or [SQLITE_OK] if there have been no errors. +** +** ^The [sqlite3_str_length(X)] method returns the current length, in bytes, +** of the dynamic string under construction in [sqlite3_str] object X. +** ^The length returned by [sqlite3_str_length(X)] does not include the +** zero-termination byte. +** +** ^The [sqlite3_str_value(X)] method returns a pointer to the current +** content of the dynamic string under construction in X. The value +** returned by [sqlite3_str_value(X)] is managed by the sqlite3_str object X +** and might be freed or altered by any subsequent method on the same +** [sqlite3_str] object. Applications must not used the pointer returned +** [sqlite3_str_value(X)] after any subsequent method call on the same +** object. ^Applications may change the content of the string returned +** by [sqlite3_str_value(X)] as long as they do not write into any bytes +** outside the range of 0 to [sqlite3_str_length(X)] and do not read or +** write any byte after any subsequent sqlite3_str method call. +*/ +SQLITE_API int sqlite3_str_errcode(sqlite3_str*); +SQLITE_API int sqlite3_str_length(sqlite3_str*); +SQLITE_API char *sqlite3_str_value(sqlite3_str*); + +/* +** CAPI3REF: SQLite Runtime Status +** +** ^These interfaces are used to retrieve runtime status information +** about the performance of SQLite, and optionally to reset various +** highwater marks. ^The first argument is an integer code for +** the specific parameter to measure. ^(Recognized integer codes +** are of the form [status parameters | SQLITE_STATUS_...].)^ +** ^The current value of the parameter is returned into *pCurrent. +** ^The highest recorded value is returned in *pHighwater. ^If the +** resetFlag is true, then the highest record value is reset after +** *pHighwater is written. ^(Some parameters do not record the highest +** value. For those parameters +** nothing is written into *pHighwater and the resetFlag is ignored.)^ +** ^(Other parameters record only the highwater mark and not the current +** value. For these latter parameters nothing is written into *pCurrent.)^ +** +** ^The sqlite3_status() and sqlite3_status64() routines return +** SQLITE_OK on success and a non-zero [error code] on failure. +** +** If either the current value or the highwater mark is too large to +** be represented by a 32-bit integer, then the values returned by +** sqlite3_status() are undefined. +** +** See also: [sqlite3_db_status()] +*/ +SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); +SQLITE_API int sqlite3_status64( + int op, + sqlite3_int64 *pCurrent, + sqlite3_int64 *pHighwater, + int resetFlag +); + + +/* +** CAPI3REF: Status Parameters +** KEYWORDS: {status parameters} +** +** These integer constants designate various run-time status parameters +** that can be returned by [sqlite3_status()]. +** +**
+** [[SQLITE_STATUS_MEMORY_USED]] ^(
SQLITE_STATUS_MEMORY_USED
+**
This parameter is the current amount of memory checked out +** using [sqlite3_malloc()], either directly or indirectly. The +** figure includes calls made to [sqlite3_malloc()] by the application +** and internal memory usage by the SQLite library. Auxiliary page-cache +** memory controlled by [SQLITE_CONFIG_PAGECACHE] is not included in +** this parameter. The amount returned is the sum of the allocation +** sizes as reported by the xSize method in [sqlite3_mem_methods].
)^ +** +** [[SQLITE_STATUS_MALLOC_SIZE]] ^(
SQLITE_STATUS_MALLOC_SIZE
+**
This parameter records the largest memory allocation request +** handed to [sqlite3_malloc()] or [sqlite3_realloc()] (or their +** internal equivalents). Only the value returned in the +** *pHighwater parameter to [sqlite3_status()] is of interest. +** The value written into the *pCurrent parameter is undefined.
)^ +** +** [[SQLITE_STATUS_MALLOC_COUNT]] ^(
SQLITE_STATUS_MALLOC_COUNT
+**
This parameter records the number of separate memory allocations +** currently checked out.
)^ +** +** [[SQLITE_STATUS_PAGECACHE_USED]] ^(
SQLITE_STATUS_PAGECACHE_USED
+**
This parameter returns the number of pages used out of the +** [pagecache memory allocator] that was configured using +** [SQLITE_CONFIG_PAGECACHE]. The +** value returned is in pages, not in bytes.
)^ +** +** [[SQLITE_STATUS_PAGECACHE_OVERFLOW]] +** ^(
SQLITE_STATUS_PAGECACHE_OVERFLOW
+**
This parameter returns the number of bytes of page cache +** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE] +** buffer and where forced to overflow to [sqlite3_malloc()]. The +** returned value includes allocations that overflowed because they +** where too large (they were larger than the "sz" parameter to +** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because +** no space was left in the page cache.
)^ +** +** [[SQLITE_STATUS_PAGECACHE_SIZE]] ^(
SQLITE_STATUS_PAGECACHE_SIZE
+**
This parameter records the largest memory allocation request +** handed to [pagecache memory allocator]. Only the value returned in the +** *pHighwater parameter to [sqlite3_status()] is of interest. +** The value written into the *pCurrent parameter is undefined.
)^ +** +** [[SQLITE_STATUS_SCRATCH_USED]]
SQLITE_STATUS_SCRATCH_USED
+**
No longer used.
+** +** [[SQLITE_STATUS_SCRATCH_OVERFLOW]] ^(
SQLITE_STATUS_SCRATCH_OVERFLOW
+**
No longer used.
+** +** [[SQLITE_STATUS_SCRATCH_SIZE]]
SQLITE_STATUS_SCRATCH_SIZE
+**
No longer used.
+** +** [[SQLITE_STATUS_PARSER_STACK]] ^(
SQLITE_STATUS_PARSER_STACK
+**
The *pHighwater parameter records the deepest parser stack. +** The *pCurrent value is undefined. The *pHighwater value is only +** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH].
)^ +**
+** +** New status parameters may be added from time to time. +*/ +#define SQLITE_STATUS_MEMORY_USED 0 +#define SQLITE_STATUS_PAGECACHE_USED 1 +#define SQLITE_STATUS_PAGECACHE_OVERFLOW 2 +#define SQLITE_STATUS_SCRATCH_USED 3 /* NOT USED */ +#define SQLITE_STATUS_SCRATCH_OVERFLOW 4 /* NOT USED */ +#define SQLITE_STATUS_MALLOC_SIZE 5 +#define SQLITE_STATUS_PARSER_STACK 6 +#define SQLITE_STATUS_PAGECACHE_SIZE 7 +#define SQLITE_STATUS_SCRATCH_SIZE 8 /* NOT USED */ +#define SQLITE_STATUS_MALLOC_COUNT 9 + +/* +** CAPI3REF: Database Connection Status +** METHOD: sqlite3 +** +** ^This interface is used to retrieve runtime status information +** about a single [database connection]. ^The first argument is the +** database connection object to be interrogated. ^The second argument +** is an integer constant, taken from the set of +** [SQLITE_DBSTATUS options], that +** determines the parameter to interrogate. The set of +** [SQLITE_DBSTATUS options] is likely +** to grow in future releases of SQLite. +** +** ^The current value of the requested parameter is written into *pCur +** and the highest instantaneous value is written into *pHiwtr. ^If +** the resetFlg is true, then the highest instantaneous value is +** reset back down to the current value. +** +** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a +** non-zero [error code] on failure. +** +** See also: [sqlite3_status()] and [sqlite3_stmt_status()]. +*/ +SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); + +/* +** CAPI3REF: Status Parameters for database connections +** KEYWORDS: {SQLITE_DBSTATUS options} +** +** These constants are the available integer "verbs" that can be passed as +** the second argument to the [sqlite3_db_status()] interface. +** +** New verbs may be added in future releases of SQLite. Existing verbs +** might be discontinued. Applications should check the return code from +** [sqlite3_db_status()] to make sure that the call worked. +** The [sqlite3_db_status()] interface will return a non-zero error code +** if a discontinued or unsupported verb is invoked. +** +**
+** [[SQLITE_DBSTATUS_LOOKASIDE_USED]] ^(
SQLITE_DBSTATUS_LOOKASIDE_USED
+**
This parameter returns the number of lookaside memory slots currently +** checked out.
)^ +** +** [[SQLITE_DBSTATUS_LOOKASIDE_HIT]] ^(
SQLITE_DBSTATUS_LOOKASIDE_HIT
+**
This parameter returns the number malloc attempts that were +** satisfied using lookaside memory. Only the high-water value is meaningful; +** the current value is always zero.)^ +** +** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE]] +** ^(
SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE
+**
This parameter returns the number malloc attempts that might have +** been satisfied using lookaside memory but failed due to the amount of +** memory requested being larger than the lookaside slot size. +** Only the high-water value is meaningful; +** the current value is always zero.)^ +** +** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL]] +** ^(
SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL
+**
This parameter returns the number malloc attempts that might have +** been satisfied using lookaside memory but failed due to all lookaside +** memory already being in use. +** Only the high-water value is meaningful; +** the current value is always zero.)^ +** +** [[SQLITE_DBSTATUS_CACHE_USED]] ^(
SQLITE_DBSTATUS_CACHE_USED
+**
This parameter returns the approximate number of bytes of heap +** memory used by all pager caches associated with the database connection.)^ +** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. +** +** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] +** ^(
SQLITE_DBSTATUS_CACHE_USED_SHARED
+**
This parameter is similar to DBSTATUS_CACHE_USED, except that if a +** pager cache is shared between two or more connections the bytes of heap +** memory used by that pager cache is divided evenly between the attached +** connections.)^ In other words, if none of the pager caches associated +** with the database connection are shared, this request returns the same +** value as DBSTATUS_CACHE_USED. Or, if one or more or the pager caches are +** shared, the value returned by this call will be smaller than that returned +** by DBSTATUS_CACHE_USED. ^The highwater mark associated with +** SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0. +** +** [[SQLITE_DBSTATUS_SCHEMA_USED]] ^(
SQLITE_DBSTATUS_SCHEMA_USED
+**
This parameter returns the approximate number of bytes of heap +** memory used to store the schema for all databases associated +** with the connection - main, temp, and any [ATTACH]-ed databases.)^ +** ^The full amount of memory used by the schemas is reported, even if the +** schema memory is shared with other database connections due to +** [shared cache mode] being enabled. +** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0. +** +** [[SQLITE_DBSTATUS_STMT_USED]] ^(
SQLITE_DBSTATUS_STMT_USED
+**
This parameter returns the approximate number of bytes of heap +** and lookaside memory used by all prepared statements associated with +** the database connection.)^ +** ^The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 0. +**
+** +** [[SQLITE_DBSTATUS_CACHE_HIT]] ^(
SQLITE_DBSTATUS_CACHE_HIT
+**
This parameter returns the number of pager cache hits that have +** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT +** is always 0. +**
+** +** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(
SQLITE_DBSTATUS_CACHE_MISS
+**
This parameter returns the number of pager cache misses that have +** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS +** is always 0. +**
+** +** [[SQLITE_DBSTATUS_CACHE_WRITE]] ^(
SQLITE_DBSTATUS_CACHE_WRITE
+**
This parameter returns the number of dirty cache entries that have +** been written to disk. Specifically, the number of pages written to the +** wal file in wal mode databases, or the number of pages written to the +** database file in rollback mode databases. Any pages written as part of +** transaction rollback or database recovery operations are not included. +** If an IO or other error occurs while writing a page to disk, the effect +** on subsequent SQLITE_DBSTATUS_CACHE_WRITE requests is undefined.)^ ^The +** highwater mark associated with SQLITE_DBSTATUS_CACHE_WRITE is always 0. +**
+** +** [[SQLITE_DBSTATUS_CACHE_SPILL]] ^(
SQLITE_DBSTATUS_CACHE_SPILL
+**
This parameter returns the number of dirty cache entries that have +** been written to disk in the middle of a transaction due to the page +** cache overflowing. Transactions are more efficient if they are written +** to disk all at once. When pages spill mid-transaction, that introduces +** additional overhead. This parameter can be used help identify +** inefficiencies that can be resolve by increasing the cache size. +**
+** +** [[SQLITE_DBSTATUS_DEFERRED_FKS]] ^(
SQLITE_DBSTATUS_DEFERRED_FKS
+**
This parameter returns zero for the current value if and only if +** all foreign key constraints (deferred or immediate) have been +** resolved.)^ ^The highwater mark is always 0. +**
+**
+*/ +#define SQLITE_DBSTATUS_LOOKASIDE_USED 0 +#define SQLITE_DBSTATUS_CACHE_USED 1 +#define SQLITE_DBSTATUS_SCHEMA_USED 2 +#define SQLITE_DBSTATUS_STMT_USED 3 +#define SQLITE_DBSTATUS_LOOKASIDE_HIT 4 +#define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE 5 +#define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL 6 +#define SQLITE_DBSTATUS_CACHE_HIT 7 +#define SQLITE_DBSTATUS_CACHE_MISS 8 +#define SQLITE_DBSTATUS_CACHE_WRITE 9 +#define SQLITE_DBSTATUS_DEFERRED_FKS 10 +#define SQLITE_DBSTATUS_CACHE_USED_SHARED 11 +#define SQLITE_DBSTATUS_CACHE_SPILL 12 +#define SQLITE_DBSTATUS_MAX 12 /* Largest defined DBSTATUS */ + + +/* +** CAPI3REF: Prepared Statement Status +** METHOD: sqlite3_stmt +** +** ^(Each prepared statement maintains various +** [SQLITE_STMTSTATUS counters] that measure the number +** of times it has performed specific operations.)^ These counters can +** be used to monitor the performance characteristics of the prepared +** statements. For example, if the number of table steps greatly exceeds +** the number of table searches or result rows, that would tend to indicate +** that the prepared statement is using a full table scan rather than +** an index. +** +** ^(This interface is used to retrieve and reset counter values from +** a [prepared statement]. The first argument is the prepared statement +** object to be interrogated. The second argument +** is an integer code for a specific [SQLITE_STMTSTATUS counter] +** to be interrogated.)^ +** ^The current value of the requested counter is returned. +** ^If the resetFlg is true, then the counter is reset to zero after this +** interface call returns. +** +** See also: [sqlite3_status()] and [sqlite3_db_status()]. +*/ +SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); + +/* +** CAPI3REF: Status Parameters for prepared statements +** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters} +** +** These preprocessor macros define integer codes that name counter +** values associated with the [sqlite3_stmt_status()] interface. +** The meanings of the various counters are as follows: +** +**
+** [[SQLITE_STMTSTATUS_FULLSCAN_STEP]]
SQLITE_STMTSTATUS_FULLSCAN_STEP
+**
^This is the number of times that SQLite has stepped forward in +** a table as part of a full table scan. Large numbers for this counter +** may indicate opportunities for performance improvement through +** careful use of indices.
+** +** [[SQLITE_STMTSTATUS_SORT]]
SQLITE_STMTSTATUS_SORT
+**
^This is the number of sort operations that have occurred. +** A non-zero value in this counter may indicate an opportunity to +** improvement performance through careful use of indices.
+** +** [[SQLITE_STMTSTATUS_AUTOINDEX]]
SQLITE_STMTSTATUS_AUTOINDEX
+**
^This is the number of rows inserted into transient indices that +** were created automatically in order to help joins run faster. +** A non-zero value in this counter may indicate an opportunity to +** improvement performance by adding permanent indices that do not +** need to be reinitialized each time the statement is run.
+** +** [[SQLITE_STMTSTATUS_VM_STEP]]
SQLITE_STMTSTATUS_VM_STEP
+**
^This is the number of virtual machine operations executed +** by the prepared statement if that number is less than or equal +** to 2147483647. The number of virtual machine operations can be +** used as a proxy for the total work done by the prepared statement. +** If the number of virtual machine operations exceeds 2147483647 +** then the value returned by this statement status code is undefined. +** +** [[SQLITE_STMTSTATUS_REPREPARE]]
SQLITE_STMTSTATUS_REPREPARE
+**
^This is the number of times that the prepare statement has been +** automatically regenerated due to schema changes or change to +** [bound parameters] that might affect the query plan. +** +** [[SQLITE_STMTSTATUS_RUN]]
SQLITE_STMTSTATUS_RUN
+**
^This is the number of times that the prepared statement has +** been run. A single "run" for the purposes of this counter is one +** or more calls to [sqlite3_step()] followed by a call to [sqlite3_reset()]. +** The counter is incremented on the first [sqlite3_step()] call of each +** cycle. +** +** [[SQLITE_STMTSTATUS_MEMUSED]]
SQLITE_STMTSTATUS_MEMUSED
+**
^This is the approximate number of bytes of heap memory +** used to store the prepared statement. ^This value is not actually +** a counter, and so the resetFlg parameter to sqlite3_stmt_status() +** is ignored when the opcode is SQLITE_STMTSTATUS_MEMUSED. +**
+**
+*/ +#define SQLITE_STMTSTATUS_FULLSCAN_STEP 1 +#define SQLITE_STMTSTATUS_SORT 2 +#define SQLITE_STMTSTATUS_AUTOINDEX 3 +#define SQLITE_STMTSTATUS_VM_STEP 4 +#define SQLITE_STMTSTATUS_REPREPARE 5 +#define SQLITE_STMTSTATUS_RUN 6 +#define SQLITE_STMTSTATUS_MEMUSED 99 + +/* +** CAPI3REF: Custom Page Cache Object +** +** The sqlite3_pcache type is opaque. It is implemented by +** the pluggable module. The SQLite core has no knowledge of +** its size or internal structure and never deals with the +** sqlite3_pcache object except by holding and passing pointers +** to the object. +** +** See [sqlite3_pcache_methods2] for additional information. +*/ +typedef struct sqlite3_pcache sqlite3_pcache; + +/* +** CAPI3REF: Custom Page Cache Object +** +** The sqlite3_pcache_page object represents a single page in the +** page cache. The page cache will allocate instances of this +** object. Various methods of the page cache use pointers to instances +** of this object as parameters or as their return value. +** +** See [sqlite3_pcache_methods2] for additional information. +*/ +typedef struct sqlite3_pcache_page sqlite3_pcache_page; +struct sqlite3_pcache_page { + void *pBuf; /* The content of the page */ + void *pExtra; /* Extra information associated with the page */ +}; + +/* +** CAPI3REF: Application Defined Page Cache. +** KEYWORDS: {page cache} +** +** ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE2], ...) interface can +** register an alternative page cache implementation by passing in an +** instance of the sqlite3_pcache_methods2 structure.)^ +** In many applications, most of the heap memory allocated by +** SQLite is used for the page cache. +** By implementing a +** custom page cache using this API, an application can better control +** the amount of memory consumed by SQLite, the way in which +** that memory is allocated and released, and the policies used to +** determine exactly which parts of a database file are cached and for +** how long. +** +** The alternative page cache mechanism is an +** extreme measure that is only needed by the most demanding applications. +** The built-in page cache is recommended for most uses. +** +** ^(The contents of the sqlite3_pcache_methods2 structure are copied to an +** internal buffer by SQLite within the call to [sqlite3_config]. Hence +** the application may discard the parameter after the call to +** [sqlite3_config()] returns.)^ +** +** [[the xInit() page cache method]] +** ^(The xInit() method is called once for each effective +** call to [sqlite3_initialize()])^ +** (usually only once during the lifetime of the process). ^(The xInit() +** method is passed a copy of the sqlite3_pcache_methods2.pArg value.)^ +** The intent of the xInit() method is to set up global data structures +** required by the custom page cache implementation. +** ^(If the xInit() method is NULL, then the +** built-in default page cache is used instead of the application defined +** page cache.)^ +** +** [[the xShutdown() page cache method]] +** ^The xShutdown() method is called by [sqlite3_shutdown()]. +** It can be used to clean up +** any outstanding resources before process shutdown, if required. +** ^The xShutdown() method may be NULL. +** +** ^SQLite automatically serializes calls to the xInit method, +** so the xInit method need not be threadsafe. ^The +** xShutdown method is only called from [sqlite3_shutdown()] so it does +** not need to be threadsafe either. All other methods must be threadsafe +** in multithreaded applications. +** +** ^SQLite will never invoke xInit() more than once without an intervening +** call to xShutdown(). +** +** [[the xCreate() page cache methods]] +** ^SQLite invokes the xCreate() method to construct a new cache instance. +** SQLite will typically create one cache instance for each open database file, +** though this is not guaranteed. ^The +** first parameter, szPage, is the size in bytes of the pages that must +** be allocated by the cache. ^szPage will always a power of two. ^The +** second parameter szExtra is a number of bytes of extra storage +** associated with each page cache entry. ^The szExtra parameter will +** a number less than 250. SQLite will use the +** extra szExtra bytes on each page to store metadata about the underlying +** database page on disk. The value passed into szExtra depends +** on the SQLite version, the target platform, and how SQLite was compiled. +** ^The third argument to xCreate(), bPurgeable, is true if the cache being +** created will be used to cache database pages of a file stored on disk, or +** false if it is used for an in-memory database. The cache implementation +** does not have to do anything special based with the value of bPurgeable; +** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will +** never invoke xUnpin() except to deliberately delete a page. +** ^In other words, calls to xUnpin() on a cache with bPurgeable set to +** false will always have the "discard" flag set to true. +** ^Hence, a cache created with bPurgeable false will +** never contain any unpinned pages. +** +** [[the xCachesize() page cache method]] +** ^(The xCachesize() method may be called at any time by SQLite to set the +** suggested maximum cache-size (number of pages stored by) the cache +** instance passed as the first argument. This is the value configured using +** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable +** parameter, the implementation is not required to do anything with this +** value; it is advisory only. +** +** [[the xPagecount() page cache methods]] +** The xPagecount() method must return the number of pages currently +** stored in the cache, both pinned and unpinned. +** +** [[the xFetch() page cache methods]] +** The xFetch() method locates a page in the cache and returns a pointer to +** an sqlite3_pcache_page object associated with that page, or a NULL pointer. +** The pBuf element of the returned sqlite3_pcache_page object will be a +** pointer to a buffer of szPage bytes used to store the content of a +** single database page. The pExtra element of sqlite3_pcache_page will be +** a pointer to the szExtra bytes of extra storage that SQLite has requested +** for each entry in the page cache. +** +** The page to be fetched is determined by the key. ^The minimum key value +** is 1. After it has been retrieved using xFetch, the page is considered +** to be "pinned". +** +** If the requested page is already in the page cache, then the page cache +** implementation must return a pointer to the page buffer with its content +** intact. If the requested page is not already in the cache, then the +** cache implementation should use the value of the createFlag +** parameter to help it determined what action to take: +** +** +**
createFlag Behavior when page is not already in cache +**
0 Do not allocate a new page. Return NULL. +**
1 Allocate a new page if it easy and convenient to do so. +** Otherwise return NULL. +**
2 Make every effort to allocate a new page. Only return +** NULL if allocating a new page is effectively impossible. +**
+** +** ^(SQLite will normally invoke xFetch() with a createFlag of 0 or 1. SQLite +** will only use a createFlag of 2 after a prior call with a createFlag of 1 +** failed.)^ In between the to xFetch() calls, SQLite may +** attempt to unpin one or more cache pages by spilling the content of +** pinned pages to disk and synching the operating system disk cache. +** +** [[the xUnpin() page cache method]] +** ^xUnpin() is called by SQLite with a pointer to a currently pinned page +** as its second argument. If the third parameter, discard, is non-zero, +** then the page must be evicted from the cache. +** ^If the discard parameter is +** zero, then the page may be discarded or retained at the discretion of +** page cache implementation. ^The page cache implementation +** may choose to evict unpinned pages at any time. +** +** The cache must not perform any reference counting. A single +** call to xUnpin() unpins the page regardless of the number of prior calls +** to xFetch(). +** +** [[the xRekey() page cache methods]] +** The xRekey() method is used to change the key value associated with the +** page passed as the second argument. If the cache +** previously contains an entry associated with newKey, it must be +** discarded. ^Any prior cache entry associated with newKey is guaranteed not +** to be pinned. +** +** When SQLite calls the xTruncate() method, the cache must discard all +** existing cache entries with page numbers (keys) greater than or equal +** to the value of the iLimit parameter passed to xTruncate(). If any +** of these pages are pinned, they are implicitly unpinned, meaning that +** they can be safely discarded. +** +** [[the xDestroy() page cache method]] +** ^The xDestroy() method is used to delete a cache allocated by xCreate(). +** All resources associated with the specified cache should be freed. ^After +** calling the xDestroy() method, SQLite considers the [sqlite3_pcache*] +** handle invalid, and will not use it with any other sqlite3_pcache_methods2 +** functions. +** +** [[the xShrink() page cache method]] +** ^SQLite invokes the xShrink() method when it wants the page cache to +** free up as much of heap memory as possible. The page cache implementation +** is not obligated to free any memory, but well-behaved implementations should +** do their best. +*/ +typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2; +struct sqlite3_pcache_methods2 { + int iVersion; + void *pArg; + int (*xInit)(void*); + void (*xShutdown)(void*); + sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable); + void (*xCachesize)(sqlite3_pcache*, int nCachesize); + int (*xPagecount)(sqlite3_pcache*); + sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); + void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard); + void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, + unsigned oldKey, unsigned newKey); + void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); + void (*xDestroy)(sqlite3_pcache*); + void (*xShrink)(sqlite3_pcache*); +}; + +/* +** This is the obsolete pcache_methods object that has now been replaced +** by sqlite3_pcache_methods2. This object is not used by SQLite. It is +** retained in the header file for backwards compatibility only. +*/ +typedef struct sqlite3_pcache_methods sqlite3_pcache_methods; +struct sqlite3_pcache_methods { + void *pArg; + int (*xInit)(void*); + void (*xShutdown)(void*); + sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable); + void (*xCachesize)(sqlite3_pcache*, int nCachesize); + int (*xPagecount)(sqlite3_pcache*); + void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); + void (*xUnpin)(sqlite3_pcache*, void*, int discard); + void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey); + void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); + void (*xDestroy)(sqlite3_pcache*); +}; + + +/* +** CAPI3REF: Online Backup Object +** +** The sqlite3_backup object records state information about an ongoing +** online backup operation. ^The sqlite3_backup object is created by +** a call to [sqlite3_backup_init()] and is destroyed by a call to +** [sqlite3_backup_finish()]. +** +** See Also: [Using the SQLite Online Backup API] +*/ +typedef struct sqlite3_backup sqlite3_backup; + +/* +** CAPI3REF: Online Backup API. +** +** The backup API copies the content of one database into another. +** It is useful either for creating backups of databases or +** for copying in-memory databases to or from persistent files. +** +** See Also: [Using the SQLite Online Backup API] +** +** ^SQLite holds a write transaction open on the destination database file +** for the duration of the backup operation. +** ^The source database is read-locked only while it is being read; +** it is not locked continuously for the entire backup operation. +** ^Thus, the backup may be performed on a live source database without +** preventing other database connections from +** reading or writing to the source database while the backup is underway. +** +** ^(To perform a backup operation: +**
    +**
  1. sqlite3_backup_init() is called once to initialize the +** backup, +**
  2. sqlite3_backup_step() is called one or more times to transfer +** the data between the two databases, and finally +**
  3. sqlite3_backup_finish() is called to release all resources +** associated with the backup operation. +**
)^ +** There should be exactly one call to sqlite3_backup_finish() for each +** successful call to sqlite3_backup_init(). +** +** [[sqlite3_backup_init()]] sqlite3_backup_init() +** +** ^The D and N arguments to sqlite3_backup_init(D,N,S,M) are the +** [database connection] associated with the destination database +** and the database name, respectively. +** ^The database name is "main" for the main database, "temp" for the +** temporary database, or the name specified after the AS keyword in +** an [ATTACH] statement for an attached database. +** ^The S and M arguments passed to +** sqlite3_backup_init(D,N,S,M) identify the [database connection] +** and database name of the source database, respectively. +** ^The source and destination [database connections] (parameters S and D) +** must be different or else sqlite3_backup_init(D,N,S,M) will fail with +** an error. +** +** ^A call to sqlite3_backup_init() will fail, returning NULL, if +** there is already a read or read-write transaction open on the +** destination database. +** +** ^If an error occurs within sqlite3_backup_init(D,N,S,M), then NULL is +** returned and an error code and error message are stored in the +** destination [database connection] D. +** ^The error code and message for the failed call to sqlite3_backup_init() +** can be retrieved using the [sqlite3_errcode()], [sqlite3_errmsg()], and/or +** [sqlite3_errmsg16()] functions. +** ^A successful call to sqlite3_backup_init() returns a pointer to an +** [sqlite3_backup] object. +** ^The [sqlite3_backup] object may be used with the sqlite3_backup_step() and +** sqlite3_backup_finish() functions to perform the specified backup +** operation. +** +** [[sqlite3_backup_step()]] sqlite3_backup_step() +** +** ^Function sqlite3_backup_step(B,N) will copy up to N pages between +** the source and destination databases specified by [sqlite3_backup] object B. +** ^If N is negative, all remaining source pages are copied. +** ^If sqlite3_backup_step(B,N) successfully copies N pages and there +** are still more pages to be copied, then the function returns [SQLITE_OK]. +** ^If sqlite3_backup_step(B,N) successfully finishes copying all pages +** from source to destination, then it returns [SQLITE_DONE]. +** ^If an error occurs while running sqlite3_backup_step(B,N), +** then an [error code] is returned. ^As well as [SQLITE_OK] and +** [SQLITE_DONE], a call to sqlite3_backup_step() may return [SQLITE_READONLY], +** [SQLITE_NOMEM], [SQLITE_BUSY], [SQLITE_LOCKED], or an +** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX] extended error code. +** +** ^(The sqlite3_backup_step() might return [SQLITE_READONLY] if +**
    +**
  1. the destination database was opened read-only, or +**
  2. the destination database is using write-ahead-log journaling +** and the destination and source page sizes differ, or +**
  3. the destination database is an in-memory database and the +** destination and source page sizes differ. +**
)^ +** +** ^If sqlite3_backup_step() cannot obtain a required file-system lock, then +** the [sqlite3_busy_handler | busy-handler function] +** is invoked (if one is specified). ^If the +** busy-handler returns non-zero before the lock is available, then +** [SQLITE_BUSY] is returned to the caller. ^In this case the call to +** sqlite3_backup_step() can be retried later. ^If the source +** [database connection] +** is being used to write to the source database when sqlite3_backup_step() +** is called, then [SQLITE_LOCKED] is returned immediately. ^Again, in this +** case the call to sqlite3_backup_step() can be retried later on. ^(If +** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX], [SQLITE_NOMEM], or +** [SQLITE_READONLY] is returned, then +** there is no point in retrying the call to sqlite3_backup_step(). These +** errors are considered fatal.)^ The application must accept +** that the backup operation has failed and pass the backup operation handle +** to the sqlite3_backup_finish() to release associated resources. +** +** ^The first call to sqlite3_backup_step() obtains an exclusive lock +** on the destination file. ^The exclusive lock is not released until either +** sqlite3_backup_finish() is called or the backup operation is complete +** and sqlite3_backup_step() returns [SQLITE_DONE]. ^Every call to +** sqlite3_backup_step() obtains a [shared lock] on the source database that +** lasts for the duration of the sqlite3_backup_step() call. +** ^Because the source database is not locked between calls to +** sqlite3_backup_step(), the source database may be modified mid-way +** through the backup process. ^If the source database is modified by an +** external process or via a database connection other than the one being +** used by the backup operation, then the backup will be automatically +** restarted by the next call to sqlite3_backup_step(). ^If the source +** database is modified by the using the same database connection as is used +** by the backup operation, then the backup database is automatically +** updated at the same time. +** +** [[sqlite3_backup_finish()]] sqlite3_backup_finish() +** +** When sqlite3_backup_step() has returned [SQLITE_DONE], or when the +** application wishes to abandon the backup operation, the application +** should destroy the [sqlite3_backup] by passing it to sqlite3_backup_finish(). +** ^The sqlite3_backup_finish() interfaces releases all +** resources associated with the [sqlite3_backup] object. +** ^If sqlite3_backup_step() has not yet returned [SQLITE_DONE], then any +** active write-transaction on the destination database is rolled back. +** The [sqlite3_backup] object is invalid +** and may not be used following a call to sqlite3_backup_finish(). +** +** ^The value returned by sqlite3_backup_finish is [SQLITE_OK] if no +** sqlite3_backup_step() errors occurred, regardless or whether or not +** sqlite3_backup_step() completed. +** ^If an out-of-memory condition or IO error occurred during any prior +** sqlite3_backup_step() call on the same [sqlite3_backup] object, then +** sqlite3_backup_finish() returns the corresponding [error code]. +** +** ^A return of [SQLITE_BUSY] or [SQLITE_LOCKED] from sqlite3_backup_step() +** is not a permanent error and does not affect the return value of +** sqlite3_backup_finish(). +** +** [[sqlite3_backup_remaining()]] [[sqlite3_backup_pagecount()]] +** sqlite3_backup_remaining() and sqlite3_backup_pagecount() +** +** ^The sqlite3_backup_remaining() routine returns the number of pages still +** to be backed up at the conclusion of the most recent sqlite3_backup_step(). +** ^The sqlite3_backup_pagecount() routine returns the total number of pages +** in the source database at the conclusion of the most recent +** sqlite3_backup_step(). +** ^(The values returned by these functions are only updated by +** sqlite3_backup_step(). If the source database is modified in a way that +** changes the size of the source database or the number of pages remaining, +** those changes are not reflected in the output of sqlite3_backup_pagecount() +** and sqlite3_backup_remaining() until after the next +** sqlite3_backup_step().)^ +** +** Concurrent Usage of Database Handles +** +** ^The source [database connection] may be used by the application for other +** purposes while a backup operation is underway or being initialized. +** ^If SQLite is compiled and configured to support threadsafe database +** connections, then the source database connection may be used concurrently +** from within other threads. +** +** However, the application must guarantee that the destination +** [database connection] is not passed to any other API (by any thread) after +** sqlite3_backup_init() is called and before the corresponding call to +** sqlite3_backup_finish(). SQLite does not currently check to see +** if the application incorrectly accesses the destination [database connection] +** and so no error code is reported, but the operations may malfunction +** nevertheless. Use of the destination database connection while a +** backup is in progress might also also cause a mutex deadlock. +** +** If running in [shared cache mode], the application must +** guarantee that the shared cache used by the destination database +** is not accessed while the backup is running. In practice this means +** that the application must guarantee that the disk file being +** backed up to is not accessed by any connection within the process, +** not just the specific connection that was passed to sqlite3_backup_init(). +** +** The [sqlite3_backup] object itself is partially threadsafe. Multiple +** threads may safely make multiple concurrent calls to sqlite3_backup_step(). +** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount() +** APIs are not strictly speaking threadsafe. If they are invoked at the +** same time as another thread is invoking sqlite3_backup_step() it is +** possible that they return invalid values. +*/ +SQLITE_API sqlite3_backup *sqlite3_backup_init( + sqlite3 *pDest, /* Destination database handle */ + const char *zDestName, /* Destination database name */ + sqlite3 *pSource, /* Source database handle */ + const char *zSourceName /* Source database name */ +); +SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage); +SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p); +SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p); +SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); + +/* +** CAPI3REF: Unlock Notification +** METHOD: sqlite3 +** +** ^When running in shared-cache mode, a database operation may fail with +** an [SQLITE_LOCKED] error if the required locks on the shared-cache or +** individual tables within the shared-cache cannot be obtained. See +** [SQLite Shared-Cache Mode] for a description of shared-cache locking. +** ^This API may be used to register a callback that SQLite will invoke +** when the connection currently holding the required lock relinquishes it. +** ^This API is only available if the library was compiled with the +** [SQLITE_ENABLE_UNLOCK_NOTIFY] C-preprocessor symbol defined. +** +** See Also: [Using the SQLite Unlock Notification Feature]. +** +** ^Shared-cache locks are released when a database connection concludes +** its current transaction, either by committing it or rolling it back. +** +** ^When a connection (known as the blocked connection) fails to obtain a +** shared-cache lock and SQLITE_LOCKED is returned to the caller, the +** identity of the database connection (the blocking connection) that +** has locked the required resource is stored internally. ^After an +** application receives an SQLITE_LOCKED error, it may call the +** sqlite3_unlock_notify() method with the blocked connection handle as +** the first argument to register for a callback that will be invoked +** when the blocking connections current transaction is concluded. ^The +** callback is invoked from within the [sqlite3_step] or [sqlite3_close] +** call that concludes the blocking connections transaction. +** +** ^(If sqlite3_unlock_notify() is called in a multi-threaded application, +** there is a chance that the blocking connection will have already +** concluded its transaction by the time sqlite3_unlock_notify() is invoked. +** If this happens, then the specified callback is invoked immediately, +** from within the call to sqlite3_unlock_notify().)^ +** +** ^If the blocked connection is attempting to obtain a write-lock on a +** shared-cache table, and more than one other connection currently holds +** a read-lock on the same table, then SQLite arbitrarily selects one of +** the other connections to use as the blocking connection. +** +** ^(There may be at most one unlock-notify callback registered by a +** blocked connection. If sqlite3_unlock_notify() is called when the +** blocked connection already has a registered unlock-notify callback, +** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is +** called with a NULL pointer as its second argument, then any existing +** unlock-notify callback is canceled. ^The blocked connections +** unlock-notify callback may also be canceled by closing the blocked +** connection using [sqlite3_close()]. +** +** The unlock-notify callback is not reentrant. If an application invokes +** any sqlite3_xxx API functions from within an unlock-notify callback, a +** crash or deadlock may be the result. +** +** ^Unless deadlock is detected (see below), sqlite3_unlock_notify() always +** returns SQLITE_OK. +** +** Callback Invocation Details +** +** When an unlock-notify callback is registered, the application provides a +** single void* pointer that is passed to the callback when it is invoked. +** However, the signature of the callback function allows SQLite to pass +** it an array of void* context pointers. The first argument passed to +** an unlock-notify callback is a pointer to an array of void* pointers, +** and the second is the number of entries in the array. +** +** When a blocking connections transaction is concluded, there may be +** more than one blocked connection that has registered for an unlock-notify +** callback. ^If two or more such blocked connections have specified the +** same callback function, then instead of invoking the callback function +** multiple times, it is invoked once with the set of void* context pointers +** specified by the blocked connections bundled together into an array. +** This gives the application an opportunity to prioritize any actions +** related to the set of unblocked database connections. +** +** Deadlock Detection +** +** Assuming that after registering for an unlock-notify callback a +** database waits for the callback to be issued before taking any further +** action (a reasonable assumption), then using this API may cause the +** application to deadlock. For example, if connection X is waiting for +** connection Y's transaction to be concluded, and similarly connection +** Y is waiting on connection X's transaction, then neither connection +** will proceed and the system may remain deadlocked indefinitely. +** +** To avoid this scenario, the sqlite3_unlock_notify() performs deadlock +** detection. ^If a given call to sqlite3_unlock_notify() would put the +** system in a deadlocked state, then SQLITE_LOCKED is returned and no +** unlock-notify callback is registered. The system is said to be in +** a deadlocked state if connection A has registered for an unlock-notify +** callback on the conclusion of connection B's transaction, and connection +** B has itself registered for an unlock-notify callback when connection +** A's transaction is concluded. ^Indirect deadlock is also detected, so +** the system is also considered to be deadlocked if connection B has +** registered for an unlock-notify callback on the conclusion of connection +** C's transaction, where connection C is waiting on connection A. ^Any +** number of levels of indirection are allowed. +** +** The "DROP TABLE" Exception +** +** When a call to [sqlite3_step()] returns SQLITE_LOCKED, it is almost +** always appropriate to call sqlite3_unlock_notify(). There is however, +** one exception. When executing a "DROP TABLE" or "DROP INDEX" statement, +** SQLite checks if there are any currently executing SELECT statements +** that belong to the same connection. If there are, SQLITE_LOCKED is +** returned. In this case there is no "blocking connection", so invoking +** sqlite3_unlock_notify() results in the unlock-notify callback being +** invoked immediately. If the application then re-attempts the "DROP TABLE" +** or "DROP INDEX" query, an infinite loop might be the result. +** +** One way around this problem is to check the extended error code returned +** by an sqlite3_step() call. ^(If there is a blocking connection, then the +** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in +** the special "DROP TABLE/INDEX" case, the extended error code is just +** SQLITE_LOCKED.)^ +*/ +SQLITE_API int sqlite3_unlock_notify( + sqlite3 *pBlocked, /* Waiting connection */ + void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */ + void *pNotifyArg /* Argument to pass to xNotify */ +); + + +/* +** CAPI3REF: String Comparison +** +** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications +** and extensions to compare the contents of two buffers containing UTF-8 +** strings in a case-independent fashion, using the same definition of "case +** independence" that SQLite uses internally when comparing identifiers. +*/ +SQLITE_API int sqlite3_stricmp(const char *, const char *); +SQLITE_API int sqlite3_strnicmp(const char *, const char *, int); + +/* +** CAPI3REF: String Globbing +* +** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if +** string X matches the [GLOB] pattern P. +** ^The definition of [GLOB] pattern matching used in +** [sqlite3_strglob(P,X)] is the same as for the "X GLOB P" operator in the +** SQL dialect understood by SQLite. ^The [sqlite3_strglob(P,X)] function +** is case sensitive. +** +** Note that this routine returns zero on a match and non-zero if the strings +** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. +** +** See also: [sqlite3_strlike()]. +*/ +SQLITE_API int sqlite3_strglob(const char *zGlob, const char *zStr); + +/* +** CAPI3REF: String LIKE Matching +* +** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if +** string X matches the [LIKE] pattern P with escape character E. +** ^The definition of [LIKE] pattern matching used in +** [sqlite3_strlike(P,X,E)] is the same as for the "X LIKE P ESCAPE E" +** operator in the SQL dialect understood by SQLite. ^For "X LIKE P" without +** the ESCAPE clause, set the E parameter of [sqlite3_strlike(P,X,E)] to 0. +** ^As with the LIKE operator, the [sqlite3_strlike(P,X,E)] function is case +** insensitive - equivalent upper and lower case ASCII characters match +** one another. +** +** ^The [sqlite3_strlike(P,X,E)] function matches Unicode characters, though +** only ASCII characters are case folded. +** +** Note that this routine returns zero on a match and non-zero if the strings +** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. +** +** See also: [sqlite3_strglob()]. +*/ +SQLITE_API int sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc); + +/* +** CAPI3REF: Error Logging Interface +** +** ^The [sqlite3_log()] interface writes a message into the [error log] +** established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()]. +** ^If logging is enabled, the zFormat string and subsequent arguments are +** used with [sqlite3_snprintf()] to generate the final output string. +** +** The sqlite3_log() interface is intended for use by extensions such as +** virtual tables, collating functions, and SQL functions. While there is +** nothing to prevent an application from calling sqlite3_log(), doing so +** is considered bad form. +** +** The zFormat string must not be NULL. +** +** To avoid deadlocks and other threading problems, the sqlite3_log() routine +** will not use dynamically allocated memory. The log message is stored in +** a fixed-length buffer on the stack. If the log message is longer than +** a few hundred characters, it will be truncated to the length of the +** buffer. +*/ +SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); + +/* +** CAPI3REF: Write-Ahead Log Commit Hook +** METHOD: sqlite3 +** +** ^The [sqlite3_wal_hook()] function is used to register a callback that +** is invoked each time data is committed to a database in wal mode. +** +** ^(The callback is invoked by SQLite after the commit has taken place and +** the associated write-lock on the database released)^, so the implementation +** may read, write or [checkpoint] the database as required. +** +** ^The first parameter passed to the callback function when it is invoked +** is a copy of the third parameter passed to sqlite3_wal_hook() when +** registering the callback. ^The second is a copy of the database handle. +** ^The third parameter is the name of the database that was written to - +** either "main" or the name of an [ATTACH]-ed database. ^The fourth parameter +** is the number of pages currently in the write-ahead log file, +** including those that were just committed. +** +** The callback function should normally return [SQLITE_OK]. ^If an error +** code is returned, that error will propagate back up through the +** SQLite code base to cause the statement that provoked the callback +** to report an error, though the commit will have still occurred. If the +** callback returns [SQLITE_ROW] or [SQLITE_DONE], or if it returns a value +** that does not correspond to any valid SQLite error code, the results +** are undefined. +** +** A single database handle may have at most a single write-ahead log callback +** registered at one time. ^Calling [sqlite3_wal_hook()] replaces any +** previously registered write-ahead log callback. ^Note that the +** [sqlite3_wal_autocheckpoint()] interface and the +** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will +** overwrite any prior [sqlite3_wal_hook()] settings. +*/ +SQLITE_API void *sqlite3_wal_hook( + sqlite3*, + int(*)(void *,sqlite3*,const char*,int), + void* +); + +/* +** CAPI3REF: Configure an auto-checkpoint +** METHOD: sqlite3 +** +** ^The [sqlite3_wal_autocheckpoint(D,N)] is a wrapper around +** [sqlite3_wal_hook()] that causes any database on [database connection] D +** to automatically [checkpoint] +** after committing a transaction if there are N or +** more frames in the [write-ahead log] file. ^Passing zero or +** a negative value as the nFrame parameter disables automatic +** checkpoints entirely. +** +** ^The callback registered by this function replaces any existing callback +** registered using [sqlite3_wal_hook()]. ^Likewise, registering a callback +** using [sqlite3_wal_hook()] disables the automatic checkpoint mechanism +** configured by this function. +** +** ^The [wal_autocheckpoint pragma] can be used to invoke this interface +** from SQL. +** +** ^Checkpoints initiated by this mechanism are +** [sqlite3_wal_checkpoint_v2|PASSIVE]. +** +** ^Every new [database connection] defaults to having the auto-checkpoint +** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT] +** pages. The use of this interface +** is only necessary if the default setting is found to be suboptimal +** for a particular application. +*/ +SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N); + +/* +** CAPI3REF: Checkpoint a database +** METHOD: sqlite3 +** +** ^(The sqlite3_wal_checkpoint(D,X) is equivalent to +** [sqlite3_wal_checkpoint_v2](D,X,[SQLITE_CHECKPOINT_PASSIVE],0,0).)^ +** +** In brief, sqlite3_wal_checkpoint(D,X) causes the content in the +** [write-ahead log] for database X on [database connection] D to be +** transferred into the database file and for the write-ahead log to +** be reset. See the [checkpointing] documentation for addition +** information. +** +** This interface used to be the only way to cause a checkpoint to +** occur. But then the newer and more powerful [sqlite3_wal_checkpoint_v2()] +** interface was added. This interface is retained for backwards +** compatibility and as a convenience for applications that need to manually +** start a callback but which do not need the full power (and corresponding +** complication) of [sqlite3_wal_checkpoint_v2()]. +*/ +SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); + +/* +** CAPI3REF: Checkpoint a database +** METHOD: sqlite3 +** +** ^(The sqlite3_wal_checkpoint_v2(D,X,M,L,C) interface runs a checkpoint +** operation on database X of [database connection] D in mode M. Status +** information is written back into integers pointed to by L and C.)^ +** ^(The M parameter must be a valid [checkpoint mode]:)^ +** +**
+**
SQLITE_CHECKPOINT_PASSIVE
+** ^Checkpoint as many frames as possible without waiting for any database +** readers or writers to finish, then sync the database file if all frames +** in the log were checkpointed. ^The [busy-handler callback] +** is never invoked in the SQLITE_CHECKPOINT_PASSIVE mode. +** ^On the other hand, passive mode might leave the checkpoint unfinished +** if there are concurrent readers or writers. +** +**
SQLITE_CHECKPOINT_FULL
+** ^This mode blocks (it invokes the +** [sqlite3_busy_handler|busy-handler callback]) until there is no +** database writer and all readers are reading from the most recent database +** snapshot. ^It then checkpoints all frames in the log file and syncs the +** database file. ^This mode blocks new database writers while it is pending, +** but new database readers are allowed to continue unimpeded. +** +**
SQLITE_CHECKPOINT_RESTART
+** ^This mode works the same way as SQLITE_CHECKPOINT_FULL with the addition +** that after checkpointing the log file it blocks (calls the +** [busy-handler callback]) +** until all readers are reading from the database file only. ^This ensures +** that the next writer will restart the log file from the beginning. +** ^Like SQLITE_CHECKPOINT_FULL, this mode blocks new +** database writer attempts while it is pending, but does not impede readers. +** +**
SQLITE_CHECKPOINT_TRUNCATE
+** ^This mode works the same way as SQLITE_CHECKPOINT_RESTART with the +** addition that it also truncates the log file to zero bytes just prior +** to a successful return. +**
+** +** ^If pnLog is not NULL, then *pnLog is set to the total number of frames in +** the log file or to -1 if the checkpoint could not run because +** of an error or because the database is not in [WAL mode]. ^If pnCkpt is not +** NULL,then *pnCkpt is set to the total number of checkpointed frames in the +** log file (including any that were already checkpointed before the function +** was called) or to -1 if the checkpoint could not run due to an error or +** because the database is not in WAL mode. ^Note that upon successful +** completion of an SQLITE_CHECKPOINT_TRUNCATE, the log file will have been +** truncated to zero bytes and so both *pnLog and *pnCkpt will be set to zero. +** +** ^All calls obtain an exclusive "checkpoint" lock on the database file. ^If +** any other process is running a checkpoint operation at the same time, the +** lock cannot be obtained and SQLITE_BUSY is returned. ^Even if there is a +** busy-handler configured, it will not be invoked in this case. +** +** ^The SQLITE_CHECKPOINT_FULL, RESTART and TRUNCATE modes also obtain the +** exclusive "writer" lock on the database file. ^If the writer lock cannot be +** obtained immediately, and a busy-handler is configured, it is invoked and +** the writer lock retried until either the busy-handler returns 0 or the lock +** is successfully obtained. ^The busy-handler is also invoked while waiting for +** database readers as described above. ^If the busy-handler returns 0 before +** the writer lock is obtained or while waiting for database readers, the +** checkpoint operation proceeds from that point in the same way as +** SQLITE_CHECKPOINT_PASSIVE - checkpointing as many frames as possible +** without blocking any further. ^SQLITE_BUSY is returned in this case. +** +** ^If parameter zDb is NULL or points to a zero length string, then the +** specified operation is attempted on all WAL databases [attached] to +** [database connection] db. In this case the +** values written to output parameters *pnLog and *pnCkpt are undefined. ^If +** an SQLITE_BUSY error is encountered when processing one or more of the +** attached WAL databases, the operation is still attempted on any remaining +** attached databases and SQLITE_BUSY is returned at the end. ^If any other +** error occurs while processing an attached database, processing is abandoned +** and the error code is returned to the caller immediately. ^If no error +** (SQLITE_BUSY or otherwise) is encountered while processing the attached +** databases, SQLITE_OK is returned. +** +** ^If database zDb is the name of an attached database that is not in WAL +** mode, SQLITE_OK is returned and both *pnLog and *pnCkpt set to -1. ^If +** zDb is not NULL (or a zero length string) and is not the name of any +** attached database, SQLITE_ERROR is returned to the caller. +** +** ^Unless it returns SQLITE_MISUSE, +** the sqlite3_wal_checkpoint_v2() interface +** sets the error information that is queried by +** [sqlite3_errcode()] and [sqlite3_errmsg()]. +** +** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface +** from SQL. +*/ +SQLITE_API int sqlite3_wal_checkpoint_v2( + sqlite3 *db, /* Database handle */ + const char *zDb, /* Name of attached database (or NULL) */ + int eMode, /* SQLITE_CHECKPOINT_* value */ + int *pnLog, /* OUT: Size of WAL log in frames */ + int *pnCkpt /* OUT: Total number of frames checkpointed */ +); + +/* +** CAPI3REF: Checkpoint Mode Values +** KEYWORDS: {checkpoint mode} +** +** These constants define all valid values for the "checkpoint mode" passed +** as the third parameter to the [sqlite3_wal_checkpoint_v2()] interface. +** See the [sqlite3_wal_checkpoint_v2()] documentation for details on the +** meaning of each of these checkpoint modes. +*/ +#define SQLITE_CHECKPOINT_PASSIVE 0 /* Do as much as possible w/o blocking */ +#define SQLITE_CHECKPOINT_FULL 1 /* Wait for writers, then checkpoint */ +#define SQLITE_CHECKPOINT_RESTART 2 /* Like FULL but wait for for readers */ +#define SQLITE_CHECKPOINT_TRUNCATE 3 /* Like RESTART but also truncate WAL */ + +/* +** CAPI3REF: Virtual Table Interface Configuration +** +** This function may be called by either the [xConnect] or [xCreate] method +** of a [virtual table] implementation to configure +** various facets of the virtual table interface. +** +** If this interface is invoked outside the context of an xConnect or +** xCreate virtual table method then the behavior is undefined. +** +** At present, there is only one option that may be configured using +** this function. (See [SQLITE_VTAB_CONSTRAINT_SUPPORT].) Further options +** may be added in the future. +*/ +SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); + +/* +** CAPI3REF: Virtual Table Configuration Options +** +** These macros define the various options to the +** [sqlite3_vtab_config()] interface that [virtual table] implementations +** can use to customize and optimize their behavior. +** +**
+**
SQLITE_VTAB_CONSTRAINT_SUPPORT +**
Calls of the form +** [sqlite3_vtab_config](db,SQLITE_VTAB_CONSTRAINT_SUPPORT,X) are supported, +** where X is an integer. If X is zero, then the [virtual table] whose +** [xCreate] or [xConnect] method invoked [sqlite3_vtab_config()] does not +** support constraints. In this configuration (which is the default) if +** a call to the [xUpdate] method returns [SQLITE_CONSTRAINT], then the entire +** statement is rolled back as if [ON CONFLICT | OR ABORT] had been +** specified as part of the users SQL statement, regardless of the actual +** ON CONFLICT mode specified. +** +** If X is non-zero, then the virtual table implementation guarantees +** that if [xUpdate] returns [SQLITE_CONSTRAINT], it will do so before +** any modifications to internal or persistent data structures have been made. +** If the [ON CONFLICT] mode is ABORT, FAIL, IGNORE or ROLLBACK, SQLite +** is able to roll back a statement or database transaction, and abandon +** or continue processing the current SQL statement as appropriate. +** If the ON CONFLICT mode is REPLACE and the [xUpdate] method returns +** [SQLITE_CONSTRAINT], SQLite handles this as if the ON CONFLICT mode +** had been ABORT. +** +** Virtual table implementations that are required to handle OR REPLACE +** must do so within the [xUpdate] method. If a call to the +** [sqlite3_vtab_on_conflict()] function indicates that the current ON +** CONFLICT policy is REPLACE, the virtual table implementation should +** silently replace the appropriate rows within the xUpdate callback and +** return SQLITE_OK. Or, if this is not possible, it may return +** SQLITE_CONSTRAINT, in which case SQLite falls back to OR ABORT +** constraint handling. +**
+*/ +#define SQLITE_VTAB_CONSTRAINT_SUPPORT 1 + +/* +** CAPI3REF: Determine The Virtual Table Conflict Policy +** +** This function may only be called from within a call to the [xUpdate] method +** of a [virtual table] implementation for an INSERT or UPDATE operation. ^The +** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL], +** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode +** of the SQL statement that triggered the call to the [xUpdate] method of the +** [virtual table]. +*/ +SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *); + +/* +** CAPI3REF: Determine If Virtual Table Column Access Is For UPDATE +** +** If the sqlite3_vtab_nochange(X) routine is called within the [xColumn] +** method of a [virtual table], then it returns true if and only if the +** column is being fetched as part of an UPDATE operation during which the +** column value will not change. Applications might use this to substitute +** a return value that is less expensive to compute and that the corresponding +** [xUpdate] method understands as a "no-change" value. +** +** If the [xColumn] method calls sqlite3_vtab_nochange() and finds that +** the column is not changed by the UPDATE statement, then the xColumn +** method can optionally return without setting a result, without calling +** any of the [sqlite3_result_int|sqlite3_result_xxxxx() interfaces]. +** In that case, [sqlite3_value_nochange(X)] will return true for the +** same column in the [xUpdate] method. +*/ +SQLITE_API int sqlite3_vtab_nochange(sqlite3_context*); + +/* +** CAPI3REF: Determine The Collation For a Virtual Table Constraint +** +** This function may only be called from within a call to the [xBestIndex] +** method of a [virtual table]. +** +** The first argument must be the sqlite3_index_info object that is the +** first parameter to the xBestIndex() method. The second argument must be +** an index into the aConstraint[] array belonging to the sqlite3_index_info +** structure passed to xBestIndex. This function returns a pointer to a buffer +** containing the name of the collation sequence for the corresponding +** constraint. +*/ +SQLITE_API SQLITE_EXPERIMENTAL const char *sqlite3_vtab_collation(sqlite3_index_info*,int); + +/* +** CAPI3REF: Conflict resolution modes +** KEYWORDS: {conflict resolution mode} +** +** These constants are returned by [sqlite3_vtab_on_conflict()] to +** inform a [virtual table] implementation what the [ON CONFLICT] mode +** is for the SQL statement being evaluated. +** +** Note that the [SQLITE_IGNORE] constant is also used as a potential +** return value from the [sqlite3_set_authorizer()] callback and that +** [SQLITE_ABORT] is also a [result code]. +*/ +#define SQLITE_ROLLBACK 1 +/* #define SQLITE_IGNORE 2 // Also used by sqlite3_authorizer() callback */ +#define SQLITE_FAIL 3 +/* #define SQLITE_ABORT 4 // Also an error code */ +#define SQLITE_REPLACE 5 + +/* +** CAPI3REF: Prepared Statement Scan Status Opcodes +** KEYWORDS: {scanstatus options} +** +** The following constants can be used for the T parameter to the +** [sqlite3_stmt_scanstatus(S,X,T,V)] interface. Each constant designates a +** different metric for sqlite3_stmt_scanstatus() to return. +** +** When the value returned to V is a string, space to hold that string is +** managed by the prepared statement S and will be automatically freed when +** S is finalized. +** +**
+** [[SQLITE_SCANSTAT_NLOOP]]
SQLITE_SCANSTAT_NLOOP
+**
^The [sqlite3_int64] variable pointed to by the T parameter will be +** set to the total number of times that the X-th loop has run.
+** +** [[SQLITE_SCANSTAT_NVISIT]]
SQLITE_SCANSTAT_NVISIT
+**
^The [sqlite3_int64] variable pointed to by the T parameter will be set +** to the total number of rows examined by all iterations of the X-th loop.
+** +** [[SQLITE_SCANSTAT_EST]]
SQLITE_SCANSTAT_EST
+**
^The "double" variable pointed to by the T parameter will be set to the +** query planner's estimate for the average number of rows output from each +** iteration of the X-th loop. If the query planner's estimates was accurate, +** then this value will approximate the quotient NVISIT/NLOOP and the +** product of this value for all prior loops with the same SELECTID will +** be the NLOOP value for the current loop. +** +** [[SQLITE_SCANSTAT_NAME]]
SQLITE_SCANSTAT_NAME
+**
^The "const char *" variable pointed to by the T parameter will be set +** to a zero-terminated UTF-8 string containing the name of the index or table +** used for the X-th loop. +** +** [[SQLITE_SCANSTAT_EXPLAIN]]
SQLITE_SCANSTAT_EXPLAIN
+**
^The "const char *" variable pointed to by the T parameter will be set +** to a zero-terminated UTF-8 string containing the [EXPLAIN QUERY PLAN] +** description for the X-th loop. +** +** [[SQLITE_SCANSTAT_SELECTID]]
SQLITE_SCANSTAT_SELECT
+**
^The "int" variable pointed to by the T parameter will be set to the +** "select-id" for the X-th loop. The select-id identifies which query or +** subquery the loop is part of. The main query has a select-id of zero. +** The select-id is the same value as is output in the first column +** of an [EXPLAIN QUERY PLAN] query. +**
+*/ +#define SQLITE_SCANSTAT_NLOOP 0 +#define SQLITE_SCANSTAT_NVISIT 1 +#define SQLITE_SCANSTAT_EST 2 +#define SQLITE_SCANSTAT_NAME 3 +#define SQLITE_SCANSTAT_EXPLAIN 4 +#define SQLITE_SCANSTAT_SELECTID 5 + +/* +** CAPI3REF: Prepared Statement Scan Status +** METHOD: sqlite3_stmt +** +** This interface returns information about the predicted and measured +** performance for pStmt. Advanced applications can use this +** interface to compare the predicted and the measured performance and +** issue warnings and/or rerun [ANALYZE] if discrepancies are found. +** +** Since this interface is expected to be rarely used, it is only +** available if SQLite is compiled using the [SQLITE_ENABLE_STMT_SCANSTATUS] +** compile-time option. +** +** The "iScanStatusOp" parameter determines which status information to return. +** The "iScanStatusOp" must be one of the [scanstatus options] or the behavior +** of this interface is undefined. +** ^The requested measurement is written into a variable pointed to by +** the "pOut" parameter. +** Parameter "idx" identifies the specific loop to retrieve statistics for. +** Loops are numbered starting from zero. ^If idx is out of range - less than +** zero or greater than or equal to the total number of loops used to implement +** the statement - a non-zero value is returned and the variable that pOut +** points to is unchanged. +** +** ^Statistics might not be available for all loops in all statements. ^In cases +** where there exist loops with no available statistics, this function behaves +** as if the loop did not exist - it returns non-zero and leave the variable +** that pOut points to unchanged. +** +** See also: [sqlite3_stmt_scanstatus_reset()] +*/ +SQLITE_API int sqlite3_stmt_scanstatus( + sqlite3_stmt *pStmt, /* Prepared statement for which info desired */ + int idx, /* Index of loop to report on */ + int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */ + void *pOut /* Result written here */ +); + +/* +** CAPI3REF: Zero Scan-Status Counters +** METHOD: sqlite3_stmt +** +** ^Zero all [sqlite3_stmt_scanstatus()] related event counters. +** +** This API is only available if the library is built with pre-processor +** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined. +*/ +SQLITE_API void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); + +/* +** CAPI3REF: Flush caches to disk mid-transaction +** +** ^If a write-transaction is open on [database connection] D when the +** [sqlite3_db_cacheflush(D)] interface invoked, any dirty +** pages in the pager-cache that are not currently in use are written out +** to disk. A dirty page may be in use if a database cursor created by an +** active SQL statement is reading from it, or if it is page 1 of a database +** file (page 1 is always "in use"). ^The [sqlite3_db_cacheflush(D)] +** interface flushes caches for all schemas - "main", "temp", and +** any [attached] databases. +** +** ^If this function needs to obtain extra database locks before dirty pages +** can be flushed to disk, it does so. ^If those locks cannot be obtained +** immediately and there is a busy-handler callback configured, it is invoked +** in the usual manner. ^If the required lock still cannot be obtained, then +** the database is skipped and an attempt made to flush any dirty pages +** belonging to the next (if any) database. ^If any databases are skipped +** because locks cannot be obtained, but no other error occurs, this +** function returns SQLITE_BUSY. +** +** ^If any other error occurs while flushing dirty pages to disk (for +** example an IO error or out-of-memory condition), then processing is +** abandoned and an SQLite [error code] is returned to the caller immediately. +** +** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK. +** +** ^This function does not set the database handle error code or message +** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions. +*/ +SQLITE_API int sqlite3_db_cacheflush(sqlite3*); + +/* +** CAPI3REF: The pre-update hook. +** +** ^These interfaces are only available if SQLite is compiled using the +** [SQLITE_ENABLE_PREUPDATE_HOOK] compile-time option. +** +** ^The [sqlite3_preupdate_hook()] interface registers a callback function +** that is invoked prior to each [INSERT], [UPDATE], and [DELETE] operation +** on a database table. +** ^At most one preupdate hook may be registered at a time on a single +** [database connection]; each call to [sqlite3_preupdate_hook()] overrides +** the previous setting. +** ^The preupdate hook is disabled by invoking [sqlite3_preupdate_hook()] +** with a NULL pointer as the second parameter. +** ^The third parameter to [sqlite3_preupdate_hook()] is passed through as +** the first parameter to callbacks. +** +** ^The preupdate hook only fires for changes to real database tables; the +** preupdate hook is not invoked for changes to [virtual tables] or to +** system tables like sqlite_master or sqlite_stat1. +** +** ^The second parameter to the preupdate callback is a pointer to +** the [database connection] that registered the preupdate hook. +** ^The third parameter to the preupdate callback is one of the constants +** [SQLITE_INSERT], [SQLITE_DELETE], or [SQLITE_UPDATE] to identify the +** kind of update operation that is about to occur. +** ^(The fourth parameter to the preupdate callback is the name of the +** database within the database connection that is being modified. This +** will be "main" for the main database or "temp" for TEMP tables or +** the name given after the AS keyword in the [ATTACH] statement for attached +** databases.)^ +** ^The fifth parameter to the preupdate callback is the name of the +** table that is being modified. +** +** For an UPDATE or DELETE operation on a [rowid table], the sixth +** parameter passed to the preupdate callback is the initial [rowid] of the +** row being modified or deleted. For an INSERT operation on a rowid table, +** or any operation on a WITHOUT ROWID table, the value of the sixth +** parameter is undefined. For an INSERT or UPDATE on a rowid table the +** seventh parameter is the final rowid value of the row being inserted +** or updated. The value of the seventh parameter passed to the callback +** function is not defined for operations on WITHOUT ROWID tables, or for +** INSERT operations on rowid tables. +** +** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()], +** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces +** provide additional information about a preupdate event. These routines +** may only be called from within a preupdate callback. Invoking any of +** these routines from outside of a preupdate callback or with a +** [database connection] pointer that is different from the one supplied +** to the preupdate callback results in undefined and probably undesirable +** behavior. +** +** ^The [sqlite3_preupdate_count(D)] interface returns the number of columns +** in the row that is being inserted, updated, or deleted. +** +** ^The [sqlite3_preupdate_old(D,N,P)] interface writes into P a pointer to +** a [protected sqlite3_value] that contains the value of the Nth column of +** the table row before it is updated. The N parameter must be between 0 +** and one less than the number of columns or the behavior will be +** undefined. This must only be used within SQLITE_UPDATE and SQLITE_DELETE +** preupdate callbacks; if it is used by an SQLITE_INSERT callback then the +** behavior is undefined. The [sqlite3_value] that P points to +** will be destroyed when the preupdate callback returns. +** +** ^The [sqlite3_preupdate_new(D,N,P)] interface writes into P a pointer to +** a [protected sqlite3_value] that contains the value of the Nth column of +** the table row after it is updated. The N parameter must be between 0 +** and one less than the number of columns or the behavior will be +** undefined. This must only be used within SQLITE_INSERT and SQLITE_UPDATE +** preupdate callbacks; if it is used by an SQLITE_DELETE callback then the +** behavior is undefined. The [sqlite3_value] that P points to +** will be destroyed when the preupdate callback returns. +** +** ^The [sqlite3_preupdate_depth(D)] interface returns 0 if the preupdate +** callback was invoked as a result of a direct insert, update, or delete +** operation; or 1 for inserts, updates, or deletes invoked by top-level +** triggers; or 2 for changes resulting from triggers called by top-level +** triggers; and so forth. +** +** See also: [sqlite3_update_hook()] +*/ +#if defined(SQLITE_ENABLE_PREUPDATE_HOOK) +SQLITE_API void *sqlite3_preupdate_hook( + sqlite3 *db, + void(*xPreUpdate)( + void *pCtx, /* Copy of third arg to preupdate_hook() */ + sqlite3 *db, /* Database handle */ + int op, /* SQLITE_UPDATE, DELETE or INSERT */ + char const *zDb, /* Database name */ + char const *zName, /* Table name */ + sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */ + sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */ + ), + void* +); +SQLITE_API int sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **); +SQLITE_API int sqlite3_preupdate_count(sqlite3 *); +SQLITE_API int sqlite3_preupdate_depth(sqlite3 *); +SQLITE_API int sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); +#endif + +/* +** CAPI3REF: Low-level system error code +** +** ^Attempt to return the underlying operating system error code or error +** number that caused the most recent I/O error or failure to open a file. +** The return value is OS-dependent. For example, on unix systems, after +** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be +** called to get back the underlying "errno" that caused the problem, such +** as ENOSPC, EAUTH, EISDIR, and so forth. +*/ +SQLITE_API int sqlite3_system_errno(sqlite3*); + +/* +** CAPI3REF: Database Snapshot +** KEYWORDS: {snapshot} {sqlite3_snapshot} +** EXPERIMENTAL +** +** An instance of the snapshot object records the state of a [WAL mode] +** database for some specific point in history. +** +** In [WAL mode], multiple [database connections] that are open on the +** same database file can each be reading a different historical version +** of the database file. When a [database connection] begins a read +** transaction, that connection sees an unchanging copy of the database +** as it existed for the point in time when the transaction first started. +** Subsequent changes to the database from other connections are not seen +** by the reader until a new read transaction is started. +** +** The sqlite3_snapshot object records state information about an historical +** version of the database file so that it is possible to later open a new read +** transaction that sees that historical version of the database rather than +** the most recent version. +** +** The constructor for this object is [sqlite3_snapshot_get()]. The +** [sqlite3_snapshot_open()] method causes a fresh read transaction to refer +** to an historical snapshot (if possible). The destructor for +** sqlite3_snapshot objects is [sqlite3_snapshot_free()]. +*/ +typedef struct sqlite3_snapshot { + unsigned char hidden[48]; +} sqlite3_snapshot; + +/* +** CAPI3REF: Record A Database Snapshot +** EXPERIMENTAL +** +** ^The [sqlite3_snapshot_get(D,S,P)] interface attempts to make a +** new [sqlite3_snapshot] object that records the current state of +** schema S in database connection D. ^On success, the +** [sqlite3_snapshot_get(D,S,P)] interface writes a pointer to the newly +** created [sqlite3_snapshot] object into *P and returns SQLITE_OK. +** If there is not already a read-transaction open on schema S when +** this function is called, one is opened automatically. +** +** The following must be true for this function to succeed. If any of +** the following statements are false when sqlite3_snapshot_get() is +** called, SQLITE_ERROR is returned. The final value of *P is undefined +** in this case. +** +**
    +**
  • The database handle must be in [autocommit mode]. +** +**
  • Schema S of [database connection] D must be a [WAL mode] database. +** +**
  • There must not be a write transaction open on schema S of database +** connection D. +** +**
  • One or more transactions must have been written to the current wal +** file since it was created on disk (by any connection). This means +** that a snapshot cannot be taken on a wal mode database with no wal +** file immediately after it is first opened. At least one transaction +** must be written to it first. +**
+** +** This function may also return SQLITE_NOMEM. If it is called with the +** database handle in autocommit mode but fails for some other reason, +** whether or not a read transaction is opened on schema S is undefined. +** +** The [sqlite3_snapshot] object returned from a successful call to +** [sqlite3_snapshot_get()] must be freed using [sqlite3_snapshot_free()] +** to avoid a memory leak. +** +** The [sqlite3_snapshot_get()] interface is only available when the +** SQLITE_ENABLE_SNAPSHOT compile-time option is used. +*/ +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_get( + sqlite3 *db, + const char *zSchema, + sqlite3_snapshot **ppSnapshot +); + +/* +** CAPI3REF: Start a read transaction on an historical snapshot +** EXPERIMENTAL +** +** ^The [sqlite3_snapshot_open(D,S,P)] interface starts a +** read transaction for schema S of +** [database connection] D such that the read transaction +** refers to historical [snapshot] P, rather than the most +** recent change to the database. +** ^The [sqlite3_snapshot_open()] interface returns SQLITE_OK on success +** or an appropriate [error code] if it fails. +** +** ^In order to succeed, a call to [sqlite3_snapshot_open(D,S,P)] must be +** the first operation following the [BEGIN] that takes the schema S +** out of [autocommit mode]. +** ^In other words, schema S must not currently be in +** a transaction for [sqlite3_snapshot_open(D,S,P)] to work, but the +** database connection D must be out of [autocommit mode]. +** ^A [snapshot] will fail to open if it has been overwritten by a +** [checkpoint]. +** ^(A call to [sqlite3_snapshot_open(D,S,P)] will fail if the +** database connection D does not know that the database file for +** schema S is in [WAL mode]. A database connection might not know +** that the database file is in [WAL mode] if there has been no prior +** I/O on that database connection, or if the database entered [WAL mode] +** after the most recent I/O on the database connection.)^ +** (Hint: Run "[PRAGMA application_id]" against a newly opened +** database connection in order to make it ready to use snapshots.) +** +** The [sqlite3_snapshot_open()] interface is only available when the +** SQLITE_ENABLE_SNAPSHOT compile-time option is used. +*/ +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_open( + sqlite3 *db, + const char *zSchema, + sqlite3_snapshot *pSnapshot +); + +/* +** CAPI3REF: Destroy a snapshot +** EXPERIMENTAL +** +** ^The [sqlite3_snapshot_free(P)] interface destroys [sqlite3_snapshot] P. +** The application must eventually free every [sqlite3_snapshot] object +** using this routine to avoid a memory leak. +** +** The [sqlite3_snapshot_free()] interface is only available when the +** SQLITE_ENABLE_SNAPSHOT compile-time option is used. +*/ +SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_snapshot_free(sqlite3_snapshot*); + +/* +** CAPI3REF: Compare the ages of two snapshot handles. +** EXPERIMENTAL +** +** The sqlite3_snapshot_cmp(P1, P2) interface is used to compare the ages +** of two valid snapshot handles. +** +** If the two snapshot handles are not associated with the same database +** file, the result of the comparison is undefined. +** +** Additionally, the result of the comparison is only valid if both of the +** snapshot handles were obtained by calling sqlite3_snapshot_get() since the +** last time the wal file was deleted. The wal file is deleted when the +** database is changed back to rollback mode or when the number of database +** clients drops to zero. If either snapshot handle was obtained before the +** wal file was last deleted, the value returned by this function +** is undefined. +** +** Otherwise, this API returns a negative value if P1 refers to an older +** snapshot than P2, zero if the two handles refer to the same database +** snapshot, and a positive value if P1 is a newer snapshot than P2. +*/ +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_cmp( + sqlite3_snapshot *p1, + sqlite3_snapshot *p2 +); + +/* +** CAPI3REF: Recover snapshots from a wal file +** EXPERIMENTAL +** +** If all connections disconnect from a database file but do not perform +** a checkpoint, the existing wal file is opened along with the database +** file the next time the database is opened. At this point it is only +** possible to successfully call sqlite3_snapshot_open() to open the most +** recent snapshot of the database (the one at the head of the wal file), +** even though the wal file may contain other valid snapshots for which +** clients have sqlite3_snapshot handles. +** +** This function attempts to scan the wal file associated with database zDb +** of database handle db and make all valid snapshots available to +** sqlite3_snapshot_open(). It is an error if there is already a read +** transaction open on the database, or if the database is not a wal mode +** database. +** +** SQLITE_OK is returned if successful, or an SQLite error code otherwise. +*/ +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const char *zDb); + +/* +** CAPI3REF: Serialize a database +** +** The sqlite3_serialize(D,S,P,F) interface returns a pointer to memory +** that is a serialization of the S database on [database connection] D. +** If P is not a NULL pointer, then the size of the database in bytes +** is written into *P. +** +** For an ordinary on-disk database file, the serialization is just a +** copy of the disk file. For an in-memory database or a "TEMP" database, +** the serialization is the same sequence of bytes which would be written +** to disk if that database where backed up to disk. +** +** The usual case is that sqlite3_serialize() copies the serialization of +** the database into memory obtained from [sqlite3_malloc64()] and returns +** a pointer to that memory. The caller is responsible for freeing the +** returned value to avoid a memory leak. However, if the F argument +** contains the SQLITE_SERIALIZE_NOCOPY bit, then no memory allocations +** are made, and the sqlite3_serialize() function will return a pointer +** to the contiguous memory representation of the database that SQLite +** is currently using for that database, or NULL if the no such contiguous +** memory representation of the database exists. A contiguous memory +** representation of the database will usually only exist if there has +** been a prior call to [sqlite3_deserialize(D,S,...)] with the same +** values of D and S. +** The size of the database is written into *P even if the +** SQLITE_SERIALIZE_NOCOPY bit is set but no contiguous copy +** of the database exists. +** +** A call to sqlite3_serialize(D,S,P,F) might return NULL even if the +** SQLITE_SERIALIZE_NOCOPY bit is omitted from argument F if a memory +** allocation error occurs. +** +** This interface is only available if SQLite is compiled with the +** [SQLITE_ENABLE_DESERIALIZE] option. +*/ +SQLITE_API unsigned char *sqlite3_serialize( + sqlite3 *db, /* The database connection */ + const char *zSchema, /* Which DB to serialize. ex: "main", "temp", ... */ + sqlite3_int64 *piSize, /* Write size of the DB here, if not NULL */ + unsigned int mFlags /* Zero or more SQLITE_SERIALIZE_* flags */ +); + +/* +** CAPI3REF: Flags for sqlite3_serialize +** +** Zero or more of the following constants can be OR-ed together for +** the F argument to [sqlite3_serialize(D,S,P,F)]. +** +** SQLITE_SERIALIZE_NOCOPY means that [sqlite3_serialize()] will return +** a pointer to contiguous in-memory database that it is currently using, +** without making a copy of the database. If SQLite is not currently using +** a contiguous in-memory database, then this option causes +** [sqlite3_serialize()] to return a NULL pointer. SQLite will only be +** using a contiguous in-memory database if it has been initialized by a +** prior call to [sqlite3_deserialize()]. +*/ +#define SQLITE_SERIALIZE_NOCOPY 0x001 /* Do no memory allocations */ + +/* +** CAPI3REF: Deserialize a database +** +** The sqlite3_deserialize(D,S,P,N,M,F) interface causes the +** [database connection] D to disconnect from database S and then +** reopen S as an in-memory database based on the serialization contained +** in P. The serialized database P is N bytes in size. M is the size of +** the buffer P, which might be larger than N. If M is larger than N, and +** the SQLITE_DESERIALIZE_READONLY bit is not set in F, then SQLite is +** permitted to add content to the in-memory database as long as the total +** size does not exceed M bytes. +** +** If the SQLITE_DESERIALIZE_FREEONCLOSE bit is set in F, then SQLite will +** invoke sqlite3_free() on the serialization buffer when the database +** connection closes. If the SQLITE_DESERIALIZE_RESIZEABLE bit is set, then +** SQLite will try to increase the buffer size using sqlite3_realloc64() +** if writes on the database cause it to grow larger than M bytes. +** +** The sqlite3_deserialize() interface will fail with SQLITE_BUSY if the +** database is currently in a read transaction or is involved in a backup +** operation. +** +** If sqlite3_deserialize(D,S,P,N,M,F) fails for any reason and if the +** SQLITE_DESERIALIZE_FREEONCLOSE bit is set in argument F, then +** [sqlite3_free()] is invoked on argument P prior to returning. +** +** This interface is only available if SQLite is compiled with the +** [SQLITE_ENABLE_DESERIALIZE] option. +*/ +SQLITE_API int sqlite3_deserialize( + sqlite3 *db, /* The database connection */ + const char *zSchema, /* Which DB to reopen with the deserialization */ + unsigned char *pData, /* The serialized database content */ + sqlite3_int64 szDb, /* Number bytes in the deserialization */ + sqlite3_int64 szBuf, /* Total size of buffer pData[] */ + unsigned mFlags /* Zero or more SQLITE_DESERIALIZE_* flags */ +); + +/* +** CAPI3REF: Flags for sqlite3_deserialize() +** +** The following are allowed values for 6th argument (the F argument) to +** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. +** +** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization +** in the P argument is held in memory obtained from [sqlite3_malloc64()] +** and that SQLite should take ownership of this memory and automatically +** free it when it has finished using it. Without this flag, the caller +** is resposible for freeing any dynamically allocated memory. +** +** The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to +** grow the size of the database using calls to [sqlite3_realloc64()]. This +** flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used. +** Without this flag, the deserialized database cannot increase in size beyond +** the number of bytes specified by the M parameter. +** +** The SQLITE_DESERIALIZE_READONLY flag means that the deserialized database +** should be treated as read-only. +*/ +#define SQLITE_DESERIALIZE_FREEONCLOSE 1 /* Call sqlite3_free() on close */ +#define SQLITE_DESERIALIZE_RESIZEABLE 2 /* Resize using sqlite3_realloc64() */ +#define SQLITE_DESERIALIZE_READONLY 4 /* Database is read-only */ + +/* +** Undo the hack that converts floating point types to integer for +** builds on processors without floating point support. +*/ +#ifdef SQLITE_OMIT_FLOATING_POINT +# undef double +#endif + +#ifdef __cplusplus +} /* End of the 'extern "C"' block */ +#endif +#endif /* SQLITE3_H */ + +/******** Begin file sqlite3rtree.h *********/ +/* +** 2010 August 30 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +*/ + +#ifndef _SQLITE3RTREE_H_ +#define _SQLITE3RTREE_H_ + + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct sqlite3_rtree_geometry sqlite3_rtree_geometry; +typedef struct sqlite3_rtree_query_info sqlite3_rtree_query_info; + +/* The double-precision datatype used by RTree depends on the +** SQLITE_RTREE_INT_ONLY compile-time option. +*/ +#ifdef SQLITE_RTREE_INT_ONLY + typedef sqlite3_int64 sqlite3_rtree_dbl; +#else + typedef double sqlite3_rtree_dbl; +#endif + +/* +** Register a geometry callback named zGeom that can be used as part of an +** R-Tree geometry query as follows: +** +** SELECT ... FROM WHERE MATCH $zGeom(... params ...) +*/ +SQLITE_API int sqlite3_rtree_geometry_callback( + sqlite3 *db, + const char *zGeom, + int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*), + void *pContext +); + + +/* +** A pointer to a structure of the following type is passed as the first +** argument to callbacks registered using rtree_geometry_callback(). +*/ +struct sqlite3_rtree_geometry { + void *pContext; /* Copy of pContext passed to s_r_g_c() */ + int nParam; /* Size of array aParam[] */ + sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */ + void *pUser; /* Callback implementation user data */ + void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */ +}; + +/* +** Register a 2nd-generation geometry callback named zScore that can be +** used as part of an R-Tree geometry query as follows: +** +** SELECT ... FROM WHERE MATCH $zQueryFunc(... params ...) +*/ +SQLITE_API int sqlite3_rtree_query_callback( + sqlite3 *db, + const char *zQueryFunc, + int (*xQueryFunc)(sqlite3_rtree_query_info*), + void *pContext, + void (*xDestructor)(void*) +); + + +/* +** A pointer to a structure of the following type is passed as the +** argument to scored geometry callback registered using +** sqlite3_rtree_query_callback(). +** +** Note that the first 5 fields of this structure are identical to +** sqlite3_rtree_geometry. This structure is a subclass of +** sqlite3_rtree_geometry. +*/ +struct sqlite3_rtree_query_info { + void *pContext; /* pContext from when function registered */ + int nParam; /* Number of function parameters */ + sqlite3_rtree_dbl *aParam; /* value of function parameters */ + void *pUser; /* callback can use this, if desired */ + void (*xDelUser)(void*); /* function to free pUser */ + sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */ + unsigned int *anQueue; /* Number of pending entries in the queue */ + int nCoord; /* Number of coordinates */ + int iLevel; /* Level of current node or entry */ + int mxLevel; /* The largest iLevel value in the tree */ + sqlite3_int64 iRowid; /* Rowid for current entry */ + sqlite3_rtree_dbl rParentScore; /* Score of parent node */ + int eParentWithin; /* Visibility of parent node */ + int eWithin; /* OUT: Visiblity */ + sqlite3_rtree_dbl rScore; /* OUT: Write the score here */ + /* The following fields are only available in 3.8.11 and later */ + sqlite3_value **apSqlParam; /* Original SQL values of parameters */ +}; + +/* +** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. +*/ +#define NOT_WITHIN 0 /* Object completely outside of query region */ +#define PARTLY_WITHIN 1 /* Object partially overlaps query region */ +#define FULLY_WITHIN 2 /* Object fully contained within query region */ + + +#ifdef __cplusplus +} /* end of the 'extern "C"' block */ +#endif + +#endif /* ifndef _SQLITE3RTREE_H_ */ + +/******** End of sqlite3rtree.h *********/ +/******** Begin file sqlite3session.h *********/ + +#if !defined(__SQLITESESSION_H_) && defined(SQLITE_ENABLE_SESSION) +#define __SQLITESESSION_H_ 1 + +/* +** Make sure we can call this stuff from C++. +*/ +#ifdef __cplusplus +extern "C" { +#endif + + +/* +** CAPI3REF: Session Object Handle +** +** An instance of this object is a [session] that can be used to +** record changes to a database. +*/ +typedef struct sqlite3_session sqlite3_session; + +/* +** CAPI3REF: Changeset Iterator Handle +** +** An instance of this object acts as a cursor for iterating +** over the elements of a [changeset] or [patchset]. +*/ +typedef struct sqlite3_changeset_iter sqlite3_changeset_iter; + +/* +** CAPI3REF: Create A New Session Object +** CONSTRUCTOR: sqlite3_session +** +** Create a new session object attached to database handle db. If successful, +** a pointer to the new object is written to *ppSession and SQLITE_OK is +** returned. If an error occurs, *ppSession is set to NULL and an SQLite +** error code (e.g. SQLITE_NOMEM) is returned. +** +** It is possible to create multiple session objects attached to a single +** database handle. +** +** Session objects created using this function should be deleted using the +** [sqlite3session_delete()] function before the database handle that they +** are attached to is itself closed. If the database handle is closed before +** the session object is deleted, then the results of calling any session +** module function, including [sqlite3session_delete()] on the session object +** are undefined. +** +** Because the session module uses the [sqlite3_preupdate_hook()] API, it +** is not possible for an application to register a pre-update hook on a +** database handle that has one or more session objects attached. Nor is +** it possible to create a session object attached to a database handle for +** which a pre-update hook is already defined. The results of attempting +** either of these things are undefined. +** +** The session object will be used to create changesets for tables in +** database zDb, where zDb is either "main", or "temp", or the name of an +** attached database. It is not an error if database zDb is not attached +** to the database when the session object is created. +*/ +SQLITE_API int sqlite3session_create( + sqlite3 *db, /* Database handle */ + const char *zDb, /* Name of db (e.g. "main") */ + sqlite3_session **ppSession /* OUT: New session object */ +); + +/* +** CAPI3REF: Delete A Session Object +** DESTRUCTOR: sqlite3_session +** +** Delete a session object previously allocated using +** [sqlite3session_create()]. Once a session object has been deleted, the +** results of attempting to use pSession with any other session module +** function are undefined. +** +** Session objects must be deleted before the database handle to which they +** are attached is closed. Refer to the documentation for +** [sqlite3session_create()] for details. +*/ +SQLITE_API void sqlite3session_delete(sqlite3_session *pSession); + + +/* +** CAPI3REF: Enable Or Disable A Session Object +** METHOD: sqlite3_session +** +** Enable or disable the recording of changes by a session object. When +** enabled, a session object records changes made to the database. When +** disabled - it does not. A newly created session object is enabled. +** Refer to the documentation for [sqlite3session_changeset()] for further +** details regarding how enabling and disabling a session object affects +** the eventual changesets. +** +** Passing zero to this function disables the session. Passing a value +** greater than zero enables it. Passing a value less than zero is a +** no-op, and may be used to query the current state of the session. +** +** The return value indicates the final state of the session object: 0 if +** the session is disabled, or 1 if it is enabled. +*/ +SQLITE_API int sqlite3session_enable(sqlite3_session *pSession, int bEnable); + +/* +** CAPI3REF: Set Or Clear the Indirect Change Flag +** METHOD: sqlite3_session +** +** Each change recorded by a session object is marked as either direct or +** indirect. A change is marked as indirect if either: +** +**
    +**
  • The session object "indirect" flag is set when the change is +** made, or +**
  • The change is made by an SQL trigger or foreign key action +** instead of directly as a result of a users SQL statement. +**
+** +** If a single row is affected by more than one operation within a session, +** then the change is considered indirect if all operations meet the criteria +** for an indirect change above, or direct otherwise. +** +** This function is used to set, clear or query the session object indirect +** flag. If the second argument passed to this function is zero, then the +** indirect flag is cleared. If it is greater than zero, the indirect flag +** is set. Passing a value less than zero does not modify the current value +** of the indirect flag, and may be used to query the current state of the +** indirect flag for the specified session object. +** +** The return value indicates the final state of the indirect flag: 0 if +** it is clear, or 1 if it is set. +*/ +SQLITE_API int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect); + +/* +** CAPI3REF: Attach A Table To A Session Object +** METHOD: sqlite3_session +** +** If argument zTab is not NULL, then it is the name of a table to attach +** to the session object passed as the first argument. All subsequent changes +** made to the table while the session object is enabled will be recorded. See +** documentation for [sqlite3session_changeset()] for further details. +** +** Or, if argument zTab is NULL, then changes are recorded for all tables +** in the database. If additional tables are added to the database (by +** executing "CREATE TABLE" statements) after this call is made, changes for +** the new tables are also recorded. +** +** Changes can only be recorded for tables that have a PRIMARY KEY explicitly +** defined as part of their CREATE TABLE statement. It does not matter if the +** PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias) or not. The PRIMARY +** KEY may consist of a single column, or may be a composite key. +** +** It is not an error if the named table does not exist in the database. Nor +** is it an error if the named table does not have a PRIMARY KEY. However, +** no changes will be recorded in either of these scenarios. +** +** Changes are not recorded for individual rows that have NULL values stored +** in one or more of their PRIMARY KEY columns. +** +** SQLITE_OK is returned if the call completes without error. Or, if an error +** occurs, an SQLite error code (e.g. SQLITE_NOMEM) is returned. +** +**

Special sqlite_stat1 Handling

+** +** As of SQLite version 3.22.0, the "sqlite_stat1" table is an exception to +** some of the rules above. In SQLite, the schema of sqlite_stat1 is: +**
+**        CREATE TABLE sqlite_stat1(tbl,idx,stat)  
+**  
+** +** Even though sqlite_stat1 does not have a PRIMARY KEY, changes are +** recorded for it as if the PRIMARY KEY is (tbl,idx). Additionally, changes +** are recorded for rows for which (idx IS NULL) is true. However, for such +** rows a zero-length blob (SQL value X'') is stored in the changeset or +** patchset instead of a NULL value. This allows such changesets to be +** manipulated by legacy implementations of sqlite3changeset_invert(), +** concat() and similar. +** +** The sqlite3changeset_apply() function automatically converts the +** zero-length blob back to a NULL value when updating the sqlite_stat1 +** table. However, if the application calls sqlite3changeset_new(), +** sqlite3changeset_old() or sqlite3changeset_conflict on a changeset +** iterator directly (including on a changeset iterator passed to a +** conflict-handler callback) then the X'' value is returned. The application +** must translate X'' to NULL itself if required. +** +** Legacy (older than 3.22.0) versions of the sessions module cannot capture +** changes made to the sqlite_stat1 table. Legacy versions of the +** sqlite3changeset_apply() function silently ignore any modifications to the +** sqlite_stat1 table that are part of a changeset or patchset. +*/ +SQLITE_API int sqlite3session_attach( + sqlite3_session *pSession, /* Session object */ + const char *zTab /* Table name */ +); + +/* +** CAPI3REF: Set a table filter on a Session Object. +** METHOD: sqlite3_session +** +** The second argument (xFilter) is the "filter callback". For changes to rows +** in tables that are not attached to the Session object, the filter is called +** to determine whether changes to the table's rows should be tracked or not. +** If xFilter returns 0, changes is not tracked. Note that once a table is +** attached, xFilter will not be called again. +*/ +SQLITE_API void sqlite3session_table_filter( + sqlite3_session *pSession, /* Session object */ + int(*xFilter)( + void *pCtx, /* Copy of third arg to _filter_table() */ + const char *zTab /* Table name */ + ), + void *pCtx /* First argument passed to xFilter */ +); + +/* +** CAPI3REF: Generate A Changeset From A Session Object +** METHOD: sqlite3_session +** +** Obtain a changeset containing changes to the tables attached to the +** session object passed as the first argument. If successful, +** set *ppChangeset to point to a buffer containing the changeset +** and *pnChangeset to the size of the changeset in bytes before returning +** SQLITE_OK. If an error occurs, set both *ppChangeset and *pnChangeset to +** zero and return an SQLite error code. +** +** A changeset consists of zero or more INSERT, UPDATE and/or DELETE changes, +** each representing a change to a single row of an attached table. An INSERT +** change contains the values of each field of a new database row. A DELETE +** contains the original values of each field of a deleted database row. An +** UPDATE change contains the original values of each field of an updated +** database row along with the updated values for each updated non-primary-key +** column. It is not possible for an UPDATE change to represent a change that +** modifies the values of primary key columns. If such a change is made, it +** is represented in a changeset as a DELETE followed by an INSERT. +** +** Changes are not recorded for rows that have NULL values stored in one or +** more of their PRIMARY KEY columns. If such a row is inserted or deleted, +** no corresponding change is present in the changesets returned by this +** function. If an existing row with one or more NULL values stored in +** PRIMARY KEY columns is updated so that all PRIMARY KEY columns are non-NULL, +** only an INSERT is appears in the changeset. Similarly, if an existing row +** with non-NULL PRIMARY KEY values is updated so that one or more of its +** PRIMARY KEY columns are set to NULL, the resulting changeset contains a +** DELETE change only. +** +** The contents of a changeset may be traversed using an iterator created +** using the [sqlite3changeset_start()] API. A changeset may be applied to +** a database with a compatible schema using the [sqlite3changeset_apply()] +** API. +** +** Within a changeset generated by this function, all changes related to a +** single table are grouped together. In other words, when iterating through +** a changeset or when applying a changeset to a database, all changes related +** to a single table are processed before moving on to the next table. Tables +** are sorted in the same order in which they were attached (or auto-attached) +** to the sqlite3_session object. The order in which the changes related to +** a single table are stored is undefined. +** +** Following a successful call to this function, it is the responsibility of +** the caller to eventually free the buffer that *ppChangeset points to using +** [sqlite3_free()]. +** +**

Changeset Generation

+** +** Once a table has been attached to a session object, the session object +** records the primary key values of all new rows inserted into the table. +** It also records the original primary key and other column values of any +** deleted or updated rows. For each unique primary key value, data is only +** recorded once - the first time a row with said primary key is inserted, +** updated or deleted in the lifetime of the session. +** +** There is one exception to the previous paragraph: when a row is inserted, +** updated or deleted, if one or more of its primary key columns contain a +** NULL value, no record of the change is made. +** +** The session object therefore accumulates two types of records - those +** that consist of primary key values only (created when the user inserts +** a new record) and those that consist of the primary key values and the +** original values of other table columns (created when the users deletes +** or updates a record). +** +** When this function is called, the requested changeset is created using +** both the accumulated records and the current contents of the database +** file. Specifically: +** +**
    +**
  • For each record generated by an insert, the database is queried +** for a row with a matching primary key. If one is found, an INSERT +** change is added to the changeset. If no such row is found, no change +** is added to the changeset. +** +**
  • For each record generated by an update or delete, the database is +** queried for a row with a matching primary key. If such a row is +** found and one or more of the non-primary key fields have been +** modified from their original values, an UPDATE change is added to +** the changeset. Or, if no such row is found in the table, a DELETE +** change is added to the changeset. If there is a row with a matching +** primary key in the database, but all fields contain their original +** values, no change is added to the changeset. +**
+** +** This means, amongst other things, that if a row is inserted and then later +** deleted while a session object is active, neither the insert nor the delete +** will be present in the changeset. Or if a row is deleted and then later a +** row with the same primary key values inserted while a session object is +** active, the resulting changeset will contain an UPDATE change instead of +** a DELETE and an INSERT. +** +** When a session object is disabled (see the [sqlite3session_enable()] API), +** it does not accumulate records when rows are inserted, updated or deleted. +** This may appear to have some counter-intuitive effects if a single row +** is written to more than once during a session. For example, if a row +** is inserted while a session object is enabled, then later deleted while +** the same session object is disabled, no INSERT record will appear in the +** changeset, even though the delete took place while the session was disabled. +** Or, if one field of a row is updated while a session is disabled, and +** another field of the same row is updated while the session is enabled, the +** resulting changeset will contain an UPDATE change that updates both fields. +*/ +SQLITE_API int sqlite3session_changeset( + sqlite3_session *pSession, /* Session object */ + int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */ + void **ppChangeset /* OUT: Buffer containing changeset */ +); + +/* +** CAPI3REF: Load The Difference Between Tables Into A Session +** METHOD: sqlite3_session +** +** If it is not already attached to the session object passed as the first +** argument, this function attaches table zTbl in the same manner as the +** [sqlite3session_attach()] function. If zTbl does not exist, or if it +** does not have a primary key, this function is a no-op (but does not return +** an error). +** +** Argument zFromDb must be the name of a database ("main", "temp" etc.) +** attached to the same database handle as the session object that contains +** a table compatible with the table attached to the session by this function. +** A table is considered compatible if it: +** +**
    +**
  • Has the same name, +**
  • Has the same set of columns declared in the same order, and +**
  • Has the same PRIMARY KEY definition. +**
+** +** If the tables are not compatible, SQLITE_SCHEMA is returned. If the tables +** are compatible but do not have any PRIMARY KEY columns, it is not an error +** but no changes are added to the session object. As with other session +** APIs, tables without PRIMARY KEYs are simply ignored. +** +** This function adds a set of changes to the session object that could be +** used to update the table in database zFrom (call this the "from-table") +** so that its content is the same as the table attached to the session +** object (call this the "to-table"). Specifically: +** +**
    +**
  • For each row (primary key) that exists in the to-table but not in +** the from-table, an INSERT record is added to the session object. +** +**
  • For each row (primary key) that exists in the to-table but not in +** the from-table, a DELETE record is added to the session object. +** +**
  • For each row (primary key) that exists in both tables, but features +** different non-PK values in each, an UPDATE record is added to the +** session. +**
+** +** To clarify, if this function is called and then a changeset constructed +** using [sqlite3session_changeset()], then after applying that changeset to +** database zFrom the contents of the two compatible tables would be +** identical. +** +** It an error if database zFrom does not exist or does not contain the +** required compatible table. +** +** If the operation successful, SQLITE_OK is returned. Otherwise, an SQLite +** error code. In this case, if argument pzErrMsg is not NULL, *pzErrMsg +** may be set to point to a buffer containing an English language error +** message. It is the responsibility of the caller to free this buffer using +** sqlite3_free(). +*/ +SQLITE_API int sqlite3session_diff( + sqlite3_session *pSession, + const char *zFromDb, + const char *zTbl, + char **pzErrMsg +); + + +/* +** CAPI3REF: Generate A Patchset From A Session Object +** METHOD: sqlite3_session +** +** The differences between a patchset and a changeset are that: +** +**
    +**
  • DELETE records consist of the primary key fields only. The +** original values of other fields are omitted. +**
  • The original values of any modified fields are omitted from +** UPDATE records. +**
+** +** A patchset blob may be used with up to date versions of all +** sqlite3changeset_xxx API functions except for sqlite3changeset_invert(), +** which returns SQLITE_CORRUPT if it is passed a patchset. Similarly, +** attempting to use a patchset blob with old versions of the +** sqlite3changeset_xxx APIs also provokes an SQLITE_CORRUPT error. +** +** Because the non-primary key "old.*" fields are omitted, no +** SQLITE_CHANGESET_DATA conflicts can be detected or reported if a patchset +** is passed to the sqlite3changeset_apply() API. Other conflict types work +** in the same way as for changesets. +** +** Changes within a patchset are ordered in the same way as for changesets +** generated by the sqlite3session_changeset() function (i.e. all changes for +** a single table are grouped together, tables appear in the order in which +** they were attached to the session object). +*/ +SQLITE_API int sqlite3session_patchset( + sqlite3_session *pSession, /* Session object */ + int *pnPatchset, /* OUT: Size of buffer at *ppPatchset */ + void **ppPatchset /* OUT: Buffer containing patchset */ +); + +/* +** CAPI3REF: Test if a changeset has recorded any changes. +** +** Return non-zero if no changes to attached tables have been recorded by +** the session object passed as the first argument. Otherwise, if one or +** more changes have been recorded, return zero. +** +** Even if this function returns zero, it is possible that calling +** [sqlite3session_changeset()] on the session handle may still return a +** changeset that contains no changes. This can happen when a row in +** an attached table is modified and then later on the original values +** are restored. However, if this function returns non-zero, then it is +** guaranteed that a call to sqlite3session_changeset() will return a +** changeset containing zero changes. +*/ +SQLITE_API int sqlite3session_isempty(sqlite3_session *pSession); + +/* +** CAPI3REF: Create An Iterator To Traverse A Changeset +** CONSTRUCTOR: sqlite3_changeset_iter +** +** Create an iterator used to iterate through the contents of a changeset. +** If successful, *pp is set to point to the iterator handle and SQLITE_OK +** is returned. Otherwise, if an error occurs, *pp is set to zero and an +** SQLite error code is returned. +** +** The following functions can be used to advance and query a changeset +** iterator created by this function: +** +**
    +**
  • [sqlite3changeset_next()] +**
  • [sqlite3changeset_op()] +**
  • [sqlite3changeset_new()] +**
  • [sqlite3changeset_old()] +**
+** +** It is the responsibility of the caller to eventually destroy the iterator +** by passing it to [sqlite3changeset_finalize()]. The buffer containing the +** changeset (pChangeset) must remain valid until after the iterator is +** destroyed. +** +** Assuming the changeset blob was created by one of the +** [sqlite3session_changeset()], [sqlite3changeset_concat()] or +** [sqlite3changeset_invert()] functions, all changes within the changeset +** that apply to a single table are grouped together. This means that when +** an application iterates through a changeset using an iterator created by +** this function, all changes that relate to a single table are visited +** consecutively. There is no chance that the iterator will visit a change +** the applies to table X, then one for table Y, and then later on visit +** another change for table X. +*/ +SQLITE_API int sqlite3changeset_start( + sqlite3_changeset_iter **pp, /* OUT: New changeset iterator handle */ + int nChangeset, /* Size of changeset blob in bytes */ + void *pChangeset /* Pointer to blob containing changeset */ +); + + +/* +** CAPI3REF: Advance A Changeset Iterator +** METHOD: sqlite3_changeset_iter +** +** This function may only be used with iterators created by function +** [sqlite3changeset_start()]. If it is called on an iterator passed to +** a conflict-handler callback by [sqlite3changeset_apply()], SQLITE_MISUSE +** is returned and the call has no effect. +** +** Immediately after an iterator is created by sqlite3changeset_start(), it +** does not point to any change in the changeset. Assuming the changeset +** is not empty, the first call to this function advances the iterator to +** point to the first change in the changeset. Each subsequent call advances +** the iterator to point to the next change in the changeset (if any). If +** no error occurs and the iterator points to a valid change after a call +** to sqlite3changeset_next() has advanced it, SQLITE_ROW is returned. +** Otherwise, if all changes in the changeset have already been visited, +** SQLITE_DONE is returned. +** +** If an error occurs, an SQLite error code is returned. Possible error +** codes include SQLITE_CORRUPT (if the changeset buffer is corrupt) or +** SQLITE_NOMEM. +*/ +SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *pIter); + +/* +** CAPI3REF: Obtain The Current Operation From A Changeset Iterator +** METHOD: sqlite3_changeset_iter +** +** The pIter argument passed to this function may either be an iterator +** passed to a conflict-handler by [sqlite3changeset_apply()], or an iterator +** created by [sqlite3changeset_start()]. In the latter case, the most recent +** call to [sqlite3changeset_next()] must have returned [SQLITE_ROW]. If this +** is not the case, this function returns [SQLITE_MISUSE]. +** +** If argument pzTab is not NULL, then *pzTab is set to point to a +** nul-terminated utf-8 encoded string containing the name of the table +** affected by the current change. The buffer remains valid until either +** sqlite3changeset_next() is called on the iterator or until the +** conflict-handler function returns. If pnCol is not NULL, then *pnCol is +** set to the number of columns in the table affected by the change. If +** pbIncorrect is not NULL, then *pbIndirect is set to true (1) if the change +** is an indirect change, or false (0) otherwise. See the documentation for +** [sqlite3session_indirect()] for a description of direct and indirect +** changes. Finally, if pOp is not NULL, then *pOp is set to one of +** [SQLITE_INSERT], [SQLITE_DELETE] or [SQLITE_UPDATE], depending on the +** type of change that the iterator currently points to. +** +** If no error occurs, SQLITE_OK is returned. If an error does occur, an +** SQLite error code is returned. The values of the output variables may not +** be trusted in this case. +*/ +SQLITE_API int sqlite3changeset_op( + sqlite3_changeset_iter *pIter, /* Iterator object */ + const char **pzTab, /* OUT: Pointer to table name */ + int *pnCol, /* OUT: Number of columns in table */ + int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */ + int *pbIndirect /* OUT: True for an 'indirect' change */ +); + +/* +** CAPI3REF: Obtain The Primary Key Definition Of A Table +** METHOD: sqlite3_changeset_iter +** +** For each modified table, a changeset includes the following: +** +**
    +**
  • The number of columns in the table, and +**
  • Which of those columns make up the tables PRIMARY KEY. +**
+** +** This function is used to find which columns comprise the PRIMARY KEY of +** the table modified by the change that iterator pIter currently points to. +** If successful, *pabPK is set to point to an array of nCol entries, where +** nCol is the number of columns in the table. Elements of *pabPK are set to +** 0x01 if the corresponding column is part of the tables primary key, or +** 0x00 if it is not. +** +** If argument pnCol is not NULL, then *pnCol is set to the number of columns +** in the table. +** +** If this function is called when the iterator does not point to a valid +** entry, SQLITE_MISUSE is returned and the output variables zeroed. Otherwise, +** SQLITE_OK is returned and the output variables populated as described +** above. +*/ +SQLITE_API int sqlite3changeset_pk( + sqlite3_changeset_iter *pIter, /* Iterator object */ + unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */ + int *pnCol /* OUT: Number of entries in output array */ +); + +/* +** CAPI3REF: Obtain old.* Values From A Changeset Iterator +** METHOD: sqlite3_changeset_iter +** +** The pIter argument passed to this function may either be an iterator +** passed to a conflict-handler by [sqlite3changeset_apply()], or an iterator +** created by [sqlite3changeset_start()]. In the latter case, the most recent +** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. +** Furthermore, it may only be called if the type of change that the iterator +** currently points to is either [SQLITE_DELETE] or [SQLITE_UPDATE]. Otherwise, +** this function returns [SQLITE_MISUSE] and sets *ppValue to NULL. +** +** Argument iVal must be greater than or equal to 0, and less than the number +** of columns in the table affected by the current change. Otherwise, +** [SQLITE_RANGE] is returned and *ppValue is set to NULL. +** +** If successful, this function sets *ppValue to point to a protected +** sqlite3_value object containing the iVal'th value from the vector of +** original row values stored as part of the UPDATE or DELETE change and +** returns SQLITE_OK. The name of the function comes from the fact that this +** is similar to the "old.*" columns available to update or delete triggers. +** +** If some other error occurs (e.g. an OOM condition), an SQLite error code +** is returned and *ppValue is set to NULL. +*/ +SQLITE_API int sqlite3changeset_old( + sqlite3_changeset_iter *pIter, /* Changeset iterator */ + int iVal, /* Column number */ + sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */ +); + +/* +** CAPI3REF: Obtain new.* Values From A Changeset Iterator +** METHOD: sqlite3_changeset_iter +** +** The pIter argument passed to this function may either be an iterator +** passed to a conflict-handler by [sqlite3changeset_apply()], or an iterator +** created by [sqlite3changeset_start()]. In the latter case, the most recent +** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. +** Furthermore, it may only be called if the type of change that the iterator +** currently points to is either [SQLITE_UPDATE] or [SQLITE_INSERT]. Otherwise, +** this function returns [SQLITE_MISUSE] and sets *ppValue to NULL. +** +** Argument iVal must be greater than or equal to 0, and less than the number +** of columns in the table affected by the current change. Otherwise, +** [SQLITE_RANGE] is returned and *ppValue is set to NULL. +** +** If successful, this function sets *ppValue to point to a protected +** sqlite3_value object containing the iVal'th value from the vector of +** new row values stored as part of the UPDATE or INSERT change and +** returns SQLITE_OK. If the change is an UPDATE and does not include +** a new value for the requested column, *ppValue is set to NULL and +** SQLITE_OK returned. The name of the function comes from the fact that +** this is similar to the "new.*" columns available to update or delete +** triggers. +** +** If some other error occurs (e.g. an OOM condition), an SQLite error code +** is returned and *ppValue is set to NULL. +*/ +SQLITE_API int sqlite3changeset_new( + sqlite3_changeset_iter *pIter, /* Changeset iterator */ + int iVal, /* Column number */ + sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */ +); + +/* +** CAPI3REF: Obtain Conflicting Row Values From A Changeset Iterator +** METHOD: sqlite3_changeset_iter +** +** This function should only be used with iterator objects passed to a +** conflict-handler callback by [sqlite3changeset_apply()] with either +** [SQLITE_CHANGESET_DATA] or [SQLITE_CHANGESET_CONFLICT]. If this function +** is called on any other iterator, [SQLITE_MISUSE] is returned and *ppValue +** is set to NULL. +** +** Argument iVal must be greater than or equal to 0, and less than the number +** of columns in the table affected by the current change. Otherwise, +** [SQLITE_RANGE] is returned and *ppValue is set to NULL. +** +** If successful, this function sets *ppValue to point to a protected +** sqlite3_value object containing the iVal'th value from the +** "conflicting row" associated with the current conflict-handler callback +** and returns SQLITE_OK. +** +** If some other error occurs (e.g. an OOM condition), an SQLite error code +** is returned and *ppValue is set to NULL. +*/ +SQLITE_API int sqlite3changeset_conflict( + sqlite3_changeset_iter *pIter, /* Changeset iterator */ + int iVal, /* Column number */ + sqlite3_value **ppValue /* OUT: Value from conflicting row */ +); + +/* +** CAPI3REF: Determine The Number Of Foreign Key Constraint Violations +** METHOD: sqlite3_changeset_iter +** +** This function may only be called with an iterator passed to an +** SQLITE_CHANGESET_FOREIGN_KEY conflict handler callback. In this case +** it sets the output variable to the total number of known foreign key +** violations in the destination database and returns SQLITE_OK. +** +** In all other cases this function returns SQLITE_MISUSE. +*/ +SQLITE_API int sqlite3changeset_fk_conflicts( + sqlite3_changeset_iter *pIter, /* Changeset iterator */ + int *pnOut /* OUT: Number of FK violations */ +); + + +/* +** CAPI3REF: Finalize A Changeset Iterator +** METHOD: sqlite3_changeset_iter +** +** This function is used to finalize an iterator allocated with +** [sqlite3changeset_start()]. +** +** This function should only be called on iterators created using the +** [sqlite3changeset_start()] function. If an application calls this +** function with an iterator passed to a conflict-handler by +** [sqlite3changeset_apply()], [SQLITE_MISUSE] is immediately returned and the +** call has no effect. +** +** If an error was encountered within a call to an sqlite3changeset_xxx() +** function (for example an [SQLITE_CORRUPT] in [sqlite3changeset_next()] or an +** [SQLITE_NOMEM] in [sqlite3changeset_new()]) then an error code corresponding +** to that error is returned by this function. Otherwise, SQLITE_OK is +** returned. This is to allow the following pattern (pseudo-code): +** +**
+**   sqlite3changeset_start();
+**   while( SQLITE_ROW==sqlite3changeset_next() ){
+**     // Do something with change.
+**   }
+**   rc = sqlite3changeset_finalize();
+**   if( rc!=SQLITE_OK ){
+**     // An error has occurred 
+**   }
+** 
+*/ +SQLITE_API int sqlite3changeset_finalize(sqlite3_changeset_iter *pIter); + +/* +** CAPI3REF: Invert A Changeset +** +** This function is used to "invert" a changeset object. Applying an inverted +** changeset to a database reverses the effects of applying the uninverted +** changeset. Specifically: +** +**
    +**
  • Each DELETE change is changed to an INSERT, and +**
  • Each INSERT change is changed to a DELETE, and +**
  • For each UPDATE change, the old.* and new.* values are exchanged. +**
+** +** This function does not change the order in which changes appear within +** the changeset. It merely reverses the sense of each individual change. +** +** If successful, a pointer to a buffer containing the inverted changeset +** is stored in *ppOut, the size of the same buffer is stored in *pnOut, and +** SQLITE_OK is returned. If an error occurs, both *pnOut and *ppOut are +** zeroed and an SQLite error code returned. +** +** It is the responsibility of the caller to eventually call sqlite3_free() +** on the *ppOut pointer to free the buffer allocation following a successful +** call to this function. +** +** WARNING/TODO: This function currently assumes that the input is a valid +** changeset. If it is not, the results are undefined. +*/ +SQLITE_API int sqlite3changeset_invert( + int nIn, const void *pIn, /* Input changeset */ + int *pnOut, void **ppOut /* OUT: Inverse of input */ +); + +/* +** CAPI3REF: Concatenate Two Changeset Objects +** +** This function is used to concatenate two changesets, A and B, into a +** single changeset. The result is a changeset equivalent to applying +** changeset A followed by changeset B. +** +** This function combines the two input changesets using an +** sqlite3_changegroup object. Calling it produces similar results as the +** following code fragment: +** +**
+**   sqlite3_changegroup *pGrp;
+**   rc = sqlite3_changegroup_new(&pGrp);
+**   if( rc==SQLITE_OK ) rc = sqlite3changegroup_add(pGrp, nA, pA);
+**   if( rc==SQLITE_OK ) rc = sqlite3changegroup_add(pGrp, nB, pB);
+**   if( rc==SQLITE_OK ){
+**     rc = sqlite3changegroup_output(pGrp, pnOut, ppOut);
+**   }else{
+**     *ppOut = 0;
+**     *pnOut = 0;
+**   }
+** 
+** +** Refer to the sqlite3_changegroup documentation below for details. +*/ +SQLITE_API int sqlite3changeset_concat( + int nA, /* Number of bytes in buffer pA */ + void *pA, /* Pointer to buffer containing changeset A */ + int nB, /* Number of bytes in buffer pB */ + void *pB, /* Pointer to buffer containing changeset B */ + int *pnOut, /* OUT: Number of bytes in output changeset */ + void **ppOut /* OUT: Buffer containing output changeset */ +); + + +/* +** CAPI3REF: Changegroup Handle +** +** A changegroup is an object used to combine two or more +** [changesets] or [patchsets] +*/ +typedef struct sqlite3_changegroup sqlite3_changegroup; + +/* +** CAPI3REF: Create A New Changegroup Object +** CONSTRUCTOR: sqlite3_changegroup +** +** An sqlite3_changegroup object is used to combine two or more changesets +** (or patchsets) into a single changeset (or patchset). A single changegroup +** object may combine changesets or patchsets, but not both. The output is +** always in the same format as the input. +** +** If successful, this function returns SQLITE_OK and populates (*pp) with +** a pointer to a new sqlite3_changegroup object before returning. The caller +** should eventually free the returned object using a call to +** sqlite3changegroup_delete(). If an error occurs, an SQLite error code +** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL. +** +** The usual usage pattern for an sqlite3_changegroup object is as follows: +** +**
    +**
  • It is created using a call to sqlite3changegroup_new(). +** +**
  • Zero or more changesets (or patchsets) are added to the object +** by calling sqlite3changegroup_add(). +** +**
  • The result of combining all input changesets together is obtained +** by the application via a call to sqlite3changegroup_output(). +** +**
  • The object is deleted using a call to sqlite3changegroup_delete(). +**
+** +** Any number of calls to add() and output() may be made between the calls to +** new() and delete(), and in any order. +** +** As well as the regular sqlite3changegroup_add() and +** sqlite3changegroup_output() functions, also available are the streaming +** versions sqlite3changegroup_add_strm() and sqlite3changegroup_output_strm(). +*/ +SQLITE_API int sqlite3changegroup_new(sqlite3_changegroup **pp); + +/* +** CAPI3REF: Add A Changeset To A Changegroup +** METHOD: sqlite3_changegroup +** +** Add all changes within the changeset (or patchset) in buffer pData (size +** nData bytes) to the changegroup. +** +** If the buffer contains a patchset, then all prior calls to this function +** on the same changegroup object must also have specified patchsets. Or, if +** the buffer contains a changeset, so must have the earlier calls to this +** function. Otherwise, SQLITE_ERROR is returned and no changes are added +** to the changegroup. +** +** Rows within the changeset and changegroup are identified by the values in +** their PRIMARY KEY columns. A change in the changeset is considered to +** apply to the same row as a change already present in the changegroup if +** the two rows have the same primary key. +** +** Changes to rows that do not already appear in the changegroup are +** simply copied into it. Or, if both the new changeset and the changegroup +** contain changes that apply to a single row, the final contents of the +** changegroup depends on the type of each change, as follows: +** +** +** +** +**
Existing Change New Change Output Change +**
INSERT INSERT +** The new change is ignored. This case does not occur if the new +** changeset was recorded immediately after the changesets already +** added to the changegroup. +**
INSERT UPDATE +** The INSERT change remains in the changegroup. The values in the +** INSERT change are modified as if the row was inserted by the +** existing change and then updated according to the new change. +**
INSERT DELETE +** The existing INSERT is removed from the changegroup. The DELETE is +** not added. +**
UPDATE INSERT +** The new change is ignored. This case does not occur if the new +** changeset was recorded immediately after the changesets already +** added to the changegroup. +**
UPDATE UPDATE +** The existing UPDATE remains within the changegroup. It is amended +** so that the accompanying values are as if the row was updated once +** by the existing change and then again by the new change. +**
UPDATE DELETE +** The existing UPDATE is replaced by the new DELETE within the +** changegroup. +**
DELETE INSERT +** If one or more of the column values in the row inserted by the +** new change differ from those in the row deleted by the existing +** change, the existing DELETE is replaced by an UPDATE within the +** changegroup. Otherwise, if the inserted row is exactly the same +** as the deleted row, the existing DELETE is simply discarded. +**
DELETE UPDATE +** The new change is ignored. This case does not occur if the new +** changeset was recorded immediately after the changesets already +** added to the changegroup. +**
DELETE DELETE +** The new change is ignored. This case does not occur if the new +** changeset was recorded immediately after the changesets already +** added to the changegroup. +**
+** +** If the new changeset contains changes to a table that is already present +** in the changegroup, then the number of columns and the position of the +** primary key columns for the table must be consistent. If this is not the +** case, this function fails with SQLITE_SCHEMA. If the input changeset +** appears to be corrupt and the corruption is detected, SQLITE_CORRUPT is +** returned. Or, if an out-of-memory condition occurs during processing, this +** function returns SQLITE_NOMEM. In all cases, if an error occurs the +** final contents of the changegroup is undefined. +** +** If no error occurs, SQLITE_OK is returned. +*/ +SQLITE_API int sqlite3changegroup_add(sqlite3_changegroup*, int nData, void *pData); + +/* +** CAPI3REF: Obtain A Composite Changeset From A Changegroup +** METHOD: sqlite3_changegroup +** +** Obtain a buffer containing a changeset (or patchset) representing the +** current contents of the changegroup. If the inputs to the changegroup +** were themselves changesets, the output is a changeset. Or, if the +** inputs were patchsets, the output is also a patchset. +** +** As with the output of the sqlite3session_changeset() and +** sqlite3session_patchset() functions, all changes related to a single +** table are grouped together in the output of this function. Tables appear +** in the same order as for the very first changeset added to the changegroup. +** If the second or subsequent changesets added to the changegroup contain +** changes for tables that do not appear in the first changeset, they are +** appended onto the end of the output changeset, again in the order in +** which they are first encountered. +** +** If an error occurs, an SQLite error code is returned and the output +** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK +** is returned and the output variables are set to the size of and a +** pointer to the output buffer, respectively. In this case it is the +** responsibility of the caller to eventually free the buffer using a +** call to sqlite3_free(). +*/ +SQLITE_API int sqlite3changegroup_output( + sqlite3_changegroup*, + int *pnData, /* OUT: Size of output buffer in bytes */ + void **ppData /* OUT: Pointer to output buffer */ +); + +/* +** CAPI3REF: Delete A Changegroup Object +** DESTRUCTOR: sqlite3_changegroup +*/ +SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*); + +/* +** CAPI3REF: Apply A Changeset To A Database +** +** Apply a changeset or patchset to a database. These functions attempt to +** update the "main" database attached to handle db with the changes found in +** the changeset passed via the second and third arguments. +** +** The fourth argument (xFilter) passed to these functions is the "filter +** callback". If it is not NULL, then for each table affected by at least one +** change in the changeset, the filter callback is invoked with +** the table name as the second argument, and a copy of the context pointer +** passed as the sixth argument as the first. If the "filter callback" +** returns zero, then no attempt is made to apply any changes to the table. +** Otherwise, if the return value is non-zero or the xFilter argument to +** is NULL, all changes related to the table are attempted. +** +** For each table that is not excluded by the filter callback, this function +** tests that the target database contains a compatible table. A table is +** considered compatible if all of the following are true: +** +**
    +**
  • The table has the same name as the name recorded in the +** changeset, and +**
  • The table has at least as many columns as recorded in the +** changeset, and +**
  • The table has primary key columns in the same position as +** recorded in the changeset. +**
+** +** If there is no compatible table, it is not an error, but none of the +** changes associated with the table are applied. A warning message is issued +** via the sqlite3_log() mechanism with the error code SQLITE_SCHEMA. At most +** one such warning is issued for each table in the changeset. +** +** For each change for which there is a compatible table, an attempt is made +** to modify the table contents according to the UPDATE, INSERT or DELETE +** change. If a change cannot be applied cleanly, the conflict handler +** function passed as the fifth argument to sqlite3changeset_apply() may be +** invoked. A description of exactly when the conflict handler is invoked for +** each type of change is below. +** +** Unlike the xFilter argument, xConflict may not be passed NULL. The results +** of passing anything other than a valid function pointer as the xConflict +** argument are undefined. +** +** Each time the conflict handler function is invoked, it must return one +** of [SQLITE_CHANGESET_OMIT], [SQLITE_CHANGESET_ABORT] or +** [SQLITE_CHANGESET_REPLACE]. SQLITE_CHANGESET_REPLACE may only be returned +** if the second argument passed to the conflict handler is either +** SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT. If the conflict-handler +** returns an illegal value, any changes already made are rolled back and +** the call to sqlite3changeset_apply() returns SQLITE_MISUSE. Different +** actions are taken by sqlite3changeset_apply() depending on the value +** returned by each invocation of the conflict-handler function. Refer to +** the documentation for the three +** [SQLITE_CHANGESET_OMIT|available return values] for details. +** +**
+**
DELETE Changes
+** For each DELETE change, the function checks if the target database +** contains a row with the same primary key value (or values) as the +** original row values stored in the changeset. If it does, and the values +** stored in all non-primary key columns also match the values stored in +** the changeset the row is deleted from the target database. +** +** If a row with matching primary key values is found, but one or more of +** the non-primary key fields contains a value different from the original +** row value stored in the changeset, the conflict-handler function is +** invoked with [SQLITE_CHANGESET_DATA] as the second argument. If the +** database table has more columns than are recorded in the changeset, +** only the values of those non-primary key fields are compared against +** the current database contents - any trailing database table columns +** are ignored. +** +** If no row with matching primary key values is found in the database, +** the conflict-handler function is invoked with [SQLITE_CHANGESET_NOTFOUND] +** passed as the second argument. +** +** If the DELETE operation is attempted, but SQLite returns SQLITE_CONSTRAINT +** (which can only happen if a foreign key constraint is violated), the +** conflict-handler function is invoked with [SQLITE_CHANGESET_CONSTRAINT] +** passed as the second argument. This includes the case where the DELETE +** operation is attempted because an earlier call to the conflict handler +** function returned [SQLITE_CHANGESET_REPLACE]. +** +**
INSERT Changes
+** For each INSERT change, an attempt is made to insert the new row into +** the database. If the changeset row contains fewer fields than the +** database table, the trailing fields are populated with their default +** values. +** +** If the attempt to insert the row fails because the database already +** contains a row with the same primary key values, the conflict handler +** function is invoked with the second argument set to +** [SQLITE_CHANGESET_CONFLICT]. +** +** If the attempt to insert the row fails because of some other constraint +** violation (e.g. NOT NULL or UNIQUE), the conflict handler function is +** invoked with the second argument set to [SQLITE_CHANGESET_CONSTRAINT]. +** This includes the case where the INSERT operation is re-attempted because +** an earlier call to the conflict handler function returned +** [SQLITE_CHANGESET_REPLACE]. +** +**
UPDATE Changes
+** For each UPDATE change, the function checks if the target database +** contains a row with the same primary key value (or values) as the +** original row values stored in the changeset. If it does, and the values +** stored in all modified non-primary key columns also match the values +** stored in the changeset the row is updated within the target database. +** +** If a row with matching primary key values is found, but one or more of +** the modified non-primary key fields contains a value different from an +** original row value stored in the changeset, the conflict-handler function +** is invoked with [SQLITE_CHANGESET_DATA] as the second argument. Since +** UPDATE changes only contain values for non-primary key fields that are +** to be modified, only those fields need to match the original values to +** avoid the SQLITE_CHANGESET_DATA conflict-handler callback. +** +** If no row with matching primary key values is found in the database, +** the conflict-handler function is invoked with [SQLITE_CHANGESET_NOTFOUND] +** passed as the second argument. +** +** If the UPDATE operation is attempted, but SQLite returns +** SQLITE_CONSTRAINT, the conflict-handler function is invoked with +** [SQLITE_CHANGESET_CONSTRAINT] passed as the second argument. +** This includes the case where the UPDATE operation is attempted after +** an earlier call to the conflict handler function returned +** [SQLITE_CHANGESET_REPLACE]. +**
+** +** It is safe to execute SQL statements, including those that write to the +** table that the callback related to, from within the xConflict callback. +** This can be used to further customize the applications conflict +** resolution strategy. +** +** All changes made by these functions are enclosed in a savepoint transaction. +** If any other error (aside from a constraint failure when attempting to +** write to the target database) occurs, then the savepoint transaction is +** rolled back, restoring the target database to its original state, and an +** SQLite error code returned. +** +** If the output parameters (ppRebase) and (pnRebase) are non-NULL and +** the input is a changeset (not a patchset), then sqlite3changeset_apply_v2() +** may set (*ppRebase) to point to a "rebase" that may be used with the +** sqlite3_rebaser APIs buffer before returning. In this case (*pnRebase) +** is set to the size of the buffer in bytes. It is the responsibility of the +** caller to eventually free any such buffer using sqlite3_free(). The buffer +** is only allocated and populated if one or more conflicts were encountered +** while applying the patchset. See comments surrounding the sqlite3_rebaser +** APIs for further details. +** +** The behavior of sqlite3changeset_apply_v2() and its streaming equivalent +** may be modified by passing a combination of +** [SQLITE_CHANGESETAPPLY_NOSAVEPOINT | supported flags] as the 9th parameter. +** +** Note that the sqlite3changeset_apply_v2() API is still experimental +** and therefore subject to change. +*/ +SQLITE_API int sqlite3changeset_apply( + sqlite3 *db, /* Apply change to "main" db of this handle */ + int nChangeset, /* Size of changeset in bytes */ + void *pChangeset, /* Changeset blob */ + int(*xFilter)( + void *pCtx, /* Copy of sixth arg to _apply() */ + const char *zTab /* Table name */ + ), + int(*xConflict)( + void *pCtx, /* Copy of sixth arg to _apply() */ + int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ + sqlite3_changeset_iter *p /* Handle describing change and conflict */ + ), + void *pCtx /* First argument passed to xConflict */ +); +SQLITE_API int sqlite3changeset_apply_v2( + sqlite3 *db, /* Apply change to "main" db of this handle */ + int nChangeset, /* Size of changeset in bytes */ + void *pChangeset, /* Changeset blob */ + int(*xFilter)( + void *pCtx, /* Copy of sixth arg to _apply() */ + const char *zTab /* Table name */ + ), + int(*xConflict)( + void *pCtx, /* Copy of sixth arg to _apply() */ + int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ + sqlite3_changeset_iter *p /* Handle describing change and conflict */ + ), + void *pCtx, /* First argument passed to xConflict */ + void **ppRebase, int *pnRebase, /* OUT: Rebase data */ + int flags /* Combination of SESSION_APPLY_* flags */ +); + +/* +** CAPI3REF: Flags for sqlite3changeset_apply_v2 +** +** The following flags may passed via the 9th parameter to +** [sqlite3changeset_apply_v2] and [sqlite3changeset_apply_v2_strm]: +** +**
+**
SQLITE_CHANGESETAPPLY_NOSAVEPOINT
+** Usually, the sessions module encloses all operations performed by +** a single call to apply_v2() or apply_v2_strm() in a [SAVEPOINT]. The +** SAVEPOINT is committed if the changeset or patchset is successfully +** applied, or rolled back if an error occurs. Specifying this flag +** causes the sessions module to omit this savepoint. In this case, if the +** caller has an open transaction or savepoint when apply_v2() is called, +** it may revert the partially applied changeset by rolling it back. +*/ +#define SQLITE_CHANGESETAPPLY_NOSAVEPOINT 0x0001 + +/* +** CAPI3REF: Constants Passed To The Conflict Handler +** +** Values that may be passed as the second argument to a conflict-handler. +** +**
+**
SQLITE_CHANGESET_DATA
+** The conflict handler is invoked with CHANGESET_DATA as the second argument +** when processing a DELETE or UPDATE change if a row with the required +** PRIMARY KEY fields is present in the database, but one or more other +** (non primary-key) fields modified by the update do not contain the +** expected "before" values. +** +** The conflicting row, in this case, is the database row with the matching +** primary key. +** +**
SQLITE_CHANGESET_NOTFOUND
+** The conflict handler is invoked with CHANGESET_NOTFOUND as the second +** argument when processing a DELETE or UPDATE change if a row with the +** required PRIMARY KEY fields is not present in the database. +** +** There is no conflicting row in this case. The results of invoking the +** sqlite3changeset_conflict() API are undefined. +** +**
SQLITE_CHANGESET_CONFLICT
+** CHANGESET_CONFLICT is passed as the second argument to the conflict +** handler while processing an INSERT change if the operation would result +** in duplicate primary key values. +** +** The conflicting row in this case is the database row with the matching +** primary key. +** +**
SQLITE_CHANGESET_FOREIGN_KEY
+** If foreign key handling is enabled, and applying a changeset leaves the +** database in a state containing foreign key violations, the conflict +** handler is invoked with CHANGESET_FOREIGN_KEY as the second argument +** exactly once before the changeset is committed. If the conflict handler +** returns CHANGESET_OMIT, the changes, including those that caused the +** foreign key constraint violation, are committed. Or, if it returns +** CHANGESET_ABORT, the changeset is rolled back. +** +** No current or conflicting row information is provided. The only function +** it is possible to call on the supplied sqlite3_changeset_iter handle +** is sqlite3changeset_fk_conflicts(). +** +**
SQLITE_CHANGESET_CONSTRAINT
+** If any other constraint violation occurs while applying a change (i.e. +** a UNIQUE, CHECK or NOT NULL constraint), the conflict handler is +** invoked with CHANGESET_CONSTRAINT as the second argument. +** +** There is no conflicting row in this case. The results of invoking the +** sqlite3changeset_conflict() API are undefined. +** +**
+*/ +#define SQLITE_CHANGESET_DATA 1 +#define SQLITE_CHANGESET_NOTFOUND 2 +#define SQLITE_CHANGESET_CONFLICT 3 +#define SQLITE_CHANGESET_CONSTRAINT 4 +#define SQLITE_CHANGESET_FOREIGN_KEY 5 + +/* +** CAPI3REF: Constants Returned By The Conflict Handler +** +** A conflict handler callback must return one of the following three values. +** +**
+**
SQLITE_CHANGESET_OMIT
+** If a conflict handler returns this value no special action is taken. The +** change that caused the conflict is not applied. The session module +** continues to the next change in the changeset. +** +**
SQLITE_CHANGESET_REPLACE
+** This value may only be returned if the second argument to the conflict +** handler was SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT. If this +** is not the case, any changes applied so far are rolled back and the +** call to sqlite3changeset_apply() returns SQLITE_MISUSE. +** +** If CHANGESET_REPLACE is returned by an SQLITE_CHANGESET_DATA conflict +** handler, then the conflicting row is either updated or deleted, depending +** on the type of change. +** +** If CHANGESET_REPLACE is returned by an SQLITE_CHANGESET_CONFLICT conflict +** handler, then the conflicting row is removed from the database and a +** second attempt to apply the change is made. If this second attempt fails, +** the original row is restored to the database before continuing. +** +**
SQLITE_CHANGESET_ABORT
+** If this value is returned, any changes applied so far are rolled back +** and the call to sqlite3changeset_apply() returns SQLITE_ABORT. +**
+*/ +#define SQLITE_CHANGESET_OMIT 0 +#define SQLITE_CHANGESET_REPLACE 1 +#define SQLITE_CHANGESET_ABORT 2 + +/* +** CAPI3REF: Rebasing changesets +** EXPERIMENTAL +** +** Suppose there is a site hosting a database in state S0. And that +** modifications are made that move that database to state S1 and a +** changeset recorded (the "local" changeset). Then, a changeset based +** on S0 is received from another site (the "remote" changeset) and +** applied to the database. The database is then in state +** (S1+"remote"), where the exact state depends on any conflict +** resolution decisions (OMIT or REPLACE) made while applying "remote". +** Rebasing a changeset is to update it to take those conflict +** resolution decisions into account, so that the same conflicts +** do not have to be resolved elsewhere in the network. +** +** For example, if both the local and remote changesets contain an +** INSERT of the same key on "CREATE TABLE t1(a PRIMARY KEY, b)": +** +** local: INSERT INTO t1 VALUES(1, 'v1'); +** remote: INSERT INTO t1 VALUES(1, 'v2'); +** +** and the conflict resolution is REPLACE, then the INSERT change is +** removed from the local changeset (it was overridden). Or, if the +** conflict resolution was "OMIT", then the local changeset is modified +** to instead contain: +** +** UPDATE t1 SET b = 'v2' WHERE a=1; +** +** Changes within the local changeset are rebased as follows: +** +**
+**
Local INSERT
+** This may only conflict with a remote INSERT. If the conflict +** resolution was OMIT, then add an UPDATE change to the rebased +** changeset. Or, if the conflict resolution was REPLACE, add +** nothing to the rebased changeset. +** +**
Local DELETE
+** This may conflict with a remote UPDATE or DELETE. In both cases the +** only possible resolution is OMIT. If the remote operation was a +** DELETE, then add no change to the rebased changeset. If the remote +** operation was an UPDATE, then the old.* fields of change are updated +** to reflect the new.* values in the UPDATE. +** +**
Local UPDATE
+** This may conflict with a remote UPDATE or DELETE. If it conflicts +** with a DELETE, and the conflict resolution was OMIT, then the update +** is changed into an INSERT. Any undefined values in the new.* record +** from the update change are filled in using the old.* values from +** the conflicting DELETE. Or, if the conflict resolution was REPLACE, +** the UPDATE change is simply omitted from the rebased changeset. +** +** If conflict is with a remote UPDATE and the resolution is OMIT, then +** the old.* values are rebased using the new.* values in the remote +** change. Or, if the resolution is REPLACE, then the change is copied +** into the rebased changeset with updates to columns also updated by +** the conflicting remote UPDATE removed. If this means no columns would +** be updated, the change is omitted. +**
+** +** A local change may be rebased against multiple remote changes +** simultaneously. If a single key is modified by multiple remote +** changesets, they are combined as follows before the local changeset +** is rebased: +** +**
    +**
  • If there has been one or more REPLACE resolutions on a +** key, it is rebased according to a REPLACE. +** +**
  • If there have been no REPLACE resolutions on a key, then +** the local changeset is rebased according to the most recent +** of the OMIT resolutions. +**
+** +** Note that conflict resolutions from multiple remote changesets are +** combined on a per-field basis, not per-row. This means that in the +** case of multiple remote UPDATE operations, some fields of a single +** local change may be rebased for REPLACE while others are rebased for +** OMIT. +** +** In order to rebase a local changeset, the remote changeset must first +** be applied to the local database using sqlite3changeset_apply_v2() and +** the buffer of rebase information captured. Then: +** +**
    +**
  1. An sqlite3_rebaser object is created by calling +** sqlite3rebaser_create(). +**
  2. The new object is configured with the rebase buffer obtained from +** sqlite3changeset_apply_v2() by calling sqlite3rebaser_configure(). +** If the local changeset is to be rebased against multiple remote +** changesets, then sqlite3rebaser_configure() should be called +** multiple times, in the same order that the multiple +** sqlite3changeset_apply_v2() calls were made. +**
  3. Each local changeset is rebased by calling sqlite3rebaser_rebase(). +**
  4. The sqlite3_rebaser object is deleted by calling +** sqlite3rebaser_delete(). +**
+*/ +typedef struct sqlite3_rebaser sqlite3_rebaser; + +/* +** CAPI3REF: Create a changeset rebaser object. +** EXPERIMENTAL +** +** Allocate a new changeset rebaser object. If successful, set (*ppNew) to +** point to the new object and return SQLITE_OK. Otherwise, if an error +** occurs, return an SQLite error code (e.g. SQLITE_NOMEM) and set (*ppNew) +** to NULL. +*/ +SQLITE_API int sqlite3rebaser_create(sqlite3_rebaser **ppNew); + +/* +** CAPI3REF: Configure a changeset rebaser object. +** EXPERIMENTAL +** +** Configure the changeset rebaser object to rebase changesets according +** to the conflict resolutions described by buffer pRebase (size nRebase +** bytes), which must have been obtained from a previous call to +** sqlite3changeset_apply_v2(). +*/ +SQLITE_API int sqlite3rebaser_configure( + sqlite3_rebaser*, + int nRebase, const void *pRebase +); + +/* +** CAPI3REF: Rebase a changeset +** EXPERIMENTAL +** +** Argument pIn must point to a buffer containing a changeset nIn bytes +** in size. This function allocates and populates a buffer with a copy +** of the changeset rebased rebased according to the configuration of the +** rebaser object passed as the first argument. If successful, (*ppOut) +** is set to point to the new buffer containing the rebased changset and +** (*pnOut) to its size in bytes and SQLITE_OK returned. It is the +** responsibility of the caller to eventually free the new buffer using +** sqlite3_free(). Otherwise, if an error occurs, (*ppOut) and (*pnOut) +** are set to zero and an SQLite error code returned. +*/ +SQLITE_API int sqlite3rebaser_rebase( + sqlite3_rebaser*, + int nIn, const void *pIn, + int *pnOut, void **ppOut +); + +/* +** CAPI3REF: Delete a changeset rebaser object. +** EXPERIMENTAL +** +** Delete the changeset rebaser object and all associated resources. There +** should be one call to this function for each successful invocation +** of sqlite3rebaser_create(). +*/ +SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser *p); + +/* +** CAPI3REF: Streaming Versions of API functions. +** +** The six streaming API xxx_strm() functions serve similar purposes to the +** corresponding non-streaming API functions: +** +** +** +**
Streaming functionNon-streaming equivalent
sqlite3changeset_apply_strm[sqlite3changeset_apply] +**
sqlite3changeset_apply_strm_v2[sqlite3changeset_apply_v2] +**
sqlite3changeset_concat_strm[sqlite3changeset_concat] +**
sqlite3changeset_invert_strm[sqlite3changeset_invert] +**
sqlite3changeset_start_strm[sqlite3changeset_start] +**
sqlite3session_changeset_strm[sqlite3session_changeset] +**
sqlite3session_patchset_strm[sqlite3session_patchset] +**
+** +** Non-streaming functions that accept changesets (or patchsets) as input +** require that the entire changeset be stored in a single buffer in memory. +** Similarly, those that return a changeset or patchset do so by returning +** a pointer to a single large buffer allocated using sqlite3_malloc(). +** Normally this is convenient. However, if an application running in a +** low-memory environment is required to handle very large changesets, the +** large contiguous memory allocations required can become onerous. +** +** In order to avoid this problem, instead of a single large buffer, input +** is passed to a streaming API functions by way of a callback function that +** the sessions module invokes to incrementally request input data as it is +** required. In all cases, a pair of API function parameters such as +** +**
+**        int nChangeset,
+**        void *pChangeset,
+**  
+** +** Is replaced by: +** +**
+**        int (*xInput)(void *pIn, void *pData, int *pnData),
+**        void *pIn,
+**  
+** +** Each time the xInput callback is invoked by the sessions module, the first +** argument passed is a copy of the supplied pIn context pointer. The second +** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no +** error occurs the xInput method should copy up to (*pnData) bytes of data +** into the buffer and set (*pnData) to the actual number of bytes copied +** before returning SQLITE_OK. If the input is completely exhausted, (*pnData) +** should be set to zero to indicate this. Or, if an error occurs, an SQLite +** error code should be returned. In all cases, if an xInput callback returns +** an error, all processing is abandoned and the streaming API function +** returns a copy of the error code to the caller. +** +** In the case of sqlite3changeset_start_strm(), the xInput callback may be +** invoked by the sessions module at any point during the lifetime of the +** iterator. If such an xInput callback returns an error, the iterator enters +** an error state, whereby all subsequent calls to iterator functions +** immediately fail with the same error code as returned by xInput. +** +** Similarly, streaming API functions that return changesets (or patchsets) +** return them in chunks by way of a callback function instead of via a +** pointer to a single large buffer. In this case, a pair of parameters such +** as: +** +**
+**        int *pnChangeset,
+**        void **ppChangeset,
+**  
+** +** Is replaced by: +** +**
+**        int (*xOutput)(void *pOut, const void *pData, int nData),
+**        void *pOut
+**  
+** +** The xOutput callback is invoked zero or more times to return data to +** the application. The first parameter passed to each call is a copy of the +** pOut pointer supplied by the application. The second parameter, pData, +** points to a buffer nData bytes in size containing the chunk of output +** data being returned. If the xOutput callback successfully processes the +** supplied data, it should return SQLITE_OK to indicate success. Otherwise, +** it should return some other SQLite error code. In this case processing +** is immediately abandoned and the streaming API function returns a copy +** of the xOutput error code to the application. +** +** The sessions module never invokes an xOutput callback with the third +** parameter set to a value less than or equal to zero. Other than this, +** no guarantees are made as to the size of the chunks of data returned. +*/ +SQLITE_API int sqlite3changeset_apply_strm( + sqlite3 *db, /* Apply change to "main" db of this handle */ + int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */ + void *pIn, /* First arg for xInput */ + int(*xFilter)( + void *pCtx, /* Copy of sixth arg to _apply() */ + const char *zTab /* Table name */ + ), + int(*xConflict)( + void *pCtx, /* Copy of sixth arg to _apply() */ + int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ + sqlite3_changeset_iter *p /* Handle describing change and conflict */ + ), + void *pCtx /* First argument passed to xConflict */ +); +SQLITE_API int sqlite3changeset_apply_v2_strm( + sqlite3 *db, /* Apply change to "main" db of this handle */ + int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */ + void *pIn, /* First arg for xInput */ + int(*xFilter)( + void *pCtx, /* Copy of sixth arg to _apply() */ + const char *zTab /* Table name */ + ), + int(*xConflict)( + void *pCtx, /* Copy of sixth arg to _apply() */ + int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ + sqlite3_changeset_iter *p /* Handle describing change and conflict */ + ), + void *pCtx, /* First argument passed to xConflict */ + void **ppRebase, int *pnRebase, + int flags +); +SQLITE_API int sqlite3changeset_concat_strm( + int (*xInputA)(void *pIn, void *pData, int *pnData), + void *pInA, + int (*xInputB)(void *pIn, void *pData, int *pnData), + void *pInB, + int (*xOutput)(void *pOut, const void *pData, int nData), + void *pOut +); +SQLITE_API int sqlite3changeset_invert_strm( + int (*xInput)(void *pIn, void *pData, int *pnData), + void *pIn, + int (*xOutput)(void *pOut, const void *pData, int nData), + void *pOut +); +SQLITE_API int sqlite3changeset_start_strm( + sqlite3_changeset_iter **pp, + int (*xInput)(void *pIn, void *pData, int *pnData), + void *pIn +); +SQLITE_API int sqlite3session_changeset_strm( + sqlite3_session *pSession, + int (*xOutput)(void *pOut, const void *pData, int nData), + void *pOut +); +SQLITE_API int sqlite3session_patchset_strm( + sqlite3_session *pSession, + int (*xOutput)(void *pOut, const void *pData, int nData), + void *pOut +); +SQLITE_API int sqlite3changegroup_add_strm(sqlite3_changegroup*, + int (*xInput)(void *pIn, void *pData, int *pnData), + void *pIn +); +SQLITE_API int sqlite3changegroup_output_strm(sqlite3_changegroup*, + int (*xOutput)(void *pOut, const void *pData, int nData), + void *pOut +); +SQLITE_API int sqlite3rebaser_rebase_strm( + sqlite3_rebaser *pRebaser, + int (*xInput)(void *pIn, void *pData, int *pnData), + void *pIn, + int (*xOutput)(void *pOut, const void *pData, int nData), + void *pOut +); + + +/* +** Make sure we can call this stuff from C++. +*/ +#ifdef __cplusplus +} +#endif + +#endif /* !defined(__SQLITESESSION_H_) && defined(SQLITE_ENABLE_SESSION) */ + +/******** End of sqlite3session.h *********/ +/******** Begin file fts5.h *********/ +/* +** 2014 May 31 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +****************************************************************************** +** +** Interfaces to extend FTS5. Using the interfaces defined in this file, +** FTS5 may be extended with: +** +** * custom tokenizers, and +** * custom auxiliary functions. +*/ + + +#ifndef _FTS5_H +#define _FTS5_H + + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************* +** CUSTOM AUXILIARY FUNCTIONS +** +** Virtual table implementations may overload SQL functions by implementing +** the sqlite3_module.xFindFunction() method. +*/ + +typedef struct Fts5ExtensionApi Fts5ExtensionApi; +typedef struct Fts5Context Fts5Context; +typedef struct Fts5PhraseIter Fts5PhraseIter; + +typedef void (*fts5_extension_function)( + const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ + Fts5Context *pFts, /* First arg to pass to pApi functions */ + sqlite3_context *pCtx, /* Context for returning result/error */ + int nVal, /* Number of values in apVal[] array */ + sqlite3_value **apVal /* Array of trailing arguments */ +); + +struct Fts5PhraseIter { + const unsigned char *a; + const unsigned char *b; +}; + +/* +** EXTENSION API FUNCTIONS +** +** xUserData(pFts): +** Return a copy of the context pointer the extension function was +** registered with. +** +** xColumnTotalSize(pFts, iCol, pnToken): +** If parameter iCol is less than zero, set output variable *pnToken +** to the total number of tokens in the FTS5 table. Or, if iCol is +** non-negative but less than the number of columns in the table, return +** the total number of tokens in column iCol, considering all rows in +** the FTS5 table. +** +** If parameter iCol is greater than or equal to the number of columns +** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. +** an OOM condition or IO error), an appropriate SQLite error code is +** returned. +** +** xColumnCount(pFts): +** Return the number of columns in the table. +** +** xColumnSize(pFts, iCol, pnToken): +** If parameter iCol is less than zero, set output variable *pnToken +** to the total number of tokens in the current row. Or, if iCol is +** non-negative but less than the number of columns in the table, set +** *pnToken to the number of tokens in column iCol of the current row. +** +** If parameter iCol is greater than or equal to the number of columns +** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. +** an OOM condition or IO error), an appropriate SQLite error code is +** returned. +** +** This function may be quite inefficient if used with an FTS5 table +** created with the "columnsize=0" option. +** +** xColumnText: +** This function attempts to retrieve the text of column iCol of the +** current document. If successful, (*pz) is set to point to a buffer +** containing the text in utf-8 encoding, (*pn) is set to the size in bytes +** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, +** if an error occurs, an SQLite error code is returned and the final values +** of (*pz) and (*pn) are undefined. +** +** xPhraseCount: +** Returns the number of phrases in the current query expression. +** +** xPhraseSize: +** Returns the number of tokens in phrase iPhrase of the query. Phrases +** are numbered starting from zero. +** +** xInstCount: +** Set *pnInst to the total number of occurrences of all phrases within +** the query within the current row. Return SQLITE_OK if successful, or +** an error code (i.e. SQLITE_NOMEM) if an error occurs. +** +** This API can be quite slow if used with an FTS5 table created with the +** "detail=none" or "detail=column" option. If the FTS5 table is created +** with either "detail=none" or "detail=column" and "content=" option +** (i.e. if it is a contentless table), then this API always returns 0. +** +** xInst: +** Query for the details of phrase match iIdx within the current row. +** Phrase matches are numbered starting from zero, so the iIdx argument +** should be greater than or equal to zero and smaller than the value +** output by xInstCount(). +** +** Usually, output parameter *piPhrase is set to the phrase number, *piCol +** to the column in which it occurs and *piOff the token offset of the +** first token of the phrase. The exception is if the table was created +** with the offsets=0 option specified. In this case *piOff is always +** set to -1. +** +** Returns SQLITE_OK if successful, or an error code (i.e. SQLITE_NOMEM) +** if an error occurs. +** +** This API can be quite slow if used with an FTS5 table created with the +** "detail=none" or "detail=column" option. +** +** xRowid: +** Returns the rowid of the current row. +** +** xTokenize: +** Tokenize text using the tokenizer belonging to the FTS5 table. +** +** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): +** This API function is used to query the FTS table for phrase iPhrase +** of the current query. Specifically, a query equivalent to: +** +** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid +** +** with $p set to a phrase equivalent to the phrase iPhrase of the +** current query is executed. Any column filter that applies to +** phrase iPhrase of the current query is included in $p. For each +** row visited, the callback function passed as the fourth argument +** is invoked. The context and API objects passed to the callback +** function may be used to access the properties of each matched row. +** Invoking Api.xUserData() returns a copy of the pointer passed as +** the third argument to pUserData. +** +** If the callback function returns any value other than SQLITE_OK, the +** query is abandoned and the xQueryPhrase function returns immediately. +** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. +** Otherwise, the error code is propagated upwards. +** +** If the query runs to completion without incident, SQLITE_OK is returned. +** Or, if some error occurs before the query completes or is aborted by +** the callback, an SQLite error code is returned. +** +** +** xSetAuxdata(pFts5, pAux, xDelete) +** +** Save the pointer passed as the second argument as the extension functions +** "auxiliary data". The pointer may then be retrieved by the current or any +** future invocation of the same fts5 extension function made as part of +** of the same MATCH query using the xGetAuxdata() API. +** +** Each extension function is allocated a single auxiliary data slot for +** each FTS query (MATCH expression). If the extension function is invoked +** more than once for a single FTS query, then all invocations share a +** single auxiliary data context. +** +** If there is already an auxiliary data pointer when this function is +** invoked, then it is replaced by the new pointer. If an xDelete callback +** was specified along with the original pointer, it is invoked at this +** point. +** +** The xDelete callback, if one is specified, is also invoked on the +** auxiliary data pointer after the FTS5 query has finished. +** +** If an error (e.g. an OOM condition) occurs within this function, an +** the auxiliary data is set to NULL and an error code returned. If the +** xDelete parameter was not NULL, it is invoked on the auxiliary data +** pointer before returning. +** +** +** xGetAuxdata(pFts5, bClear) +** +** Returns the current auxiliary data pointer for the fts5 extension +** function. See the xSetAuxdata() method for details. +** +** If the bClear argument is non-zero, then the auxiliary data is cleared +** (set to NULL) before this function returns. In this case the xDelete, +** if any, is not invoked. +** +** +** xRowCount(pFts5, pnRow) +** +** This function is used to retrieve the total number of rows in the table. +** In other words, the same value that would be returned by: +** +** SELECT count(*) FROM ftstable; +** +** xPhraseFirst() +** This function is used, along with type Fts5PhraseIter and the xPhraseNext +** method, to iterate through all instances of a single query phrase within +** the current row. This is the same information as is accessible via the +** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient +** to use, this API may be faster under some circumstances. To iterate +** through instances of phrase iPhrase, use the following code: +** +** Fts5PhraseIter iter; +** int iCol, iOff; +** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); +** iCol>=0; +** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) +** ){ +** // An instance of phrase iPhrase at offset iOff of column iCol +** } +** +** The Fts5PhraseIter structure is defined above. Applications should not +** modify this structure directly - it should only be used as shown above +** with the xPhraseFirst() and xPhraseNext() API methods (and by +** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). +** +** This API can be quite slow if used with an FTS5 table created with the +** "detail=none" or "detail=column" option. If the FTS5 table is created +** with either "detail=none" or "detail=column" and "content=" option +** (i.e. if it is a contentless table), then this API always iterates +** through an empty set (all calls to xPhraseFirst() set iCol to -1). +** +** xPhraseNext() +** See xPhraseFirst above. +** +** xPhraseFirstColumn() +** This function and xPhraseNextColumn() are similar to the xPhraseFirst() +** and xPhraseNext() APIs described above. The difference is that instead +** of iterating through all instances of a phrase in the current row, these +** APIs are used to iterate through the set of columns in the current row +** that contain one or more instances of a specified phrase. For example: +** +** Fts5PhraseIter iter; +** int iCol; +** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); +** iCol>=0; +** pApi->xPhraseNextColumn(pFts, &iter, &iCol) +** ){ +** // Column iCol contains at least one instance of phrase iPhrase +** } +** +** This API can be quite slow if used with an FTS5 table created with the +** "detail=none" option. If the FTS5 table is created with either +** "detail=none" "content=" option (i.e. if it is a contentless table), +** then this API always iterates through an empty set (all calls to +** xPhraseFirstColumn() set iCol to -1). +** +** The information accessed using this API and its companion +** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext +** (or xInst/xInstCount). The chief advantage of this API is that it is +** significantly more efficient than those alternatives when used with +** "detail=column" tables. +** +** xPhraseNextColumn() +** See xPhraseFirstColumn above. +*/ +struct Fts5ExtensionApi { + int iVersion; /* Currently always set to 3 */ + + void *(*xUserData)(Fts5Context*); + + int (*xColumnCount)(Fts5Context*); + int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); + int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken); + + int (*xTokenize)(Fts5Context*, + const char *pText, int nText, /* Text to tokenize */ + void *pCtx, /* Context passed to xToken() */ + int (*xToken)(void*, int, const char*, int, int, int) /* Callback */ + ); + + int (*xPhraseCount)(Fts5Context*); + int (*xPhraseSize)(Fts5Context*, int iPhrase); + + int (*xInstCount)(Fts5Context*, int *pnInst); + int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff); + + sqlite3_int64 (*xRowid)(Fts5Context*); + int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn); + int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken); + + int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData, + int(*)(const Fts5ExtensionApi*,Fts5Context*,void*) + ); + int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*)); + void *(*xGetAuxdata)(Fts5Context*, int bClear); + + int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*); + void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff); + + int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*); + void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol); +}; + +/* +** CUSTOM AUXILIARY FUNCTIONS +*************************************************************************/ + +/************************************************************************* +** CUSTOM TOKENIZERS +** +** Applications may also register custom tokenizer types. A tokenizer +** is registered by providing fts5 with a populated instance of the +** following structure. All structure methods must be defined, setting +** any member of the fts5_tokenizer struct to NULL leads to undefined +** behaviour. The structure methods are expected to function as follows: +** +** xCreate: +** This function is used to allocate and initialize a tokenizer instance. +** A tokenizer instance is required to actually tokenize text. +** +** The first argument passed to this function is a copy of the (void*) +** pointer provided by the application when the fts5_tokenizer object +** was registered with FTS5 (the third argument to xCreateTokenizer()). +** The second and third arguments are an array of nul-terminated strings +** containing the tokenizer arguments, if any, specified following the +** tokenizer name as part of the CREATE VIRTUAL TABLE statement used +** to create the FTS5 table. +** +** The final argument is an output variable. If successful, (*ppOut) +** should be set to point to the new tokenizer handle and SQLITE_OK +** returned. If an error occurs, some value other than SQLITE_OK should +** be returned. In this case, fts5 assumes that the final value of *ppOut +** is undefined. +** +** xDelete: +** This function is invoked to delete a tokenizer handle previously +** allocated using xCreate(). Fts5 guarantees that this function will +** be invoked exactly once for each successful call to xCreate(). +** +** xTokenize: +** This function is expected to tokenize the nText byte string indicated +** by argument pText. pText may or may not be nul-terminated. The first +** argument passed to this function is a pointer to an Fts5Tokenizer object +** returned by an earlier call to xCreate(). +** +** The second argument indicates the reason that FTS5 is requesting +** tokenization of the supplied text. This is always one of the following +** four values: +** +**
  • FTS5_TOKENIZE_DOCUMENT - A document is being inserted into +** or removed from the FTS table. The tokenizer is being invoked to +** determine the set of tokens to add to (or delete from) the +** FTS index. +** +**
  • FTS5_TOKENIZE_QUERY - A MATCH query is being executed +** against the FTS index. The tokenizer is being called to tokenize +** a bareword or quoted string specified as part of the query. +** +**
  • (FTS5_TOKENIZE_QUERY | FTS5_TOKENIZE_PREFIX) - Same as +** FTS5_TOKENIZE_QUERY, except that the bareword or quoted string is +** followed by a "*" character, indicating that the last token +** returned by the tokenizer will be treated as a token prefix. +** +**
  • FTS5_TOKENIZE_AUX - The tokenizer is being invoked to +** satisfy an fts5_api.xTokenize() request made by an auxiliary +** function. Or an fts5_api.xColumnSize() request made by the same +** on a columnsize=0 database. +**
+** +** For each token in the input string, the supplied callback xToken() must +** be invoked. The first argument to it should be a copy of the pointer +** passed as the second argument to xTokenize(). The third and fourth +** arguments are a pointer to a buffer containing the token text, and the +** size of the token in bytes. The 4th and 5th arguments are the byte offsets +** of the first byte of and first byte immediately following the text from +** which the token is derived within the input. +** +** The second argument passed to the xToken() callback ("tflags") should +** normally be set to 0. The exception is if the tokenizer supports +** synonyms. In this case see the discussion below for details. +** +** FTS5 assumes the xToken() callback is invoked for each token in the +** order that they occur within the input text. +** +** If an xToken() callback returns any value other than SQLITE_OK, then +** the tokenization should be abandoned and the xTokenize() method should +** immediately return a copy of the xToken() return value. Or, if the +** input buffer is exhausted, xTokenize() should return SQLITE_OK. Finally, +** if an error occurs with the xTokenize() implementation itself, it +** may abandon the tokenization and return any error code other than +** SQLITE_OK or SQLITE_DONE. +** +** SYNONYM SUPPORT +** +** Custom tokenizers may also support synonyms. Consider a case in which a +** user wishes to query for a phrase such as "first place". Using the +** built-in tokenizers, the FTS5 query 'first + place' will match instances +** of "first place" within the document set, but not alternative forms +** such as "1st place". In some applications, it would be better to match +** all instances of "first place" or "1st place" regardless of which form +** the user specified in the MATCH query text. +** +** There are several ways to approach this in FTS5: +** +**
  1. By mapping all synonyms to a single token. In this case, the +** In the above example, this means that the tokenizer returns the +** same token for inputs "first" and "1st". Say that token is in +** fact "first", so that when the user inserts the document "I won +** 1st place" entries are added to the index for tokens "i", "won", +** "first" and "place". If the user then queries for '1st + place', +** the tokenizer substitutes "first" for "1st" and the query works +** as expected. +** +**
  2. By adding multiple synonyms for a single term to the FTS index. +** In this case, when tokenizing query text, the tokenizer may +** provide multiple synonyms for a single term within the document. +** FTS5 then queries the index for each synonym individually. For +** example, faced with the query: +** +** +** ... MATCH 'first place' +** +** the tokenizer offers both "1st" and "first" as synonyms for the +** first token in the MATCH query and FTS5 effectively runs a query +** similar to: +** +** +** ... MATCH '(first OR 1st) place' +** +** except that, for the purposes of auxiliary functions, the query +** still appears to contain just two phrases - "(first OR 1st)" +** being treated as a single phrase. +** +**
  3. By adding multiple synonyms for a single term to the FTS index. +** Using this method, when tokenizing document text, the tokenizer +** provides multiple synonyms for each token. So that when a +** document such as "I won first place" is tokenized, entries are +** added to the FTS index for "i", "won", "first", "1st" and +** "place". +** +** This way, even if the tokenizer does not provide synonyms +** when tokenizing query text (it should not - to do would be +** inefficient), it doesn't matter if the user queries for +** 'first + place' or '1st + place', as there are entires in the +** FTS index corresponding to both forms of the first token. +**
+** +** Whether it is parsing document or query text, any call to xToken that +** specifies a tflags argument with the FTS5_TOKEN_COLOCATED bit +** is considered to supply a synonym for the previous token. For example, +** when parsing the document "I won first place", a tokenizer that supports +** synonyms would call xToken() 5 times, as follows: +** +** +** xToken(pCtx, 0, "i", 1, 0, 1); +** xToken(pCtx, 0, "won", 3, 2, 5); +** xToken(pCtx, 0, "first", 5, 6, 11); +** xToken(pCtx, FTS5_TOKEN_COLOCATED, "1st", 3, 6, 11); +** xToken(pCtx, 0, "place", 5, 12, 17); +** +** +** It is an error to specify the FTS5_TOKEN_COLOCATED flag the first time +** xToken() is called. Multiple synonyms may be specified for a single token +** by making multiple calls to xToken(FTS5_TOKEN_COLOCATED) in sequence. +** There is no limit to the number of synonyms that may be provided for a +** single token. +** +** In many cases, method (1) above is the best approach. It does not add +** extra data to the FTS index or require FTS5 to query for multiple terms, +** so it is efficient in terms of disk space and query speed. However, it +** does not support prefix queries very well. If, as suggested above, the +** token "first" is subsituted for "1st" by the tokenizer, then the query: +** +** +** ... MATCH '1s*' +** +** will not match documents that contain the token "1st" (as the tokenizer +** will probably not map "1s" to any prefix of "first"). +** +** For full prefix support, method (3) may be preferred. In this case, +** because the index contains entries for both "first" and "1st", prefix +** queries such as 'fi*' or '1s*' will match correctly. However, because +** extra entries are added to the FTS index, this method uses more space +** within the database. +** +** Method (2) offers a midpoint between (1) and (3). Using this method, +** a query such as '1s*' will match documents that contain the literal +** token "1st", but not "first" (assuming the tokenizer is not able to +** provide synonyms for prefixes). However, a non-prefix query like '1st' +** will match against "1st" and "first". This method does not require +** extra disk space, as no extra entries are added to the FTS index. +** On the other hand, it may require more CPU cycles to run MATCH queries, +** as separate queries of the FTS index are required for each synonym. +** +** When using methods (2) or (3), it is important that the tokenizer only +** provide synonyms when tokenizing document text (method (2)) or query +** text (method (3)), not both. Doing so will not cause any errors, but is +** inefficient. +*/ +typedef struct Fts5Tokenizer Fts5Tokenizer; +typedef struct fts5_tokenizer fts5_tokenizer; +struct fts5_tokenizer { + int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut); + void (*xDelete)(Fts5Tokenizer*); + int (*xTokenize)(Fts5Tokenizer*, + void *pCtx, + int flags, /* Mask of FTS5_TOKENIZE_* flags */ + const char *pText, int nText, + int (*xToken)( + void *pCtx, /* Copy of 2nd argument to xTokenize() */ + int tflags, /* Mask of FTS5_TOKEN_* flags */ + const char *pToken, /* Pointer to buffer containing token */ + int nToken, /* Size of token in bytes */ + int iStart, /* Byte offset of token within input text */ + int iEnd /* Byte offset of end of token within input text */ + ) + ); +}; + +/* Flags that may be passed as the third argument to xTokenize() */ +#define FTS5_TOKENIZE_QUERY 0x0001 +#define FTS5_TOKENIZE_PREFIX 0x0002 +#define FTS5_TOKENIZE_DOCUMENT 0x0004 +#define FTS5_TOKENIZE_AUX 0x0008 + +/* Flags that may be passed by the tokenizer implementation back to FTS5 +** as the third argument to the supplied xToken callback. */ +#define FTS5_TOKEN_COLOCATED 0x0001 /* Same position as prev. token */ + +/* +** END OF CUSTOM TOKENIZERS +*************************************************************************/ + +/************************************************************************* +** FTS5 EXTENSION REGISTRATION API +*/ +typedef struct fts5_api fts5_api; +struct fts5_api { + int iVersion; /* Currently always set to 2 */ + + /* Create a new tokenizer */ + int (*xCreateTokenizer)( + fts5_api *pApi, + const char *zName, + void *pContext, + fts5_tokenizer *pTokenizer, + void (*xDestroy)(void*) + ); + + /* Find an existing tokenizer */ + int (*xFindTokenizer)( + fts5_api *pApi, + const char *zName, + void **ppContext, + fts5_tokenizer *pTokenizer + ); + + /* Create a new auxiliary function */ + int (*xCreateFunction)( + fts5_api *pApi, + const char *zName, + void *pContext, + fts5_extension_function xFunction, + void (*xDestroy)(void*) + ); +}; + +/* +** END OF REGISTRATION API +*************************************************************************/ + +#ifdef __cplusplus +} /* end of the 'extern "C"' block */ +#endif + +#endif /* _FTS5_H */ + +/******** End of fts5.h *********/ diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/pnp/linux/pnpimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/pnp/linux/pnpimpl.h new file mode 100644 index 0000000..54e6676 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/pnp/linux/pnpimpl.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file pnp/linux/pnpimpl.h + @brief Declares the AJAPnpImpl class. + @copyright (C) 2011-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_PNP_IMPL_H +#define AJA_PNP_IMPL_H + +#include "ajabase/pnp/pnp.h" + +class AJAPnpImpl +{ +public: + AJAPnpImpl(); + virtual ~AJAPnpImpl(void); + + AJAStatus Install(AJAPnpCallback callback, void* refCon, uint32_t devices); + AJAStatus Uninstall(void); + + AJAPnpCallback GetCallback(); + void* GetRefCon(); + uint32_t GetPnpDevices(); + +private: + + void* mRefCon; + AJAPnpCallback mCallback; + uint32_t mDevices; +}; + +#endif // AJA_PNP_IMPL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/pnp/mac/devicenotifier.h b/build_dependencies/aja/include/ajalibraries/ajabase/pnp/mac/devicenotifier.h new file mode 100644 index 0000000..5ad9c24 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/pnp/mac/devicenotifier.h @@ -0,0 +1,96 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file devicenotifier.h + @brief Declares the MacOS-specific KonaNotifier and DeviceNotifier classes, which invoke + a client-registered callback function when devices are attached and/or detached. + @copyright (C) 2011-2021 AJA Video Systems, Inc. +**/ + +#if !defined (__DEVICE_NOTIFIER_H__) + #define __DEVICE_NOTIFIER_H__ + + #include + #include + #include + #include + #include + #include + #include + + #define kAJADeviceInitialOpen 0xAA1 + #define kAJADeviceTerminate 0xAA2 + + + /** + @brief Mac-specific device add/change/remove event notification callback function. + **/ + typedef void (*DeviceClientCallback)(unsigned long message, void * refcon); + + + /** + @brief Mac-specific class that notifies clients when AJA devices are attached/detached, etc. + **/ + class DeviceNotifier + { + // Instance Methods + public: + + DeviceNotifier (DeviceClientCallback callback, void *refcon); + virtual ~DeviceNotifier (); + virtual bool Install (CFMutableDictionaryRef dict = NULL); + virtual void Uninstall (); + + // alternate way to set callback + virtual void SetCallback (DeviceClientCallback callback, void *refcon); + + protected: + // override these + inline virtual CFMutableDictionaryRef CreateMatchingDictionary () {return NULL;} + virtual CFMutableDictionaryRef CreateMatchingDictionary (CFStringRef deviceDriverName); + + // callbacks + virtual void DeviceAdded (io_iterator_t iterator); + virtual void DeviceRemoved (io_iterator_t iterator); + virtual void DeviceChanged (io_service_t unitService, natural_t messageType, void* message); + + // util + virtual void AddGeneralInterest (io_object_t service); + + // Class Methods + public: + //static void SetDebugLogging (const uint64_t inWhichUserClientCommands); + static std::string MessageTypeToStr (const natural_t messageType); + + // Non-Public Class Methods + static void DeviceAddedCallback ( DeviceNotifier* thisObject, io_iterator_t iterator); + static void DeviceRemovedCallback ( DeviceNotifier* thisObject, io_iterator_t iterator); + static void DeviceChangedCallback ( DeviceNotifier * thisObject, + io_service_t unitService, + natural_t messageType, + void * message); + // Instance Data + protected: + void * m_refcon; + DeviceClientCallback m_clientCallback; + mach_port_t m_masterPort; + IONotificationPortRef m_notificationPort; + CFMutableDictionaryRef m_matchingDictionary; + std::list m_deviceMatchList; + std::list m_deviceInterestList; + + }; // DeviceNotifier + + + /** + @brief Subclass of DeviceNotifier that notifies clients when Kona/Corvid/Io/TTap devices are attached/detached. + **/ + class KonaNotifier : public DeviceNotifier + { + public: + inline KonaNotifier (DeviceClientCallback callback, void *refcon) + : DeviceNotifier (callback, refcon) {} + inline virtual ~KonaNotifier () {} + virtual bool Install (CFMutableDictionaryRef dict = NULL); + }; + +#endif // __DEVICE_NOTIFIER_H__ diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/pnp/mac/masterport.h b/build_dependencies/aja/include/ajalibraries/ajabase/pnp/mac/masterport.h new file mode 100644 index 0000000..1d0824f --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/pnp/mac/masterport.h @@ -0,0 +1,50 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file pnp/mac/masterport.h + @brief Declares the MasterPort class. + @copyright (C) 2013-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#if !defined (__MASTERPORT_H__) + #define __MASTERPORT_H__ + + // Includes + #include "ajabase/common/ajarefptr.h" + #include + #include + + + /** + @brief I'm a wrapper class for IONotificationPortRef that provides automatic clean-up. + **/ + class MasterPort; + typedef AJARefPtr MasterPortPtr; + + class MasterPort + { + // Class Methods + public: + static IONotificationPortRef Get (void); + static MasterPortPtr GetInstance (void); + private: + static bool Create (MasterPortPtr & outObj); + + // Instance Methods + public: + virtual ~MasterPort (); + virtual inline IONotificationPortRef GetPortRef (void) const {return mpMasterPort;} + virtual inline operator IONotificationPortRef () const {return GetPortRef ();} + virtual inline bool IsOkay (void) const {return GetPortRef () ? true : false;} + + private: + explicit MasterPort (); + inline MasterPort (const MasterPort & inObj) {if (&inObj != this) assert (false);} + inline MasterPort & operator = (const MasterPort & inRHS) {if (&inRHS != this) assert (false); return *this;} + + // Instance Data + private: + IONotificationPortRef mpMasterPort; /// My master port reference + + }; // MasterPort + +#endif // __MASTERPORT_H__ diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/pnp/mac/pnpimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/pnp/mac/pnpimpl.h new file mode 100644 index 0000000..129bc9b --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/pnp/mac/pnpimpl.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file pnp/mac/pnpimpl.h + @brief Declares the AJAPnpImpl class. + @copyright (C) 2011-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_PNP_IMPL_H +#define AJA_PNP_IMPL_H + +#include "ajabase/pnp/pnp.h" + +class DeviceNotifier; + + +class AJAPnpImpl +{ +public: + AJAPnpImpl(); + virtual ~AJAPnpImpl(void); + + AJAStatus Install (AJAPnpCallback callback, void* refCon, uint32_t devices); + AJAStatus Uninstall (void); + + inline AJAPnpCallback GetCallback() const {return mCallback;} + inline void * GetRefCon() const {return mRefCon;} + inline uint32_t GetPnpDevices() const {return mDevices;} + +private: + void* mRefCon; + AJAPnpCallback mCallback; + uint32_t mDevices; + + DeviceNotifier* mPciDevices; +}; + +#endif // AJA_PNP_IMPL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/pnp/pnp.h b/build_dependencies/aja/include/ajalibraries/ajabase/pnp/pnp.h new file mode 100644 index 0000000..0e392e3 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/pnp/pnp.h @@ -0,0 +1,131 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file pnp/pnp.h + @brief Declares the AJAPnp (plug-and-play) class. + @copyright (C) 2011-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_PNP_H +#define AJA_PNP_H + +#include "ajabase/common/public.h" + + +typedef enum +{ + AJA_Pnp_PciVideoDevices = (1 << 0), + AJA_Pnp_UsbSerialDevices = (1 << 1), + AJA_Pnp_FireWireDevices = (1 << 2) +} AJAPnpDevice; + + +typedef enum +{ + AJA_Pnp_DeviceAdded, + AJA_Pnp_DeviceRemoved, + AJA_Pnp_DeviceOnline, + AJA_Pnp_DeviceOffline, + AJA_Pnp_DeviceGoingToSleep, + AJA_Pnp_DeviceWakingUp +} AJAPnpMessage; + + +/** + @brief If installed (see AJAPnp::Install) in an AJAPnp instance, this function is called when + an AJA device is attached/detached, powered on/off, etc. + @param[in] inMessage Specifies the message (i.e., added, removed, etc.). + @param[in] inRefCon Specifies the reference cookie that was passed to AJAPnp::Install. +**/ +typedef void (*AJAPnpCallback)(AJAPnpMessage inMessage, void * inRefCon); + + +// forward declarations. +class AJAPnpImpl; + +/** + @brief This is a platform-agnostic plug-and-play class that notifies a client when AJA devices are + attached/detached, powered on/off, sleep/wake, etc. + @ingroup AJAGroupPnp + @bug This class has no Linux implementation. +**/ +class AJA_EXPORT AJAPnp +{ +public: // INSTANCE METHODS + + /** + * @brief Default constructor. + */ + AJAPnp(); + + /** + * @brief Default destructor. + */ + virtual ~AJAPnp(); + + /** + * @brief Installs the given plug-n-play notification callback function, replacing any callback function that + * may have been installed previously. If any matching devices are attached to the host, the callback + * function is immediately called for each attached device with the AJA_Pnp_DeviceAdded message. + * + * @param[in] callback Specifies a pointer to a client-defined function to be called when AJA devices + * sleep/wake or are attached/detached to/from the host. If non-NULL, must be valid. + * @param[in] refCon Specifies a pointer-sized reference cookie that gets passed to the callback function. + * Defaults to NULL. + * @param[in] devices Specifies a bit mask that filters which devices to include/ignore (see implementation). + * Use zero (the default) to see all possible devices. + * + * @bug The current Windows implementation doesn't automatically invoke the callback for each attached device. + * As a workaround, the caller must explicitly enumerate the devices immediately before or after calling + * this function. + * + * @return AJA_STATUS_SUCCESS Install succeeded + * AJA_STATUS_FAIL Install failed + */ + virtual AJAStatus Install(AJAPnpCallback callback, void* refCon= NULL, uint32_t devices = 0); + + /** + * @return the address of the currently-installed callback (NULL if none installed). + */ + virtual AJAPnpCallback GetCallback() const; + + /** + * @brief Uninstalls any previously-installed callback notifier. + * @return AJA_STATUS_SUCCESS Uninstall succeeded + * AJA_STATUS_FAIL Uninstall failed + */ + virtual AJAStatus Uninstall(); + + /** + * @return the currently installed reference cookie. + */ + virtual void* GetRefCon() const; + + /** + * @return the current bit mask that filters which devices to include or ignore (see implementation). + */ + virtual uint32_t GetPnpDevices() const; + + +private: // INSTANCE METHODS + /** + * @brief Hidden copy constructor. + * + * @param[in] inObjToCopy Specifies the object to be copied. + **/ + AJAPnp (const AJAPnp & inObjToCopy); + + + /** + * @brief Hidden assignment operator. + * + * @param[in] inObjToCopy Specifies the object to be copied. + **/ + virtual AJAPnp & operator= (const AJAPnp & inObjToCopy); + + +private: // INSTANCE DATA + AJAPnpImpl * mpImpl; ///< @brief My platform-specific implementation object + +}; // AJAPnp + +#endif // AJA_PNP_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/pnp/windows/pnpimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/pnp/windows/pnpimpl.h new file mode 100644 index 0000000..3553713 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/pnp/windows/pnpimpl.h @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file pnp/windows/pnpimpl.h + @brief Declares the AJAPnpImpl class. + @copyright (C) 2011-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_PNP_IMPL_H +#define AJA_PNP_IMPL_H + +#include +#include "ajabase/pnp/pnp.h" + +class AJAPnpImpl +{ +public: + AJAPnpImpl(); + virtual ~AJAPnpImpl(void); + + AJAStatus Install(AJAPnpCallback callback, void* refCon, uint32_t devices); + AJAStatus Uninstall(void); + + AJAPnpCallback GetCallback(); + void* GetRefCon(); + uint32_t GetPnpDevices(); + void AddSignaled(); + void RemoveSignaled(); + +private: + + void* mRefCon; + AJAPnpCallback mCallback; + uint32_t mDevices; + HANDLE mAddEventHandle; + HANDLE mAddWaitHandle; + HANDLE mRemoveEventHandle; + HANDLE mRemoveWaitHandle; + bool mbInstalled; +}; + +#endif // AJA_PNP_IMPL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/atomic.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/atomic.h new file mode 100644 index 0000000..4c0000e --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/atomic.h @@ -0,0 +1,134 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file atomic.h + @brief Declares the AJAAtomic class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_ATOMIC_H +#define AJA_ATOMIC_H + +#include "ajabase/common/public.h" + +/** + * Collection of system independent atomic functions. + * @ingroup AJAGroupSystem + */ +class AJA_EXPORT AJAAtomic +{ +public: + + AJAAtomic(); + virtual ~AJAAtomic(); + + /** + * Exchange the pointer value with the target. + * + * @param[in,out] pTarget The target of the exchange. + * @param[in] pValue The value to exchange with the target. + * @return The value of the target before the exchange. + */ + static void* Exchange(void* volatile* pTarget, void* pValue); + + /** + * Exchange the integer value with the target. + * + * @param[in,out] pTarget The target of the exchange. + * @param[in] value The value to exchange with the target. + * @return The value of the target before the exchange. + */ + static int32_t Exchange(int32_t volatile* pTarget, int32_t value); + + /** + * Increment the integer target. + * + * @param[in, out] pTarget The target to increment. + * @return The target value post increment. + */ + static int32_t Increment(int32_t volatile* pTarget); + + /** + * Decrement the integer target. + * + * @param[in,out] pTarget The target to decrement. + * @return The target value post decrement. + */ + static int32_t Decrement(int32_t volatile* pTarget); + + /** + * Exchange unsigned integer value and target. + * + * @param[in,out] pTarget The target of the exchange. + * @param[in] value The value to exchange with the target. + * @return The value of the target before the exchange. + */ + static uint32_t Exchange(uint32_t volatile* pTarget, uint32_t value); + + /** + * Increment the unsigned integer target. + * + * @param[in,out] pTarget The target to increment. + * @return The target value post increment. + */ + static uint32_t Increment(uint32_t volatile* pTarget); + + /** + * Decrement the unsigned integer target. + * + * @param[in,out] pTarget The target to decrement. + * @return The target value post decrement. + */ + static uint32_t Decrement(uint32_t volatile* pTarget); + + /** + * Exchange the integer value with the target. + * + * @param[in,out] pTarget The target of the exchange. + * @param[in] value The value to exchange with the target. + * @return The value of the target before the exchange. + */ + static int64_t Exchange(int64_t volatile* pTarget, int64_t value); + + /** + * Increment the integer target. + * + * @param[in, out] pTarget The target to increment. + * @return The target value post increment. + */ + static int64_t Increment(int64_t volatile* pTarget); + + /** + * Decrement the integer target. + * + * @param[in,out] pTarget The target to decrement. + * @return The target value post decrement. + */ + static int64_t Decrement(int64_t volatile* pTarget); + + /** + * Exchange unsigned integer value and target. + * + * @param[in,out] pTarget The target of the exchange. + * @param[in] value The value to exchange with the target. + * @return The value of the target before the exchange. + */ + static uint64_t Exchange(uint64_t volatile* pTarget, uint64_t value); + + /** + * Increment the unsigned integer target. + * + * @param[in,out] pTarget The target to increment. + * @return The target value post increment. + */ + static uint64_t Increment(uint64_t volatile* pTarget); + + /** + * Decrement the unsigned integer target. + * + * @param[in,out] pTarget The target to decrement. + * @return The target value post decrement. + */ + static uint64_t Decrement(uint64_t volatile* pTarget); +}; + +#endif // AJAAtomic diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/debug.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/debug.h new file mode 100644 index 0000000..f299034 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/debug.h @@ -0,0 +1,733 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file debug.h + @brief Declares the AJADebug class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_DEBUG_H +#define AJA_DEBUG_H + +#include +#include +#include "ajabase/common/public.h" +#include "ajabase/system/debugshare.h" + + + +/** @defgroup AJAGroupMacro AJA Debug Macros + * The macros are used to generate messages and assertions. + * @ingroup AJAGroupDebug + * @{ + */ + +/** @def AJA_ASSERT(_expression_) + * Assert if _expression_ is false. + * @hideinitializer + * + * This macro provides the file name and line number of the reporting module. + * + * @param[in] _expression_ Boolean expression that should be false only in an exceptional condition. + */ + +/** @def AJA_REPORT(_index_, _severity_, _format_) + * Report debug messages to active destinations. + * @hideinitializer + * + * This macro provides the file name and line number of the reporting module. + * + * @param[in] _index_ Send message to this destination index. + * @param[in] _severity_ Severity (::AJADebugSeverity) of the message to report. + * @param[in] _format_ Format parameters passed to vsprintf. The first is the format itself. + */ + +#if defined(AJA_WINDOWS) + + #if defined(AJA_DEBUG) + #define AJA_ASSERT(_expression_) \ + if (!(_expression_)) AJADebug::AssertWithMessage(__FILE__, __LINE__, #_expression_); + #define AJA_PRINT(...) \ + AJADebug::Report(0, AJA_DebugSeverity_Debug, NULL, 0, __VA_ARGS__) + #else + #define AJA_ASSERT(_expression_) + #define AJA_PRINT(...) + #endif + + #define AJA_REPORT(_index_, _severity_, ...) \ + AJADebug::Report(_index_, _severity_, __FILE__, __LINE__, __VA_ARGS__); + +#elif defined(AJA_LINUX) + + #if defined(AJA_DEBUG) + #define AJA_ASSERT(_expression_) \ + if(!(_expression_)) AJADebug::AssertWithMessage(NULL, 0, #_expression_); + #define AJA_PRINT(...) \ + AJADebug::Report(0, AJA_DebugSeverity_Error, NULL, 0, __VA_ARGS__) + #else + #define AJA_ASSERT(_expression_) + #define AJA_PRINT(...) + #endif + + #define AJA_REPORT(_index_, _severity_, ...) \ + AJADebug::Report(_index_, _severity_, __FILE__, __LINE__, __VA_ARGS__); + +#elif defined(AJA_MAC) + + #if defined(AJA_DEBUG) + #define AJA_ASSERT(_expression_) \ + if (!(_expression_)) AJADebug::AssertWithMessage(__FILE__, __LINE__, #_expression_); + #if !defined (AJA_PRINTTYPE) + #define AJA_PRINTTYPE 0 + #endif // if AJA_PRINTTYPE undefined + #if (AJA_PRINTTYPE==0) + #define AJA_PRINT(...) \ + AJADebug::Report(0, AJA_DebugSeverity_Error, NULL, 0, __VA_ARGS__) + #elif (AJA_PRINTTYPE==1) + #include + #define AJA_PRINT(_format_...) printf(_format_) + #elif (AJA_PRINTTYPE==3) + #include + #define AJA_PRINT(_format_...) fprintf(stderr, _format_) + #elif (AJA_PRINTTYPE==4) + #include + #include + #define AJA_PRINT(_format_...) syslog(LOG_ERR, _format_) + #endif + #else + #define AJA_ASSERT(_expression_) + #define AJA_PRINT(...) + #endif + + #define AJA_REPORT(_index_, _severity_, ...) \ + AJADebug::Report(_index_, _severity_, __FILE__, __LINE__, __VA_ARGS__); + +#else + + #if defined(AJA_DEBUG) + #define AJA_ASSERT(_expression_) \ + if(!(_expression_)) AJADebug::AssertWithMessage(NULL, 0, #_expression_); + #define AJA_PRINT(_format_,...) \ + AJADebug::Report(0, AJA_DebugSeverity_Error, NULL, 0, _format_) + #else + #define AJA_ASSERT(_expression_) + #define AJA_PRINT(_format_,...) + #endif + + #define AJA_REPORT(_index_, _severity_, _format_) \ + AJADebug::Report(_index_, _severity_, NULL, 0, _format_); + +#endif + + + +// Handy ostream-based macros... + +#define AJA_sASSERT(_expr_) do { std::ostringstream __ss__; __ss__ << #_expr_; \ + AJADebug::AssertWithMessage(__FILE__, __LINE__, __ss__.str()); \ + } while (false) + + +/** @def AJA_sREPORT(_index_, _severity_, _expr_) + * Report a message to active destinations using the given std::ostream expression. + * @hideinitializer + * + * This macro provides the file name and line number of the reporting module. + * + * @param[in] _index_ Specifies the message classification as an ::AJADebugUnit. + * @param[in] _severity_ Severity (::AJADebugSeverity) of the message to report. + * @param[in] _expr_ The message to report, as a std::ostream expression (e.g. "Foo" << std::hex << 3500). + */ +#define AJA_sREPORT(_index_,_severity_,_expr_) do {std::ostringstream __ss__; __ss__ << _expr_; \ + AJADebug::Report((_index_), (_severity_), __FILE__, __LINE__, __ss__.str()); \ + } while (false) + +/** @def AJA_sEMERGENCY(_index_, _expr_) + * Reports a ::AJA_DebugSeverity_Emergency message to active destinations using the given std::ostream expression. + * @hideinitializer + * + * This macro provides the file name and line number of the reporting module. + * + * @param[in] _index_ Specifies the message classification as an ::AJADebugUnit. + * @param[in] _expr_ The message to report, as a std::ostream expression. + */ +#define AJA_sEMERGENCY(_index_,_expr_) AJA_sREPORT((_index_), AJA_DebugSeverity_Emergency, _expr_) + +/** @def AJA_sALERT(_index_, _expr_) + * Reports a ::AJA_DebugSeverity_Alert message to active destinations using the given std::ostream expression. + * @hideinitializer + * + * This macro provides the file name and line number of the reporting module. + * + * @param[in] _index_ Specifies the message classification as an ::AJADebugUnit. + * @param[in] _expr_ The message to report, as a std::ostream expression. + */ +#define AJA_sALERT(_index_,_expr_) AJA_sREPORT((_index_), AJA_DebugSeverity_Alert, _expr_) + +/** @def AJA_sERROR(_index_, _expr_) + * Reports a ::AJA_DebugSeverity_Error message to active destinations using the given std::ostream expression. + * @hideinitializer + * + * This macro provides the file name and line number of the reporting module. + * + * @param[in] _index_ Specifies the message classification as an ::AJADebugUnit. + * @param[in] _expr_ The message to report, as a std::ostream expression. + */ +#define AJA_sERROR(_index_,_expr_) AJA_sREPORT((_index_), AJA_DebugSeverity_Error, _expr_) + +/** @def AJA_sWARNING(_index_, _expr_) + * Reports a ::AJA_DebugSeverity_Warning message to active destinations using the given std::ostream expression. + * @hideinitializer + * + * This macro provides the file name and line number of the reporting module. + * + * @param[in] _index_ Specifies the message classification as an ::AJADebugUnit. + * @param[in] _expr_ The message to report, as a std::ostream expression. + */ +#define AJA_sWARNING(_index_,_expr_) AJA_sREPORT((_index_), AJA_DebugSeverity_Warning, _expr_) + +/** @def AJA_sNOTICE(_index_, _expr_) + * Reports a ::AJA_DebugSeverity_Notice message to active destinations using the given std::ostream expression. + * @hideinitializer + * + * This macro provides the file name and line number of the reporting module. + * + * @param[in] _index_ Specifies the message classification as an ::AJADebugUnit. + * @param[in] _expr_ The message to report, as a std::ostream expression. + */ +#define AJA_sNOTICE(_index_,_expr_) AJA_sREPORT((_index_), AJA_DebugSeverity_Notice, _expr_) + +/** @def AJA_sINFO(_index_, _expr_) + * Reports a ::AJA_DebugSeverity_Info message to active destinations using the given std::ostream expression. + * @hideinitializer + * + * This macro provides the file name and line number of the reporting module. + * + * @param[in] _index_ Specifies the message classification as an ::AJADebugUnit. + * @param[in] _expr_ The message to report, as a std::ostream expression. + */ +#define AJA_sINFO(_index_,_expr_) AJA_sREPORT((_index_), AJA_DebugSeverity_Info, _expr_) + +/** @def AJA_sDEBUG(_index_, _expr_) + * Reports a ::AJA_DebugSeverity_Debug message to active destinations using the given std::ostream expression. + * @hideinitializer + * + * This macro provides the file name and line number of the reporting module. + * + * @param[in] _index_ Specifies the message classification as an ::AJADebugUnit. + * @param[in] _expr_ The message to report, as a std::ostream expression. + */ +#define AJA_sDEBUG(_index_,_expr_) AJA_sREPORT((_index_), AJA_DebugSeverity_Debug, _expr_) + +/** @} */ + + + +// forward declarations +class AJAMemory; + +/** + * @param[in] inStatus The AJAStatus value of interest. + * @return A string containing the given AJAStatus value as human-readable text. + */ +AJA_EXPORT std::string AJAStatusToString (const AJAStatus inStatus); + + +/** + * Debug class to generate debug output and assertions. + * @ingroup AJAGroupDebug + */ +class AJA_EXPORT AJADebug +{ +public: + + AJADebug() {} + virtual ~AJADebug() {} + + /** + * @return The debug facility's version number. + */ + static uint32_t Version (void); // New in SDK 16.0 + + /** + * @return The size of the debug facility's shared memory region. + */ + static uint32_t TotalBytes (void); // New in SDK 16.0 + + /** + * Initialize the debug system. + * + * Invoke before reporting debug messages. + * + * @param[in] incrementRefCount If true will increment the ref count in the shared memory, + * NOTE that this should only be true when used in something that is + * processing the log messages, like ajalogger. + * + * @return AJA_STATUS_SUCCESS Debug system initialized + * AJA_STATUS_FAIL Initialization failed + */ + static AJAStatus Open (bool incrementRefCount = false); + + /** + * Release resources used by the debug system. + * + * Invoke before application terminates. + * + * @param[in] decrementRefCount If true will decrement the ref count in the shared memory, + * NOTE that this should only be true when used in something that is + * processing the log messages, like ajalogger. + * + * @return AJA_STATUS_SUCCESS Debug system closed + * AJA_STATUS_FAIL Close failed + */ + static AJAStatus Close (bool decrementRefCount = false); + + /** + * Enable delivery of messages to the destination index. + * + * @param[in] index Specify the message destinations for this group index. + * @param[in] destination Bit array of message destinations (@link AJA_DEBUG_DESTINATION@endlink). + * @return AJA_STATUS_SUCCESS Destination enabled + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_RANGE Index out of range + */ + static AJAStatus Enable (int32_t index, uint32_t destination = AJA_DEBUG_DESTINATION_NONE); + + /** + * Disable delivery of messages to the destination index. + * + * @param[in] index Specify the message destinations for this group index. + * @param[in] destination Bit array of message destinations (@link AJA_DEBUG_DESTINATION@endlink). + * @return AJA_STATUS_SUCCESS Destination disabled + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_RANGE Index out of range + */ + static AJAStatus Disable (int32_t index, uint32_t destination = AJA_DEBUG_DESTINATION_NONE); + + /** + * Enable delivery of messages to the destination index. + * + * @param[in] index Specify the message destinations for this index. + * @param[in] destination Bit array of message destinations (@link AJA_DEBUG_DESTINATION@endlink). + * @return AJA_STATUS_SUCCESS Destination disabled + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_RANGE Index out of range + */ + static AJAStatus SetDestination (int32_t index, uint32_t destination = AJA_DEBUG_DESTINATION_NONE); + + /** + * Get the destination associated with a debug group. + * + * @param[in] inGroup Index of the group destination to return. + * @param[out] outDestination Receives the current destination + * @return AJA_STATUS_SUCCESS Destination disabled + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_RANGE Index out of range + * AJA_STATUS_NULL Null output pointer + */ + static AJAStatus GetDestination (const int32_t inGroup, uint32_t & outDestination); + + /** + * @param[in] index The destination index of interest. + * @return True if the debug facility is open, and the destination index is valid and active; otherwise false. + */ + static bool IsActive (int32_t index); + + /** + * @return True if the debug facility is open; otherwise false. + */ + static bool IsOpen (void); + + /** + * @return True if this class was built with AJA_DEBUG defined; otherwise false. + */ + static bool IsDebugBuild (void); + + /** + * Report debug message to the specified destination index. + * + * @param[in] index Report the message to this destination index. + * @param[in] severity Severity (::AJA_DEBUG_SEVERITY) of the message to report. + * @param[in] pFileName The source filename reporting the message. + * @param[in] lineNumber The line number in the source file reporting the message. + * @param[in] ... Format parameters to be passed to vsprintf. The first is the format itself. + */ + static void Report (int32_t index, int32_t severity, const char* pFileName, int32_t lineNumber, ...); + + /** + * Report debug message to the specified destination index. + * + * @param[in] index Report the message to this destination index. + * @param[in] severity Severity (::AJA_DEBUG_SEVERITY) of the message to report. + * @param[in] pFileName The source filename reporting the message. + * @param[in] lineNumber The line number in the source file reporting the message. + * @param[in] message The message to report. + */ + static void Report (int32_t index, int32_t severity, const char* pFileName, int32_t lineNumber, const std::string& message); + + /** + * Assert that an unexpected error has occurred. + * + * @param[in] pFileName The source file name reporting the assertion. + * @param[in] lineNumber The line number in the source file reporting the assertion. + * @param[in] pExpression Expression that caused the assertion. + */ + static void AssertWithMessage (const char* pFileName, int32_t lineNumber, const std::string& pExpression); + + /** + * @return The capacity of the debug logging facility's message ring. + */ + static uint32_t MessageRingCapacity (void); // New in SDK 16.0 + + /** + * Get the reference count for the number of clients accessing shared debug info + * + * @param[out] outRefCount Receives the current client reference count. + * @return AJA_STATUS_SUCCESS Reference count returned + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_RANGE Index out of range + * AJA_STATUS_NULL Null output pointer + */ + static AJAStatus GetClientReferenceCount (int32_t & outRefCount); + + /** + * Set the reference count for the number of clients accessing shared debug info + * NOTE: in normal circumstances this should never be used, if set to 0 or less + * the debug system will be closed (shared memory cleaned up) + * + * @param[in] refCount The client reference count to set. + * @return AJA_STATUS_SUCCESS Reference count set + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_RANGE Index out of range + */ + static AJAStatus SetClientReferenceCount (int32_t refCount); + + /** + * Get the sequence number of the latest message + * + * @param[out] outSequenceNumber Receives the current sequence number. + * @return AJA_STATUS_SUCCESS Sequence number returned + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_RANGE Index out of range + * AJA_STATUS_NULL Null output pointer + */ + static AJAStatus GetSequenceNumber (uint64_t & outSequenceNumber); + + /** + * Get the sequence number recorded in the message. + * + * @param[in] sequenceNumber Sequence number of the message. + * @param[out] outSequenceNumber Receives the sequence number recorded in the message. + * @return AJA_STATUS_SUCCESS Group index returned + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_RANGE Index out of range + * AJA_STATUS_NULL Null output pointer + */ + static AJAStatus GetMessageSequenceNumber (const uint64_t sequenceNumber, uint64_t & outSequenceNumber); + + /** + * Get the group index that reported the message. + * + * @param[in] sequenceNumber Sequence number of the message. + * @param[out] outGroupIndex Receives the group that reported the message. + * @return AJA_STATUS_SUCCESS Group index returned + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_RANGE Index out of range + * AJA_STATUS_NULL Null output pointer + */ + static AJAStatus GetMessageGroup (const uint64_t sequenceNumber, int32_t & outGroupIndex); + + /** + * Get the destination of the message. + * + * @param[in] sequenceNumber Sequence number of the message. + * @param[out] outDestination Receives the destination of the message. + * @return AJA_STATUS_SUCCESS Destination returned + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_RANGE Index out of range + * AJA_STATUS_NULL Null output pointer + */ + static AJAStatus GetMessageDestination (const uint64_t sequenceNumber, uint32_t & outDestination); + + /** + * Get the time the message was reported. + * + * @param[in] sequenceNumber Sequence number of the message. + * @param[out] outTime Receives the time the message was reported. + * @return AJA_STATUS_SUCCESS message time returned + * AJA_STATUS_OPEN debug system not open + * AJA_STATUS_RANGE index out of range + * AJA_STATUS_NULL null output pointer + */ + static AJAStatus GetMessageTime (const uint64_t sequenceNumber, uint64_t & outTime); + + /** + * Get the wall clock time the message was reported. + * + * @param[in] sequenceNumber Sequence number of the message. + * @param[out] outTime Receives the wall clock time the message was reported, as returned from time() + * @return AJA_STATUS_SUCCESS message time returned + * AJA_STATUS_OPEN debug system not open + * AJA_STATUS_RANGE index out of range + * AJA_STATUS_NULL null output pointer + */ + static AJAStatus GetMessageWallClockTime (const uint64_t sequenceNumber, int64_t & outTime); + + + /** + * Get the source file name that reported the message. + * + * @param[in] sequenceNumber Sequence number of the message. + * @param[out] outFileName Receives the source file name that reported the message. + * @return AJA_STATUS_SUCCESS Message file name returned + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_RANGE Index out of range + * AJA_STATUS_NULL Null output pointer + */ + static AJAStatus GetMessageFileName (const uint64_t sequenceNumber, std::string & outFileName); + + /** + * Get the source line number that reported the message. + * + * @param[in] sequenceNumber Sequence number of the message. + * @param[out] outLineNumber Receives the source line number that reported the message. + * @return AJA_STATUS_SUCCESS Sequence number returned + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_RANGE Index out of range + * AJA_STATUS_NULL Null output pointer + */ + static AJAStatus GetMessageLineNumber (const uint64_t sequenceNumber, int32_t & outLineNumber); + + /** + * Get the severity of the reported message. + * + * @param[in] sequenceNumber Sequence number of the message. + * @param[out] outSeverity Receives the severity of the reported message. + * @return AJA_STATUS_SUCCESS Message severity returned + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_RANGE Index out of range + * AJA_STATUS_NULL Null output pointer + */ + static AJAStatus GetMessageSeverity (const uint64_t sequenceNumber, int32_t & outSeverity); + + /** + * Get the message. + * + * @param[in] sequenceNumber Sequence number of the message. + * @param[out] outMessage Receives the message text + * @return AJA_STATUS_SUCCESS Message text returned + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_RANGE Index out of range + * AJA_STATUS_NULL Null output pointer + */ + static AJAStatus GetMessageText (const uint64_t sequenceNumber, std::string & outMessage); + + /** + * Get the Process Id that reported the message. + * + * @param[in] sequenceNumber Sequence number of the message. + * @param[out] outPid Process Id that reported the message. + * @return AJA_STATUS_SUCCESS message time returned + * AJA_STATUS_OPEN debug system not open + * AJA_STATUS_RANGE index out of range + * AJA_STATUS_NULL null output pointer + */ + static AJAStatus GetProcessId (const uint64_t sequenceNumber, uint64_t & outPid); + + /** + * Get the Thread Id that reported the message. + * + * @param[in] sequenceNumber Sequence number of the message. + * @param[out] outTid Receives the thread Id that reported the message. + * @return AJA_STATUS_SUCCESS message time returned + * AJA_STATUS_OPEN debug system not open + * AJA_STATUS_RANGE index out of range + * AJA_STATUS_NULL null output pointer + */ + static AJAStatus GetThreadId (const uint64_t sequenceNumber, uint64_t & outTid); + + /** + * Get the number of messages accepted into the ring since creation. + * + * @param[out] outCount Receives the number of messages + * @return AJA_STATUS_SUCCESS Number of messages returned + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_RANGE Index out of range + * AJA_STATUS_NULL Null output pointer + */ + static AJAStatus GetMessagesAccepted (uint64_t & outCount); + + /** + * Get the number of messages ignored and not put into the ring since creation. + * + * @param[out] outCount Receives the number of messages + * @return AJA_STATUS_SUCCESS Number of messages returned + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_RANGE Index out of range + * AJA_STATUS_NULL Null output pointer + */ + static AJAStatus GetMessagesIgnored (uint64_t & outCount); + + /** + * @param[in] severity The Severity of interest. + * @return A human-readable string containing the name associated with the given Severity value. + */ + static const std::string & SeverityName (const int32_t severity); + + + /** + * @param[in] group The Message Group of interest. + * @return A human-readable string containing the name associated with the given Message Group. + */ + static const std::string & GroupName (const int32_t group); + + /** + * Write group state to a file. + * + * @param[in] pFileName The group state file name. + * @return AJA_STATUS_SUCCESS State saved + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_NULL Null output pointer + */ + static AJAStatus SaveState (const char * pFileName); + + /** + * Read group state from a file. + * + * @param[in] pFileName The group state file name. + * @return AJA_STATUS_SUCCESS State restored + * AJA_STATUS_OPEN Debug system not open + * AJA_STATUS_NULL Null output pointer + */ + static AJAStatus RestoreState (const char * pFileName); + + /** + * @return The capacity of the debug facility's stats buffer. + */ + static uint32_t StatsCapacity (void); // New in SDK 16.0 + + /** + * @return True if stats are supported; otherwise false. + */ + static bool HasStats (void); // New in SDK 16.0 + + /** + * Registers/adds new stat, prepares for first use. + * + * @param[in] inKey The timer/counter key to be registered/allocated. + * @return AJA_STATUS_SUCCESS if successful. + */ + static AJAStatus StatAllocate (const uint32_t inKey); // New in SDK 16.0 + + /** + * Unregisters/deletes the given stat. + * + * @param[in] inKey The timer/counter to be unregistered/deleted. + * @return AJA_STATUS_SUCCESS if successful. + */ + static AJAStatus StatFree (const uint32_t inKey); // New in SDK 16.0 + + /** + * Answers if the given stat is allocated (in use). + * + * @param[in] inKey The timer/counter of interest. + * @return True if stat is allocated; otherwise false. + */ + static bool StatIsAllocated (const uint32_t inKey); // New in SDK 16.0 + + /** + * Resets/clears the given timer/counter stat. + * + * @param[in] inKey The timer/counter of interest. + * @return AJA_STATUS_SUCCESS if successful. + */ + static AJAStatus StatReset (const uint32_t inKey); // New in SDK 16.0 + + /** + * Starts the given timer stat by recording the host OS' high-resolution clock. + * + * @param[in] inKey The timer of interest. + * @return AJA_STATUS_SUCCESS if successful. + */ + static AJAStatus StatTimerStart (const uint32_t inKey); // New in SDK 16.0 + + /** + * Stops the given timer stat, storing the elapsed time since the last Start call + * into the timer's deque of elapsed times. + * + * @param[in] inKey The timer of interest. + * @return AJA_STATUS_SUCCESS if successful. + */ + static AJAStatus StatTimerStop (const uint32_t inKey); // New in SDK 16.0 + + /** + * Increments the given counter stat. + * + * @param[in] inKey The counter of interest. + * @param[in] inIncrement Optionally specifies the increment value. Defaults to 1. + * @return AJA_STATUS_SUCCESS if successful. + */ + static AJAStatus StatCounterIncrement (const uint32_t inKey, const uint32_t inIncrement = 1); // New in SDK 16.0 + + /** + * Records a new value for the stat. + * + * @param[in] inKey The counter of interest. + * @param[in] inValue Specifies the value. + * @return AJA_STATUS_SUCCESS if successful. + */ + static AJAStatus StatSetValue (const uint32_t inKey, const uint32_t inValue); // New in SDK 16.0 + + /** + * Answers with the given stat's info. + * + * @param[in] inKey The timer/counter of interest. + * @param[out] outInfo Receives the timer/counter info. + * @return AJA_STATUS_SUCCESS if successful. + */ + static AJAStatus StatGetInfo (const uint32_t inKey, AJADebugStat & outInfo); // New in SDK 16.0 + + /** + * Answers with the given stat's info. + * + * @param[out] outKeys Receives the list of allocated stats. + * @param[out] outSeqNum Receives the list change sequence number (to detect if the list changed). + * @return AJA_STATUS_SUCCESS if successful. + */ + static AJAStatus StatGetKeys (std::vector & outKeys, uint32_t & outSeqNum); // New in SDK 16.0 + + /** + * Get the current time at the debug rate. + * + * @return The current time in debug ticks. + */ + static int64_t DebugTime (void); + + // Old APIs + static const char* GetSeverityString (int32_t severity); + static const char* GetGroupString (int32_t group); + static AJAStatus GetDestination (int32_t index, uint32_t* pDestination) {return pDestination ? GetDestination(index, *pDestination) : AJA_STATUS_NULL;} + static AJAStatus GetClientReferenceCount (int32_t* pRefCount) {return pRefCount ? GetClientReferenceCount(*pRefCount) : AJA_STATUS_NULL;} + static AJAStatus GetSequenceNumber (uint64_t* pSequenceNumber) {return pSequenceNumber ? GetSequenceNumber(*pSequenceNumber) : AJA_STATUS_NULL;} + static AJAStatus GetMessageSequenceNumber (uint64_t sequenceNumber, uint64_t *pSequenceNumber) {return pSequenceNumber ? GetMessageSequenceNumber(sequenceNumber, *pSequenceNumber) : AJA_STATUS_NULL;} + static AJAStatus GetMessageGroup (uint64_t sequenceNumber, int32_t* pGroupIndex) {return pGroupIndex ? GetMessageGroup(sequenceNumber, *pGroupIndex) : AJA_STATUS_NULL;} + static AJAStatus GetMessageDestination (uint64_t sequenceNumber, uint32_t* pDestination) {return pDestination ? GetMessageDestination(sequenceNumber, *pDestination) : AJA_STATUS_NULL;} + static AJAStatus GetMessageTime (uint64_t sequenceNumber, uint64_t* pTime) {return pTime ? GetMessageTime(sequenceNumber, *pTime) : AJA_STATUS_NULL;} + static AJAStatus GetMessageWallClockTime (uint64_t sequenceNumber, int64_t *pTime) {return pTime ? GetMessageWallClockTime(sequenceNumber, *pTime) : AJA_STATUS_NULL;} + static AJAStatus GetMessageFileName (uint64_t sequenceNumber, const char** ppFileName); + static AJAStatus GetMessageLineNumber (uint64_t sequenceNumber, int32_t* pLineNumber) {return pLineNumber ? GetMessageLineNumber(sequenceNumber, *pLineNumber) : AJA_STATUS_NULL;} + static AJAStatus GetMessageSeverity (uint64_t sequenceNumber, int32_t* pSeverity) {return pSeverity ? GetMessageSeverity(sequenceNumber, *pSeverity) : AJA_STATUS_NULL;} + static AJAStatus GetMessageText (uint64_t sequenceNumber, const char** ppMessage); + static AJAStatus GetProcessId (uint64_t sequenceNumber, uint64_t* pPid) {return pPid ? GetProcessId(sequenceNumber, *pPid) : AJA_STATUS_NULL;} + static AJAStatus GetThreadId (uint64_t sequenceNumber, uint64_t* pTid) {return pTid ? GetThreadId(sequenceNumber, *pTid) : AJA_STATUS_NULL;} + static AJAStatus GetMessagesAccepted (uint64_t* pCount) {return pCount ? GetMessagesAccepted(*pCount) : AJA_STATUS_NULL;} + static AJAStatus GetMessagesIgnored (uint64_t* pCount) {return pCount ? GetMessagesIgnored(*pCount) : AJA_STATUS_NULL;} + + // Other APIs + static void * GetPrivateDataLoc (void); + static size_t GetPrivateDataLen (void); + +}; // AJADebug + +std::ostream & operator << (std::ostream & oss, const AJADebugStat & inStat); + +#endif // AJA_DEBUG_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/debugshare.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/debugshare.h new file mode 100644 index 0000000..0cbaf91 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/debugshare.h @@ -0,0 +1,302 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file debugshare.h + @brief Declares the constants used for sharing debug messages. These structures are used + to gather debug messages and share them with the applications that report and log. + @note This file is shared with drivers written in c. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_DEBUGSHARE_H +#define AJA_DEBUGSHARE_H + +/** + * The list of debug message severity codes. + * @ingroup AJAGroupDebug + */ +///@{ +typedef enum _AJADebugSeverity +{ + AJA_DebugSeverity_Emergency = 0, /**< System is unusable */ + AJA_DebugSeverity_Alert = 1, /**< Action must be taken immediately */ + AJA_DebugSeverity_Assert = 2, /**< Assert conditions */ + AJA_DebugSeverity_Error = 3, /**< Error conditions */ + AJA_DebugSeverity_Warning = 4, /**< Warning conditions */ + AJA_DebugSeverity_Notice = 5, /**< Normal but significant condition */ + AJA_DebugSeverity_Info = 6, /**< Informational */ + AJA_DebugSeverity_Debug = 7, /**< Debug-level messages */ + AJA_DebugSeverity_Size = 8 /**< Size of severity enum, must be last */ + +} AJADebugSeverity; +///@} + + +/** + * The list of debug message groups. + * @ingroup AJAGroupDebug + */ +///@{ +typedef enum _AJADebugUnit +{ + AJA_DebugUnit_Unknown = 0, + AJA_DebugUnit_Critical = 1, + AJA_DebugUnit_DriverGeneric = 2, + AJA_DebugUnit_ServiceGeneric = 3, + AJA_DebugUnit_UserGeneric = 4, + AJA_DebugUnit_VideoGeneric = 5, + AJA_DebugUnit_AudioGeneric = 6, + AJA_DebugUnit_TimecodeGeneric = 7, + AJA_DebugUnit_AncGeneric = 8, + AJA_DebugUnit_RoutingGeneric = 9, + AJA_DebugUnit_StatsGeneric = 10, + AJA_DebugUnit_Enumeration = 11, + AJA_DebugUnit_Application = 12, + AJA_DebugUnit_QuickTime = 13, + AJA_DebugUnit_ControlPanel = 14, + AJA_DebugUnit_Watcher = 15, + AJA_DebugUnit_Plugins = 16, + AJA_DebugUnit_CCLine21Decode = 17, + AJA_DebugUnit_CCLine21Encode = 18, + AJA_DebugUnit_CC608DataQueue = 19, + AJA_DebugUnit_CC608MsgQueue = 20, + AJA_DebugUnit_CC608Decode = 21, + AJA_DebugUnit_CC608DecodeChannel = 22, + AJA_DebugUnit_CC608DecodeScreen = 23, + AJA_DebugUnit_CC608Encode = 24, + AJA_DebugUnit_CC708Decode = 25, + AJA_DebugUnit_CC708Service = 26, + AJA_DebugUnit_CC708ServiceBlockQueue = 27, + AJA_DebugUnit_CC708Window = 28, + AJA_DebugUnit_CC708Encode = 29, + AJA_DebugUnit_CCFont = 30, + AJA_DebugUnit_SMPTEAnc = 31, + AJA_DebugUnit_AJAAncData = 32, + AJA_DebugUnit_AJAAncList = 33, + AJA_DebugUnit_Testing = 34, + AJA_DebugUnit_PnP = 35, + AJA_DebugUnit_Persistence = 36, + AJA_DebugUnit_Avid = 37, + AJA_DebugUnit_DriverInterface = 38, + AJA_DebugUnit_AutoCirculate = 39, + AJA_DebugUnit_NMOS = 40, + AJA_DebugUnit_App_DiskRead = 41, + AJA_DebugUnit_App_DiskWrite = 42, + AJA_DebugUnit_App_Decode = 43, + AJA_DebugUnit_App_Encode = 44, + AJA_DebugUnit_App_DMA = 45, + AJA_DebugUnit_App_Screen = 46, + AJA_DebugUnit_App_User1 = 47, + AJA_DebugUnit_App_User2 = 48, + AJA_DebugUnit_Anc2110Xmit = 49, + AJA_DebugUnit_Anc2110Rcv = 50, + AJA_DebugUnit_DemoPlayout = 51, + AJA_DebugUnit_DemoCapture = 52, + AJA_DebugUnit_CSC = 53, + AJA_DebugUnit_LUT = 54, + AJA_DebugUnit_Cables = 55, + AJA_DebugUnit_RPCServer = 56, + AJA_DebugUnit_RPCClient = 57, + AJA_DebugUnit_Firmware = 58, + + // to add a new unit: + // + // if there is an unused unit below: + // + // * rename the next available unused and move above this comment block + // * make sure the enum starts with "AJA_DebugUnit_" + // * update the value of AJA_DebugUnit_FirstUnused with the value of the new next available unused + // + // else if there are not any unused units below: + // + // * add the new unit above this message block with the next available index + // * make sure the enum starts with "AJA_DebugUnit_" + // * increment AJA_DebugUnit_Size by 1 + // + // if no more unused units + // * set AJA_DebugUnit_FirstUnused to the same value as AJA_DebugUnit_Size + // + AJA_DebugUnit_FirstUnused = 59, + AJA_DebugUnit_Unused_59 = AJA_DebugUnit_FirstUnused, + AJA_DebugUnit_Unused_60 = 60, + AJA_DebugUnit_Unused_61 = 61, + AJA_DebugUnit_Unused_62 = 62, + AJA_DebugUnit_Unused_63 = 63, + AJA_DebugUnit_Unused_64 = 64, + AJA_DebugUnit_Unused_65 = 65, + AJA_DebugUnit_Unused_66 = 66, + AJA_DebugUnit_Unused_67 = 67, + AJA_DebugUnit_Unused_68 = 68, + AJA_DebugUnit_Unused_69 = 69, + AJA_DebugUnit_Unused_70 = 70, + AJA_DebugUnit_Unused_71 = 71, + AJA_DebugUnit_Unused_72 = 72, + AJA_DebugUnit_Unused_73 = 73, + AJA_DebugUnit_Unused_74 = 74, + AJA_DebugUnit_Unused_75 = 75, + AJA_DebugUnit_Unused_76 = 76, + AJA_DebugUnit_Unused_77 = 77, + AJA_DebugUnit_Unused_78 = 78, + AJA_DebugUnit_Unused_79 = 79, + AJA_DebugUnit_Unused_80 = 80, + AJA_DebugUnit_Unused_81 = 81, + AJA_DebugUnit_Unused_82 = 82, + AJA_DebugUnit_Unused_83 = 83, + AJA_DebugUnit_Unused_84 = 84, + + AJA_DebugUnit_Size = 85 + +} AJADebugUnit; +///@} + + +/** + @defgroup AJAUnitDestination AJA_DEBUG_DESTINATION + Bit definitions that specify the destination of a debug message. + + @ingroup AJAGroupDebug + Use logical OR for multiple destinations. +**/ +///@{ +#define AJA_DEBUG_DESTINATION_NONE 0 /**< Unknown destination, used as default */ +#define AJA_DEBUG_DESTINATION_DEBUG 0x00000001 /**< Send message to the debug window */ +#define AJA_DEBUG_DESTINATION_CONSOLE 0x00000002 /**< Send message to the console */ +#define AJA_DEBUG_DESTINATION_LOG 0x00000004 /**< Send message to a log file */ +#define AJA_DEBUG_DESTINATION_DRIVER 0x00000008 /**< Send message directly to driver output (driver messages only) */ +///@} + +/** + @defgroup AJAGroupVarious AJA_DEBUG + Various parameters that define the characteristics of the shared debug memory space. + SDK 16.0 introduced a new stats measurement feature that still allows logging to work in pre-16.0 clients. + @ingroup AJAGroupDebug +**/ +///@{ +#define AJA_DEBUG_MAGIC_ID AJA_FOURCC('D','B','U','G') /**< Magic identifier of the debug system */ +#define AJA_DEBUG_VERSION 110 /**< Version of the debug system */ +#define AJA_DEBUG_UNIT_ARRAY_SIZE 65536 /**< Number of unit destinations */ +#define AJA_DEBUG_SEVERITY_ARRAY_SIZE 64 /**< Number of severity destinations */ +#define AJA_DEBUG_MAX_NUM_STATS 256 /**< Max number of individual stats measurements (multiple of 64) */ +#define AJA_DEBUG_STAT_DEQUE_SIZE 11 +#define AJA_DEBUG_MESSAGE_MAX_SIZE 512 /**< Maximum size of a message */ +#define AJA_DEBUG_MESSAGE_RING_SIZE 4096 /**< Size of the message ring */ +#define AJA_DEBUG_FILE_NAME_MAX_SIZE 512 /**< Maximum size of a file name */ +#define AJA_DEBUG_SHARE_NAME "aja-shm-debug" /**< Name of the shared memory for the debug messages */ +#define AJA_DEBUG_TICK_RATE 1000000 /**< Resolution of debug time in ticks/second */ +#define AJA_DEBUG_STATE_FILE_VERSION 510 /**< Version number of the state file format */ +///@} + +/** + Structure representing the debug message. + @ingroup AJAGroupDebug +**/ + +// using a 16 byte alignment for arm64 atomic operations to work properly +#pragma pack(push, 16) + +typedef struct _AJADebugMessage +{ + uint64_t sequenceNumber; /**< Sequence number of this message */ + int64_t time; /**< Time this message was generated (microseconds) */ + int64_t wallTime; /**< Time this message was generated as returned by time() */ + int32_t groupIndex; /**< Group that generated this message */ + uint32_t destinationMask; /**< Destination of the message */ + int32_t severity; /**< Severity of the message */ + int32_t lineNumber; /**< Source file line number that generated this message */ + uint64_t pid; /**< Process ID that generated the message */ + uint64_t tid; /**< Thread ID that generated the message */ + char fileName[AJA_DEBUG_FILE_NAME_MAX_SIZE]; /**< Source file name that generated this message */ + char messageText[AJA_DEBUG_MESSAGE_MAX_SIZE]; /**< Text generated for this message */ +} AJADebugMessage; + + +/** + 64-byte structure representing an unsigned 32-bit measurement (timer, counter or data value). + As a timer, it stores minimum, maximum and average elapsed time in microseconds. + As a data value, it stores minimum, maximum, moving average value, and last update usec timestamp. + As a counter, it can increment or decrement, with or without rollover/rollunder. + @ingroup AJAGroupDebug +**/ +class AJADebugStat +{ + public: + uint32_t fMin; /**< Smallest value yet seen. (Fixed at 0xFFFFFFFF and unused for counters.) */ + uint32_t fMax; /**< Largest value yet seen. (Fixed at zero and unused for counters.) */ + uint32_t fCount; /**< Update/change count */ + uint64_t fLastTimeStamp; /**< Timestamp (start time for timer, zero if not running; last update time for counter or data value) */ + uint32_t fValues[AJA_DEBUG_STAT_DEQUE_SIZE]; /**< Deque that provides an 11-sample moving average. (Unused for counters.) */ + + AJADebugStat() {Reset();} + + void Reset (void) + { + fMin = 0xFFFFFFFF; + fMax = fCount = 0; + fLastTimeStamp = 0; + for (size_t n(0); n < AJA_DEBUG_STAT_DEQUE_SIZE; n++) + fValues[n] = 0; + } + + double Average(void) const; /**< Returns the average of the stored values */ + uint64_t Sum (const size_t inNum = 0) const; /**< Returns the sum of the first "inNum" stored values */ + void Start (void); /**< Starts a timer by setting fLastTimeStamp to the high-resolution host OS system timestamp */ + + /** + * Stops the timer, stores the elapsed time in the deque, bumps fCount, and clears fLastTimeStamp. + * Also updates fMin and/or fMax if necessary. + */ + void Stop (void); + + /** + * Increments fCount by the given amount, and sets fLastTimeStamp. + * @param[in] inIncrement Optionally specifies a different increment value. Defaults to 1. + * @param[in] inRollOver Optionally controls if overflow is permitted. Defaults to true. + */ + void Increment (const uint32_t inIncrement = 1, const bool inRollOver = true); + + /** + * Decrements fCount by the given amount, and sets fLastTimeStamp. + * @param[in] inDecrement Optionally specifies a different increment value. Defaults to 1. + * @param[in] inRollUnder Optionally controls if underflow is permitted. Defaults to true. + */ + void Decrement (const uint32_t inDecrement = 1, const bool inRollUnder = true); + + /** + * Inserts the given value into the deque, bumps fCount, and sets fLastTimeStamp to the current time. + * @param[in] inValue Specifies the value to store. + * @param[in] inStamp Optionally specifies whether to set the timestamp or not. Defaults to true. + */ + void SetValue (const uint32_t inValue, const bool inStamp = true); +}; + + +/** + Structure representing the shared debug groups and messages. + @ingroup AJAGroupDebug +**/ +typedef struct _AJADebugShare +{ + uint32_t magicId; /**< Magic cookie identifier used to id this as an AJADebugShare structure */ + uint32_t version; /**< Version of the debug system */ + uint64_t volatile writeIndex; /**< Write index for the message ring */ + int32_t volatile clientRefCount; /**< A count of current number of clients using structure*/ + + uint32_t messageRingCapacity; /**< The number of messages that can be in the ring */ + uint32_t messageTextCapacity; /**< The maximum text capacity of message in bytes */ + uint32_t messageFileNameCapacity; /**< The maximum text capacity of message filename in bytes */ + uint32_t unitArraySize; /**< The number of unit destinations */ + + uint64_t volatile statsMessagesAccepted; /**< The number of messages accepted into the ring since creation */ + uint64_t volatile statsMessagesIgnored; /**< The number of messages ignored since creation, filtered out */ + + uint32_t statCapacity; /**< The number of stats that can be stored, or zero if no stat facility (new in SDK 16) */ + uint32_t volatile statAllocChanges; /**< Number of changes to statAllocMask (new in SDK 16.0) */ + uint64_t statAllocMask[AJA_DEBUG_MAX_NUM_STATS/64]; /**< Stats allocation bitmask, 1 bit per stats measurement (new in SDK 16.0) */ + uint32_t reserved[128 - 1 - 1 - 2*AJA_DEBUG_MAX_NUM_STATS/64]; /**< Reserved (was [128] in version 110) */ + uint32_t unitArray[AJA_DEBUG_UNIT_ARRAY_SIZE]; /**< Array of message destinations by unit */ + AJADebugMessage messageRing[AJA_DEBUG_MESSAGE_RING_SIZE]; /**< Message ring holding current message data */ + AJADebugStat stats[AJA_DEBUG_MAX_NUM_STATS]; /**< Per-stat measurement data (new in v111) */ +} AJADebugShare; + +#pragma pack(pop) + +#endif // AJA_DEBUGSHARE_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/diskstatus.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/diskstatus.h new file mode 100644 index 0000000..d415d00 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/diskstatus.h @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file diskstatus.h + @brief Declares the AJADiskStatus class. + @copyright (C) 2013-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_DISK_STATUS_H +#define AJA_DISK_STATUS_H + +#include "ajabase/common/public.h" + +typedef enum +{ + AJADiskStatusUnitTypeByte, + AJADiskStatusUnitTypeKiloByte, + AJADiskStatusUnitTypeMegaByte, + AJADiskStatusUnitTypeGigaByte +} AJADiskStatusUnitType; + +/** + * System independent disk status. + * @ingroup AJAGroupSystem + */ +class AJA_EXPORT AJADiskStatus +{ +public: + + AJADiskStatus(); + virtual ~AJADiskStatus(); + + /** + * Get the available free space and total drive space for path. + * + * @param[in] dirPath Path to the volume to get space info about. + * @param[out] freeSpace Available free space on volume in unitType units, is untouched if return is false. + * @param[out] totalSpace Total space on volume in unitType units, is untouched if return is false. + * @param[in] unitType Unit of measure for space values, B, KB, MB, GB + * @return true if successfully got space info for path, false for failure. + */ + static bool GetFreeAndTotalSpace(const char* dirPath, double& freeSpace, double& totalSpace, AJADiskStatusUnitType unitType = AJADiskStatusUnitTypeGigaByte); +}; + +#endif // AJA_DISK_STATUS_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/event.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/event.h new file mode 100644 index 0000000..ba325da --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/event.h @@ -0,0 +1,142 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file event.h + @brief Declares the AJAEvent class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_EVENT_H +#define AJA_EVENT_H + +#include "ajabase/common/public.h" +#include + +// forward declarations. +class AJAEventImpl; + +/** + * System independent event class for signaling between threads. + * @ingroup AJAGroupSystem + */ +class AJA_EXPORT AJAEvent +{ +public: + + friend AJA_EXPORT AJAStatus AJAWaitForEvents(AJAEvent*, uint32_t, bool, uint32_t); + + /** + * Constructor obtains an event object from the system. + * + * The event is automatically reset when the first waiting thread is released. Set manualReset + * to control the reset with the api. Specify a name if the event is to be shared system wide. + * + * @param[in] manualReset true if event must be reset by caller. + * false if event automatically reset. + * @param[in] name Name of a shared lock object. + */ + AJAEvent(bool manualReset = true, const std::string& name = ""); + virtual ~AJAEvent(); + + /** + * Set the event to the signaled state. + * + * @return AJA_STATUS_SUCCESS Event signaled + * AJA_STATUS_FAIL Signal failed + * AJA_STATUS_OPEN Event not initialized + */ + virtual AJAStatus Signal(); + + /** + * Set the event to a non signaled state. + * + * @return AJA_STATUS_SUCCESS Event cleared + * AJA_STATUS_FAIL Clear failed + * AJA_STATUS_OPEN Event not initialized + */ + virtual AJAStatus Clear(); + + /** + * Set the event to the state specified by the parameter signaled. + * + * @param[in] signaled True to signal, false to clear + * @return AJA_STATUS_SUCCESS State set + * AJA_STATUS_FAIL State not set + * AJA_STATUS_OPEN Event not initialized + */ + virtual AJAStatus SetState(bool signaled = true); + + /** + * Get the current state of the event. + * + * @param[out] pSignaled True if signaled + * @return AJA_STATUS_SUCCESS State available + * AJA_STATUS_OPEN Event not initialized + * AJA_STATUS_FAIL Event error + */ + virtual AJAStatus GetState(bool* pSignaled); + + /** + * Set the manual reset state. + * + * @param[in] manualReset True to enable manual signal reset, False to enabled automatically reset of signal + * @return AJA_STATUS_SUCCESS Manual reset state set + * AJA_STATUS_FAIL Manual reset state not set + */ + virtual AJAStatus SetManualReset(bool manualReset); + + /** + * Get the manual reset state. + * + * @param[out] pManualReset True indicates manually reset of signal is required, False indicates it is automatic + * @return AJA_STATUS_SUCCESS Manual reset state initialized + * AJA_STATUS_FAIL Manual reset state not initialized + */ + virtual AJAStatus GetManualReset(bool* pManualReset); + + /** + * Wait for the event to be signaled. + * + * @param[in] timeout Wait timeout in milliseconds. + * @return AJA_STATUS_SUCCESS Event was signaled + * AJA_STATUS_TIMEOUT Event wait timeout + * AJA_STATUS_OPEN Event not initialized + * AJA_STATUS_FAIL Event error + */ + virtual AJAStatus WaitForSignal(uint32_t timeout = 0xffffffff); + + /** + * Get the system event object. + * + * @param[out] pEventObject The system event object + * @return AJA_STATUS_SUCCESS Event object returned + * AJA_STATUS_OPEN Event not initialized + */ + virtual AJAStatus GetEventObject(uint64_t* pEventObject); + +private: + + AJAEventImpl* mpImpl; +}; + + /** + * Wait for a list of events to be signaled. + * @relates AJAEvent + * + * The wait can terminate when one or all of the events in the list is signaled. + * + * @param[in] pList An array of events (AJAEventPtr). + * @param[in] numEvents Number of events in the event array. + * @param[in] all true to wait for all events to be signaled. + * @param[in] timeout Wait timeout in milliseconds (0xffffffff infinite). + * @return AJA_STATUS_SUCCESS events signaled + * AJA_STATUS_TIMEOUT event wait timeout + * AJA_STATUS_OPEN event not initialized + * AJA_STATUS_RANGE numEvents out of range + * AJA_STATUS_FAIL event error + */ + AJA_EXPORT AJAStatus AJAWaitForEvents( AJAEvent* pList, + uint32_t numEvents, + bool all = true, + uint32_t timeout = 0xffffffff); + +#endif // AJA_EVENT_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/file_io.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/file_io.h new file mode 100644 index 0000000..465f8df --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/file_io.h @@ -0,0 +1,322 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file file_io.h + @brief Declares the AJAFileIO class. + @copyright (C) 2011-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_FILE_IO_H +#define AJA_FILE_IO_H + + +#include "ajabase/common/types.h" +#include "ajabase/common/public.h" +#include "ajabase/system/system.h" +#include +#include + +#if defined(AJA_WINDOWS) + const char AJA_PATHSEP = '\\'; + const wchar_t AJA_PATHSEP_WIDE = L'\\'; +#else + const char AJA_PATHSEP = '/'; + const wchar_t AJA_PATHSEP_WIDE = L'/'; +#endif + +typedef enum +{ + eAJACreateAlways = 1, + eAJACreateNew = 2, + eAJATruncateExisting = 4, + + eAJAReadOnly = 8, + eAJAWriteOnly = 16, + eAJAReadWrite = 32 +} AJAFileCreationFlags; + + +typedef enum +{ + eAJABuffered = 1, + eAJAUnbuffered = 2, + eAJANoCaching = 4 +} AJAFileProperties; + + +typedef enum +{ + eAJASeekSet, + eAJASeekCurrent, + eAJASeekEnd +} AJAFileSetFlag; + + +/** + * The File I/O class proper. + * @ingroup AJAGroupSystem + */ +class AJA_EXPORT AJAFileIO +{ +public: + AJAFileIO(); + ~AJAFileIO(); + + /** + * Open a file. + * + * @param[in] fileName The fully qualified file name + * @param[in] flags The way in which the file is opened + * @param[in] properties Indicates whether the file is buffered or not + * + * @return AJA_STATUS_SUCCESS A file has been successfully opened + * AJA_STATUS_FAIL A file could not be opened + */ + AJAStatus Open( + const std::string & fileName, + const int flags, + const int properties); + + AJAStatus Open( + const std::wstring & fileName, + const int flags, + const int properties); + + /** + * Close a file. + * + * @return AJA_STATUS_SUCCESS The file was successfully closed + * AJA_STATUS_FAIL The file could not be closed + */ + AJAStatus Close(); + + /** + * Tests for a valid open file. + * + * @return bool 'true' if a valid file is available + */ + bool IsOpen(); + + /** + * Read the contents of the file. + * + * @param[out] pBuffer The buffer to be written to + * @param[in] length The number of bytes to be read + * + * @return uint32_t The number of bytes actually read + */ + uint32_t Read(uint8_t* pBuffer, const uint32_t length); + + /** + * Read the contents of the file. + * + * @param[out] buffer The buffer to be written to + * @param[in] length The number of bytes to be read + * + * @return uint32_t The number of bytes actually read + */ + uint32_t Read(std::string& buffer, const uint32_t length); + + /** + * Write the contents of the file. + * + * @param[in] pBuffer The buffer to be written out + * @param[in] length The number of bytes to be written + * + * @return uint32_t The number of bytes actually written + */ + uint32_t Write(const uint8_t* pBuffer, const uint32_t length) const; + + /** + * Write the contents of the file. + * + * @param[in] buffer The buffer to be written out + * + * @return uint32_t The number of bytes actually written + */ + uint32_t Write(const std::string& buffer) const; + + /** + * Flush the cache + * + * @return AJA_STATUS_SUCCESS Was able to sync file + */ + AJAStatus Sync(); + + /** + * Truncates the file. + * + * @param[in] offset The size offset of the file + * + * @return AJA_STATUS_SUCCESS Was able to truncate file + */ + AJAStatus Truncate(int32_t offset); + + /** + * Retrieves the offset of the file pointer from the start of a file. + * + * @return int64_t The position of the file pointer, -1 if error + */ + int64_t Tell(); + + /** + * Moves the offset of the file pointer. + * + * @param[in] distance The distance to move the file pointer + * @param[in] flag Describes from whence to move the file pointer + * + * @return AJA_STATUS_SUCCESS The position of the file pointer was moved + */ + AJAStatus Seek(const int64_t distance, const AJAFileSetFlag flag) const; + + /** + * Get some basic file info + * + * @param[out] createTime Time of file creation, measured in seconds since 1970 + * @param[out] modTime Last time file was modified, measured in seconds since 1970 + * @param[out] size Size of the file in bytes + * + * @return AJA_STATUS_SUCCESS Was able to get info from the file + */ + AJAStatus FileInfo(int64_t& createTime, int64_t& modTime, int64_t& size); + AJAStatus FileInfo(int64_t& createTime, int64_t& modTime, int64_t& size, std::string& filePath); + + /** + * Test file to see if it exists + * + * @param[in] fileName The fully qualified file name + * + * @return bool true if file exists + */ + static bool FileExists(const std::wstring& fileName); + static bool FileExists(const std::string& fileName); + + /** + * Remove the file for the system + * + * @param[in] fileName The fully qualified file name + * + * @return AJA_STATUS_SUCCESS The file was successfully deleteed + * AJA_STATUS_FAIL The file could not be deleted + */ + static AJAStatus Delete(const std::string& fileName); + static AJAStatus Delete(const std::wstring& fileName); + + /** + * Retrieves a set of files from a directory. + * Changes the current directory. + * + * @param[in] directory The path to the directory + * @param[in] filePattern The pattern within the directory to match + * @param[out] fileContainer The files that match the file pattern + * + * @return AJA_STATUS_SUCCESS The returned container has a size > 0 + */ + static AJAStatus ReadDirectory( + const std::string& directory, + const std::string& filePattern, + std::vector& fileContainer); + + static AJAStatus ReadDirectory( + const std::wstring& directory, + const std::wstring& filePattern, + std::vector& fileContainer); + + /** + * Tests if a directory contains a file that matches the pattern. + * Does not change the current directory. + * + * @param[in] directory The path to the directory + * @param[in] filePattern The pattern within the directory to match + * + * @return AJA_STATUS_SUCCESS If the directory has at least one matching file + */ + static AJAStatus DoesDirectoryContain( + const std::string& directory, + const std::string& filePattern); + + static AJAStatus DoesDirectoryContain( + const std::wstring& directory, + const std::wstring& filePattern); + + /** + * Tests if a directory exists. + * Does not change the current directory. + * + * @param[in] directory The path to the directory + * + * @return AJA_STATUS_SUCCESS If and only if the directory exists + */ + static AJAStatus DoesDirectoryExist(const std::string& directory); + static AJAStatus DoesDirectoryExist(const std::wstring& directory); + + /** + * Tests if a directory is empty. + * Does not change the current directory. + * + * @param[in] directory The path to the directory + * + * @return AJA_STATUS_SUCCESS If and only if the directory contains no files + */ + static AJAStatus IsDirectoryEmpty(const std::string& directory); + static AJAStatus IsDirectoryEmpty(const std::wstring& directory); + + /** + * Retrieves a path to the temp directory + * + * @param[out] directory The path to the temp directory + * + * @return AJA_STATUS_SUCCESS If and only if a temp directory found + */ + static AJAStatus TempDirectory(std::string& directory); // New in SDK 16.0 + static AJAStatus TempDirectory(std::wstring& directory); // New in SDK 16.0 + + /** + * Retrieves the path to the current working directory + * + * @param[out] directory Path of the current working directory + * + * @return AJA_STATUS_SUCCESS If and only if current working directory retrieved. + */ + static AJAStatus GetWorkingDirectory(std::string& directory); // New in SDK 16.0 + static AJAStatus GetWorkingDirectory(std::wstring& directory); // New in SDK 16.0 + + /** + * Retrieves the directory name from the specified path. + * + * @param[in] path Path from which to extract the directory name + * + * @param[out] directory Path of the directory extracted from specified path + * + * @return AJA_STATUS_SUCCESS If and only if the directory name is extracted + */ + static AJAStatus GetDirectoryName(const std::string& path, std::string& directory); // New in SDK 16.0 + static AJAStatus GetDirectoryName(const std::wstring& path, std::wstring& directory); // New in SDK 16.0 + + /** + * Retrieves the filename (with extension) from the specified path. + * + * @param[in] path Path from which to extract the filename + * + * @param[out] filename Filename extracted from specified path + * + * @return AJA_STATUS_SUCCESS If and only if the filename is extracted + */ + static AJAStatus GetFileName(const std::string& path, std::string& filename); // New in SDK 16.0 + static AJAStatus GetFileName(const std::wstring& path, std::wstring& filename); // New in SDK 16.0 + +#if defined(AJA_WINDOWS) + void *GetHandle(void) {return mFileDescriptor;} +#else + void *GetHandle(void) {return NULL;} +#endif + +private: + +#if defined(AJA_WINDOWS) + HANDLE mFileDescriptor; +#else + FILE* mpFile; +#endif +}; + +#endif // AJA_FILE_IO_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/info.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/info.h new file mode 100644 index 0000000..45437cd --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/info.h @@ -0,0 +1,192 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file info.h + @brief Declares the AJASystemInfo class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_INFO_H +#define AJA_INFO_H + +#include "ajabase/common/public.h" +#include +#include +#include + +// forward declarations +class AJASystemInfoImpl; + +enum AJASystemInfoMemoryUnit +{ + AJA_SystemInfoMemoryUnit_Bytes, + AJA_SystemInfoMemoryUnit_Kilobytes, + AJA_SystemInfoMemoryUnit_Megabytes, + AJA_SystemInfoMemoryUnit_Gigabytes, + + AJA_SystemInfoMemoryUnit_LAST +}; + +enum AJASystemInfoTag +{ + AJA_SystemInfoTag_System_Model, + AJA_SystemInfoTag_System_Bios, + AJA_SystemInfoTag_System_Name, + AJA_SystemInfoTag_System_BootTime, + AJA_SystemInfoTag_OS_ProductName, + AJA_SystemInfoTag_OS_Version, + AJA_SystemInfoTag_OS_VersionBuild, + AJA_SystemInfoTag_OS_KernelVersion, + AJA_SystemInfoTag_CPU_Type, + AJA_SystemInfoTag_CPU_NumCores, + AJA_SystemInfoTag_Mem_Total, + AJA_SystemInfoTag_Mem_Used, + AJA_SystemInfoTag_Mem_Free, + AJA_SystemInfoTag_GPU_Type, + AJA_SystemInfoTag_Path_UserHome, + AJA_SystemInfoTag_Path_PersistenceStoreUser, + AJA_SystemInfoTag_Path_PersistenceStoreSystem, + AJA_SystemInfoTag_Path_Applications, + AJA_SystemInfoTag_Path_Utilities, + AJA_SystemInfoTag_Path_Firmware, + + AJA_SystemInfoTag_LAST +}; + +enum AJASystemInfoSections +{ + AJA_SystemInfoSection_CPU = 0x00000001 << 0, + AJA_SystemInfoSection_GPU = 0x00000001 << 1, + AJA_SystemInfoSection_Mem = 0x00000001 << 2, + AJA_SystemInfoSection_OS = 0x00000001 << 3, + AJA_SystemInfoSection_Path = 0x00000001 << 4, + AJA_SystemInfoSection_System = 0x00000001 << 5, + + AJA_SystemInfoSection_None = 0x00000000, + AJA_SystemInfoSection_All = 0xFFFFFFFF +}; + +typedef std::pair AJALabelValuePair; ///< @brief A pair of strings comprising a label and a value +typedef std::vector AJALabelValuePairs; ///< @brief An ordered sequence of label/value pairs +typedef AJALabelValuePairs::const_iterator AJALabelValuePairsConstIter; + +/** + * Class for getting common information about the system. + * @ingroup AJAGroupSystem + * + * + */ +class AJA_EXPORT AJASystemInfo +{ +public: // Instance Methods + /** + * @brief Default constructor that instantiates the platform-specific implementation, + * then calls Rescan. + * @param[in] inUnits Optionally specifies the AJASystemInfoMemoryUnit to use. + * Defaults to "megabytes". + * @param[in] sections The sections of the info structure to rescan, bitwise OR the desired sections + * or use AJA_SystemInfoSection_All (the default) for all sections or + * AJA_SystemInfoSection_None for no sections. In the case of AJA_SystemInfoSection_None + * only the labels are set, no scanning is done at initialization. + */ + AJASystemInfo (const AJASystemInfoMemoryUnit inUnits = AJA_SystemInfoMemoryUnit_Megabytes, + AJASystemInfoSections sections = AJA_SystemInfoSection_All); + + virtual ~AJASystemInfo(); + + /** + * Rescans the host system. + * @param[in] sections The sections of the info structure to rescan, bitwise OR the desired sections + * or use AJA_SystemInfoSection_All (the default) for all sections or + * AJA_SystemInfoSection_None for no sections. In the case of AJA_SystemInfoSection_None + * only the labels are set, no scanning is done. + */ + virtual AJAStatus Rescan (AJASystemInfoSections sections = AJA_SystemInfoSection_All); + + /** + * @brief Answers with the host system info value string for the given AJASystemInfoTag. + * @param[in] inTag The AJASystemInfoTag of interest + * @param[out] outValue Receives the value string + * @return AJA_SUCCESS if successful + */ + virtual AJAStatus GetValue(const AJASystemInfoTag inTag, std::string & outValue) const; + + /** + * @brief Answers with the host system info label string for the given AJASystemInfoTag. + * @param[in] inTag The AJASystemInfoTag of interest + * @param[out] outLabel Receives the label string + * @return AJA_SUCCESS if successful + */ + virtual AJAStatus GetLabel(const AJASystemInfoTag inTag, std::string & outLabel) const; + + /** + * @brief Answers with a multi-line string that contains the complete host system info table. + * @param[out] outAllLabelsAndValues Receives the string + */ + virtual void ToString (std::string & outAllLabelsAndValues) const; + + /** + * @return A multi-line string containing the complete host system info table. + * @param[in] inValueWrapLen Optionally specifies the maximum width of the "value" column, + * in characters. Zero, the default, disables wrapping. + * (However, wrapping always occurs on line-breaks (e.g. CRLF, LF, CR, etc.)). + * @param[in] inGutterWidth Optionally specifies the gap ("gutter") between the "label" + * and "value" columns, in character spaces. Defaults to 3 spaces. + */ + virtual std::string ToString (const size_t inValueWrapLen = 0, const size_t inGutterWidth = 3) const; + +public: // Class Methods + /** + * @brief Generates a multi-line string from a "table" of label/value pairs that, when displayed + * in a monospaced font, appears as a neat, two-column table. + * @param[in] inLabelValuePairs The AJALabelValuePairs to be formatted as a table. + * @param[in] inValueWrapLen Optionally specifies the maximum width of the "value" column, + * in characters. Zero, the default, disables any/all wrapping. + * (However, wrapping always occurs on line-breaks (e.g. CRLF, LF, CR, etc.)). + * @param[in] inGutterWidth Optionally specifies the gap ("gutter") between the "label" + * and "value" columns, in character spaces. Defaults to 3 spaces. + * @return A multi-line string containing the formatted AJALabelValuePairs table. + * @bug Multi-byte UTF8 characters need to be counted as one character. + */ + static std::string ToString (const AJALabelValuePairs & inLabelValuePairs, const size_t inValueWrapLen = 0, const size_t inGutterWidth = 3); + + /** + * @brief A convenience function that appends the given label and value strings to the + * provided AJALabelValuePairs table. + * @param inOutTable The AJALabelValuePairs table to be modified. + * @param[in] inLabel Specifies the label string to use. + * @param[in] inValue Specifies the value string to use. If empty, treat "inLabel" as a section heading. + * @return A reference to the given AJALabelValuePairs. + */ + static inline AJALabelValuePairs & append (AJALabelValuePairs & inOutTable, const std::string & inLabel, const std::string & inValue = std::string()) + {inOutTable.push_back(AJALabelValuePair(inLabel,inValue)); return inOutTable;} + +private: // Instance Data + AJASystemInfoImpl* mpImpl; +}; + + +/** + @brief Streams a human-readable representation of the AJASystemInfo into the given output stream. + @param outStream The stream into which the given AJASystemInfo will be printed. + @param[in] inData The AJASystemInfo to be streamed. + @return A reference to the given "outStream". +**/ +AJA_EXPORT std::ostream & operator << (std::ostream & outStream, const AJASystemInfo & inData); + +/** + @brief Streams a human-readable representation of the AJALabelValuePair into the given output stream. + @param outStream The stream into which the given AJALabelValuePair will be printed. + @param[in] inData The AJALabelValuePair to be streamed. + @return A reference to the given "outStream". +**/ +AJA_EXPORT std::ostream & operator << (std::ostream & outStream, const AJALabelValuePair & inData); + +/** + @brief Streams a human-readable representation of the AJALabelValuePairs into the given output stream. + @param outStream The stream into which the given AJALabelValuePairs will be printed. + @param[in] inData The AJALabelValuePairs to be streamed. + @return A reference to the given "outStream". +**/ +AJA_EXPORT std::ostream & operator << (std::ostream & outStream, const AJALabelValuePairs & inData); + +#endif // AJA_INFO_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/linux/eventimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/linux/eventimpl.h new file mode 100644 index 0000000..5347a83 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/linux/eventimpl.h @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file linux/eventimpl.h + @brief Declares the AJAEventImpl class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_EVENT_IMPL_H +#define AJA_EVENT_IMPL_H + +#include "ajabase/system/system.h" +#include "ajabase/common/common.h" +#include "ajabase/system/event.h" + + +class AJAEventImpl +{ +public: + + AJAEventImpl(bool manualReset, const std::string& name); + virtual ~AJAEventImpl(void); + + AJAStatus Signal(void); + AJAStatus Clear(void); + + AJAStatus SetState(bool signaled = true); + AJAStatus GetState(bool* pSignaled); + + AJAStatus SetManualReset(bool manualReset); + AJAStatus GetManualReset(bool* pManualReset); + + AJAStatus WaitForSignal(uint32_t timeout = 0xffffffff); + + virtual AJAStatus GetEventObject(uint64_t* pEventObject); + +private: + pthread_mutex_t mMutex; + pthread_cond_t mCondVar; + bool mSignaled; + bool mManualReset; +}; + +#endif // AJA_EVENT_IMPL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/linux/infoimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/linux/infoimpl.h new file mode 100644 index 0000000..e201171 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/linux/infoimpl.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file linux/infoimpl.h + @brief Declares the AJASystemInfoImpl class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_INFO_IMPL_H +#define AJA_INFO_IMPL_H + +#include "ajabase/common/common.h" +#include "ajabase/system/info.h" + +class AJASystemInfoImpl +{ +public: + + AJASystemInfoImpl(int units); + virtual ~AJASystemInfoImpl(); + + virtual AJAStatus Rescan(AJASystemInfoSections sections); + + std::map mLabelMap; + std::map mValueMap; + + int mMemoryUnits; +}; + +#endif // AJA_INFO_IMPL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/linux/lockimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/linux/lockimpl.h new file mode 100644 index 0000000..aa911b4 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/linux/lockimpl.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file linux/lockimpl.h + @brief Declares the AJALockImpl class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_LOCK_IMPL_H +#define AJA_LOCK_IMPL_H + +#include +#include +#include "ajabase/system/system.h" +#include "ajabase/common/common.h" +#include "ajabase/system/lock.h" + + +class AJALockImpl +{ +public: + + AJALockImpl(const char* pName); + virtual ~AJALockImpl(); + + AJAStatus Lock(uint32_t uTimeout = 0xffffffff); + AJAStatus Unlock(); + +private: + const char* mName; + pthread_t mOwner; + int mRefCount; + pthread_mutex_t mMutex; // For protecting the member variables +}; + +#endif // AJA_LOCK_IMPL_H + diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/linux/processimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/linux/processimpl.h new file mode 100644 index 0000000..83abef1 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/linux/processimpl.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file linux/processimpl.h + @brief Declares the AJAProcessImpl class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_PROCESS_IMPL_H +#define AJA_PROCESS_IMPL_H + +#include "ajabase/system/system.h" +#include "ajabase/common/common.h" +#include "ajabase/system/process.h" + + +class AJAProcessImpl +{ +public: + + AJAProcessImpl(); + virtual ~AJAProcessImpl(); + +static uint64_t GetPid(); +static bool IsValid(uint64_t pid); +static bool Activate(uint64_t handle); +static bool Activate(const char* pWindow); +}; + +#endif // AJA_PROCESS_IMPL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/linux/threadimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/linux/threadimpl.h new file mode 100644 index 0000000..90202cc --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/linux/threadimpl.h @@ -0,0 +1,65 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file linux/threadimpl.h + @brief Declares the AJAThreadImpl class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_THREAD_IMPL_H +#define AJA_THREAD_IMPL_H + +#include +#include "ajabase/system/system.h" +#include "ajabase/common/common.h" +#include "ajabase/system/thread.h" +#include "ajabase/system/lock.h" + + +class AJAThreadImpl +{ +public: + + AJAThreadImpl(AJAThread* pThreadContext); + virtual ~AJAThreadImpl(); + + AJAStatus Start(); + + AJAStatus Stop(uint32_t timeout = 0xffffffff); + + AJAStatus Kill(uint32_t exitCode); + + bool Active(); + bool IsCurrentThread(); + + AJAStatus SetPriority(AJAThreadPriority threadPriority); + AJAStatus GetPriority(AJAThreadPriority* pThreadPriority); + + AJAStatus SetRealTime(AJAThreadRealTimePolicy policy, int priority); + + AJAStatus Attach(AJAThreadFunction* pThreadFunction, void* pUserContext); + AJAStatus SetThreadName(const char *name); + + static uint64_t GetThreadId(); + static void* ThreadProcStatic(void* pThreadImplContext); + +public: + AJAThread* mpThreadContext; + pthread_t mThread; + pid_t mTid; + AJAThreadPriority mPriority; + AJAThreadFunction* mThreadFunc; + void* mpUserContext; + AJALock mLock; + + bool mThreadStarted; + pthread_mutex_t mStartMutex; + pthread_cond_t mStartCond; + + bool mTerminate; + bool mExiting; + pthread_mutex_t mExitMutex; + pthread_cond_t mExitCond; +}; + +#endif // AJA_THREAD_IMPL_H + diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/lock.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/lock.h new file mode 100644 index 0000000..85af5f7 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/lock.h @@ -0,0 +1,110 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file lock.h + @brief Declares the AJALock class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_LOCK_H +#define AJA_LOCK_H + +#include "ajabase/common/public.h" + +#if defined(AJA_USE_CPLUSPLUS11) + #include + #include + using std::recursive_timed_mutex; + using std::string; +#endif + +#define LOCK_TIME_INFINITE 0xffffffff + + +// forward declarations +class AJALockImpl; + +/** + * Class to coordinate access to non reentrant code. + * @ingroup AJAGroupSystem + */ +class AJA_EXPORT AJALock +{ +public: + + /** + * Constructor obtains a lockable object from the system. + * + * Specify a name if the lock is to be shared system wide. + * + * @param pName Name of a shared lock object. + */ + AJALock(const char* pName = NULL); + virtual ~AJALock(); + + /** + * Request the lock. + * + * @param[in] timeout Request timeout in milliseconds (0xffffffff infinite). + * @return AJA_STATUS_SUCCESS Object locked + * AJA_STATUS_TIMEOUT Lock wait timeout + * AJA_STATUS_OPEN Lock not initialized + * AJA_STATUS_FAIL Lock failed + */ + virtual AJAStatus Lock(uint32_t timeout = LOCK_TIME_INFINITE); + + /** + * Release the lock. + * + * @return AJA_STATUS_SUCCESS Lock released + * AJA_STATUS_OPEN Lock not initialized + */ + virtual AJAStatus Unlock(); + + /** + * @return True if valid (has implementation). + * False if not valid. + */ + virtual inline bool IsValid(void) const + { + #if defined(AJA_USE_CPLUSPLUS11) + return mpMutex != nullptr; + #else + return mpImpl != NULL; + #endif + } + +private: +#if defined(AJA_USE_CPLUSPLUS11) + recursive_timed_mutex* mpMutex={nullptr}; + string name; +#else + AJALockImpl* mpImpl; +#endif +}; + +/** + * Automatically obtain and release a lock. + */ +class AJA_EXPORT AJAAutoLock +{ +public: + + /** + * Constructor waits for lock. + * + * @param[in] pLock The required lock. + */ + AJAAutoLock(AJALock* pLock = NULL); + + /** + * Destructor releases lock. + */ + virtual ~AJAAutoLock(); + +private: + + AJALock* mpLock; +}; + + +#endif // AJA_LOCK_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/log.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/log.h new file mode 100644 index 0000000..8772724 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/log.h @@ -0,0 +1,269 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file log.h + @brief Declares the AJATimeLog class. + @copyright (C) 2012-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_LOG_H +#define AJA_LOG_H + +#include +#include "ajabase/common/public.h" +#include "debug.h" + +#if defined(AJA_WINDOWS) +extern void __cdecl log_odprintf(const char *format, ...); +#elif defined (AJA_MAC) +#pragma GCC diagnostic ignored "-Wformat-security" +#endif + +// use this the select alternate platform specific loggers, 0 is used for no-log +#ifndef AJA_LOGTYPE +#define AJA_LOGTYPE 2 +#endif + +// define AJA_LOG here + +#if defined(AJA_WINDOWS) + + #if defined(AJA_DEBUG) + + #if (AJA_LOGTYPE==0) + // no log + #define AJA_LOG(...) + #define AJA_ULOG(_unit_,...) + + #elif (AJA_LOGTYPE==1) + #define AJA_LOG(...) log_odprintf(__VA_ARGS__) + #define AJA_ULOG(_unit_,...) \ + do {if (AJADebug::IsActive(_unit_)) log_odprintf(__VA_ARGS__);} while(0); + + #elif (AJA_LOGTYPE==2) + #define AJA_LOG(...) AJA_REPORT(AJA_DebugUnit_Critical, AJA_DebugSeverity_Info, __VA_ARGS__) + #define AJA_ULOG(_unit_,...) \ + do {if (AJADebug::IsActive(_unit_)) AJA_REPORT(_unit_, AJA_DebugSeverity_Info, __VA_ARGS__);} while(0); + + #else + //catch all, so builds won't break + #define AJA_LOG(...) + #define AJA_ULOG(_unit_,...) + #endif + + #else + // no log + #define AJA_LOG(...) + #define AJA_ULOG(_unit_,...) + #endif + +#elif defined(AJA_LINUX) || defined(AJA_MAC) + + #if defined(AJA_DEBUG) + + #if (AJA_LOGTYPE==0) + // no log + #define AJA_LOG(_format_...) + #define AJA_ULOG(_unit_, _format_...) + + #elif (AJA_LOGTYPE==1) + // printf + #include + #define AJA_LOG(_format_...) printf(_format_) + #define AJA_ULOG(_unit_, _format_...) \ + do {if (AJADebug::IsActive(_unit_)) printf(_format_);} while(0); + + #elif (AJA_LOGTYPE==2) + #define AJA_LOG(_format_...) AJA_REPORT(AJA_DebugUnit_Critical, AJA_DebugSeverity_Info, _format_) + #define AJA_ULOG(_unit_, _format_...) \ + do {if (AJADebug::IsActive(_unit_)) AJA_REPORT(_unit_, AJA_DebugSeverity_Info, _format_);} while(0); + + #endif + + #else + // no log + #define AJA_LOG(_format_...) + #define AJA_ULOG(_unit_, _format_...) + #endif + +#endif + +#ifndef Make4CC +#define Make4CC(my4CC) ((my4CC < 0x40) ? ' ' : ((char*)(&my4CC))[3]), \ + ((my4CC < 0x40) ? ' ' : ((char*)(&my4CC))[2]), \ + ((my4CC < 0x40) ? ('0' + (char)(my4CC / 10)) : ((char*)(&my4CC))[1]), \ + ((my4CC < 0x40) ? ('0' + (char)(my4CC % 10)) : ((char*)(&my4CC))[0]) +#endif + +/** + * Supports auto initialization of logger, if needed + * @ingroup AJAGroupDebug + */ +class AJA_EXPORT AJALog +{ +public: + + /** + * Singleton initialization of logging service. + */ + AJALog(); + + /** + * Singleton release of logging service. + */ + virtual ~AJALog(); + +private: + static bool bInitialized; +}; + + +extern AJALog gLogInit; + + +/** + * Used to generate timer logs. + * @ingroup AJAGroupDebug + */ + +#define TAG_SIZE 64 + + + +//--------------------------------------------------------------------------------------------------------------------- +// class AJARunAverage +// calculates a running average of input values +//--------------------------------------------------------------------------------------------------------------------- +class AJA_EXPORT AJARunAverage +{ +protected: + explicit AJARunAverage() {} + uint64_t _samplesTotal; + uint64_t _sampleSize; + std::vector _samples; + +public: + AJARunAverage(uint64_t sampleSize) + { Resize(sampleSize); } + virtual ~AJARunAverage() + {} + + virtual void Resize(uint64_t sampleSize); + virtual void Reset(); + + void Mark(int64_t val); + int64_t LastValue(); + int64_t MarkAverage(int64_t val); + int64_t Average(); + uint64_t Total() { return _samplesTotal; } + uint64_t SampleSize() { return _sampleSize; } +}; + + +//--------------------------------------------------------------------------------------------------------------------- +// class AJARunTimeAverage +// calculates a running average of time deltas +//--------------------------------------------------------------------------------------------------------------------- +class AJA_EXPORT AJARunTimeAverage : public AJARunAverage +{ +protected: + explicit AJARunTimeAverage() {} + int64_t _lastTime; + +public: + AJARunTimeAverage(int sampleSize); + virtual ~AJARunTimeAverage() + {} + + virtual void Resize(uint64_t sampleSize); + virtual void Reset(); + virtual void ResetTime(); + + int64_t MarkDeltaTime(); + int64_t MarkDeltaAverage(); +}; + + +//--------------------------------------------------------------------------------------------------------------------- +// class AJARunAverage +// caculates timelogs +//--------------------------------------------------------------------------------------------------------------------- +class AJA_EXPORT AJATimeLog +{ +public: + AJATimeLog(); + AJATimeLog(const char* tag, int unit=AJA_DebugUnit_Critical); + AJATimeLog(const std::string& tag, int unit=AJA_DebugUnit_Critical); + virtual ~AJATimeLog(); + + /** + * reset timer. + */ + void Reset(); + + /** + * Print does reset along with print + */ + void PrintReset(); + inline void PrintResetIf(bool bEnable=true) + { if (bEnable) PrintReset(); } + + /** + * Print tag, appended tag, and delta-time since last reset. + * @param[in] bReset true if time is reset after print + */ + void PrintDelta(bool bReset=true); + void PrintDelta(const char* addedTag, bool bReset=true); + void PrintDelta(uint64_t threashold, const char* addedTag, bool bReset); + + inline void PrintDelta(const std::string& addedTag, bool bReset=true) + { PrintDelta(addedTag.c_str(), bReset); } + + /** + * Optional print tag, appended tag, and delta-time since last reset. + * @param[in] bEnable true to print, false inhibits printing + * @param[in] bReset true if time is reset after print + */ + inline void PrintDeltaIf(bool bEnable, bool bReset=true) + { if (bEnable) PrintDelta(bReset); } + inline void PrintDeltaIf(bool bEnable, const char* addedTag, bool bReset=true) + { if (bEnable) PrintDelta(addedTag, bReset); } + inline void PrintDeltaIf(bool bEnable, const std::string& addedTag, bool bReset=true) + { PrintDeltaIf(bEnable, addedTag.c_str(), bReset); } + + /** + * Get delta-time since last reset. + * @param[in] bReset true if time is reset after get + */ + int32_t GetDelta(bool bReset=true); + + /** + * Optional print tag, appended tag, and delta-time since last reset. + * @param[in] val value to print + */ + void PrintValue(int64_t val); + void PrintValue(int64_t val, const char* addedTag); + inline void PrintValue(int64_t val, const std::string& addedTag) + { PrintValue(val, addedTag.c_str()); } + + void Print(const char* str); + void Print(const std::string& str) + { Print(str.c_str()); } + + inline int GetUnit() + { return _unit; } + inline void SetUnit(int unit) + { _unit = unit; } + + inline std::string GetTag() + {return _tag;} + inline void SetTag(const char* tag) + { _tag = tag; } + +protected: + std::string _tag; + int _unit; + uint64_t _time; +}; + + +#endif // AJA_LOG_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/eventimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/eventimpl.h new file mode 100644 index 0000000..3b681ed --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/eventimpl.h @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file mac/eventimpl.h + @brief Declares the AJAEventImpl class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_EVENT_IMPL_H +#define AJA_EVENT_IMPL_H + +#include "ajabase/system/system.h" +#include "ajabase/common/common.h" +#include "ajabase/system/event.h" + + +class AJAEventImpl +{ +public: + + AJAEventImpl(bool manualReset, const std::string& name); + virtual ~AJAEventImpl(void); + + AJAStatus Signal(void); + AJAStatus Clear(void); + + AJAStatus SetState(bool signaled = true); + AJAStatus GetState(bool* pSignaled); + + AJAStatus SetManualReset(bool manualReset); + AJAStatus GetManualReset(bool* pManualReset); + + AJAStatus WaitForSignal(uint32_t timeout = 0xffffffff); + + virtual AJAStatus GetEventObject(uint64_t* pEventObject); + +private: + pthread_mutex_t mMutex; + pthread_cond_t mCondVar; + bool mSignaled; + bool mManualReset; +}; + +#endif // AJA_EVENT_IMPL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/infoimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/infoimpl.h new file mode 100644 index 0000000..9cad611 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/infoimpl.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ajabase/system/mac/infoimpl.h + @brief Declares the AJASystemInfoImpl class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_INFO_IMPL_H +#define AJA_INFO_IMPL_H + +#include "ajabase/common/common.h" +#include "ajabase/system/info.h" + +class AJASystemInfoImpl +{ +public: + + AJASystemInfoImpl(int units); + virtual ~AJASystemInfoImpl(); + + virtual AJAStatus Rescan(AJASystemInfoSections sections); + + std::map mLabelMap; + std::map mValueMap; + + int mMemoryUnits; +}; + +#endif // AJA_INFO_IMPL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/lockimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/lockimpl.h new file mode 100644 index 0000000..f85fbbc --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/lockimpl.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file mac/lockimpl.h + @brief Declares the AJALockImpl class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_LOCK_IMPL_H +#define AJA_LOCK_IMPL_H + +#include +#include "ajabase/system/system.h" +#include "ajabase/common/common.h" +#include "ajabase/system/lock.h" + +class AJALockImpl +{ +public: + + AJALockImpl(const char* pName); + virtual ~AJALockImpl(); + + AJAStatus Lock(uint32_t uTimeout = 0xffffffff); + AJAStatus Unlock(); + +private: + const char* mName; + pthread_t mOwner; + int mRefCount; + pthread_mutex_t mMutex; // For protecting the member variables +}; + +#endif // AJA_LOCK_IMPL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/processimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/processimpl.h new file mode 100644 index 0000000..675f4cb --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/processimpl.h @@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file mac/processimpl.h + @brief Declares the AJAProcessImpl class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_PROCESS_IMPL_H +#define AJA_PROCESS_IMPL_H + +#include "ajabase/system/system.h" +#include "ajabase/common/common.h" +#include "ajabase/system/process.h" + + +class AJAProcessImpl +{ +public: + + AJAProcessImpl(); + virtual ~AJAProcessImpl(); + +static uint64_t GetPid(); +static bool IsValid(uint64_t pid); + +static bool Activate(const char* pWindow); +static bool Activate(uint64_t handle); +}; + +#endif // AJA_PROCESS_IMPL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/pthreadsextra.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/pthreadsextra.h new file mode 100644 index 0000000..431b9dc --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/pthreadsextra.h @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file mac/pthreadsextra.h + @brief Declares extra symbols to make the Mac threads implementation look more like Unix. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_PTREAD_EXTRA_H +#define AJA_PTREAD_EXTRA_H + +#include +#include + +// defined in later XCode header + +#ifndef CLOCK_REALTIME + +typedef int clockid_t; + +/* Identifier for system-wide realtime clock. */ +# define CLOCK_REALTIME 0 +/* Monotonic system-wide clock. */ +# define CLOCK_MONOTONIC 1 +/* High-resolution timer from the CPU. */ +# define CLOCK_PROCESS_CPUTIME_ID 2 +/* Thread-specific CPU-time clock. */ +# define CLOCK_THREAD_CPUTIME_ID 3 +/* Monotonic system-wide clock, not adjusted for frequency scaling. */ +# define CLOCK_MONOTONIC_RAW 4 +/* Identifier for system-wide realtime clock, updated only on ticks. */ +# define CLOCK_REALTIME_COARSE 5 +/* Monotonic system-wide clock, updated only on ticks. */ +# define CLOCK_MONOTONIC_COARSE 6 + +#endif + +//ignore the clockid_t in this implementation +int clock_gettime(clockid_t clk_id,struct timespec *tp); +int pthread_mutex_timedlock(pthread_mutex_t *__restrict mutex, const struct timespec *__restrict abs_timeout); +pid_t gettid(void); + +#endif // AJA_PTREAD_EXTRA_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/threadimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/threadimpl.h new file mode 100644 index 0000000..428e0b6 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/mac/threadimpl.h @@ -0,0 +1,56 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file mac/threadimpl.h + @brief Declares the AJAThreadImpl class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_THREAD_IMPL_H +#define AJA_THREAD_IMPL_H + +#include +#include "ajabase/system/system.h" +#include "ajabase/common/common.h" +#include "ajabase/system/thread.h" +#include "ajabase/system/lock.h" + + +class AJAThreadImpl +{ +public: + + AJAThreadImpl(AJAThread* pThreadContext); + virtual ~AJAThreadImpl(); + + AJAStatus Start(); + AJAStatus Stop(uint32_t timeout = 0xffffffff); + + AJAStatus Kill(uint32_t exitCode); + + bool Active(); + bool IsCurrentThread(); + + AJAStatus SetPriority(AJAThreadPriority threadPriority); + AJAStatus GetPriority(AJAThreadPriority* pThreadPriority); + + AJAStatus SetRealTime(AJAThreadRealTimePolicy policy, int priority); + + AJAStatus Attach(AJAThreadFunction* pThreadFunction, void* pUserContext); + + static uint64_t GetThreadId(); + static void* ThreadProcStatic(void* pThreadImplContext); + AJAStatus SetThreadName(const char *name); + + AJAThread* mpThreadContext; + pthread_t mThread; + AJAThreadPriority mPriority; + AJAThreadFunction* mThreadFunc; + void* mpUserContext; + AJALock mLock; + bool mTerminate; + bool mExiting; + pthread_mutex_t mExitMutex; + pthread_cond_t mExitCond; +}; + +#endif // AJA_THREAD_IMPL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/make_unique_shim.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/make_unique_shim.h new file mode 100644 index 0000000..df30b1a --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/make_unique_shim.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: MIT */ +#pragma once + +#include + +namespace aja { + +// shim for std::make unique from c++14 +template +std::unique_ptr make_unique(Args&&... args) +{ + return std::unique_ptr(new T(std::forward(args)...)); +} + +} // namespace aja \ No newline at end of file diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/memory.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/memory.h new file mode 100644 index 0000000..445d133 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/memory.h @@ -0,0 +1,75 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file memory.h + @brief Declares the AJAMemory class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_MEMORY_H +#define AJA_MEMORY_H + +#include "ajabase/common/public.h" + +/** + * Collection of system independent memory allocation functions. + * @ingroup AJAGroupSystem + */ +class AJA_EXPORT AJAMemory +{ +public: + + AJAMemory(); + virtual ~AJAMemory(); + + /** + * Allocate memory with no specific alignment requirements. + * + * @param[in] size Bytes of memory to allocate. + * @return Address of allocated memory. NULL if allocation fails. + */ + static void* Allocate(size_t size); + + /** + * Free memory allocated using Allocate(). + * + * @param[in] pMemory Address of memory to free. + */ + static void Free(void* pMemory); + + /** + * Allocate memory aligned to alignment bytes. + * + * @param[in] size Bytes of memory to allocate. + * @param[in] alignment Alignment of allocated memory in bytes. + * @return Address of allocated memory. NULL if allocation fails. + */ + static void* AllocateAligned(size_t size, size_t alignment); + + /** + * Free memory allocated using AllocateAligned(). + * + * @param[in] pMemory Address of memory to free. + */ + static void FreeAligned(void* pMemory); + + /** + * Allocate memory aligned to alignment bytes. + * + * Allocates a named system wide memory region. If the named memory already exists that memory is + * returned and size is updated to reflect the preallocated size. + * + * @param[in,out] size Bytes of memory to allocate. + * @param[in] pShareName Name of system wide memory to allocate. + * @return Address of allocated memory. NULL if allocation fails. + */ + static void* AllocateShared(size_t* size, const char* pShareName); + + /** + * Free memory allocated using AllocateShared(). + * + * @param[in] pMemory Address of memory to free. + */ + static void FreeShared(void* pMemory); +}; + +#endif // AJA_MEMORY_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/process.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/process.h new file mode 100644 index 0000000..bad2786 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/process.h @@ -0,0 +1,68 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file process.h + @brief Declares the AJAProcess class. + @copyright (C) 2011-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_PROCESS_H +#define AJA_PROCESS_H + +#include "ajabase/common/public.h" + +class AJAProcessImpl; + +/** + * Collection of system independent process related functions. + * @ingroup AJAGroupSystem + */ +class AJA_EXPORT AJAProcess +{ +public: + + AJAProcess(); + virtual ~AJAProcess(); + + /** + * Get the Process ID of the current running process + * + * @return The process ID of the current process, expressed as a 64 bit unsigned integer + */ +static uint64_t GetPid(); + + /** + * Determine whether the given pid represents a currently running, valid process. + * + * @param[in] pid The process ID of the process in question. + * + * @return true if the given process is valid, otherwise false. + */ +static bool IsValid(uint64_t pid); + + /** + * Activate the main window associated with the given handle. + * + * @param[in] handle An OS-dependent window handle (HWND on Windows) + * + * @return true if the given window was activated, false if it couln't be found. + */ +static bool Activate(uint64_t handle); + + /** + * Activate the main window associated with the given handle, alternate form. + * + * @param[in] pWindow NULL terminated character string representing the window caption. + * Pass * at the front to find having the tail of their titles matching, + * i.e. "* - AJA ControlPanel" + * + * @return true if the given window was activated, false if it couln't be found. + */ +static bool Activate(const char* pWindow); + +private: + + AJAProcessImpl* mpImpl; + +}; + +#endif // AJA_PROCESS_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/system.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/system.h new file mode 100644 index 0000000..bab666b --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/system.h @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file system.h + @brief System specific functions + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_SYSTEM_H +#define AJA_SYSTEM_H + +#include "ajabase/common/public.h" + +#if defined(AJA_WINDOWS) + #pragma warning (disable:4996) + #if !defined(_WIN32_WINNT) + #define _WIN32_WINNT 0x0600 + #endif + #include // NOTE: This must be included BEFORE to avoid "macro redefinition" errors. + #include // http://www.zachburlingame.com/2011/05/resolving-redefinition-errors-betwen-ws2def-h-and-winsock-h/ + #include + #include + #include + #include + #include + + namespace aja + { + AJA_EXPORT bool write_registry_string(HKEY hkey, std::string key_path, std::string key, std::string value); + + AJA_EXPORT bool write_registry_dword(HKEY hkey, std::string key_path, std::string key, DWORD value); + + AJA_EXPORT std::string read_registry_string(HKEY hkey, std::string key_path, std::string key); + + AJA_EXPORT DWORD read_registry_dword(HKEY hkey, std::string key_path, std::string key); + + } //end aja namespace + +#endif + +#if defined(AJA_MAC) + #include + #include +#endif + +#if defined(AJA_LINUX) + +#endif + +// Common to all +namespace aja +{ + AJA_EXPORT int reveal_file_in_file_manager(const std::string& filePath); +} + +#endif diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/systemtime.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/systemtime.h new file mode 100644 index 0000000..7b8f670 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/systemtime.h @@ -0,0 +1,71 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file systemtime.h + @brief Declares the AJATime class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_TIME_H +#define AJA_TIME_H + +#include "ajabase/common/public.h" + +/** + @brief Collection of platform-independent host system clock time functions. + @ingroup AJAGroupSystem +**/ +class AJA_EXPORT AJATime +{ +public: + + /** + @brief Returns the current value of the host system's low-resolution clock, in milliseconds. + @return The current value of the host system's low-resolution clock, in milliseconds. + **/ + static int64_t GetSystemTime (void); + + /** + @brief Returns the current value of the host system's high-resolution time counter. + @return The current value of the host system's high-resolution time counter. + **/ + static int64_t GetSystemCounter (void); + + /** + @brief Returns the frequency of the host system's high-resolution time counter. + @return The high resolution counter frequency in ticks per second. + **/ + static int64_t GetSystemFrequency (void); + + /** + @brief Returns the current value of the host's high-resolution clock, in milliseconds. + @return Current value of the host's clock, in milliseconds, based on GetSystemCounter() and GetSystemFrequency(). + **/ + static uint64_t GetSystemMilliseconds (void); + + /** + @brief Returns the current value of the host's high-resolution clock, in microseconds. + @return Current value of the host's clock, in microseconds, based on GetSystemCounter() and GetSystemFrequency(). + **/ + static uint64_t GetSystemMicroseconds (void); + + /** + @brief Returns the current value of the host's high-resolution clock, in nanoseconds. + @return Current value of the host's clock, in nanoseconds, based on GetSystemCounter() and GetSystemFrequency(). + **/ + static uint64_t GetSystemNanoseconds (void); + + /** + @brief Suspends execution of the current thread for a given number of milliseconds. + @param inMilliseconds Specifies the sleep time, in milliseconds. + **/ + static void Sleep (const int32_t inMilliseconds); + + /** + @brief Suspends execution of the current thread for a given number of microseconds. + @param inMicroseconds Time to sleep (microseconds). + **/ + static void SleepInMicroseconds (const int32_t inMicroseconds); + +}; // AJATime + +#endif // AJA_TIME_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/thread.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/thread.h new file mode 100644 index 0000000..11c28f7 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/thread.h @@ -0,0 +1,235 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file thread.h + @brief Declares the AJAThread class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_THREAD_H +#define AJA_THREAD_H + +#include "ajabase/common/public.h" + +// forward declarations +class AJAThread; +class AJAThreadImpl; + + +/** + * Template for external thread entry point. + * @relates AJAThread + */ +typedef void AJAThreadFunction(AJAThread* pThread, void* pContext); + +/** + * Enumerate State of theads used to implemente state in run function. + * Not actually used by the thread class. + */ +enum AJAThreadState +{ + AJA_ThreadState_Running, + AJA_ThreadState_Idle, + AJA_ThreadState_Shutdown +}; + + +/** + * Enumerate system independent thread priorities. + */ +enum AJAThreadPriority +{ + AJA_ThreadPriority_Unknown, /**< Priority unknown, used as default. */ + AJA_ThreadPriority_Low, /**< Below normal priority. */ + AJA_ThreadPriority_Normal, /**< Normal system priority. */ + AJA_ThreadPriority_High, /**< Above normal priority. */ + AJA_ThreadPriority_TimeCritical, /**< Priority designate for time critical tasks */ + AJA_ThreadPriority_AboveNormal /**< Priority between normal and high */ +}; + + +enum AJAThreadRealTimePolicy +{ + AJA_ThreadRealTimePolicyFIFO, + AJA_ThreadRealTimePolicyRoundRobin +}; + + +/** + * System independent class for creating and controlling threads. + * @ingroup AJAGroupSystem + * + * This class can be used 2 ways. If an external thread function is attached, the Start() method creates + * a thread and invokes the attached function. It is up to the attached function to query the Terminate() + * method to determine when the a Stop() has been issued. If no external thread function is attached, the + * Start() method creates a thread and invokes the ThreadRun() method. ThreadRun() calls ThreadInit() and then + * calls ThreadLoop() continuously until a Stop is issued at which time if calls ThreadFlush(). A subclass + * can override any of the functions it requires but should at least override ThreadLoop() to do some work + * then wait an appropriate amount of time. + */ +class AJA_EXPORT AJAThread +{ +public: + + AJAThread(); + virtual ~AJAThread(); + + /** + * Start the thread. + * + * @return AJA_STATUS_SUCCESS Thread started + * AJA_STATUS_FAIL Thread start failed + * + */ + virtual AJAStatus Start(); + + /** + * Stop the thread. + * + * @param[in] timeout Wait timeout in milliseconds (0xffffffff infinite). + * @return AJA_STATUS_SUCCESS Thread stopped + * AJA_STATUS_TIMEOUT Thread stop timeout + * AJA_STATUS_FAIL Thread stop wait failure + */ + + virtual AJAStatus Stop(uint32_t timeout = 0xffffffff); + + /** + * Kill the thread. + * + * @return AJA_STATUS_SUCCESS Thread killed + * AJA_STATUS_FAIL Thread could not be killed + */ + virtual AJAStatus Kill(uint32_t exitCode); + + /** + * Is the thread active. + * + * @return true Thread active + * false Thread inactive + */ + virtual bool Active(); + + /** + * Is this the current running thread. + * + * @return true Thread current + * false Thread not current + */ + virtual bool IsCurrentThread(); + + /** + * Set the thread priority. + * + * @param[in] priority New thread priority. + * @return AJA_STATUS_SUCCESS Thread priority set + * AJA_STATUS_RANGE Unknown priority + * AJA_STATUS_FAIL Priority not set + */ + virtual AJAStatus SetPriority(AJAThreadPriority priority); + + /** + * Get the thread priority. + * + * @return AJA_STATUS_SUCCESS Priority returned + * AJA_STATUS_NULL PPriority is null + */ + virtual AJAStatus GetPriority(AJAThreadPriority* pPriority); + + /** + * Set the thread to be realtime. + * + * @param[in] AJAThreadRealTimePolicy Thread policy + * int Realtime priority + * @return AJA_STATUS_SUCCESS Thread priority set + * AJA_STATUS_RANGE Unknown priority + * AJA_STATUS_FAIL Priority not set + */ + virtual AJAStatus SetRealTime(AJAThreadRealTimePolicy policy, int priority); + + /** + * Controlling function for the new thread. + * + * This function calls ThreadInit() once then continuously call ThreadLoop until Terminate() is + * true or ThreadLoop() returns false. ThreadFlush() is called last. Override this function + * for complete control of the thread. + * + * @return AJA_STATUS_SUCCESS No thread errors + * AJA_STATUS_FAIL ThreadInit or ThreadFlush returned failure. + */ + virtual AJAStatus ThreadRun(); + + /** + * Initialize the thread resources. + * + * Override this function to initialize thread resources before executing the inner loop. + * + * @return AJA_STATUS_SUCCESS Initialize successful + * AJA_STATUS_FAIL Initialize failed + */ + virtual AJAStatus ThreadInit(); + + /** + * The thread inner loop. + * + * Override this function to repeat a task while the thread is active. + * + * @return true Loop continues + * false Loop stops + */ + virtual bool ThreadLoop(); + + /** + * Flush the thread resources. + * + * Override this function to cleanup before the thread exits. + * + * @return AJA_STATUS_SUCCESS Thread flush successful + * AJA_STATUS_FAIL Thread flush failed + */ + virtual AJAStatus ThreadFlush(); + + /** + * The thread must terminate. + * + * Threads call this function to determine when to stop. + * + * @return true Thread stop requested + * false Thread can continue + */ + virtual bool Terminate(); + + /** + * Attach an external thread function. + * + * The external function is called when the thread starts and returns when Terminate() is true + * or the task is complete. + * + * @param[in] pThreadFunction External thread entry point + * @param[in] pUserContext Context passed to external thread function. + * return AJA_STATUS_SUCCESS External function attached + */ + virtual AJAStatus Attach(AJAThreadFunction* pThreadFunction, void* pUserContext); + + /** + * + * Sets the thread name + * + * NOTE: This call must be made from within the thread. + * + * @param[in] name Name to assign to the thread + */ + virtual AJAStatus SetThreadName(const char *name); + + /** + * Get the Thread Id of the current running thread + * + * @return The thread Id of the current thread, expressed as a 64 bit unsigned integer + */ + static uint64_t GetThreadId(); + +private: + + AJAThreadImpl* mpImpl; +}; + +#endif // AJA_THREAD_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/windows/eventimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/windows/eventimpl.h new file mode 100644 index 0000000..636910f --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/windows/eventimpl.h @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file windows/eventimpl.h + @brief Declares the AJAEventImpl class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_EVENT_IMPL_H +#define AJA_EVENT_IMPL_H + +#include "ajabase/system/system.h" +#include "ajabase/common/common.h" +#include "ajabase/system/event.h" + + +class AJAEventImpl +{ +public: + + AJAEventImpl(bool manualReset, const std::string& name); + virtual ~AJAEventImpl(); + + AJAStatus Signal(); + AJAStatus Clear(); + + AJAStatus SetState(bool signaled = true); + AJAStatus GetState(bool* pSignaled); + + AJAStatus SetManualReset(bool manualReset); + AJAStatus GetManualReset(bool* pManualReset); + + AJAStatus WaitForSignal(uint32_t timeout = 0xffffffff); + + virtual AJAStatus GetEventObject(uint64_t* pEventObject); + + HANDLE mEvent; + +private: + bool mManualReset; +}; + +#endif // AJA_EVENT_IMPL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/windows/infoimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/windows/infoimpl.h new file mode 100644 index 0000000..2112aa1 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/windows/infoimpl.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file windows/infoimpl.h + @brief Declares the AJASystemInfoImpl class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_INFO_IMPL_H +#define AJA_INFO_IMPL_H + +#include "ajabase/common/common.h" +#include "ajabase/system/info.h" + +class AJA_EXPORT AJASystemInfoImpl +{ +public: + + AJASystemInfoImpl(int units); + virtual ~AJASystemInfoImpl(); + + virtual AJAStatus Rescan(AJASystemInfoSections sections); + + std::map mLabelMap; + std::map mValueMap; + + int mMemoryUnits; +}; + +#endif // AJA_INFO_IMPL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/windows/lockimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/windows/lockimpl.h new file mode 100644 index 0000000..43d0199 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/windows/lockimpl.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file windows/lockimpl.h + @brief Declares the AJALockImpl class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_LOCK_IMPL_H +#define AJA_LOCK_IMPL_H + +#include "ajabase/system/system.h" +#include "ajabase/common/common.h" +#include "ajabase/system/lock.h" + + +class AJALockImpl +{ +public: + + AJALockImpl(const char* pName); + virtual ~AJALockImpl(); + + AJAStatus Lock(uint32_t uTimeout = 0xffffffff); + AJAStatus Unlock(); + + HANDLE mMutex; +}; + +#endif // AJA_LOCK_IMPL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/windows/processimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/windows/processimpl.h new file mode 100644 index 0000000..34ca167 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/windows/processimpl.h @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file windows/processimpl.h + @brief Declares the AJAProcessImpl class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_PROCESS_IMPL_H +#define AJA_PROCESS_IMPL_H + +#include "ajabase/system/system.h" +#include "ajabase/common/common.h" +#include "ajabase/system/process.h" + + +class AJAProcessImpl +{ +public: + + AJAProcessImpl(); +virtual ~AJAProcessImpl(); + +static uint64_t GetPid(); +static bool IsValid(uint64_t pid); + +static bool Activate(const char* pWindow); +static bool Activate(uint64_t handle); +}; + + +#endif // AJA_PROCESS_IMPL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajabase/system/windows/threadimpl.h b/build_dependencies/aja/include/ajalibraries/ajabase/system/windows/threadimpl.h new file mode 100644 index 0000000..07fd55f --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajabase/system/windows/threadimpl.h @@ -0,0 +1,52 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file windows/threadimpl.h + @brief Declares the AJAThreadImpl class. + @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef AJA_THREAD_IMPL_H +#define AJA_THREAD_IMPL_H + +#include "ajabase/system/system.h" +#include "ajabase/common/common.h" +#include "ajabase/system/thread.h" +#include "ajabase/system/lock.h" + + +class AJAThreadImpl +{ +public: + + AJAThreadImpl(AJAThread* pThread); + virtual ~AJAThreadImpl(); + + AJAStatus Start(); + AJAStatus Stop(uint32_t timeout = 0xffffffff); + AJAStatus Kill(uint32_t exitCode); + + bool Active(); + bool IsCurrentThread(); + + AJAStatus SetPriority(AJAThreadPriority threadPriority); + AJAStatus GetPriority(AJAThreadPriority* pThreadPriority); + + AJAStatus SetRealTime(AJAThreadRealTimePolicy policy, int priority); + + AJAStatus Attach(AJAThreadFunction* pThreadFunction, void* pUserContext); + AJAStatus SetThreadName(const char *name); + + static uint64_t GetThreadId(); + static DWORD WINAPI ThreadProcStatic(void* pThreadImplContext); + + AJAThread* mpThread; + HANDLE mhThreadHandle; + DWORD mThreadID; + AJAThreadPriority mPriority; + AJAThreadFunction* mThreadFunc; + void* mpUserContext; + AJALock mLock; + bool mTerminate; +}; + +#endif // AJA_THREAD_IMPL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ajaexport.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ajaexport.h new file mode 100644 index 0000000..782015c --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ajaexport.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ajaexport.h + @brief Defines the import/export macros for producing DLLs or LIBs. + @copyright (C) 2008-2021 AJA Video Systems, Inc. +**/ + +#ifndef AJAEXPORT_H +#define AJAEXPORT_H + +#ifdef MSWindows + #ifndef AJASTATIC + #if defined(AJADLL) || defined(AJA_WINDLL) + #pragma warning (disable : 4251) + #if defined(AJADLL_BUILD) || defined(AJA_DLL_BUILD) + #define AJAExport __declspec(dllexport) // ajantv2 way + #define AJA_EXPORT __declspec(dllexport) // ajabase way + #else + #define AJAExport __declspec(dllimport) // ajantv2 way + #define AJA_EXPORT __declspec(dllimport) // ajabase way + #endif + #else + #define AJAExport // ajantv2 way + #define AJA_EXPORT // ajabase way + #ifndef AJA_NO_AUTOIMPORT + #endif + #endif + #else + #define AJAExport // ajantv2 way + #define AJA_EXPORT // ajabase way + #endif +#else + #define AJAExport // ajantv2 way + #define AJA_EXPORT // ajabase way +#endif + +#endif // AJAEXPORT_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ajatypes.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ajatypes.h new file mode 100644 index 0000000..1e92c24 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ajatypes.h @@ -0,0 +1,679 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ajatypes.h + @brief Declares the most fundamental data types used by NTV2. Since Windows NT was the first principal + development platform, many typedefs are Windows-centric. + @copyright (C) 2004-2021 AJA Video Systems, Inc. +**/ +#ifndef AJATYPES_H +#define AJATYPES_H + +#if defined (AJAMac) + #define NTV2_USE_STDINT +#endif // if not MSWindows + +/** + SYMBOL & API DEPRECATION MACROS + + These macros control which deprecated symbols and APIs are included or excluded from compilation. + + - To activate/include the symbols/APIs that were deprecated in a particular SDK, comment out + (undefine) the SDK's corresponding macro. + + - To deactivate/exclude the symbols/APIs that were deprecated in a particular SDK, leave the + SDK's corresponding macro defined. + + WARNING: Do not sparsely mix-and-match across SDK versions. + It's best to activate/include symbols/APIs contiguously from the latest SDK + (starting at the bottom), and continue activating/including to the SDK at which + symbols/APIs should start to be deactivated/excluded. +**/ +#define NTV2_DEPRECATE // If defined, excludes all symbols/APIs first deprecated in SDK 12.4 or earlier +#define NTV2_DEPRECATE_12_5 // If defined, excludes all symbols/APIs first deprecated in SDK 12.5 +#define NTV2_DEPRECATE_12_6 // If defined, excludes all symbols/APIs first deprecated in SDK 12.6 +#define NTV2_DEPRECATE_12_7 // If defined, excludes all symbols/APIs first deprecated in SDK 12.7 +#define NTV2_DEPRECATE_13_0 // If defined, excludes all symbols/APIs first deprecated in SDK 13.0 +#define NTV2_DEPRECATE_13_1 // If defined, excludes all symbols/APIs first deprecated in SDK 13.1 +#define NTV2_DEPRECATE_14_0 // If defined, excludes all symbols/APIs first deprecated in SDK 14.0 +#define NTV2_DEPRECATE_14_1 // If defined, excludes all symbols/APIs first deprecated in SDK 14.1 (never released) +#define NTV2_DEPRECATE_14_2 // If defined, excludes all symbols/APIs first deprecated in SDK 14.2 +#define NTV2_DEPRECATE_14_3 // If defined, excludes all symbols/APIs first deprecated in SDK 14.3 +#define NTV2_DEPRECATE_15_0 // If defined, excludes all symbols/APIs first deprecated in SDK 15.0 +#define NTV2_DEPRECATE_15_1 // If defined, excludes all symbols/APIs first deprecated in SDK 15.1 +#define NTV2_DEPRECATE_15_2 // If defined, excludes all symbols/APIs first deprecated in SDK 15.2 +//#define NTV2_DEPRECATE_15_3 // If defined, excludes all symbols/APIs first deprecated in SDK 15.3 (never released) +//#define NTV2_DEPRECATE_15_5 // If defined, excludes all symbols/APIs first deprecated in SDK 15.5 +//#define NTV2_DEPRECATE_15_6 // If defined, excludes all symbols/APIs first deprecated in SDK 15.6 (never released) +//#define NTV2_DEPRECATE_16_0 // If defined, excludes all symbols/APIs first deprecated in SDK 16.0 +//#define NTV2_DEPRECATE_16_1 // If defined, excludes all symbols/APIs first deprecated in SDK 16.1 +//#define NTV2_DEPRECATE_16_2 // If defined, excludes all symbols/APIs first deprecated in SDK 16.2 +#define NTV2_NUB_CLIENT_SUPPORT // If defined, includes nub client support; otherwise, excludes it +#define AJA_VIRTUAL virtual // Force use of virtual functions in CNTV2Card, etc. +#define AJA_STATIC static // Do not change this. +#define NTV2_WRITEREG_PROFILING // If defined, enables register write profiling +#define NTV2_UNUSED(__p__) (void)__p__ +#define NTV2_USE_CPLUSPLUS11 // New in SDK 16.0. If defined (now default), 'ajalibraries/ajantv2' will use C++11 features (requires C++11 compiler) + +#if defined(__CPLUSPLUS__) || defined(__cplusplus) + #if defined(AJAMac) + #if defined(__clang__) + #ifndef __has_feature + #define __has_feature(__x__) 0 + #endif + #if __has_feature(cxx_nullptr) + #define AJA_CXX11_NULLPTR_AVAILABLE + #endif + #endif + #elif defined(AJALinux) + #if defined(__clang__) + #ifndef __has_feature + #define __has_feature(__x__) 0 + #endif + #if __has_feature(cxx_nullptr) + #define AJA_CXX11_NULLPTR_AVAILABLE + #endif + #elif defined(__GNUC__) + #if __GNUC__ >= 6 + #define AJA_CXX11_NULLPTR_AVAILABLE + #endif + #endif + #elif defined(MSWindows) + #if defined(_MSC_VER) && _MSC_VER >= 1700 // VS2012 or later: + #define AJA_CXX11_NULLPTR_AVAILABLE + #endif + #endif +#endif + +#if defined(AJA_CXX11_NULLPTR_AVAILABLE) + #define AJA_NULL nullptr +#else + #define AJA_NULL NULL +#endif + +#if defined(__clang__) + #ifndef __has_cpp_attribute + #define __has_cpp_attribute(__x__) 0 + #endif + + #if __has_cpp_attribute(clang::fallthrough) + #define AJA_FALL_THRU [[clang::fallthrough]] + #else + #define AJA_FALL_THRU + #endif +#elif defined(__GNUC__) + #if __GNUC__ >= 5 + #define AJA_FALL_THRU [[gnu::fallthrough]] + #else + #define AJA_FALL_THRU + #endif +#else + #define AJA_FALL_THRU +#endif + + +#if defined (NTV2_USE_STDINT) + #if defined (MSWindows) + #define _WINSOCK_DEPRECATED_NO_WARNINGS 1 + #if (_MSC_VER < 1300) + typedef signed char int8_t; + typedef signed short int16_t; + typedef signed int int32_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + #if defined (NTV2_BUILDING_DRIVER) + typedef signed __int8 int8_t; + typedef signed __int16 int16_t; + typedef signed __int32 int32_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #else + #include + #endif + #endif + typedef signed __int64 int64_t; + typedef unsigned __int64 uint64_t; + #else + #include + #endif + typedef uint8_t UByte; + typedef int8_t SByte; + typedef int16_t Word; + typedef uint16_t UWord; + typedef int32_t LWord; + typedef uint32_t ULWord; + typedef uint32_t * PULWord; + typedef int64_t LWord64; + typedef uint64_t ULWord64; + typedef uint64_t Pointer64; +#else + typedef int LWord; + typedef unsigned int ULWord; + typedef unsigned int * PULWord; + typedef short Word; + typedef unsigned short UWord; + typedef unsigned char UByte; + typedef char SByte; +#endif + +// Platform dependent + ////////////////////////////////////////////////////////////////// +#if defined (MSWindows) //////////////////////// WINDOWS ////////////////////////////// + ////////////////////////////////////////////////////////////////// + #define _WINSOCK_DEPRECATED_NO_WARNINGS 1 + + #if !defined (NTV2_BUILDING_DRIVER) + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + + #include + #endif + #include + typedef unsigned char Boolean; + typedef __int64 LWord64; + typedef unsigned __int64 ULWord64; + typedef unsigned __int64 Pointer64; + typedef LWord Fixed_; + typedef bool BOOL_; + typedef UWord UWord_; + + typedef signed __int8 int8_t; + typedef signed __int16 int16_t; + typedef signed __int32 int32_t; + typedef signed __int64 int64_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int64 uint64_t; + + typedef UINT_PTR AJASocket; + + #define AJATargetBigEndian 0 + #define AJAFUNC __FUNCTION__ + #define NTV2_CPP_MIN(__x__,__y__) min((__x__),(__y__)) + #define NTV2_CPP_MAX(__x__,__y__) max((__x__),(__y__)) + + ////////////////////////////////////////////////////////////////// +#elif defined (AJAMac) //////////////////////// MAC ////////////////////////////// + ////////////////////////////////////////////////////////////////// + #include + typedef short HANDLE; + typedef void* PVOID; + typedef unsigned int BOOL_; + typedef ULWord UWord_; + typedef int Fixed_; + typedef int AJASocket; + + #define AJATargetBigEndian 0 + #define AJAFUNC __func__ + #define NTV2_CPP_MIN(__x__,__y__) std::min((__x__),(__y__)) + #define NTV2_CPP_MAX(__x__,__y__) std::max((__x__),(__y__)) + + #define MAX_PATH 4096 + + #define INVALID_HANDLE_VALUE (0) + + #if !defined (NTV2_DEPRECATE) + typedef struct { + int cx; + int cy; + } SIZE; ///< @deprecated Use NTV2FrameDimensions instead. + #endif // !defined (NTV2_DEPRECATE) + + #define POINTER_32 + + ////////////////////////////////////////////////////////////////// +#elif defined (AJALinux) //////////////////////// LINUX ////////////////////////////// + ////////////////////////////////////////////////////////////////// + /* As of kernel 2.6.19, the C type _Bool is typedefed to bool to allow + * generic booleans in the kernel. Unfortunately, we #define bool + * here and true and false there, so this fixes it ... until next time + * -JAC 3/6/2007 */ + #ifdef __KERNEL__ + #include "linux/version.h" + #include "linux/kernel.h" + #if defined (RHEL5) || (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,19)) + #include "linux/types.h" + #else/* LINUX_VERSION_CODE */ + typedef unsigned char bool; + #endif /* LINUX_VERSION_CODE */ + #endif /* __KERNEL__ */ + + #if defined(NTV2_USE_CPLUSPLUS11) + #undef NTV2_USE_CPLUSPLUS11 // Linux c++11-in-SDK TBD + #endif + + #if defined (MODULE) + #define NTV2_BUILDING_DRIVER + #undef NTV2_USE_CPLUSPLUS11 + #endif + + #if !defined (NTV2_BUILDING_DRIVER) + #include + typedef int64_t HANDLE; + typedef uint64_t ULWord64; + typedef uint64_t Pointer64; + typedef int64_t LWord64; + typedef void * PVOID; + typedef void * LPVOID; + typedef int32_t Fixed_; + typedef bool BOOL_; + typedef bool BOOL; + typedef UWord UWord_; + typedef uint32_t DWORD; /* 32 bits on 32 or 64 bit CPUS */ + + typedef int32_t AJASocket; + #define NTV2_CPP_MIN(__x__,__y__) std::min((__x__),(__y__)) + #define NTV2_CPP_MAX(__x__,__y__) std::max((__x__),(__y__)) + #else + #if defined (AJAVirtual) + #include + #include + #endif + typedef long HANDLE; + // this is what is is in Windows: + // typedef void * HANDLE; + typedef unsigned long long ULWord64; + typedef unsigned long long Pointer64; + typedef signed long long LWord64; + typedef void * PVOID; + typedef void * LPVOID; + typedef LWord Fixed_; + typedef bool BOOL_; + typedef bool BOOL; + typedef UWord UWord_; + typedef unsigned int DWORD; /* 32 bits on 32 or 64 bit CPUS */ + + typedef int AJASocket; + #endif + + #define AJATargetBigEndian 0 + #define AJAFUNC __func__ + + #if !defined (NTV2_BUILDING_DRIVER) + #if defined (NTV2_DEPRECATE) + // The gcc compiler used for Linux NTV2 builds doesn't like __declspec(deprecated) + #define NTV2_DEPRECATED // Disable deprecate warnings (for now) + #else + #define NTV2_DEPRECATED + #endif + + #if defined (NTV2_DEPRECATE_12_5) + // The gcc compiler used for Linux NTV2 builds doesn't like __declspec(deprecated) + #define NTV2_DEPRECATED_12_5 // Disable deprecate warnings (for now) + #else + #define NTV2_DEPRECATED_12_5 + #endif + + #if defined (NTV2_DEPRECATE_12_6) + // The gcc compiler used for Linux NTV2 builds doesn't like __declspec(deprecated) + #define NTV2_DEPRECATED_12_6 // Disable deprecate warnings (for now) + #else + #define NTV2_DEPRECATED_12_6 + #endif + + #if defined (NTV2_DEPRECATE_12_7) + // The gcc compiler used for Linux NTV2 builds doesn't like __declspec(deprecated) + #define NTV2_DEPRECATED_12_7 // Disable deprecate warnings (for now) + #else + #define NTV2_DEPRECATED_12_7 + #endif + + #if defined (NTV2_DEPRECATE_13_0) + // The gcc compiler used for Linux NTV2 builds doesn't like __declspec(deprecated) + #define NTV2_DEPRECATED_13_0 // Disable deprecate warnings (for now) + #else + #define NTV2_DEPRECATED_13_0 + #endif + + #if defined (NTV2_DEPRECATE_13_1) + // The gcc compiler used for Linux NTV2 builds doesn't like __declspec(deprecated) + #define NTV2_DEPRECATED_13_1 // Disable deprecate warnings (for now) + #else + #define NTV2_DEPRECATED_13_1 + #endif + + #if defined (NTV2_DEPRECATE_14_0) + // The gcc compiler used for Linux NTV2 builds doesn't like __declspec(deprecated) + #define NTV2_DEPRECATED_14_0 // Disable deprecate warnings (for now) + #else + #define NTV2_DEPRECATED_14_0 + #endif + + #if defined (NTV2_DEPRECATE_14_1) + // The gcc compiler used for Linux NTV2 builds doesn't like __declspec(deprecated) + #define NTV2_DEPRECATED_14_1 // Disable deprecate warnings (for now) + #else + #define NTV2_DEPRECATED_14_1 + #endif + #endif + + #if !defined (NTV2_DEPRECATE) + typedef struct { + int cx; + int cy; + } SIZE; ///< @deprecated Use NTV2FrameDimensions instead. + #endif // !defined (NTV2_DEPRECATE) + + typedef struct { + int left; + int right; + int top; + int bottom; + } RECT; + + #ifndef INVALID_HANDLE_VALUE + #define INVALID_HANDLE_VALUE (-1L) + #endif + #define WINAPI + #define POINTER_32 + #define MAX_PATH 4096 + ////////////////////////////////////////////////////////////////// +#else //////////////////////// (OTHER) ////////////////////////// + ////////////////////////////////////////////////////////////////// + #error "IMPLEMENT OTHER PLATFORM" + +#endif // end OTHER PLATFORM + +#if defined (NTV2_BUILDING_DRIVER) + // The AJA NTV2 driver is always built without any deprecated types or functions: + #if !defined(NTV2_DEPRECATE) + #define NTV2_DEPRECATE + #endif + #if !defined(NTV2_DEPRECATE_12_5) + #define NTV2_DEPRECATE_12_5 + #endif + #if !defined(NTV2_DEPRECATE_12_6) + #define NTV2_DEPRECATE_12_6 + #endif + #if !defined(NTV2_DEPRECATE_12_7) + #define NTV2_DEPRECATE_12_7 + #endif + #if !defined(NTV2_DEPRECATE_13_0) + #define NTV2_DEPRECATE_13_0 + #endif + #if !defined(NTV2_DEPRECATE_13_1) + #define NTV2_DEPRECATE_13_1 + #endif + #if !defined(NTV2_DEPRECATE_14_0) + #define NTV2_DEPRECATE_14_0 + #endif + #if !defined(NTV2_DEPRECATE_14_1) + #define NTV2_DEPRECATE_14_1 // (never released) + #endif + #if !defined(NTV2_DEPRECATE_14_2) + #define NTV2_DEPRECATE_14_2 + #endif + #if !defined(NTV2_DEPRECATE_14_3) + #define NTV2_DEPRECATE_14_3 + #endif + #if !defined(NTV2_DEPRECATE_15_0) + #define NTV2_DEPRECATE_15_0 + #endif + #if !defined(NTV2_DEPRECATE_15_1) + #define NTV2_DEPRECATE_15_1 + #endif + #if !defined(NTV2_DEPRECATE_15_2) + #define NTV2_DEPRECATE_15_2 + #endif + #if !defined(NTV2_DEPRECATE_15_3) + #define NTV2_DEPRECATE_15_3 + #endif + #if !defined(NTV2_DEPRECATE_15_5) + #define NTV2_DEPRECATE_15_5 + #endif + #if !defined(NTV2_DEPRECATE_15_6) + #define NTV2_DEPRECATE_15_6 + #endif + #if !defined(NTV2_DEPRECATE_16_0) + #define NTV2_DEPRECATE_16_0 + #endif + #if !defined(NTV2_DEPRECATE_16_1) + #define NTV2_DEPRECATE_16_1 + #endif + #if !defined(NTV2_DEPRECATE_16_2) + #define NTV2_DEPRECATE_16_2 + #endif +#endif + + +////////////////////////////////////////////////////////////////////// +//////////////////////// NTV2_ASSERT ////////////////////////// +////////////////////////////////////////////////////////////////////// +#if !defined (NTV2_ASSERT) + #if defined (NTV2_BUILDING_DRIVER) + // Kernel space NTV2_ASSERTs + #if defined (AJA_DEBUG) || defined (_DEBUG) + #if defined (MSWindows) + #define NTV2_ASSERT(_expr_) ASSERT (#_expr_) + #elif defined (AJAMac) + #define NTV2_ASSERT(_expr_) assert (_expr_) + #elif defined (AJALinux) + #define NTV2_ASSERT(_expr_) do {if (#_expr_) break; \ + printk (KERN_EMERG "### NTV2_ASSERT '%s': %s: line %d: %s\n", \ + __FILE__, __func__, __LINE__, #_expr_); dump_stack(); \ + } while (0) + #else + #define NTV2_ASSERT(_expr_) + #endif + #else + #define NTV2_ASSERT(_expr_) + #endif + #else + // User space NTV2_ASSERTs + #if defined (AJA_DEBUG) || defined (_DEBUG) + #include + #define NTV2_ASSERT(_expr_) assert (_expr_) + #else + #define NTV2_ASSERT(_expr_) (void) (_expr_) + #endif + #endif // else !defined (NTV2_BUILDING_DRIVER) +#endif // if NTV2_ASSERT undefined + + +////////////////////////////////////////////////////////////////////////////////// +//////////////////////// NTV2_DEPRECATED_ Macros ////////////////////////// +////////////////////////////////////////////////////////////////////////////////// +// These implement compile-time warnings for use of deprecated variables and functions +#define NTV2_DEPRECATED_INLINE // Just a marker/reminder +#define NTV2_DEPRECATED_FIELD // Just a marker/reminder +#define NTV2_DEPRECATED_VARIABLE // Just a marker/reminder +#define NTV2_DEPRECATED_TYPEDEF // Just a marker/reminder +#define NTV2_DEPRECATED_CLASS // Just a marker/reminder +#define NTV2_SHOULD_BE_DEPRECATED(__f__) __f__ +#if defined(NTV2_BUILDING_DRIVER) + // Disable deprecation warnings in driver builds + #define NTV2_DEPRECATED_f(__f__) __f__ + #define NTV2_DEPRECATED_v(__v__) __v__ + #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) +#elif defined(_MSC_VER) && _MSC_VER >= 1600 + // Use __declspec(deprecated) for MSVC + #define NTV2_DEPRECATED_f(__f__) __declspec(deprecated) __f__ + #define NTV2_DEPRECATED_v(__v__) __v__ + #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) +#elif defined(__clang__) + // Use __attribute__((deprecated)) for LLVM/Clang + #define NTV2_DEPRECATED_f(__f__) __f__ __attribute__((deprecated)) + #define NTV2_DEPRECATED_v(__v__) __v__ + #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) +#elif defined(__GNUC__) + #if __GNUC__ >= 4 + // Use __attribute__((deprecated)) for GCC 4 or later + #define NTV2_DEPRECATED_f(__f__) __f__ __attribute__ ((deprecated)) + #define NTV2_DEPRECATED_v(__v__) __v__ + #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) + #else + // Disable deprecation warnings in GCC prior to GCC 4 + #define NTV2_DEPRECATED_f(__f__) __f__ + #define NTV2_DEPRECATED_v(__v__) __v__ + #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) + #endif +#else + // Disable deprecation warnings + #define NTV2_DEPRECATED_f(__f__) __f__ + #define NTV2_DEPRECATED_v(__v__) __v__ + #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) +#endif + + +/** + @brief Describes the horizontal and vertical size dimensions of a raster, bitmap, frame or image. +**/ +typedef struct NTV2FrameDimensions +{ + #if !defined (NTV2_BUILDING_DRIVER) + // Member Functions + + /** + @brief My constructor. + @param[in] inWidth Optionally specifies my initial width dimension, in pixels. Defaults to zero. + @param[in] inHeight Optionally specifies my initial height dimension, in lines. Defaults to zero. + **/ + inline NTV2FrameDimensions (const ULWord inWidth = 0, const ULWord inHeight = 0) {Set (inWidth, inHeight);} + inline ULWord GetWidth (void) const {return mWidth;} ///< @return My width, in pixels. + inline ULWord GetHeight (void) const {return mHeight;} ///< @return My height, in lines/rows. + inline ULWord Width (void) const {return mWidth;} ///< @return My width, in pixels. + inline ULWord Height (void) const {return mHeight;} ///< @return My height, in lines/rows. + inline bool IsValid (void) const {return Width() && Height();} ///< @return True if both my width and height are non-zero. + + /** + @brief Sets my width dimension. + @param[in] inValue Specifies the new width dimension, in pixels. + @return A non-constant reference to me. + **/ + inline NTV2FrameDimensions & SetWidth (const ULWord inValue) {mWidth = inValue; return *this;} + + /** + @brief Sets my height dimension. + @param[in] inValue Specifies the new height dimension, in lines. + @return A non-constant reference to me. + **/ + inline NTV2FrameDimensions & SetHeight (const ULWord inValue) {mHeight = inValue; return *this;} + + /** + @brief Sets my dimension values. + @param[in] inWidth Specifies the new width dimension, in pixels. + @param[in] inHeight Specifies the new height dimension, in lines. + @return A non-constant reference to me. + **/ + inline NTV2FrameDimensions & Set (const ULWord inWidth, const ULWord inHeight) {return SetWidth (inWidth).SetHeight (inHeight);} + + /** + @brief Sets both my width and height to zero (an invalid state). + @return A non-constant reference to me. + **/ + inline NTV2FrameDimensions & Reset (void) {return Set (0, 0);} + + private: // Private member data only if not building driver + #endif // !defined (NTV2_BUILDING_DRIVER) + // Member Variables + ULWord mWidth; ///< @brief The horizontal dimension, in pixels. + ULWord mHeight; ///< @brief The vertical dimension, in lines. +} NTV2FrameDimensions; + + +#if !defined(BIT) + #if !defined(AJALinux) + #define BIT(_x_) (1u << (_x_)) + #else // Linux: + // As of kernel 2.6.24, BIT is defined in the kernel source (linux/bitops.h). + // By making that definition match the one in the kernel source *exactly* + // we supress compiler warnings (thanks Shaun) + #define BIT(nr) (1UL << (nr)) + #endif // AJALinux +#endif +#if 1 + #define BIT_0 (1u<<0) + #define BIT_1 (1u<<1) + #define BIT_2 (1u<<2) + #define BIT_3 (1u<<3) + #define BIT_4 (1u<<4) + #define BIT_5 (1u<<5) + #define BIT_6 (1u<<6) + #define BIT_7 (1u<<7) + #define BIT_8 (1u<<8) + #define BIT_9 (1u<<9) + #define BIT_10 (1u<<10) + #define BIT_11 (1u<<11) + #define BIT_12 (1u<<12) + #define BIT_13 (1u<<13) + #define BIT_14 (1u<<14) + #define BIT_15 (1u<<15) + #define BIT_16 (1u<<16) + #define BIT_17 (1u<<17) + #define BIT_18 (1u<<18) + #define BIT_19 (1u<<19) + #define BIT_20 (1u<<20) + #define BIT_21 (1u<<21) + #define BIT_22 (1u<<22) + #define BIT_23 (1u<<23) + #define BIT_24 (1u<<24) + #define BIT_25 (1u<<25) + #define BIT_26 (1u<<26) + #define BIT_27 (1u<<27) + #define BIT_28 (1u<<28) + #define BIT_29 (1u<<29) + #define BIT_30 (1u<<30) + #define BIT_31 (1u<<31) +#endif // 1 + +#if 0 +// Check at compile time if all the defined types are the correct size +// must support C++11 for this to work +static_assert(sizeof(bool) == 1, "bool: size is not correct"); +static_assert(sizeof(int8_t) == 1, "int8_t: size is not correct"); +static_assert(sizeof(int16_t) == 2, "int16_t: size is not correct"); +static_assert(sizeof(int32_t) == 4, "int32_t: size is not correct"); +static_assert(sizeof(int64_t) == 8, "int64_t: size is not correct"); +static_assert(sizeof(uint8_t) == 1, "uint8_t: size is not correct"); +static_assert(sizeof(uint16_t) == 2, "uint16_t: size is not correct"); +static_assert(sizeof(uint32_t) == 4, "uint32_t: size is not correct"); +static_assert(sizeof(uint64_t) == 8, "uint64_t: size is not correct"); + +static_assert(sizeof(LWord) == 4, "LWord: size is not correct"); +static_assert(sizeof(ULWord) == 4, "ULWord: size is not correct"); +static_assert(sizeof(PULWord) == 8, "PULWord: size is not correct"); +static_assert(sizeof(Word) == 2, "Word: size is not correct"); +static_assert(sizeof(UWord) == 2, "UWord: size is not correct"); +static_assert(sizeof(UByte) == 1, "UByte: size is not correct"); +static_assert(sizeof(SByte) == 1, "SByte: size is not correct"); + +static_assert(sizeof(ULWord64) == 8, "ULWord64: size is not correct"); +static_assert(sizeof(Pointer64) == 8, "Pointer64: size is not correct"); +static_assert(sizeof(LWord64) == 8, "LWord64: size is not correct"); +static_assert(sizeof(PVOID) == 8, "PVOID: size is not correct"); +static_assert(sizeof(Fixed_) == 4, "Fixed_: size is not correct"); + +// ideally these whould be the same across the platforms but historically they have not been +#if defined(MSWindows) +static_assert(sizeof(HANDLE) == 8, "HANDLE: size is not correct"); +static_assert(sizeof(BOOL) == 4, "BOOL: size is not correct"); +static_assert(sizeof(BOOL_) == 1, "BOOL_: size is not correct"); +static_assert(sizeof(AJASocket) == 8, "AJASocket: size is not correct"); +static_assert(sizeof(UWord_) == 2, "UWord_: size is not correct"); +static_assert(sizeof(LPVOID) == 8, "LPVOID: size is not correct"); +static_assert(sizeof(DWORD) == 4, "DWORD: size is not correct"); +#elif defined(AJAMac) +static_assert(sizeof(HANDLE) == 2, "HANDLE: size is not correct"); +//static_assert(sizeof(BOOL) == 1, "BOOL: size is not correct"); +static_assert(sizeof(BOOL_) == 4, "BOOL_: size is not correct"); +static_assert(sizeof(AJASocket) == 4, "AJASocket: size is not correct"); +static_assert(sizeof(UWord_) == 4, "UWord_: size is not correct"); +//static_assert(sizeof(LPVOID) == 8, "LPVOID: size is not correct"); +//static_assert(sizeof(DWORD) == 4, "DWORD: size is not correct"); +#elif defined(AJALinux) +static_assert(sizeof(HANDLE) == 8, "HANDLE: size is not correct"); +static_assert(sizeof(BOOL) == 1, "BOOL: size is not correct"); +static_assert(sizeof(BOOL_) == 1, "BOOL_: size is not correct"); +static_assert(sizeof(AJASocket) == 4, "AJASocket: size is not correct"); +static_assert(sizeof(UWord_) == 2, "UWord_: size is not correct"); +static_assert(sizeof(LPVOID) == 8, "LPVOID: size is not correct"); +static_assert(sizeof(DWORD) == 4, "DWORD: size is not correct"); +#endif + +#endif + +#endif // AJATYPES_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/basemachinecontrol.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/basemachinecontrol.h new file mode 100644 index 0000000..6434891 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/basemachinecontrol.h @@ -0,0 +1,65 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file basemachinecontrol.h + @deprecated Declares the CBaseMachineControl class. + @copyright (C) 2004-2021 AJA Video Systems, Inc. +**/ + +#ifndef _BASEMACHINECONTROL_H +#define _BASEMACHINECONTROL_H + +#include "ajaexport.h" +#include "ajatypes.h" +#include "ntv2enums.h" + +/** + @brief A base class for deck control. + @note Not intended for use in production or mission-critical environments! +**/ +class AJAExport CBaseMachineControl +{ + public: + typedef enum + { + CONTROLTYPE_DDR, // DDREthernetControl + CONTROLTYPE_XVID, // Uses NTV2 File to control AJA device + CONTROLTYPE_NTV2, // Uses AJA NTV2 device serial port + CONTROLTYPE_SERIAL, // Uses host serial Port + CONTROLTYPE_INVALID + } ControlType; + + typedef enum + { + CONTROL_UNIMPLEMENTED = 0xFFFFFFFF + } ControUnimplemented; + + public: + explicit inline CBaseMachineControl () : _controlType (CONTROLTYPE_INVALID) {} + virtual inline ~CBaseMachineControl () {} + + public: + virtual bool Open (void) = 0; + virtual void Close (void) = 0; + + // These return true, false or CONTROL_UNIMPLEMENTED + virtual inline ULWord Play (void) {return CONTROL_UNIMPLEMENTED;} + virtual inline ULWord ReversePlay (void) {return CONTROL_UNIMPLEMENTED;} + virtual inline ULWord Stop (void) {return CONTROL_UNIMPLEMENTED;} + virtual inline ULWord FastForward (void) {return CONTROL_UNIMPLEMENTED;} + virtual inline ULWord Rewind (void) {return CONTROL_UNIMPLEMENTED;} + virtual inline ULWord AdvanceFrame (void) {return CONTROL_UNIMPLEMENTED;} + virtual inline ULWord BackFrame (void) {return CONTROL_UNIMPLEMENTED;} + virtual inline ULWord GetTimecodeString (SByte * pOutTimecodeString) {(void) pOutTimecodeString; return CONTROL_UNIMPLEMENTED;} + virtual inline ULWord GotoFrameByString (SByte * pInFrameString) {(void) pInFrameString; return CONTROL_UNIMPLEMENTED;} + virtual inline ULWord GotoFrame (ULWord inFrameNumber) {(void) inFrameNumber; return CONTROL_UNIMPLEMENTED;} + virtual inline ULWord GotoFrameByHMS (UByte inHrs, UByte inMins, UByte inSecs, UByte inFrames) {(void) inHrs; (void) inMins; (void) inSecs; (void) inFrames; return CONTROL_UNIMPLEMENTED;} + virtual inline ULWord RecordAtFrame (ULWord inFrameNumber) {(void) inFrameNumber; return CONTROL_UNIMPLEMENTED;} + virtual inline ULWord Loop (ULWord inStartFrameNumber, ULWord inEndFrameNumber) {(void) inStartFrameNumber; (void) inEndFrameNumber; return CONTROL_UNIMPLEMENTED;} + virtual inline ControlType GetControlType (void) const {return _controlType;} + + protected: + ControlType _controlType; + +}; // CBaseMachineControl + +#endif // _BASEMACHINECONTROL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2audiodefines.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2audiodefines.h new file mode 100644 index 0000000..2d1cdbe --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2audiodefines.h @@ -0,0 +1,85 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2audiodefines.h + @brief Declares common audio macros and structs used in the SDK. + @copyright (C) 2004-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef NTV2_AUDIODEFINES_H +#define NTV2_AUDIODEFINES_H + +#define NTV2_NUMAUDIO_CHANNELS 6 +#define NTV2_AUDIOSAMPLESIZE (sizeof (ULWord)) +#define NTV2_AUDIO_WRAPADDRESS 0x000FF000 +#define NTV2_AUDIO_WRAPADDRESS_MEDIUM (0x000FF000 * 2) +#define NTV2_AUDIO_WRAPADDRESS_BIG (0x000FF000 * 4) +#define NTV2_AUDIO_WRAPADDRESS_BIGGER (0x000FF000 * 8) // used with KiPro Mini 99 video buffers +#define NTV2_AUDIO_READBUFFEROFFSET 0x00100000 +#define NTV2_AUDIO_READBUFFEROFFSET_MEDIUM (0x00100000 * 2) +#define NTV2_AUDIO_READBUFFEROFFSET_BIG (0x00100000 * 4) +#define NTV2_AUDIO_READBUFFEROFFSET_BIGGER (0x00100000 * 8) // used with KiPro Mini 99 video buffers + +#define NTV2_AUDIO_BUFFEROFFSET_BIG (0x00100000 * 8) + +#define NTV2_NUMSAMPLES_PER_AUDIO_INTERRUPT 960 +#define NTV2_TOTALSAMPLES_IN_BUFFER(numChannels) (NTV2_AUDIO_WRAPADDRESS/((numChannels)*NTV2_AUDIOSAMPLESIZE)) + +#define kSDIName "SDI" +#define kAESName "AES/EBU" +#define kADATName "ADAT - 8 channels" +#define kAnalogName "Analog - 4 channels" +#define kNoneName "IO - none" +#define kAllName "8 channels" + +#define kAJADeviceManufacturer "AJA Video" + + +typedef enum +{ + kNumAudioChannels2 = 2, + kNumAudioChannels4 = 4, + kNumAudioChannels6 = 6, + kNumAudioChannels8 = 8, + kNumAudioChannels16 = 16, + kNumAudioChannelsMax = kNumAudioChannels16 // Used in Linux and Windows too +} AudioChannelsPerFrameEnum; + + +typedef enum +{ + k16bitsPerSample = 16, + k24bitsPerSample = 24, + k32bitsPerSample = 32 +} AudioBitsPerSampleEnum; + + +typedef enum +{ + k44p1KHzSampleRate = 44100, + k48KHzSampleRate = 48000, + k96KHzSampleRate = 96000 +} AudioSampleRateEnum; + + +typedef enum +{ + kSourceSDI = 0x69736469, + kSourceAES = 0x69616573, + kSourceADAT = 0x69616474, + kSourceAnalog = 0x69616C67, + kSourceNone = 0x6E6F696E, + kSourceAll = 0x6F757420 +} AudioSourceEnum; + +typedef enum { + kNormal = 0, + kMuted = 1 +} AudioMuteEnum; + +// These are ProIO specific audio settings. The ENUMs represent actual register +// values. This is probably not a great idea but for now we will leave it like this +// since it only pertains to a ProIO build. Ideally these should just enumerations +// and the settings layer in the muxer should translate these to what the hardware +// wants. + +#endif // NTV2_AUDIODEFINES_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2bft.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2bft.h new file mode 100644 index 0000000..85c57af --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2bft.h @@ -0,0 +1,196 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2bft.h + @brief Handy macros for Basic Functionality Tests. + @copyright (C) 2014-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef _NTV2BFT_H_ + #define _NTV2BFT_H_ + + #include + #include + + #if defined (_DEBUG) && defined (MSWindows) + #include + #endif + + #define STDOUT std::cout + #define STDERR std::cerr + #define ENDL std::endl + + #if defined (_DEBUG) + class NTV2BFT_Debugger + { + public: + static inline void Stop (void) + { + #if defined (MSWindows) + DebugBreak (); + #else + // FORCE TRIGGER DEBUGGER + STDERR << "Stop" << ENDL; + char * pByte (NULL); + char byte (*pByte); + byte++; + #endif // not Windows + } + }; + #define DEBUG_BREAK() do {NTV2BFT_Debugger::Stop ();} while (false) + #else + #define DEBUG_BREAK() do {} while (false) + #endif // _DEBUG + + + /************************************************************************************************************************** + Basic Functionality Testing Macros + + These macros are useful for logging the results of basic functionality tests (BFTs). + They assume that the function in which they're used returns an boolean value, which will be true if successful, + and false if unsuccessful. + + SHOULD_BE_TRUE (condition) -- Logs a failure if the condition evaluates to false; otherwise, logs a success. + Use this macro when you expect the condition expression to return true. + SHOULD_BE_FALSE (condition) -- Logs a failure if the condition evaluates to true; otherwise, logs a success. + Use this macro when you expect the condition expression to return false. + SHOULD_BE_EQUAL (x, y) -- Logs a success if x == y; otherwise logs a failure. + Use this macro when you expect x to equal y. + SHOULD_BE_UNEQUAL (x, y) -- Logs a success if x != y; otherwise logs a failure. + Use this macro when you expect x to not equal y. + + The following two symbols determine how these macros behave. + + SHOW_PASSED If true, successes are logged to STDOUT. (Failures are always logged to STDERR.) + If false, successes are not logged. + + STOP_AFTER_FAILURE If true, failures will abort the rest of the test. + If false, failures won't stop execution, but will instead "press on regardless". + + DEBUG_BREAK_AFTER_FAILURE If true, failures in _DEBUG builds will invoke the DEBUG_BREAK macro (see above). + If false, failures won't call DEBUG_BREAK in _DEBUG builds. + **************************************************************************************************************************/ + #if !defined (SHOW_PASSED) + #define SHOW_PASSED (false) + #endif + #if !defined (STOP_AFTER_FAILURE) + #define STOP_AFTER_FAILURE (true) + #endif + #if !defined (DEBUG_BREAK_AFTER_FAILURE) + #define DEBUG_BREAK_AFTER_FAILURE (false) + #endif + + + #define SHOULD_BE_TRUE(_x_) do \ + { \ + if (!(_x_)) \ + { \ + STDERR << "## ERROR: '" << __FUNCTION__ << "' failed at line " << __LINE__ << " of " << __FILE__ << ":" << ENDL \ + << " Expected 'True' result from '" << #_x_ << "'" << ENDL \ + << " Instead got 'False'" << ENDL; \ + if (STOP_AFTER_FAILURE) \ + { \ + if (DEBUG_BREAK_AFTER_FAILURE) \ + DEBUG_BREAK (); \ + return false; \ + } \ + } \ + else if (SHOW_PASSED) \ + STDOUT << "## NOTE: '" << #_x_ << "' in '" << __FUNCTION__ << "' returned 'True'" << ENDL; \ + } while (false) + + + #define SHOULD_BE_FALSE(_x_) do \ + { \ + if (_x_) \ + { \ + STDERR << "## ERROR: '" << __FUNCTION__ << "' failed at line " << __LINE__ << " of " << __FILE__ << ":" << ENDL \ + << " Expected 'False' result from '" << #_x_ << "'" << ENDL \ + << " Instead got 'True'" << ENDL; \ + if (STOP_AFTER_FAILURE) \ + { \ + if (DEBUG_BREAK_AFTER_FAILURE) \ + DEBUG_BREAK (); \ + return false; \ + } \ + } \ + else if (SHOW_PASSED) \ + STDOUT << "## NOTE: '" << #_x_ << "' in '" << __FUNCTION__ << "' returned 'False'" << ENDL; \ + } while (false) + + + #define SHOULD_BE_NULL(_x_) do \ + { \ + if ((_x_) != NULL) \ + { \ + STDERR << "## ERROR: '" << __FUNCTION__ << "' failed at line " << __LINE__ << " of " << __FILE__ << ":" << ENDL \ + << " '" << (_x_) << "' is non-NULL" << ENDL \ + << " Expected '" << #_x_ << "' to be NULL" << ENDL; \ + if (STOP_AFTER_FAILURE) \ + { \ + if (DEBUG_BREAK_AFTER_FAILURE) \ + DEBUG_BREAK (); \ + return false; \ + } \ + } \ + else if (SHOW_PASSED) \ + STDOUT << "## NOTE: '" << #_x_ << "' is NULL in '" << __FUNCTION__ << "'" << ENDL; \ + } while (false) + + + #define SHOULD_BE_NON_NULL(_x_) do \ + { \ + if ((_x_) == NULL) \ + { \ + STDERR << "## ERROR: '" << __FUNCTION__ << "' failed at line " << __LINE__ << " of " << __FILE__ << ":" << ENDL \ + << " '" << (_x_) << "' is NULL" << ENDL \ + << " Expected '" << #_x_ << "' to be non-NULL" << ENDL; \ + if (STOP_AFTER_FAILURE) \ + { \ + if (DEBUG_BREAK_AFTER_FAILURE) \ + DEBUG_BREAK (); \ + return false; \ + } \ + } \ + else if (SHOW_PASSED) \ + STDOUT << "## NOTE: '" << #_x_ << "' is non-NULL in '" << __FUNCTION__ << "'" << ENDL; \ + } while (false) + + + #define SHOULD_BE_EQUAL(_x_, _y_) do \ + { \ + if ((_x_) != (_y_)) \ + { \ + STDERR << "## ERROR: '" << __FUNCTION__ << "' failed at line " << __LINE__ << " of " << __FILE__ << ":" << ENDL \ + << " '" << (_x_) << "' is not equal to '" << (_y_) << "'" << ENDL \ + << " Expected '" << #_x_ << "' to equal '" << #_y_ << "'" << ENDL; \ + if (STOP_AFTER_FAILURE) \ + { \ + if (DEBUG_BREAK_AFTER_FAILURE) \ + DEBUG_BREAK (); \ + return false; \ + } \ + } \ + else if (SHOW_PASSED) \ + STDOUT << "## NOTE: '" << #_x_ << "' is equal to '" << #_y_ << "' in '" << __FUNCTION__ << "'" << ENDL; \ + } while (false) + + + #define SHOULD_BE_UNEQUAL(_x_, _y_) do \ + { \ + if ((_x_) == (_y_)) \ + { \ + STDERR << "## ERROR: '" << __FUNCTION__ << "' failed at line " << __LINE__ << " of " << __FILE__ << ":" << ENDL \ + << " '" << (_x_) << "' is equal to '" << (_y_) << "'" << ENDL \ + << " Expected '" << #_x_ << "' to not equal '" << #_y_ << "'" << ENDL; \ + if (STOP_AFTER_FAILURE) \ + { \ + if (DEBUG_BREAK_AFTER_FAILURE) \ + DEBUG_BREAK (); \ + return false; \ + } \ + } \ + else if (SHOW_PASSED) \ + STDOUT << "## NOTE: '" << #_x_ << "' is not equal to '" << #_y_ << "' in '" << __FUNCTION__ << "'" << ENDL; \ + } while (false) + +#endif // _NTV2BFT_H_ diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2bitfile.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2bitfile.h new file mode 100644 index 0000000..3eadcb4 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2bitfile.h @@ -0,0 +1,256 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2bitfile.h + @brief Declares the CNTV2Bitfile class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef NTV2BITFILE_H +#define NTV2BITFILE_H + +#include +#ifdef AJALinux + #include + #include +#endif +#include "ajatypes.h" +#include "ajaexport.h" +#include "ntv2enums.h" +#include "ntv2publicinterface.h" +#include "ntv2utils.h" + + +/** + @brief Knows how to extract information from a bitfile header. +**/ +class AJAExport NTV2BitfileHeaderParser +{ + public: + explicit NTV2BitfileHeaderParser () {Clear();} + bool ParseHeader (const NTV2_POINTER & inHdrBuffer, + std::ostream & outMsgs); + void Clear (void); + + inline ULWord UserID (void) const {return mUserID;} + inline const std::string & Date (void) const {return mDate;} + inline const std::string & Time (void) const {return mTime;} + inline const std::string & PartName (void) const {return mPartName;} + inline const std::string & RawDesign (void) const {return mRawDesignName;} + std::string DesignName (void) const; + + inline ULWord DesignID (void) const {return mDesignID;} + inline ULWord DesignVersion (void) const {return mDesignVersion;} + inline ULWord BitfileID (void) const {return mBitfileID;} + inline ULWord BitfileVersion (void) const {return mBitfileVersion;} + inline ULWord ProgramOffsetBytes (void) const {return mProgOffsetBytes;} + inline ULWord ProgramSizeBytes (void) const {return mProgSizeBytes;} + inline bool IsValid (void) const {return mValid;} + inline bool IsTandem (void) const {return RawDesign().find("TANDEM=TRUE") != std::string::npos;} + inline bool IsPartial (void) const {return RawDesign().find("PARTIAL=TRUE") != std::string::npos;} + inline bool IsClear (void) const {return RawDesign().find("CLEAR=TRUE") != std::string::npos;} + inline bool IsCompress (void) const {return RawDesign().find("COMPRESS=TRUE") != std::string::npos;} + + public: // Class Methods + static inline ULWord GetDesignID (const ULWord userID) { return (userID & 0xff000000) >> 24; } + static inline ULWord GetDesignVersion (const ULWord userID) { return (userID & 0x00ff0000) >> 16; } + static inline ULWord GetBitfileID (const ULWord userID) { return (userID & 0x0000ff00) >> 8; } + static inline ULWord GetBitfileVersion (const ULWord userID) { return (userID & 0x000000ff) >> 0; } + + protected: + bool SetRawDesign (const std::string & inStr, std::ostream & oss); + bool SetDate (const std::string & inStr, std::ostream & oss); + bool SetTime (const std::string & inStr, std::ostream & oss); + inline void SetPartName (const std::string & inStr) {mPartName = inStr;} + bool SetProgramOffsetBytes (const ULWord inValue, std::ostream & oss); + bool SetProgramSizeBytes (const ULWord inValue, std::ostream & oss); + + private: + std::string mDate; // Compile/build date + std::string mTime; // Compile/build time + std::string mPartName; // Part name + std::string mRawDesignName; // Untruncated, unmodified design string + ULWord mUserID; // User ID + ULWord mProgOffsetBytes; // Program offset, in bytes + ULWord mProgSizeBytes; // Program length, in bytes + ULWord mDesignID; // Design ID + ULWord mDesignVersion; // Design version + ULWord mBitfileID; // Bitfile ID + ULWord mBitfileVersion; // Bitfile version + bool mValid; // Is valid? +}; // NTV2BitfileHeaderParser + + +/** + @brief Instances of me can parse a bitfile. +**/ +class AJAExport CNTV2Bitfile +{ + public: + /** + @brief My constructor. + **/ + CNTV2Bitfile (); + + /** + @brief My destructor. + **/ + virtual ~CNTV2Bitfile (); + + /** + @brief Opens the bitfile at the given path, then parses its header. + @param[in] inBitfilePath Specifies the path name of the bitfile to be parsed. + @return True if open & parse succeeds; otherwise false. + **/ + virtual bool Open (const std::string & inBitfilePath); + + #if !defined (NTV2_DEPRECATE) + virtual NTV2_DEPRECATED_f(bool Open (const char * const & inBitfilePath)); ///< @deprecated Use the std::string version of Open instead. + #endif // !defined (NTV2_DEPRECATE) + + /** + @brief Closes bitfile (if open) and resets me. + **/ + virtual void Close (void); + + /** + @brief Parse a bitfile header that's stored in a buffer. + @param[in] inBitfileBuffer Specifies the buffer of the bitfile to be parsed. + @param[in] inBufferSize Specifies the size of the buffer to be parsed. + @return A std::string containing parsing errors. It will be empty if successful. + **/ + virtual std::string ParseHeaderFromBuffer (const uint8_t* inBitfileBuffer, const size_t inBufferSize); + + /** + @brief Parse a bitfile header that's stored in a buffer. + @param[in] inBitfileBuffer Specifies the buffer of the bitfile to be parsed. + @return A std::string containing parsing errors. It will be empty if successful. + **/ + virtual std::string ParseHeaderFromBuffer (const NTV2_POINTER & inBitfileBuffer); + + /** + @return A string containing the extracted bitfile build date. + **/ + virtual inline const std::string & GetDate (void) const {return mHeaderParser.Date();} + + /** + @return A string containing the extracted bitfile build time. + **/ + virtual inline const std::string & GetTime (void) const {return mHeaderParser.Time();} + + /** + @return A string containing the extracted bitfile design name. + **/ + virtual inline std::string GetDesignName (void) const {return mHeaderParser.DesignName();} + + /** + @return A string containing the extracted bitfile part name. + **/ + virtual inline const std::string & GetPartName (void) const {return mHeaderParser.PartName();} + + /** + @return A string containing the error message, if any, from the last function that could fail. + **/ + virtual inline const std::string & GetLastError (void) const { return mLastError; } + + /** + @return True if the bitfile header includes tandem flag; otherwise false. + **/ + virtual inline bool IsTandem (void) const {return mHeaderParser.IsTandem();} + + /** + @return True if the bitfile header includes partial flag; otherwise false. + **/ + virtual inline bool IsPartial (void) const {return mHeaderParser.IsPartial();} + + /** + @return True if the bitfile header includes clear flag; otherwise false. + **/ + virtual inline bool IsClear (void) const {return mHeaderParser.IsClear();} + + /** + @return True if the bitfile header includes compress flag; otherwise false. + **/ + virtual inline bool IsCompress (void) const {return mHeaderParser.IsCompress();} + + /** + @return A ULWord containing the design design ID as extracted from the bitfile. + **/ + virtual inline ULWord GetDesignID (void) const {return mHeaderParser.DesignID();} + + /** + @return A ULWord containing the design version as extracted from the bitfile. + **/ + virtual inline ULWord GetDesignVersion (void) const {return mHeaderParser.DesignVersion();} + + /** + @return A ULWord containing the design ID as extracted from the bitfile. + **/ + virtual inline ULWord GetBitfileID (void) const {return mHeaderParser.BitfileID();} + + /** + @return A ULWord containing the design version as extracted from the bitfile. + **/ + virtual inline ULWord GetBitfileVersion (void) const {return mHeaderParser.BitfileVersion();} + + /** + @brief Answers with the design user ID, as extracted from the bitfile. + @return A ULWord containing the design user ID. + **/ + virtual inline ULWord GetUserID (void) const {return mHeaderParser.UserID();} + + /** + @return True if the bitfile can be flashed onto the device; otherwise false. + **/ + virtual bool CanFlashDevice (const NTV2DeviceID inDeviceID) const; + + /** + @return My instrinsic NTV2DeviceID. + **/ + virtual NTV2DeviceID GetDeviceID (void) const; + + /** + @return Program stream length in bytes, or zero if error/invalid. + **/ + virtual inline size_t GetProgramStreamLength (void) const {return mReady ? size_t(mHeaderParser.ProgramSizeBytes()) : 0;} + + /** + @return File stream length in bytes, or zero if error/invalid. + **/ + virtual inline size_t GetFileStreamLength (void) const {return mReady ? mFileSize : 0;} + + /** + @brief Retrieves the program bitstream. + @param[out] outBuffer Specifies the buffer that will receive the data. This method will Allocate + storage if IsNULL or IsAllocatedBySDK. + @return Number of bytes copied to the outBuffer, or zero upon failure. + **/ + virtual size_t GetProgramByteStream (NTV2_POINTER & outBuffer); + + /** + @brief Retrieves the file bitstream. + @param[out] outBuffer Specifies the buffer that will receive the data. This method will Allocate + storage if IsNULL or IsAllocatedBySDK. + @return Number of bytes copied to the outBuffer, or zero upon failure. + **/ + virtual size_t GetFileByteStream (NTV2_POINTER & outBuffer); + + public: // Class Methods + static NTV2DeviceID ConvertToDeviceID (const ULWord inDesignID, const ULWord inBitfileID); + static ULWord ConvertToDesignID (const NTV2DeviceID inDeviceID); + static ULWord ConvertToBitfileID (const NTV2DeviceID inDeviceID); + static std::string GetPrimaryHardwareDesignName (const NTV2DeviceID inDeviceID); + static NTV2DeviceID GetDeviceIDFromHardwareDesignName (const std::string & inDesignName); + + protected: // Protected Methods + virtual void SetLastError (const std::string & inStr, const bool inAppend = false); + + private: // Private Member Data + std::ifstream mFileStream; // Binary input filestream + NTV2_POINTER mHeaderBuffer; // Header buffer in use + NTV2BitfileHeaderParser mHeaderParser; // Header parser (and state info) + std::string mLastError; // Last error message + size_t mFileSize; // Bitfile size, in bytes + bool mReady; // Ready? +}; // CNTV2Bitfile + +#endif // NTV2BITFILE_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2bitfilemanager.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2bitfilemanager.h new file mode 100644 index 0000000..85a237c --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2bitfilemanager.h @@ -0,0 +1,130 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2bitfilemanager.h + @brief Declares the CNTV2BitfileManager class that manages Xilinx bitfiles. + @copyright (C) 2019-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef NTV2BITMANAGER_H +#define NTV2BITMANAGER_H + +#include +#include +#include +#ifdef AJALinux + #include + #include +#endif +#include "ntv2publicinterface.h" + +/** + Bitfile information flags. +**/ +#define NTV2_BITFILE_FLAG_TANDEM BIT(0) ///< @brief This is a tandem bitfile +#define NTV2_BITFILE_FLAG_PARTIAL BIT(1) ///< @brief This is a partial bitfile +#define NTV2_BITFILE_FLAG_CLEAR BIT(2) ///< @brief This is a clear bitfile + + +/** + @brief Bitfile information. +**/ +struct AJAExport NTV2BitfileInfo +{ + std::string bitfilePath; ///< @brief The path where this bitfile was found. + std::string designName; ///< @brief The design name for this bitfile. + ULWord designID; ///< @brief Identifies the firmware core (the design base common to all its personalities). + ULWord designVersion; ///< @brief Version of this core. + ULWord bitfileID; ///< @brief Identifies the firmware personality. + ULWord bitfileVersion; ///< @brief Version of this personality. + ULWord bitfileFlags; + NTV2DeviceID deviceID; ///< @brief The NTV2DeviceID for this firmware core+personality. +}; + +typedef std::vector NTV2BitfileInfoList; +typedef NTV2BitfileInfoList::iterator NTV2BitfileInfoListIter; +typedef NTV2BitfileInfoList::const_iterator NTV2BitfileInfoListConstIter; + + +/** + @brief I manage and cache any number of bitfiles for any number of NTV2 devices/designs. + @note This class is not thread-safe. +**/ +class AJAExport CNTV2BitfileManager +{ +public: + /** + @brief My constructor. + **/ + CNTV2BitfileManager (); + + /** + @brief My destructor. + **/ + virtual ~CNTV2BitfileManager (); + + /** + @brief Add the bitfile at the given path to the list of bitfiles. + @param[in] inBitfilePath Specifies the path name to the bitfile. + @return True if successful; otherwise false. + **/ + virtual bool AddFile (const std::string & inBitfilePath); + + /** + @brief Add the bitfile(s) at the given path to the list of bitfiles. + @param[in] inDirectory Specifies the path name to the directory. + @return True if successful; otherwise false. + **/ + virtual bool AddDirectory (const std::string & inDirectory); + + /** + @brief Clear the list of bitfiles. + **/ + virtual void Clear (void); + + /** + @brief Returns the number of bitfiles. + @return Number of bitfiles. + **/ + virtual size_t GetNumBitfiles (void); + + /** + @brief Returns an NTV2BitfileInfoList standard C++ vector. + @return A reference to my NTV2BitfileInfoList. + **/ + virtual inline const NTV2BitfileInfoList & GetBitfileInfoList (void) const {return _bitfileList;} + + /** + @brief Retrieves the bitstream specified by design ID & version, and bitfile ID & version. + It loads it into host memory, and updates/reallocates the given NTV2_POINTER to access it. + @param[out] outBitstream Receives the bitstream in this NTV2_POINTER. + @param[in] inDesignID Specifies the design ID. + @param[in] inDesignVersion Specifies the design version. + @param[in] inBitfileID Specifies the bitfile ID. + @param[in] inBitfileVersion Specifies the bitfile version (0xff for latest). + @param[in] inBitfileFlags Specifies the bitfile flags. + @return True if the bitfile is present and loads successfully; otherwise false. + **/ + virtual bool GetBitStream (NTV2_POINTER & outBitstream, + const ULWord inDesignID, + const ULWord inDesignVersion, + const ULWord inBitfileID, + const ULWord inBitfileVersion, + const ULWord inBitfileFlags); + +private: + + /** + @brief Read the specified bitstream. + @param[in] inIndex Specifies the index of the bitfile info. + @return True if the bitstream was read; otherwise false. + **/ + bool ReadBitstream (const size_t inIndex); + + typedef std::vector NTV2BitstreamList; + typedef NTV2BitstreamList::iterator NTV2BitstreamListIter; + + NTV2BitfileInfoList _bitfileList; ///< @brief List of bitfiles that I'm managing + NTV2BitstreamList _bitstreamList; ///< @brief My cached bitstreams +}; // CNTV2BitfileManager + +#endif // NTV2BITMANAGER_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2boardfeatures.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2boardfeatures.h new file mode 100644 index 0000000..707bcee --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2boardfeatures.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2boardfeatures.h + @deprecated Please include ntv2devicefeatures.h instead. + @copyright (C) 2004-2021 AJA Video Systems, Inc. +**/ +#ifndef NTV2BOARDFEATURES_H + #define NTV2BOARDFEATURES_H + + #if defined (NTV2_DEPRECATE) + #if defined (MSWindows) + #pragma message("'ntv2boardfeatures.h' is deprecated -- include 'ntv2devicefeatures.h' instead") + #else + #warning "'ntv2boardfeatures.h' is deprecated -- include 'ntv2devicefeatures.h' instead"" + #endif + #else + #include "ntv2devicefeatures.h" + #endif +#endif // NTV2BOARDFEATURES_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2boardscan.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2boardscan.h new file mode 100644 index 0000000..9947cf3 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2boardscan.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2boardscan.h + @deprecated Include ntv2devicescanner.h instead. + @copyright (C) 2004-2021 AJA Video Systems, Inc. +**/ +#ifndef NTV2BOARDSCAN_H + #define NTV2BOARDSCAN_H + + #if defined (NTV2_DEPRECATE) + #if defined (MSWindows) + #pragma message("'ntv2boardscan.h' is deprecated -- include 'ntv2devicescanner.h' instead") + #else + #warning "'ntv2boardscan.h' is deprecated -- include 'ntv2devicescanner.h' instead" + #endif + #else + #include "ntv2devicescanner.h" + #endif +#endif // NTV2BOARDSCAN_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2card.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2card.h new file mode 100644 index 0000000..0be888f --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2card.h @@ -0,0 +1,7872 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2card.h + @brief Declares the CNTV2Card class. + @copyright (C) 2004-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2CARD_H +#define NTV2CARD_H + +#include "ajaexport.h" + +#if defined (MSWindows) + #include "ntv2windriverinterface.h" +#elif defined (AJAMac) + #include "ntv2macdriverinterface.h" +#elif defined (AJALinux) + #include "ntv2linuxdriverinterface.h" +#endif +#include "ntv2signalrouter.h" +#include "ntv2utils.h" +#include +#include +#include +#include +#include + +/** + @brief Used in calls to CNTV2Card::GetBoolParam to determine device features. +**/ +typedef enum _NTV2BoolParamID +{ +// kDeviceCanChangeEmbeddedAudioClock, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has NorthWest Logic DMA hardware. + kDeviceCanChangeFrameBufferSize, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device does not have fixed frame buffer sizes. + kDeviceCanDisableUFC, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has at least one UFC, and it can be disabled. + kDeviceCanDo2KVideo, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device is capable of handling 2Kx1556 video. + kDeviceCanDo3GLevelConversion, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can perform 3G level B to 3G level A conversion. + kDeviceCanDoRGBLevelAConversion, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can do RGB over 3G Level A. + kDeviceCanDo425Mux, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device supports SMPTE 425 mux control. + kDeviceCanDo4KVideo, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can handle 4K/UHD video. + kDeviceCanDoAESAudioIn, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has at least one AES/EBU audio input. + kDeviceCanDoAnalogAudio, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has at least one analog audio input or output. + kDeviceCanDoAnalogVideoIn, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has at least one analog video input. + kDeviceCanDoAnalogVideoOut, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has at least one analog video output. +// kDeviceCanDoAudio2Channels, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the Audio System(s) on the device can be configured to embed/de-embed only 2 audio channels. +// kDeviceCanDoAudio6Channels, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the Audio System(s) on the device can be configured to embed/de-embed only 6 audio channels. +// kDeviceCanDoAudio8Channels, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the Audio System(s) on the device can be configured to embed/de-embed only 8 audio channels. +// kDeviceCanDoAudio96K, ///< @brief Use with CNTV2Card::GetBoolParam to determine if Audio System(s) on the device can be set to a 96kHz sample rate. +// kDeviceCanDoAudioDelay, ///< @brief Use with CNTV2Card::GetBoolParam to determine if Audio System(s) on the device have an adjustable delay. + kDeviceCanDoBreakoutBox, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can be connected to an AJA breakout box. + kDeviceCanDoCapture, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can capture (ingest) video. +// kDeviceCanDoColorCorrection, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has at least one programmable LUT. +// kDeviceCanDoCustomAnc, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device supports ANC insertion/extraction. +// kDeviceCanDoDSKOpacity, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has a mixer/keyer whose opacity is adjustable. +// kDeviceCanDoDualLink, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can input/output 10-bit RGB over 2-wire SDI. +// kDeviceCanDoDVCProHD, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can squeeze/stretch between 1920x1080/1280x1080 and 1280x720/960x720. +// kDeviceCanDoEnhancedCSC, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has enhanced color space converter capability. +// kDeviceCanDoFrameStore1Display, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can display video from FrameStore 1. +// kDeviceCanDoFreezeOutput, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can freeze output video. +// kDeviceCanDoHDMIOutStereo, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can handle 3D-stereo video output over HDMI. +// kDeviceCanDoHDV, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can squeeze/stretch between 1920x1080 and 1440x1080. +// kDeviceCanDoHDVideo, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can handle HD (High Definition) video. + kDeviceCanDoIsoConvert, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can do ISO conversion. + kDeviceCanDoLTC, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can take in LTC (Linear TimeCode) from one of its inputs. + kDeviceCanDoLTCInOnRefPort, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can read LTC (Linear TimeCode) from its reference input. + kDeviceCanDoMSI, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device DMA hardware supports MSI (Message Signaled Interrupts). + kDeviceCanDoMultiFormat, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can simultaneously handle different video formats on more than one SDI input or output. + kDeviceCanDoPCMControl, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device Audio System(s) can indicate non-PCM (Pulse Code Modulation) on a per-channel-pair basis. + kDeviceCanDoPCMDetection, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has per-audio-channel-pair PCM detection capabilities. +// kDeviceCanDoPIO, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device supports Programmed I/O. + kDeviceCanDoPlayback, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can output (play) video. + kDeviceCanDoProgrammableCSC, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has at least one programmable color space converter widget. + kDeviceCanDoProgrammableRS422, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has at least one RS-422 serial port, and it (they) can be programmed (for baud rate, parity, etc.). + kDeviceCanDoProRes, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can can accommodate Apple ProRes-compressed video in its frame buffers. + kDeviceCanDoQREZ, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can handle QRez. + kDeviceCanDoQuarterExpand, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can handle quarter-sized frames (pixel-halving and line-halving during input, pixel-double and line-double during output). +// kDeviceCanDoRateConvert, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can do frame rate conversion. +// kDeviceCanDoRGBPlusAlphaOut, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has CSCs capable of splitting the key (alpha) and YCbCr (fill) from RGB frame buffers that include alpha. (Has nothing to do with RGB wire formats.) +// kDeviceCanDoRP188, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can insert and/or extract RP-188/VITC. +// kDeviceCanDoSDVideo, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can handle SD (Standard Definition) video. + kDeviceCanDoSDIErrorChecks, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can perform SDI error checking. +// kDeviceCanDoStackedAudio, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device uses a "stacked" arrangement of its audio buffers. +// kDeviceCanDoStereoIn, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device supports 3D video input over dual-stream SDI. +// kDeviceCanDoStereoOut, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device supports 3D video output over dual-stream SDI. + kDeviceCanDoThunderbolt, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device connects to the host using a Thunderbolt cable. + kDeviceCanDoVideoProcessing, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can do video processing. + kDeviceCanMeasureTemperature, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can measure its temperature. + kDeviceCanReportFrameSize, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can report its frame size. + kDeviceHasBiDirectionalSDI, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device SDI connectors are bi-directional. +// kDeviceHasColorSpaceConverterOnChannel2, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has a CSC on channel 2. + kDeviceHasNWL, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has NorthWest Logic DMA hardware. + kDeviceHasPCIeGen2, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device supports 2nd-generation PCIe. + kDeviceHasRetailSupport, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can be configured and controlled by the retail services and AJA ControlPanel. + kDeviceHasSDIRelays, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has bypass relays on its SDI connectors. +// kDeviceHasSPIFlash, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has SPI flash hardware. +// kDeviceHasSPIFlashSerial, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has serial SPI flash hardware. + kDeviceHasSPIv2, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device uses version 2 SPI hardware. + kDeviceHasSPIv3, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device uses version 3 SPI hardware. + kDeviceHasSPIv4, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device uses version 4 SPI hardware. +// kDeviceIs64Bit, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device is 64-bit addressable. +// kDeviceIsDirectAddressable, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device is direct addressable. + kDeviceIsExternalToHost, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device connects to the host with a cable. + kDeviceIsSupported, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device is supported by this SDK. +// kDeviceNeedsRoutingSetup, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device widget routing can be queried and/or changed. + kDeviceSoftwareCanChangeFrameBufferSize, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device frame buffer size can be changed. + kDeviceCanThermostat, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the fan on the device can be thermostatically controlled. + kDeviceHasHEVCM31, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has an HEVC M31 encoder. + kDeviceHasHEVCM30, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device has an HEVC M30 encoder/decoder. + kDeviceCanDoVITC2, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device can insert and/or extract RP-188/VITC2. + kDeviceCanDoHDMIHDROut, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device supports HDMI HDR output. + kDeviceCanDoJ2K, ///< @brief Use with CNTV2Card::GetBoolParam to determine if the device supports the JPEG 2000 codec. + kDeviceCanDo_INVALID +} NTV2BoolParamID; + +/** + @brief Used in calls to CNTV2Card::GetNumericParam to determine numeric device features. +**/ +typedef enum _NTV2NumericParamID +{ + kDeviceGetActiveMemorySize, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the size, in bytes, of the device's active RAM available for video and audio. + kDeviceGetDACVersion, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the version number of the DAC on the device. + kDeviceGetDownConverterDelay, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the down-converter delay on the device. + kDeviceGetHDMIVersion, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the version number of the HDMI input(s) and/or output(s) on the device. + kDeviceGetLUTVersion, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the version number of the LUT(s) on the device. + kDeviceGetMaxAudioChannels, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the maximum number of audio channels that a single Audio System can support on the device. + kDeviceGetMaxRegisterNumber, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the highest register number for the device. + kDeviceGetMaxTransferCount, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the maximum number of 32-bit words that the DMA engine can move at a time on the device. + kDeviceGetNumDMAEngines, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of DMA engines on the device. + kDeviceGetNumVideoChannels, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of video channels supported on the device. + kDeviceGetPingLED, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the highest bit number of the LED bits in the Global Control Register on the device. + kDeviceGetUFCVersion, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the version number of the UFC on the device. + kDeviceGetNum4kQuarterSizeConverters, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of quarter-size 4K/UHD down-converters on the device. + kDeviceGetNumAESAudioInputChannels, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of AES/EBU audio input channels on the device. + kDeviceGetNumAESAudioOutputChannels, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of AES/EBU audio output channels on the device. + kDeviceGetNumAnalogAudioInputChannels, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of analog audio input channels on the device. + kDeviceGetNumAnalogAudioOutputChannels, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of analog audio output channels on the device. + kDeviceGetNumAnalogVideoInputs, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of analog video inputs on the device. + kDeviceGetNumAnalogVideoOutputs, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of analog video outputs on the device. + kDeviceGetNumAudioSystems, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of independent Audio Systems on the device. + kDeviceGetNumCrossConverters, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of cross-converters on the device. + kDeviceGetNumCSCs, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of colorspace converter widgets on the device. + kDeviceGetNumDownConverters, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of down-converters on the device. + kDeviceGetNumEmbeddedAudioInputChannels, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of SDI-embedded input audio channels supported by the device. + kDeviceGetNumEmbeddedAudioOutputChannels, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of SDI-embedded output audio channels supported by the device. + kDeviceGetNumFrameStores, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of FrameStores on the device. + kDeviceGetNumFrameSyncs, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of frame sync widgets on the device. + kDeviceGetNumHDMIAudioInputChannels, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of HDMI audio input channels on the device. + kDeviceGetNumHDMIAudioOutputChannels, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of HDMI audio output channels on the device. + kDeviceGetNumHDMIVideoInputs, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of HDMI video inputs on the device. + kDeviceGetNumHDMIVideoOutputs, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of HDMI video outputs on the device. + kDeviceGetNumInputConverters, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of input converter widgets on the device. + kDeviceGetNumLUTs, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of LUT widgets on the device. + kDeviceGetNumMixers, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of mixer/keyer widgets on the device. + kDeviceGetNumOutputConverters, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of output converter widgets on the device. + kDeviceGetNumReferenceVideoInputs, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of reference video inputs on the device. + kDeviceGetNumSerialPorts, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of RS-422 serial ports on the device. + kDeviceGetNumUpConverters, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of up-converters on the device. + kDeviceGetNumVideoInputs, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of SDI video inputs on the device. + kDeviceGetNumVideoOutputs, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of SDI video outputs on the device. + kDeviceGetNum2022ChannelsSFP1, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of 2022 channels configured on SFP 1 on the device. + kDeviceGetNum2022ChannelsSFP2, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of 2022 channels configured on SFP 2 on the device. + kDeviceGetNumLTCInputs, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of analog LTC inputs on the device. + kDeviceGetNumLTCOutputs, ///< @brief Use with CNTV2Card::GetNumericParam to obtain the number of analog LTC outputs on the device. + kDeviceGetNum_INVALID +} NTV2NumericParamID; + + +typedef std::set NTV2AudioChannelPairs; ///< @brief A set of distinct NTV2AudioChannelPair values. +typedef NTV2AudioChannelPairs::const_iterator NTV2AudioChannelPairsConstIter; ///< @brief Handy const iterator to iterate over a set of distinct NTV2AudioChannelPair values. +AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioChannelPairs & inSet); ///< @brief Handy ostream writer for NTV2AudioChannelPairs. + +typedef std::set NTV2AudioChannelQuads; ///< @brief A set of distinct NTV2AudioChannelQuad values. +typedef NTV2AudioChannelQuads::const_iterator NTV2AudioChannelQuadsConstIter; ///< @brief Handy const iterator to iterate over a set of distinct NTV2AudioChannelQuad values. +AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioChannelQuads & inSet); ///< @brief Handy ostream writer for NTV2AudioChannelQuads. + +typedef std::set NTV2AudioChannelOctets; ///< @brief A set of distinct NTV2AudioChannelOctet values. +typedef NTV2AudioChannelOctets::const_iterator NTV2AudioChannelOctetsConstIter;///< @brief Handy const iterator to iterate over a set of distinct NTV2AudioChannelOctet values. +AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioChannelOctets & inSet); ///< @brief Handy ostream writer for NTV2AudioChannelOctets. + +typedef std::vector NTV2DoubleArray; ///< @brief An array of double-precision floating-point values. +typedef NTV2DoubleArray::iterator NTV2DoubleArrayIter; ///< @brief Handy non-const iterator to iterate over an NTV2DoubleArray. +typedef NTV2DoubleArray::const_iterator NTV2DoubleArrayConstIter; ///< @brief Handy const iterator to iterate over an NTV2DoubleArray. +AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2DoubleArray & inVector); ///< @brief Handy ostream writer for NTV2DoubleArray. + +typedef UByte NTV2DID; ///< @brief An ancillary Data IDentifier. +typedef std::set NTV2DIDSet; ///< @brief A set of distinct NTV2DID values. +typedef NTV2DIDSet::iterator NTV2DIDSetIter; ///< @brief Handy non-const iterator to iterate over an NTV2DIDSet. +typedef NTV2DIDSet::const_iterator NTV2DIDSetConstIter; ///< @brief Handy const iterator to iterate over an NTV2DIDSet. +AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2DIDSet & inDIDs); ///< @brief Handy ostream writer for NTV2DIDSet. + + +typedef std::bitset<16> NTV2AudioChannelsMuted16; ///< @brief Per-audio-channel mute state for up to 16 audio channels. +const NTV2AudioChannelsMuted16 NTV2AudioChannelsMuteAll = NTV2AudioChannelsMuted16(0xFFFF); ///< @brief All 16 audio channels muted/disabled. +const NTV2AudioChannelsMuted16 NTV2AudioChannelsEnableAll = NTV2AudioChannelsMuted16(0x0000); ///< @brief All 16 audio channels unmuted/enabled. +const ULWord LUTTablePartitionSize = ULWord(0x40000); + + + +/** + @brief I interrogate and control an AJA video/audio capture/playout device. +**/ +#if defined (MSWindows) + class AJAExport CNTV2Card : public CNTV2WinDriverInterface +#elif defined (AJAMac) + class CNTV2Card : public CNTV2MacDriverInterface +#elif defined (AJALinux) + class CNTV2Card : public CNTV2LinuxDriverInterface +#endif +{ +public: + /** + @name Construction & Destruction + **/ + ///@{ + /** + @brief My default constructor. + **/ + CNTV2Card (); + + /** + @brief Constructor that opens the device. + @param[in] inDeviceIndex A zero-based index number that identifies which device to open, + which should be the number received from the ::CNTV2DeviceScanner. + @param[in] inHostName If non-empty, must contain the name of a host that has one or more + AJA devices. Defaults to empty string (the local host). + @nosubgrouping + **/ + explicit CNTV2Card ( const UWord inDeviceIndex, + const std::string & inHostName = std::string()); +#if !defined(NTV2_DEPRECATE_14_3) + explicit NTV2_DEPRECATED_f(CNTV2Card (const UWord inDeviceIndex, const bool inDisplayError, const UWord inDeviceType, const char* pInHostName)); +#endif // !defined(NTV2_DEPRECATE_14_3) + + /** + @brief My destructor. + **/ + virtual ~CNTV2Card(); + ///@} + + + /** + @name Inquiry + **/ + ///@{ + + /** + @brief Answers with this device's display name. + @return A string containing this device's display name. + **/ + AJA_VIRTUAL std::string GetDisplayName (void); + + /** + @brief Answers with this device's model name. + @return A string containing this device's model name. + **/ + AJA_VIRTUAL std::string GetModelName (void); + + /** + @brief Answers with this device's version number. + @return This device's version number. + **/ + AJA_VIRTUAL Word GetDeviceVersion (void); + + /** + @brief Answers with this device's version number as a human-readable string. + @return A string containing this device's version number as a human-readable string. + **/ + AJA_VIRTUAL std::string GetDeviceVersionString (void); + + /** + @brief Answers with this device's driver's version as a human-readable string. + @return A string containing this device's driver's version as a human-readable string. + **/ + AJA_VIRTUAL std::string GetDriverVersionString (void); + + /** + @brief Answers with the individual version components of this device's driver. + @param[out] outMajor Receives the driver's major version number. + @param[out] outMinor Receives the driver's minor version number. + @param[out] outPoint Receives the driver's point release number. + @param[out] outBuild Receives the driver's build number. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetDriverVersionComponents (UWord & outMajor, UWord & outMinor, UWord & outPoint, UWord & outBuild); + + /** + @brief Answers with my serial number. + @return My 64-bit serial number. + @note To decode this into a human-readable form, use my SerialNum64ToString class method. + **/ + AJA_VIRTUAL uint64_t GetSerialNumber (void); // From CNTV2Status + + /** + @brief Answers with a string that contains my human-readable serial number. + @return True if successful (and valid); otherwise false. + **/ + AJA_VIRTUAL bool GetSerialNumberString (std::string & outSerialNumberString); // From CNTV2Status + + /** + @brief Answers with my PCI device ID. + @param[out] outPCIDeviceID Receives my PCI device ID. + @return True if successful (and valid); otherwise false. + **/ + AJA_VIRTUAL bool GetPCIDeviceID (ULWord & outPCIDeviceID); + + + /** + @return My current breakout box hardware type, if any is attached. + **/ + AJA_VIRTUAL NTV2BreakoutType GetBreakoutHardware (void); + ///@} + + + /** + @name Device Features + **/ + ///@{ + AJA_VIRTUAL bool DeviceCanDoFormat (NTV2FrameRate inFrameRate, + NTV2FrameGeometry inFrameGeometry, + NTV2Standard inStandard); + AJA_VIRTUAL bool DeviceCanDo3GOut (UWord index0); + AJA_VIRTUAL bool DeviceCanDoLTCEmbeddedN (UWord index0); + AJA_VIRTUAL ULWord DeviceGetFrameBufferSize (void); + AJA_VIRTUAL ULWord DeviceGetNumberFrameBuffers (void); + AJA_VIRTUAL ULWord DeviceGetAudioFrameBuffer (void); + AJA_VIRTUAL ULWord DeviceGetAudioFrameBuffer2 (void); + AJA_VIRTUAL ULWord DeviceGetFrameBufferSize (const NTV2FrameGeometry inFrameGeometry, const NTV2FrameBufferFormat inFBFormat); // Revisit for 2MB granularity + AJA_VIRTUAL ULWord DeviceGetNumberFrameBuffers (const NTV2FrameGeometry inFrameGeometry, const NTV2FrameBufferFormat inFBFormat); // Revisit for 2MB granularity + AJA_VIRTUAL ULWord DeviceGetAudioFrameBuffer (const NTV2FrameGeometry inFrameGeometry, const NTV2FrameBufferFormat inFBFormat); // Revisit for 2MB granularity + AJA_VIRTUAL ULWord DeviceGetAudioFrameBuffer2 (const NTV2FrameGeometry inFrameGeometry, const NTV2FrameBufferFormat inFBFormat); // Revisit for 2MB granularity + + /** + @brief Returns true if the device having the given ID supports the given NTV2VideoFormat. + @param[in] inVideoFormat Specifies the NTV2VideoFormat. + @return True if the device supports the given video format. + **/ + AJA_VIRTUAL bool DeviceCanDoVideoFormat (const NTV2VideoFormat inVideoFormat); + + /** + @brief Returns true if the device having the given ID supports the given NTV2FrameBufferFormat. + @param[in] inFBFormat Specifies the NTV2FrameBufferFormat. + @return True if the device supports the given frame buffer (pixel) format. + **/ + AJA_VIRTUAL bool DeviceCanDoFrameBufferFormat (const NTV2FrameBufferFormat inFBFormat); + + /** + @brief Returns true if the device having the given ID supports the given NTV2WidgetID. + @param[in] inWidgetID Specifies the NTV2WidgetID. + @return True if the device supports the given widget. + **/ + AJA_VIRTUAL bool DeviceCanDoWidget (const NTV2WidgetID inWidgetID); + + /** + @brief Returns true if the device having the given ID supports the given NTV2ConversionMode. + @param[in] inConversionMode Specifies the NTV2ConversionMode. + @return True if the device supports the given conversion mode. + **/ + AJA_VIRTUAL bool DeviceCanDoConversionMode (const NTV2ConversionMode inConversionMode); + + /** + @brief Returns true if the device having the given ID supports the given NTV2DSKMode. + @param[in] inDSKMode Specifies the NTV2DSKMode. + @return True if the device supports the given DSK mode. + **/ + AJA_VIRTUAL bool DeviceCanDoDSKMode (const NTV2DSKMode inDSKMode); + + /** + @brief Returns true if the device having the given ID supports the given NTV2InputSource. + @param[in] inInputSource Specifies the NTV2InputSource. + @return True if the device supports the given input source. + **/ + AJA_VIRTUAL bool DeviceCanDoInputSource (const NTV2InputSource inInputSource); + + /** + @brief Returns true if the supports the audio mixer. + @return True if the device supports the audio mixer. + **/ + AJA_VIRTUAL bool DeviceCanDoAudioMixer (void); + + /** + @brief Returns true if the device can convert HDMI tsi to/from quad raster. + @return True if the device supports quad raster conversion. + **/ + AJA_VIRTUAL bool DeviceCanDoHDMIQuadRasterConversion (void); + + AJA_VIRTUAL bool DeviceIsDNxIV (void); + + /** + @return Returns true if the device has a microphone input connector. + **/ + AJA_VIRTUAL bool DeviceHasMicInput (void); + + /** + @brief Fetches the requested boolean value. Typically called to determine device features. + @param[in] inParamID Specifies the NTV2BoolParamID of interest. + @param[out] outValue Receives the requested boolean value. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetBoolParam (const NTV2BoolParamID inParamID, bool & outValue); + + /** + @brief Fetches the requested numeric value. Typically called to determine device features. + @param[in] inParamID Specifies the NTV2NumericParamID of interest. + @param[out] outValue Receives the requested numeric value. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetNumericParam (const NTV2NumericParamID inParamID, uint32_t & outValue); + ///@} + + + /** + @name DMA Transfer + **/ + ///@{ + /** + @brief Transfers data from the AJA device to the host. + @param[in] inFrameNumber Specifies the zero-based frame index number of the starting frame to be read from the device. + For \ref vidop-fbindexing purposes, this function assumes the intrinsic frame size of the device. + @param[in] pFrameBuffer Specifies the non-NULL address of the host buffer that is to receive the frame data. + The memory it points to must be writeable. + @param[in] inOffsetBytes Specifies the byte offset into the device frame buffer. + @param[in] inByteCount Specifies the total number of bytes to transfer. + @return True if successful; otherwise false. + @note The host buffer should be at least inByteCount + inOffsetBytes in size, or host memory will be corrupted. + @note This function will block and not return until the transfer has finished or failed. + @see CNTV2Card::DMAWrite, CNTV2Card::DMAReadFrame, CNTV2Card::DMAReadSegments, \ref vidop-fbaccess + **/ + AJA_VIRTUAL bool DMARead (const ULWord inFrameNumber, ULWord * pFrameBuffer, const ULWord inOffsetBytes, const ULWord inByteCount); + + /** + @brief Transfers data from the host to the AJA device. + @param[in] inFrameNumber Specifies the zero-based frame number of the frame to be written on the device. + For \ref vidop-fbindexing purposes, this function assumes the intrinsic frame size of the device. + @param[in] pFrameBuffer Specifies the non-NULL address of the host buffer that is to supply the frame data. + The memory it points to must be readable. + @param[in] inOffsetBytes Specifies the byte offset into the device frame buffer. + @param[in] inByteCount Specifies the total number of bytes to transfer. + @return True if successful; otherwise false. + @note The host buffer should be at least inByteCount + inOffsetBytes in size, or a host memory access violation may occur. + @note This function will block and not return until the transfer has finished or failed. + @see CNTV2Card::DMARead, CNTV2Card::DMAWriteFrame, CNTV2Card::DMAWriteSegments, \ref vidop-fbaccess + **/ + AJA_VIRTUAL bool DMAWrite (const ULWord inFrameNumber, const ULWord * pFrameBuffer, const ULWord inOffsetBytes, const ULWord inByteCount); + + + /** + @brief Transfers a single frame from the AJA device to the host. + @param[in] inFrameNumber Specifies the zero-based frame number of the frame to be read from the device. + For \ref vidop-fbindexing purposes, this function assumes the intrinsic frame size of the device. + @param[in] pOutFrameBuffer Specifies the non-NULL address of the host buffer that is to receive the frame data. + The memory it points to must be writeable. + @param[in] inByteCount Specifies the total number of bytes to transfer. + @return True if successful; otherwise false. + @note The host buffer must be at least inByteCount in size, or a host memory access violation may occur. + @note This function will block and not return until the transfer has finished or failed. + @see CNTV2Card::DMAWriteFrame, CNTV2Card::DMARead, CNTV2Card::DMAReadSegments, \ref vidop-fbaccess + **/ + AJA_VIRTUAL bool DMAReadFrame (const ULWord inFrameNumber, ULWord * pOutFrameBuffer, const ULWord inByteCount); + + /** + @brief Transfers a single frame from the AJA device to the host. This call is multi-format compatible. + @param[in] inFrameNumber Specifies the zero-based frame number of the frame to be read from the device. + For \ref vidop-fbindexing purposes, this function assumes frame offsets/sizes + based on the FrameStore identified by the \c inChannel parameter (below). + @param[in] pHostBuffer Specifies the non-NULL address of the host buffer that is to receive the frame data. + The memory it points to must be writeable. + @param[in] inByteCount Specifies the total number of bytes to transfer. + @param[in] inChannel Specifies the FrameStore to supply the \ref vidop-fbindexing context to use with the + \c inFrameNumber parameter. If the FrameStore, for example, is configured for UHD/4K, + the intrinsic frame size (8MB or 16MB) will be quadrupled when calculating the starting + source address in device SDRAM. + @return True if successful; otherwise false. + @note The host buffer must be at least inByteCount in size, or a host memory access violation may occur. + @note This function will block and not return until the transfer has finished or failed. + @see CNTV2Card::DMAWriteFrame, CNTV2Card::DMARead, CNTV2Card::DMAReadSegments, \ref vidop-fbaccess + **/ + AJA_VIRTUAL bool DMAReadFrame (const ULWord inFrameNumber, ULWord * pHostBuffer, const ULWord inByteCount, const NTV2Channel inChannel); + + /** + @brief Transfers a single frame from the host to the AJA device. + @param[in] inFrameNumber Specifies the zero-based frame number of the frame to be written to the device. + For \ref vidop-fbindexing purposes, this function assumes the intrinsic frame size of the device. + @param[in] pInFrameBuffer Specifies the non-NULL address of the host buffer that is to supply the frame data. + The memory it points to must be readable. + @param[in] inByteCount Specifies the total number of bytes to transfer. + @return True if successful; otherwise false. + @note The host buffer must be at least inByteCount in size, or a host memory access violation may occur. + @note This function will block and not return until the transfer has finished or failed. + @see CNTV2Card::DMAReadFrame, CNTV2Card::DMAWrite, CNTV2Card::DMAWriteSegments, \ref vidop-fbaccess + **/ + AJA_VIRTUAL bool DMAWriteFrame (const ULWord inFrameNumber, const ULWord * pInFrameBuffer, const ULWord inByteCount); + + /** + @brief Transfers a single frame from the host to the AJA device. This function is multi-format compatible. + @param[in] inFrameNumber Specifies the zero-based frame number of the frame to be written to the device. + For \ref vidop-fbindexing purposes, this function assumes frame offsets/sizes + based on the FrameStore identified by the \c inChannel parameter (below). + @param[in] pInFrameBuffer Specifies the non-NULL address of the host buffer that is to supply the frame data. + The memory it points to must be readable. + @param[in] inByteCount Specifies the total number of bytes to transfer. + @param[in] inChannel Specifies the FrameStore to supply the \ref vidop-fbindexing context to use with the + \c inFrameNumber parameter. If the FrameStore, for example, is configured for UHD/4K, + the intrinsic frame size (8MB or 16MB) will be quadrupled when calculating the starting + destination address in device SDRAM. + @return True if successful; otherwise false. + @note The host buffer must be at least inByteCount in size, or a host memory access violation may occur. + @note This function will block and not return until the transfer has finished or failed. + @see CNTV2Card::DMAReadFrame, CNTV2Card::DMAWrite, CNTV2Card::DMAWriteSegments, \ref vidop-fbaccess + **/ + AJA_VIRTUAL bool DMAWriteFrame (const ULWord inFrameNumber, const ULWord * pInFrameBuffer, const ULWord inByteCount, const NTV2Channel inChannel); + + /** + @brief Performs a segmented data transfer from the AJA device to the host. + @param[in] inFrameNumber Specifies the zero-based frame number of the frame to be read from the device. + @param[in] pFrameBuffer Specifies the non-NULL address of the host buffer that is to supply the frame data. + The memory it points to must be writeable. + @param[in] inCardOffsetBytes Specifies the initial on-device memory byte offset for the first bytes transferred. + @param[in] inSegmentByteCount Specifies the number of bytes to transfer per segment. + @param[in] inNumSegments Specifies the number of segments to transfer. + @param[in] inSegmentHostPitch Specifies the number of bytes to increment the host memory pointer after each segment is transferred. + @param[in] inSegmentCardPitch Specifies the number of bytes to increment the on-device memory pointer after each segment is transferred. + @return True if successful; otherwise false. + @note The host buffer should be at least inSegmentByteCount*inNumSegments+inOffsetBytes in size, or a host memory access violation may occur. + @note This function will block and not return until the transfer has finished or failed. + @see CNTV2Card::DMAWriteSegments, CNTV2Card::DMARead, CNTV2Card::DMAReadFrame, \ref vidop-fbaccess + **/ + AJA_VIRTUAL bool DMAReadSegments ( const ULWord inFrameNumber, + ULWord * pFrameBuffer, + const ULWord inCardOffsetBytes, + const ULWord inSegmentByteCount, + const ULWord inNumSegments, + const ULWord inSegmentHostPitch, + const ULWord inSegmentCardPitch); + + /** + @brief Performs a segmented data transfer from the host to the AJA device. + @param[in] inFrameNumber Specifies the zero-based frame number of the frame to be written on the device. + @param[in] pFrameBuffer Specifies the non-NULL address of the host buffer that is to supply the frame data. + The memory it points to must be readable. + @param[in] inOffsetBytes Specifies the initial device memory byte offset for the first bytes transferred. + @param[in] inSegmentByteCount Specifies the number of bytes to transfer per segment. + @param[in] inNumSegments Specifies the number of segments to transfer. + @param[in] inSegmentHostPitch Specifies the number of bytes to increment the host memory pointer after each segment is transferred. + @param[in] inSegmentCardPitch Specifies the number of bytes to increment the on-device memory pointer after each segment is transferred. + @return True if successful; otherwise false. + @note The host buffer should be at least inSegmentByteCount*inNumSegments+inOffsetBytes in size, or a host memory access violation may occur. + @note This function will block and not return until the transfer has finished or failed. + @see CNTV2Card::DMAReadSegments, CNTV2Card::DMAWrite, CNTV2Card::DMAWriteFrame, \ref vidop-fbaccess + **/ + AJA_VIRTUAL bool DMAWriteSegments ( const ULWord inFrameNumber, + const ULWord * pFrameBuffer, + const ULWord inOffsetBytes, + const ULWord inSegmentByteCount, + const ULWord inNumSegments, + const ULWord inSegmentHostPitch, + const ULWord inSegmentCardPitch); + + /** + @brief DirectGMA p2p transfers (not GPUDirect: see DMABufferLock) + **/ + AJA_VIRTUAL bool DmaP2PTargetFrame (NTV2Channel channel, // frame buffer channel output frame to update on completion + ULWord frameNumber, // frame number to target + ULWord frameOffset, // frame buffer offset (bytes) + PCHANNEL_P2P_STRUCT pP2PData); // p2p target data (output) + + AJA_VIRTUAL bool DmaP2PTransferFrame (NTV2DMAEngine DMAEngine, // dma engine for transfer + ULWord frameNumber, // source frame number + ULWord frameOffset, // source frame buffer offset (bytes) + ULWord transferSize, // transfer size (bytes) + ULWord numSegments, // number of segments (0 if not a segmented transfer) + ULWord segmentTargetPitch, // target frame pitch (0 if not a segmented transfer) + ULWord segmentCardPitch, // source frame pitch (0 if not a segmented transfer) + PCHANNEL_P2P_STRUCT pP2PData); // p2p target data + + /** + @brief Synchronously transfers audio data from a given Audio System's buffer memory on the AJA device to the specified host + buffer, blocking until the transfer has completed. + @param[in] inAudioSystem Specifies the Audio System on the device that is to supply the audio data. + @param pOutAudioBuffer Specifies a valid, non-NULL pointer to the host buffer that is to receive the audio data. + This buffer must be large enough to accommodate "inByteCount" bytes of data specified (below). + @param[in] inOffsetBytes Specifies the offset into the Audio System's buffer memory on the device from which to transfer + audio data. Specify zero to start reading from the device audio output (playout) buffer. + Specify the value returned from CNTV2Card::GetAudioReadOffset (0x00400000) to start reading from + the audio input (capture) portion of the Audio System's audio buffer. + @param[in] inByteCount Specifies the number of audio bytes to transfer. + @return True if successful; otherwise false. + @note This function can also be used to read audio samples from the output (playout) portion of the Audio System's buffer + memory. + **/ + AJA_VIRTUAL bool DMAReadAudio ( const NTV2AudioSystem inAudioSystem, + ULWord * pOutAudioBuffer, + const ULWord inOffsetBytes, + const ULWord inByteCount); + + /** + @brief Synchronously transfers audio data from the specified host buffer to the given Audio System's buffer memory + on the AJA device, blocking until the transfer has completed. + @param[in] inAudioSystem Specifies the Audio System on the device that is to receive the audio data. + @param[in] pInAudioBuffer Specifies a valid, non-NULL pointer to the host buffer that is to supply the audio data. + @param[in] inOffsetBytes Specifies the offset into the Audio System's buffer memory on the device to which audio data + will be transferred. Use zero for the start of the playout portion of the Audio System's buffer + memory. Specifying 0 will start writing at the start of the device audio output (playout) buffer; + specifying 0x00400000 will start writing at the start of the audio input (capture) buffer. + @param[in] inByteCount Specifies the number of audio bytes to transfer. Note that this value must not overrun the host + buffer, nor the device's audio buffer. + @return True if successful; otherwise false. + @note This function can also be used to write audio samples into the capture portion of the Audio System's buffer + memory (which will quickly be overwritten if the capture audio system has been started). + **/ + AJA_VIRTUAL bool DMAWriteAudio ( const NTV2AudioSystem inAudioSystem, + const ULWord * pInAudioBuffer, + const ULWord inOffsetBytes, + const ULWord inByteCount); + + /** + @brief Transfers the contents of the ancillary data buffer(s) from a given frame on the AJA device to the host. + @param[in] inFrameNumber Specifies the zero-based frame number of the frame buffer to be read on the device. + The actual starting device memory address is predicated on the device's current + frame size, which doesn't take into account "quad" or "quad-quad 8K" frames. + Callers must carefully calculate this number, taking into account other FrameStores + or Channels that may be active, and if they're using "Quad" or "QuadQuad" geometries. + @param[out] outAncF1Buffer Specifies the host buffer that is to receive the device F1 ancillary data buffer contents. + @param[out] outAncF2Buffer Optionally specifies the host buffer that is to receive the device F2 ancillary data + buffer contents. + @param[in] inChannel The FrameStore/Channel being used for ingest. Defaults to NTV2_CHANNEL1. + @return True if successful; otherwise false. + @note This function assumes the device Anc extractor has been properly configured by a prior calls to + CNTV2Card::AncExtractInit, CNTV2Card::AncExtractSetWriteParams (and also possibly CNTV2Card::AncExtractSetField2WriteParams). + @note This function will block and not return until the transfer has finished or failed. + @note This function uses the values stored in the ::kVRegAncField1Offset and ::kVRegAncField2Offset virtual registers + to determine the Anc data boundary locations within each frame buffer in device memory. + @note For capture from IP devices running S2110 firmware, this method will automatically extract VPID and + RP188 timecode packets from the incoming RTP Anc streams, even if not ::AUTOCIRCULATE_WITH_ANC, or without + Anc buffers in the "transferInfo". + - To disable this behavior completely, use an invalid ::NTV2Channel value (e.g. ::NTV2_CHANNEL_INVALID). + **/ + AJA_VIRTUAL bool DMAReadAnc ( const ULWord inFrameNumber, + NTV2_POINTER & outAncF1Buffer, + NTV2_POINTER & outAncF2Buffer = NULL_POINTER, + const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Transfers the contents of the ancillary data buffer(s) from the host to a given frame on the AJA device. + @param[in] inFrameNumber Specifies the zero-based frame number of the frame to be read from the device. + The actual starting device memory address is predicated on the device's current + frame size, which doesn't take into account "quad" or "quad-quad 8K" frames. + Callers must carefully calculate this number, taking into account other FrameStores + or Channels that may be active, and if they're using "Quad" or "QuadQuad" geometries. + @param[in] inAncF1Buffer Specifies the host buffer that is to supply the F1 ancillary data buffer content. + @param[in] inAncF2Buffer Optionally specifies the host buffer that is to supply the F2 ancillary data + buffer content. + @param[in] inChannel The FrameStore/Channel being used for playout. Defaults to NTV2_CHANNEL1. + @return True if successful; otherwise false. + @note This function assumes the device Anc inserter has been properly configured by prior calls to + CNTV2Card::AncInsertInit, CNTV2Card::AncInsertSetReadParams (and also possibly CNTV2Card::AncInsertSetField2ReadParams). + @note This function will block and not return until the transfer has finished or failed. + @note This function uses the values stored in the ::kVRegAncField1Offset and ::kVRegAncField2Offset virtual registers + to determine the Anc data boundary locations within each frame buffer in device memory. + @note For playout to IP devices running S2110 firmware, this method will automatically add VPID and + RP188 timecode packets into the outgoing RTP Anc streams, even if such packets weren't placed into the + given buffers. This default behavior can be overridden or disabled: + - To disable this behavior completely, use an invalid ::NTV2Channel value (e.g. ::NTV2_CHANNEL_INVALID). + - To disable the default VPID insertion, call CNTV2Card::SetSDIOutVPID, passing zeroes for + the VPID values. + - To override the default VPID values, insert your own VPID packet(s) into the F1 + and/or F2 Anc buffers. + - To override the default RP188 value(s), insert your own RP188 packets into the + F1 and/or F2 Anc buffers. + **/ + AJA_VIRTUAL bool DMAWriteAnc ( const ULWord inFrameNumber, + NTV2_POINTER & inAncF1Buffer, + NTV2_POINTER & inAncF2Buffer = NULL_POINTER, + const NTV2Channel inChannel = NTV2_CHANNEL1); + + + /** + @brief Synchronously transfers LUT data from the specified host buffer to the given buffer memory + on the AJA device, blocking until the transfer has completed. + @param[in] inFrameNumber Specifies the zero-based frame number of the frame buffer to be read on the device. + @param[in] pInLUTBuffer Specifies a valid, non-NULL pointer to the host buffer that is to supply the LUT data. + @param[in] inLUTIndex Specifies the index of the LUT + @param[in] inByteCount Specifies the amount to DMA + @return True if successful; otherwise false. + @note This function can also be used to write LUT Tables into memory + **/ + AJA_VIRTUAL bool DMAWriteLUTTable ( const ULWord inFrameNumber, const ULWord * pInLUTBuffer, const ULWord inLUTIndex,const ULWord inByteCount = LUTTablePartitionSize); + + /** + @brief Page-locks the given host buffer to reduce transfer time and CPU usage of DMA transfers. + @param[in] inBuffer Specifies the host buffer to lock. + @param[in] inMap Also lock the segment map. + @param[in] inRDMA Lock a GPUDirect buffer for p2p DMA. + @return True if successful; otherwise false. + @see CNTV2Card::DMABufferUnlock, CNTV2Card::DMABufferAutoLock, CNTV2Card::DMABufferUnlockAll, \ref vidop-fblocking + **/ + AJA_VIRTUAL bool DMABufferLock (const NTV2_POINTER & inBuffer, bool inMap = false, bool inRDMA = false); // New in SDK 15.5 + + /** + @brief Page-locks the given host buffer to reduce transfer time and CPU usage of DMA transfers. + @param[in] pInBuffer Specifies the starting address of the host buffer to lock. + @param[in] inByteCount Specifies the total length of the host buffer. + @param[in] inMap Also lock the segment map. + @param[in] inRDMA Lock a GPUDirect buffer for p2p DMA. + @return True if successful; otherwise false. + @note On the Windows platform, buffers allocated using GlobalAlloc or VirtualAlloc often won't map properly because + these functions allocate the virtual address space but not the memory pages, which only get allocated and committed + when the memory gets written (touched). Instead, we recommend using _aligned_malloc for mapped host memory. + @see CNTV2Card::DMABufferUnlock, CNTV2Card::DMABufferAutoLock, CNTV2Card::DMABufferUnlockAll, \ref vidop-fblocking + **/ + AJA_VIRTUAL inline bool DMABufferLock (const ULWord * pInBuffer, const ULWord inByteCount, bool inMap = false, bool inRDMA = false) + { + return DMABufferLock(NTV2_POINTER(pInBuffer, inByteCount), inMap, inRDMA); + } + + + /** + @brief Unlocks the given host buffer that was previously locked using CNTV2Card::DMABufferLock. + @param[in] inBuffer Specifies the host buffer to unlock. + @return True if successful; otherwise false. + @see CNTV2Card::DMABufferLock, CNTV2Card::DMABufferUnlockAll, \ref vidop-fblocking + **/ + AJA_VIRTUAL bool DMABufferUnlock (const NTV2_POINTER & inBuffer); + + /** + @brief Unlocks the given host buffer that was previously locked using CNTV2Card::DMABufferLock. + @param[in] pInBuffer Specifies the starting address of the previously locked host buffer. + @param[in] inByteCount Specifies the total length of the previously locked host buffer. + @return True if successful; otherwise false. + @see CNTV2Card::DMABufferLock, CNTV2Card::DMABufferUnlockAll, \ref vidop-fblocking + **/ + AJA_VIRTUAL inline bool DMABufferUnlock (const ULWord * pInBuffer, const ULWord inByteCount) + { + return DMABufferUnlock(NTV2_POINTER(pInBuffer, inByteCount)); + } + + /** + @brief Unlocks all previously-locked buffers used for DMA transfers. + @return True if successful; otherwise false. + @see CNTV2Card::DMABufferLock, CNTV2Card::DMABufferUnlock, \ref vidop-fblocking + **/ + AJA_VIRTUAL bool DMABufferUnlockAll (); + + /** + @brief Enables or disables automatic buffer locking. + @param[in] inEnable Specify true to enable automatic buffer locking; otherwise false to disable it. + @param[in] inMap If enabling automatic locking, also try to lock the segment map. + @param[in] inMaxLockSize Specify the maximum number of locked bytes. + @return True if successful; otherwise false. + @see CNTV2Card::DMABufferLock, CNTV2Card::DMABufferUnlock, CNTV2Card::DMABufferUnlockAll, \ref vidop-fblocking + **/ + AJA_VIRTUAL bool DMABufferAutoLock (const bool inEnable, const bool inMap = false, const ULWord64 inMaxLockSize = 0); + + + /** + @brief Clears the ancillary data region in the device frame buffer for the specified frames. + @param[in] inStartFrameNumber Specifies the starting device frame number. + @param[in] inEndFrameNumber Specifies the ending device frame number. + @param[in] inAncRegion Optionally specifies the ancillary data region to clear (e.g. + NTV2_AncRgn_Field1, NTV2_AncRgn_Field2, etc.). Defaults to all regions. + @param[in] inChannel Optionally specifies the channel associated with the frame numbers. + Defaults to NTV2_CHANNEL1. (New in SDK 16.1) + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool DMAClearAncRegion ( const UWord inStartFrameNumber, + const UWord inEndFrameNumber, + const NTV2AncillaryDataRegion inAncRegion = NTV2_AncRgn_All, + const NTV2Channel = NTV2_CHANNEL1); + + /** + @brief Answers with the address and size of the given frame. + @param[in] inFrameNumber Specifies the zero-based frame number of the frame of interest. + @param[in] inChannel Specifies the ::NTV2Channel of interest (for multi-format mode). + Ignored and assumes ::NTV2_CHANNEL1 if device is not in multi-format mode. + @param[out] outAddress Receives the device memory address of the first byte of the given frame. + @param[out] outLength Receives the frame size, in bytes. + @note The ::NTV2Channel parameter must not refer to a FrameStore that is slaved to a quad or quad-quad master. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetDeviceFrameInfo (const UWord inFrameNumber, const NTV2Channel inChannel, + uint64_t & outAddress, uint64_t & outLength); + + AJA_VIRTUAL bool GetDeviceFrameInfo (const UWord inFrameNumber, const NTV2Channel inChannel, ULWord & outIntrinsicSize, + bool & outMultiFmt, bool & outQuad, bool & outQuadQuad, bool & outSquares, bool & outTSI, + uint64_t & outAddress, uint64_t & outLength); // New in SDK 16.2 + + /** + @brief Answers with the frame number that contains the given address. + @param[in] inAddress Specifies the device memory address of the first byte of the given frame. + @param[out] outFrameNumber Receives the zero-based frame number. + @param[in] inChannel Optionally specifies the channel of interest (for multi-format). + Defaults to NTV2_CHANNEL1 for uni-format. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool DeviceAddressToFrameNumber (const uint64_t inAddress, UWord & outFrameNumber, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers with the offset and size of an ancillary data region within a device frame buffer. + @param[out] outByteOffset Receives the byte offset where the ancillary data region starts in the frame buffer, + (measured from the start of the frame buffer). + This is guaranteed to be non-zero if the function succeeds, and zero if it fails. + @param[out] outByteCount Receives the size of the ancillary data region, in bytes. + This is guaranteed to be non-zero if the function succeeds, and zero if it fails. + @param[in] inAncRegion Optionally specifies the ancillary data region of interest (e.g. NTV2_AncRgn_Field1, + NTV2_AncRgn_Field2, etc.). Defaults to all regions, for the maximum offset and size + among all of them. + @return True if successful; otherwise false. + @see CNTV2Card::AncSetFrameBufferSize, \ref anccapture-dataspace + **/ + AJA_VIRTUAL bool GetAncRegionOffsetAndSize (ULWord & outByteOffset, ULWord & outByteCount, + const NTV2AncillaryDataRegion inAncRegion = NTV2_AncRgn_All); + + /** + @brief Answers with the byte offset to the start of an ancillary data region within a device frame buffer, + as measured from the bottom of the frame buffer. + @param[out] outByteOffsetFromBottom Receives the byte offset to the start of the ancillary data region, + as measured from the bottom of the frame buffer. + @param[in] inAncRegion Optionally specifies the ancillary data region of interest (e.g. NTV2_AncRgn_Field1, + NTV2_AncRgn_Field2, etc.). Defaults to all regions, for the largest offset among + them all. + @return True if successful; otherwise false. + @see CNTV2Card::GetAncRegionOffsetAndSize, \ref anccapture-dataspace + **/ + AJA_VIRTUAL bool GetAncRegionOffsetFromBottom (ULWord & outByteOffsetFromBottom, + const NTV2AncillaryDataRegion inAncRegion = NTV2_AncRgn_All); + + +#if !defined(NTV2_DEPRECATE_15_2) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DMAReadAnc(const ULWord inFrameNumber, UByte* pOutAncBuffer, const NTV2FieldID inFieldID = NTV2_FIELD0, + const ULWord inByteCount = 2048)); ///< @deprecated Call CNTV2Card::DMAWriteAnc(const ULWord, NTV2_POINTER &, NTV2_POINTER &) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DMAWriteAnc(const ULWord inFrameNumber, const UByte* pInAncBuffer, const NTV2FieldID inFieldID = NTV2_FIELD0, + const ULWord inByteCount = 2048)); ///< @deprecated Call CNTV2Card::DMAWriteAnc(const ULWord, const NTV2_POINTER &, const NTV2_POINTER &) instead. +#endif // !defined(NTV2_DEPRECATE_15_2) + ///@} + +// +// Set/Get Parameter routines +// + #if defined (AJAMac) + #define AJA_RETAIL_DEFAULT true + #else // else !defined (AJAMac) + #define AJA_RETAIL_DEFAULT false + #endif // !defined (AJAMac) + + /** + @brief Configures the AJA device to handle a specific video format. + @param[in] inVideoFormat Specifies the desired video format for the given channel on the device. + It must be a valid ::NTV2VideoFormat constant. + @param[in] inIsAJARetail Specify 'true' to preserve the current horizontal and vertical timing settings. + Defaults to true on MacOS, false on other platforms. + @param[in] inKeepVancSettings If true, specifies that the device's current VANC settings are to be preserved; + otherwise, they will not be preserved. Defaults to false. + @param[in] inChannel Specifies the NTV2Channel of interest. Defaults to ::NTV2_CHANNEL1. + For UHD/4K video formats, specify NTV2_CHANNEL1 to configure quadrant channels 1-4, + or ::NTV2_CHANNEL5 to configure quadrant channels 5-8. + @return True if successful; otherwise false. + @details This function changes the device configuration to a specific video standard (e.g., 525, 1080, etc.), + frame geometry (e.g., 1920x1080, 720x486, etc.) and frame rate (e.g., 59.94 fps, 29.97 fps, etc.), + plus a few other settings (e.g., progressive/interlaced, etc.), all based on the given video format. + **/ + AJA_VIRTUAL bool SetVideoFormat (const NTV2VideoFormat inVideoFormat, const bool inIsAJARetail = AJA_RETAIL_DEFAULT, const bool inKeepVancSettings = false, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Sets the video format for one or more FrameStores. + @param[in] inFrameStores Specifies the FrameStore(s) of interest as a channel-set (a set of zero-based index numbers). + @param[in] inVideoFormat Specifies the desired video format. It must be a valid ::NTV2VideoFormat constant. + @param[in] inIsAJARetail Specify 'true' to preserve the current horizontal and vertical timing settings. + Defaults to true on MacOS, false on other platforms. + @return True if successful; otherwise false. + @details This function changes the device configuration to a specific video standard (e.g., 525, 1080, etc.), + frame geometry (e.g., 1920x1080, 720x486, etc.) and frame rate (e.g., 59.94 fps, 29.97 fps, etc.), + plus a few other settings (e.g., progressive/interlaced, etc.), all based on the given video format. + **/ + AJA_VIRTUAL bool SetVideoFormat (const NTV2ChannelSet & inFrameStores, const NTV2VideoFormat inVideoFormat, const bool inIsAJARetail = AJA_RETAIL_DEFAULT); + + /** + @brief Sets the frame geometry of the given channel. + @param[in] inGeometry Specifies the desired frame geometry. It must be a valid ::NTV2FrameGeometry value. + @param[in] inIsRetail This parameter is ignored. + @param[in] inChannel Specifies the ::NTV2Channel of interest. Defaults to ::NTV2_CHANNEL1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetFrameGeometry (NTV2FrameGeometry inGeometry, bool inIsRetail = AJA_RETAIL_DEFAULT, NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Sets the frame buffer format for the given FrameStore on the AJA device. + @return True if successful; otherwise false. + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel (a zero-based index number). + @param[in] inNewFormat Specifies the desired frame buffer format. + This must be a valid ::NTV2FrameBufferFormat value. + @param[in] inIsAJARetail Specifies if the AJA retail configuration settings are to be respected or not. + Defaults to false on all platforms other than MacOS, which defaults to true. + @param[in] inXferChars Specifies the HDR tranfer characteristc description (affects output VPID). + @param[in] inColorimetry Specifies the HDR colorimetry description (affects output VPID). + @param[in] inLuminance Specifies the HDR luminance description (affects output VPID). + @details This function allows client applications to control the format of frame data stored + in the FrameStores on an AJA device. This is important, because when frames are transferred + between the host and the AJA device, the frame data format is presumed to be identical. + **/ + AJA_VIRTUAL bool SetFrameBufferFormat (NTV2Channel inChannel, + NTV2FrameBufferFormat inNewFormat, + bool inIsAJARetail = AJA_RETAIL_DEFAULT, + NTV2HDRXferChars inXferChars = NTV2_VPID_TC_SDR_TV, + NTV2HDRColorimetry inColorimetry = NTV2_VPID_Color_Rec709, + NTV2HDRLuminance inLuminance = NTV2_VPID_Luminance_YCbCr); + + /** + @brief Sets the frame buffer format for the given FrameStore(s) on the AJA device. + @return True if successful; otherwise false. + @param[in] inFrameStores Specifies the FrameStore(s) of interest as a channel-set (a set of zero-based index numbers). + @param[in] inNewFormat Specifies the desired frame buffer format. + This must be a valid ::NTV2FrameBufferFormat value. + @param[in] inIsAJARetail Specifies if the AJA retail configuration settings are to be respected or not. + Defaults to false on all platforms other than MacOS, which defaults to true. + @param[in] inXferChars Specifies the HDR tranfer characteristc description (affects output VPID). + @param[in] inColorimetry Specifies the HDR colorimetry description (affects output VPID). + @param[in] inLuminance Specifies the HDR luminance description (affects output VPID). + @details This function allows client applications to control the format of frame data read or written + by the FrameStore(s) on an AJA device. This is important, because when frames are transferred + between the host and the AJA device, the frame data format is presumed to be identical. + **/ + AJA_VIRTUAL bool SetFrameBufferFormat (const NTV2ChannelSet & inFrameStores, + const NTV2FrameBufferFormat inNewFormat, + const bool inIsAJARetail = AJA_RETAIL_DEFAULT, + const NTV2HDRXferChars inXferChars = NTV2_VPID_TC_SDR_TV, + const NTV2HDRColorimetry inColorimetry = NTV2_VPID_Color_Rec709, + const NTV2HDRLuminance inLuminance = NTV2_VPID_Luminance_YCbCr); + + /** + @brief Sets the device's clock reference source. See \ref deviceclockingandsync for more information. + @param[in] inRefSource Specifies the ::NTV2ReferenceSource to use. + @param[in] inKeepFramePulseSelect For devices that support a frame pulse source that's independent of the + reference source, specify true to prevent resetting the frame pulse source. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetReference (const NTV2ReferenceSource inRefSource, const bool inKeepFramePulseSelect = false); + + /** + @brief Answers with the device's current clock reference source. See \ref deviceclockingandsync for more information. + @param[out] outRefSource Receives the ::NTV2ReferenceSource value. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetReference (NTV2ReferenceSource & outRefSource); + + /** + @brief Enables the device's frame pulse reference select. + See \ref deviceclockingandsync for more information. + @param[in] inEnable Specify true to enable the frame pulse reference; otherwise specify false. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool EnableFramePulseReference (const bool inEnable); // New in SDK 15.5 + + /** + @brief Answers whether or not the device's current frame pulse reference source is enabled. + See \ref deviceclockingandsync for more information. + @param[out] outEnabled Receives true if the frame pulse reference is enabled; otherwise false. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetEnableFramePulseReference (bool & outEnabled); // New in SDK 15.5 + + /** + @brief Sets the device's frame pulse reference source. See \ref deviceclockingandsync for more information. + @return True if successful; otherwise false. + @param[in] inRefSource Specifies the ::NTV2ReferenceSource to use for the device's frame pulse reference. + + **/ + AJA_VIRTUAL bool SetFramePulseReference (const NTV2ReferenceSource inRefSource); // New in SDK 15.5 + + /** + @brief Answers with the device's current frame pulse reference source. + @return True if successful; otherwise false. + @param[out] outRefSource Receives the ::NTV2ReferenceSource value. + **/ + AJA_VIRTUAL bool GetFramePulseReference (NTV2ReferenceSource & outRefSource); // New in SDK 15.5 + + /** + @brief Retrieves the device's current "retail service" task mode. + @param[out] outMode Receives the device's current "every frame task mode" setting. If successful, the + variable will contain ::NTV2_DISABLE_TASKS, ::NTV2_STANDARD_TASKS, or ::NTV2_OEM_TASKS. + @return True if successful; otherwise false. + @see CNTV2DriverInterface::GetStreamingApplication, \ref devicesharing + **/ + AJA_VIRTUAL bool GetEveryFrameServices (NTV2EveryFrameTaskMode & outMode); + + /** + @brief Sets the device's task mode. + @return True if successful; otherwise false. + @param[in] inMode Specifies the task mode the device is to assume, and must be one of the following values: + ::NTV2_DISABLE_TASKS, ::NTV2_STANDARD_TASKS, or ::NTV2_OEM_TASKS. + @warning Do not use task mode ::NTV2_STANDARD_TASKS for OEM applications. + @see CNTV2DriverInterface::GetStreamingApplication, \ref devicesharing + **/ + AJA_VIRTUAL bool SetEveryFrameServices (const NTV2EveryFrameTaskMode inMode); + + AJA_VIRTUAL bool SetDefaultVideoOutMode (ULWord mode); + AJA_VIRTUAL bool GetDefaultVideoOutMode (ULWord & outMode); + + /** + @brief Determines if a given FrameStore on the AJA device will be used to capture or playout video. + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel (a zero-based index number). + @param[in] inNewValue Specifies the desired mode (::NTV2_MODE_DISPLAY or ::NTV2_MODE_CAPTURE). + @param[in] inIsRetail This parameter is obsolete and ignored. + @return True if successful; otherwise false. + @details In ::NTV2_MODE_CAPTURE mode, device frame memory is written; in ::NTV2_MODE_DISPLAY mode, it's read from. + @note \ref aboutautocirculate automatically sets the ::NTV2Mode (but doesn't automatically un-set it after use). + @see CNTV2Card::GetMode, \ref vidop-fs + **/ + AJA_VIRTUAL bool SetMode (const NTV2Channel inChannel, const NTV2Mode inNewValue, const bool inIsRetail = AJA_RETAIL_DEFAULT); + + /** + @brief Answers with the current ::NTV2Mode of the given FrameStore on the AJA device. + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel value (a zero-based index number). + @param[out] outValue Receives the FrameStore's current ::NTV2Mode (::NTV2_MODE_DISPLAY or ::NTV2_MODE_CAPTURE). + @return True if successful; otherwise false. + @details In ::NTV2_MODE_CAPTURE mode, device frame memory is written; in ::NTV2_MODE_DISPLAY mode, it's read from. + @see CNTV2Card::SetMode, \ref vidop-fs + **/ + AJA_VIRTUAL bool GetMode (const NTV2Channel inChannel, NTV2Mode & outValue); + + AJA_VIRTUAL bool GetFrameGeometry (NTV2FrameGeometry & outValue, NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Returns the current frame buffer format for the given FrameStore on the AJA device. + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel (a zero-based index number). + @param[out] outValue Receives the FrameStore's current pixel format. If the function result is true, + the variable will contain a valid ::NTV2FrameBufferFormat value. + @return True if successful; otherwise false. + @details This function allows client applications to inquire about the current format of frame data + stored in an AJA device's FrameStore. This is important because when frames are transferred + between the host and the AJA device, the frame data format is presumed to be identical. + **/ + AJA_VIRTUAL bool GetFrameBufferFormat (NTV2Channel inChannel, NTV2FrameBufferFormat & outValue); + + + /** + @brief Returns a std::set of ::NTV2VideoFormat values that I support. + @param[out] outFormats Receives the set of ::NTV2VideoFormat values, or empty upon failure. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetSupportedVideoFormats (NTV2VideoFormatSet & outFormats); + + + // The rest of the routines + AJA_VIRTUAL bool GetVideoFormat (NTV2VideoFormat & outValue, NTV2Channel inChannel = NTV2_CHANNEL1); + +#if !defined(NTV2_DEPRECATE_16_2) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetActiveFrameDimensions (NTV2FrameDimensions & outFrameDimensions, const NTV2Channel inChannel = NTV2_CHANNEL1)); ///< @deprecated Obsolete starting in SDK 16.2. + AJA_VIRTUAL NTV2_DEPRECATED_f(NTV2FrameDimensions GetActiveFrameDimensions (const NTV2Channel inChannel = NTV2_CHANNEL1)); ///< @deprecated Obsolete starting in SDK 16.2. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetNumberActiveLines (ULWord & outNumActiveLines)); ///< @deprecated Obsolete starting in SDK 16.2. +#endif // defined(NTV2_DEPRECATE_16_2) + + AJA_VIRTUAL bool SetStandard (NTV2Standard inValue, NTV2Channel inChannel = NTV2_CHANNEL1); + AJA_VIRTUAL bool GetStandard (NTV2Standard & outValue, NTV2Channel inChannel = NTV2_CHANNEL1); + + AJA_VIRTUAL bool IsProgressiveStandard (bool & outIsProgressive, NTV2Channel inChannel = NTV2_CHANNEL1); + + AJA_VIRTUAL bool IsSDStandard (bool & outIsStandardDef, NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Sets the AJA device's frame rate. + @return True if successful; otherwise false. + @param[in] inNewValue Specifies the new ::NTV2FrameRate value the AJA device is to be configured with. + @param[in] inChannel Specifies the ::NTV2Channel of interest. + @note The frame rate setting for ::NTV2_CHANNEL1 dictates the device reference clock for both single + and multi-format mode (see \ref deviceclockingandsync). + **/ + AJA_VIRTUAL bool SetFrameRate (NTV2FrameRate inNewValue, NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Returns the AJA device's currently configured frame rate via its "value" parameter. + @return True if successful; otherwise false. + @param[out] outValue Receives the device's current ::NTV2FrameRate value. + @param[in] inChannel Specifies the ::NTV2Channel of interest. + @note The frame rate setting for ::NTV2_CHANNEL1 dictates the device reference clock for both single + and multi-format mode (see \ref deviceclockingandsync). + **/ + AJA_VIRTUAL bool GetFrameRate (NTV2FrameRate & outValue, NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Enables or disables the device's SMPTE-372 (dual-link) mode (used for older 3G-levelB-capable devices). + @note This allows older devices to handle 1080p60/1080p5994/1080p50 signals by "ganging" two 30Hz FrameStores. See \ref duallinkoverview for more information. + @note The enable bits work on channel pairs, thus a parameter of ::NTV2_CHANNEL1 or ::NTV2_CHANNEL2 refers to the same control bit. + @return True if successful; otherwise false. + @param[in] inValue Specify a non-zero value (true) to put the device into SMPTE 372 dual-link mode. + @param[in] inChannel Specifies the channel of interest. Defaults to channel 1. + @todo Should use bool parameter instead of a ULWord. + @todo Should be named SetSMPTE372Enable. + **/ + AJA_VIRTUAL bool SetSmpte372 (ULWord inValue, NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Returns the device's current SMPTE-372 (dual-link) mode, whether it's enabled or not. + @note The enable bits work on channel pairs, thus a parameter of ::NTV2_CHANNEL1 or ::NTV2_CHANNEL2 refers to the same control bit. + @return True if successful; otherwise false. + @param[out] outValue Receives 1 if the device is currently in dual-link mode; otherwise receives 0. + @param[in] inChannel Specifies the channel of interest. Defaults to channel 1. + @todo Should use bool& parameter instead of a ULWord&. + @todo Should be named GetSMPTE372Enable. + **/ + AJA_VIRTUAL bool GetSmpte372 (ULWord & outValue, NTV2Channel inChannel = NTV2_CHANNEL1); + + AJA_VIRTUAL bool SetProgressivePicture (ULWord value); + AJA_VIRTUAL bool GetProgressivePicture (ULWord & outValue); + + /** + @brief Enables or disables quad-frame mode on the device. + @return True if successful; otherwise false. + @param[in] inValue Specify 'true' to put the device into quad frame mode. + Specify 'false' to put the device into normal (non-quad) frame mode. + @param[in] inChannel Specifies the channel of interest. Defaults to channel 1. Ignored if the device + is incapable of 4K. + @note Most clients won't need to call this function, as calling CNTV2Card::SetVideoFormat to one of + the 4K/UHD formats will automatically do so. + **/ + AJA_VIRTUAL bool SetQuadFrameEnable (const bool inValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Returns the device's current quad-frame mode, whether it's enabled or not. + @return True if successful; otherwise false. + @param[out] outValue Receives 'true' if the device is currently in quad frame mode; otherwise 'false'. + @param[in] inChannel Specifies the channel of interest. Defaults to channel 1. Ignored if the device + is incapable of 4K. + **/ + AJA_VIRTUAL bool GetQuadFrameEnable (bool & outValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Enables or disables "quad-quad" 8K frame mode on the device. + @return True if successful; otherwise false. + @param[in] inValue Specify 'true' to put the device into "quad quad" frame mode. + Specify 'false' to put the device into normal (non-quad-quad) frame mode. + @param[in] inChannel Specifies the channel of interest. Defaults to channel 1. Ignored if the device + is incapable of 8K/UHD2. + @note Most clients won't need to call this function, as CNTV2Card::SetVideoFormat using one of + the 8K/UHD2 formats will automatically do so. + **/ + AJA_VIRTUAL bool SetQuadQuadFrameEnable (const bool inValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Returns the device's current "quad-quad" frame mode, whether it's enabled or not. + @return True if successful; otherwise false. + @param[out] outValue Receives 'true' if the device is currently in quad quad frame mode; otherwise 'false'. + @param[in] inChannel Specifies the channel of interest. Defaults to channel 1. Ignored if the device + is incapable of 8K/UHD2. + **/ + AJA_VIRTUAL bool GetQuadQuadFrameEnable (bool & outValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Enables or disables quad-quad-frame (8K) squares mode on the device. + @return True if successful; otherwise false. + @param[in] inValue Specify a non-zero value (true) to put the device into quad quad frame mode. + Specify zero (false) to put the device into normal (non-quad-quad) frame mode. + @param[in] inChannel Specifies the channel of interest. Defaults to channel 1. Ignored if the device + is incapable of multi-format mode, or is not currently in multi-format mode. + **/ + AJA_VIRTUAL bool SetQuadQuadSquaresEnable (const bool inValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Returns the device's current "quad-quad-squares" frame mode, whether it's enabled or not. + @return True if successful; otherwise false. + @param[out] outValue Receives 'true' if the device is currently in "quad quad squares" frame mode; + otherwise 'false'. + @param[in] inChannel Specifies the channel of interest. Defaults to channel 1. Ignored if the device + is incapable of multi-format mode, or is not currently in multi-format mode. + **/ + AJA_VIRTUAL bool GetQuadQuadSquaresEnable (bool & outValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Enables or disables SMPTE 425 "2K quadrants" mode for the given FrameStore bank on the device. + Client applications should call this function when "4K Squares" mode (not two-sample-interleave) is needed. + @return True if successful; otherwise false. + @param[in] inIsEnabled Specify true to put the device's FrameStores into "4K squares" (i.e., "2K quadrants") mode. + Specify false to put the device's FrameStores into normal mode (if not currently running in quad frame mode), or the non-2K quadrants quad mode. + @param[in] inChannel Specifies the FrameStore bank of interest. Using anything ordinally less than ::NTV2_CHANNEL5 + will affect FrameStores 1/2/3/4, while anything ordinally greater than ::NTV2_CHANNEL4 will + affect FrameStores 5/6/7/8. + @note Disabling 4K squares will implicitly set two-sample-interleave mode for the FrameStores. + **/ + AJA_VIRTUAL bool Set4kSquaresEnable (const bool inIsEnabled, const NTV2Channel inChannel); + + /** + @brief Answers whether the FrameStore bank's current SMPTE 425 "4K squares" (i.e., "2K quadrants") mode is enabled or not. + @return True if successful; otherwise false. + @param[out] outIsEnabled Receives true if the device's FrameStores are currently in "4K squares" + (i.e., "2K quadrants") mode; otherwise false. + @param[in] inChannel Specifies the FrameStore bank of interest. Using anything ordinally less than ::NTV2_CHANNEL5 + will report on FrameStores 1/2/3/4, while anything ordinally greater than ::NTV2_CHANNEL4 will + report on FrameStores 5/6/7/8. + **/ + AJA_VIRTUAL bool Get4kSquaresEnable (bool & outIsEnabled, const NTV2Channel inChannel); + + /** + @brief Enables or disables SMPTE 425 two-sample interleave (Tsi) frame mode on the device. + @return True if successful; otherwise false. + @param[in] inIsEnabled Specify true to put the device's FrameStores into two-sample interleave (Tsi) mode. + Specify false to put the device's FrameStores into non-Tsi mode. + @param[in] inChannel Specifies the FrameStore bank of interest. Using anything ordinally less than ::NTV2_CHANNEL5 + will affect FrameStores 1/2/3/4, while anything ordinally greater than ::NTV2_CHANNEL4 will + affect FrameStores 5/6/7/8. + @note Since Tsi is the default 4K mode, there's no need to call this function if Set4kSquaresEnable(false) was called. + **/ + AJA_VIRTUAL bool SetTsiFrameEnable (const bool inIsEnabled, const NTV2Channel inChannel); + + /** + @brief Returns the current SMPTE 425 two-sample-interleave frame mode on the device, whether it's enabled or not. + @return True if successful; otherwise false. + @param[out] outIsEnabled Receives true if the device's FrameStores are currently in two-sample interleave (Tsi) mode; otherwise false. + @param[in] inChannel Specifies the FrameStore bank of interest. Using anything ordinally less than ::NTV2_CHANNEL5 + will report on FrameStores 1/2/3/4, while anything ordinally greater than ::NTV2_CHANNEL4 will + report on FrameStores 5/6/7/8. + **/ + AJA_VIRTUAL bool GetTsiFrameEnable (bool & outIsEnabled, const NTV2Channel inChannel); + + /** + @brief Answers if the SMPTE 425 two-sample-interleave mux/demux input sync has failed or not. + @return True if successful; otherwise false. + @param[out] outSyncFailed Receives true if the device's Tsi Mux input sync detect is indicating failure. + @param[in] inWhichTsiMux Specifies the Tsi Mux of interest. Use NTV2_CHANNEL1 for Tsi Mux 1, etc. + **/ + AJA_VIRTUAL bool GetTsiMuxSyncFail (bool & outSyncFailed, const NTV2Channel inWhichTsiMux); + + AJA_VIRTUAL bool SetFrameBufferQuarterSizeMode (NTV2Channel inChannel, NTV2QuarterSizeExpandMode inValue); + AJA_VIRTUAL bool GetFrameBufferQuarterSizeMode (NTV2Channel inChannel, NTV2QuarterSizeExpandMode & outValue); + + AJA_VIRTUAL bool SetFrameBufferQuality (NTV2Channel inChannel, NTV2FrameBufferQuality inValue); + AJA_VIRTUAL bool GetFrameBufferQuality (NTV2Channel inChannel, NTV2FrameBufferQuality & outValue); + + AJA_VIRTUAL bool SetEncodeAsPSF (NTV2Channel inChannel, NTV2EncodeAsPSF inValue); + AJA_VIRTUAL bool GetEncodeAsPSF (NTV2Channel inChannel, NTV2EncodeAsPSF & outValue); + + /** + @brief Sets the frame buffer orientation for the given NTV2Channel. + @param[in] inChannel Specifies the channel (aka FrameStore) of interest. + @param[in] inValue Specifies the new frame buffer orientation. + @return True if successful; otherwise false. + @note For capture, NTV2_FRAMEBUFFER_ORIENTATION_TOPDOWN or NTV2_FRAMEBUFFER_ORIENTATION_NORMAL specifies that the input de-embedder writes + incoming pixel data in top-to-bottom order in the frame buffer, whereas NTV2_FRAMEBUFFER_ORIENTATION_BOTTOMUP writes incoming pixel + data in bottom-to-top order. For playout, NTV2_FRAMEBUFFER_ORIENTATION_TOPDOWN or NTV2_FRAMEBUFFER_ORIENTATION_NORMAL specifies that + the output embedder reads outgoing pixel data in top-to-bottom order from frame buffer memory, whereas NTV2_FRAMEBUFFER_ORIENTATION_BOTTOMUP + reads it in bottom-to-top order. + **/ + AJA_VIRTUAL bool SetFrameBufferOrientation (const NTV2Channel inChannel, const NTV2FBOrientation inValue); + + /** + @brief Answers with the current frame buffer orientation for the given NTV2Channel. + @param[in] inChannel Specifies the channel (aka FrameStore) of interest. + @param[out] outValue Receives the NTV2VideoFrameBufferOrientation value. + @return True if successful; otherwise false. + @note Normal operation is NTV2_FRAMEBUFFER_ORIENTATION_TOPDOWN. For capture, the input de-embedder writes incoming pixel data in top-to-bottom + order in the frame buffer, and the output embedder also reads outgoing pixel data in top-to-bottom order from frame buffer memory. + In NTV2_FRAMEBUFFER_ORIENTATION_BOTTOMUP operation, this is reversed. The input de-embedder writes incoming pixel data in bottom-to-top + order during capture, while for playout, the output embedder reads pixel data in bottom-to-top order. + **/ + AJA_VIRTUAL bool GetFrameBufferOrientation (const NTV2Channel inChannel, NTV2FBOrientation & outValue); + + AJA_VIRTUAL bool SetAlphaFromInput2Bit (ULWord inValue); + AJA_VIRTUAL bool GetAlphaFromInput2Bit (ULWord & outValue); + + /** + @brief Sets the output frame index number for the given FrameStore. This identifies which frame in device + SDRAM will be used for playout after the next VBI. + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel, a zero-based index number. + @param[in] inValue Specifies the desired output frame index number in device memory. See \ref vidop-fbindexing + for more information. + @return True if successful; otherwise false. + @note For the effect to be noticeable, the FrameStore should be enabled (see CNTV2Card::EnableChannel) + and in ::NTV2_MODE_DISPLAY mode. + @note Normally, if the device ::NTV2RegisterWriteMode is ::NTV2_REGWRITE_SYNCTOFRAME, the new value takes + effect at the next output frame interrupt. For example, if line 300 of frame 5 is currently + going "out the jack" at the instant this function is called with frame 6, frame 6 won't go "out the jack" + until the output VBI fires after the last line of frame 5 has gone out the spigot. + @note If the FrameStore's ::NTV2RegisterWriteMode is ::NTV2_REGWRITE_SYNCTOFIELD, the new value takes effect + at the next output field interrupt, which makes it possible to playout lines for ::NTV2_FIELD0 + and ::NTV2_FIELD1 from separate frame buffers, if desired. See CNTV2Card::SetRegisterWriteMode and/or + \ref fieldframeinterrupts for more information. + @warning If the designated FrameStore is enabled and in ::NTV2_MODE_DISPLAY mode, and the given frame is within + the frame range being used by another FrameStore/channel, this will likely result in wrong/torn/bad + output video. See \ref vidop-fbconflict + @warning If the designated FrameStore is enabled and in ::NTV2_MODE_DISPLAY mode, and the given frame is in + Audio Buffer memory that's in use by a running Audio System, this will likely result in wrong/torn/bad + output video. See \ref audioclobber + @see CNTV2Card::GetOutputFrame, \ref vidop-fs + **/ + AJA_VIRTUAL bool SetOutputFrame (const NTV2Channel inChannel, const ULWord inValue); + + /** + @brief Answers with the current output frame number for the given FrameStore (expressed as an ::NTV2Channel). + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel, a zero-based index number. + @param[out] outValue Receives the current output frame number, a zero-based index into each 8/16/32 MB + block of SDRAM on the device. + @return True if successful; otherwise false. + @see CNTV2Card::SetOutputFrame, \ref vidop-fs + **/ + AJA_VIRTUAL bool GetOutputFrame (const NTV2Channel inChannel, ULWord & outValue); + + /** + @brief Sets the input frame index number for the given FrameStore. This identifies which frame in device + SDRAM will be written after the next VBI. + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel, a zero-based index number. + @param[in] inValue Specifies the desired frame index number in device memory to be written. See \ref vidop-fbindexing + for more information. + @return True if successful; otherwise false. + @note For the effect to be noticeable, the FrameStore should be enabled (see CNTV2Card::EnableChannel) + and in ::NTV2_MODE_CAPTURE mode. + @note Normally, if the device ::NTV2RegisterWriteMode is ::NTV2_REGWRITE_SYNCTOFRAME, the new value takes + effect at the next input frame interrupt. For example, if line 300 of frame 5 is currently + being written in device memory at the instant this function is called with frame 6, video won't be + written into frame 6 in device memory until the input VBI fires after the last line of frame 5 has + been written. + @note If the FrameStore's ::NTV2RegisterWriteMode is ::NTV2_REGWRITE_SYNCTOFIELD, the new value takes effect + at the next input field interrupt. This makes it possible to record lines from ::NTV2_FIELD0 + and ::NTV2_FIELD1 in separate frame buffers, if desired. See CNTV2Card::SetRegisterWriteMode and/or + \ref fieldframeinterrupts for more information. + @warning If the designated FrameStore/channel is enabled and in ::NTV2_MODE_CAPTURE mode, and the given frame + is within the frame range being used by another FrameStore/channel, this will likely result in torn/bad + video in either or both channels. See \ref vidop-fbconflict + @warning If the designated FrameStore/channel is enabled and in ::NTV2_MODE_CAPTURE mode, and the given frame is + in Audio Buffer memory that's in use by a running Audio System, this will likely result in torn/bad video + and/or bad audio. See \ref audioclobber + @see CNTV2Card::GetInputFrame, \ref vidop-fs + **/ + AJA_VIRTUAL bool SetInputFrame (const NTV2Channel inChannel, const ULWord inValue); + + /** + @brief Answers with the current input frame index number for the given FrameStore. + This identifies which particular frame in device SDRAM will be written after the next frame interrupt. + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel, a zero-based index number. + (The FrameStore should be enabled and set for capture mode.) + @param[out] outValue Receives the current input frame index number of the frame in device memory being written. + See \ref vidop-fbindexing for more information. + @return True if successful; otherwise false. + @see CNTV2Card::SetInputFrame, \ref vidop-fs + **/ + AJA_VIRTUAL bool GetInputFrame (const NTV2Channel inChannel, ULWord & outValue); + + AJA_VIRTUAL bool SetDualLinkOutputEnable (const bool inIsEnabled); + AJA_VIRTUAL bool GetDualLinkOutputEnable (bool & outIsEnabled); + + AJA_VIRTUAL bool SetDualLinkInputEnable (const bool inIsEnabled); + AJA_VIRTUAL bool GetDualLinkInputEnable (bool & outIsEnabled); + + AJA_VIRTUAL bool SetVideoLimiting (const NTV2VideoLimiting inValue); + AJA_VIRTUAL bool GetVideoLimiting (NTV2VideoLimiting & outValue); + + AJA_VIRTUAL bool SetEnableVANCData (const bool inVANCenabled, const bool inTallerVANC, const NTV2Standard inStandard, const NTV2FrameGeometry inGeometry, const NTV2Channel inChannel = NTV2_CHANNEL1); + AJA_VIRTUAL bool SetEnableVANCData (const bool inVANCenabled, const bool inTallerVANC = false, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Sets the VANC mode for the given FrameStore. + @param[in] inVancMode Specifies the new ::NTV2VANCMode setting. + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel, a zero-based index number. + Defaults to ::NTV2_CHANNEL1. + @return True if successful; otherwise false. + @see CNTV2Card::GetVANCMode, \ref vancframegeometries + **/ + AJA_VIRTUAL bool SetVANCMode (const NTV2VANCMode inVancMode, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Sets the VANC mode for the given FrameStores. + @param[in] inChannels Specifies the FrameStores of interest as any number of ::NTV2Channel values, each a zero-based index number. + @param[in] inVancMode Specifies the new ::NTV2VANCMode setting. + @return True if successful; otherwise false. + @see CNTV2Card::GetVANCMode, \ref vancframegeometries + **/ + AJA_VIRTUAL bool SetVANCMode (const NTV2ChannelSet & inChannels, const NTV2VANCMode inVancMode); + + /** + @brief Retrieves the current VANC mode for the given FrameStore. + @param[out] outVancMode Receives the current ::NTV2VANCMode setting. + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel, a zero-based index number. + Defaults to ::NTV2_CHANNEL1. + @return True if successful; otherwise false. + @see CNTV2Card::SetVANCMode, \ref vancframegeometries + **/ + AJA_VIRTUAL bool GetVANCMode (NTV2VANCMode & outVancMode, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Enables or disables the "VANC Shift Mode" feature for the given channel. + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel, a zero-based index number. + @param[in] inMode Specifies the new data shift mode. + Use ::NTV2_VANCDATA_NORMAL to disable; use ::NTV2_VANCDATA_8BITSHIFT_ENABLE to enable. + @return True if successful; otherwise false. + @note The bit shift feature only affects VANC lines (not visible raster lines) and only when the device FrameStore is configured as follows: + - video format is set for an HD format (see ::NTV2_IS_HD_VIDEO_FORMAT macro) -- not SD or 4K/UHD; + - pixel format is set for ::NTV2_FBF_8BIT_YCBCR; + - VANC mode is set to ::NTV2_VANCMODE_TALL or ::NTV2_VANCMODE_TALLER (see CNTV2Card::SetVANCMode). + @see CNTV2Card::GetVANCShiftMode, CNTV2Card::GetVANCMode, CNTV2Card::SetVANCMode, \ref vancframegeometries + **/ + AJA_VIRTUAL bool SetVANCShiftMode (NTV2Channel inChannel, NTV2VANCDataShiftMode inMode); + + /** + @brief Sets the "VANC Shift Mode" for the given channel(s). + @param[in] inChannels Specifies the FrameStore(s) of interest as ::NTV2Channel values (zero-based index numbers). + @param[in] inMode Specifies the new data shift mode. + Use ::NTV2_VANCDATA_NORMAL to disable; use ::NTV2_VANCDATA_8BITSHIFT_ENABLE to enable. + @return True if successful; otherwise false. + @note The bit shift feature only affects VANC lines (not visible raster lines) and only when the device FrameStore is configured as follows: + - video format is set for an HD format (see ::NTV2_IS_HD_VIDEO_FORMAT macro) -- not SD or 4K/UHD; + - pixel format is set for ::NTV2_FBF_8BIT_YCBCR; + - VANC mode is set to ::NTV2_VANCMODE_TALL or ::NTV2_VANCMODE_TALLER (see CNTV2Card::SetVANCMode). + @see CNTV2Card::GetVANCShiftMode, CNTV2Card::GetVANCMode, CNTV2Card::SetVANCMode, \ref vancframegeometries + **/ + AJA_VIRTUAL bool SetVANCShiftMode (NTV2ChannelSet & inChannels, const NTV2VANCDataShiftMode inMode); // New in SDK 16.2 + + /** + @brief Retrieves the current "VANC Shift Mode" feature for the given channel. + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel, a zero-based index number. + @param[out] outValue Receives the current ::NTV2VANCDataShiftMode setting. + If ::NTV2_VANCDATA_NORMAL, then bit shifting is disabled. + If ::NTV2_VANCDATA_8BITSHIFT_ENABLE, then it's enabled. + @return True if successful; otherwise false. + @note The bit shift feature only affects VANC lines (not visible raster lines) and only when the device FrameStore is configured as follows: + - video format is set for an HD format (see ::NTV2_IS_HD_VIDEO_FORMAT macro) -- not SD or 4K/UHD; + - pixel format is set for ::NTV2_FBF_8BIT_YCBCR; + - VANC mode is set to ::NTV2_VANCMODE_TALL or ::NTV2_VANCMODE_TALLER (see CNTV2Card::SetVANCMode). + @see CNTV2Card::SetVANCShiftMode, CNTV2Card::GetVANCMode, CNTV2Card::SetVANCMode, \ref vancframegeometries + **/ + AJA_VIRTUAL bool GetVANCShiftMode (NTV2Channel inChannel, NTV2VANCDataShiftMode & outValue); + + AJA_VIRTUAL bool SetPulldownMode (NTV2Channel inChannel, bool inValue); + AJA_VIRTUAL bool GetPulldownMode (NTV2Channel inChannel, bool & outValue); + + /** + @brief Answers with the line offset into the frame currently being read (::NTV2_MODE_DISPLAY) or written + (::NTV2_MODE_CAPTURE) for FrameStore 1. + @param[out] outValue Receives the line number currently being read or written. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool ReadLineCount (ULWord & outValue); + +#if !defined(NTV2_DEPRECATE_16_2) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool FlipFlopPage (const NTV2Channel inChannel)); ///< @deprecated Declared obsolete starting in SDK 16.2. Swapped the PCI access frame and output frame registers at the next output VBI. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetPCIAccessFrame (const NTV2Channel inChannel, const ULWord inValue, const bool inWaitForVBI = true)); ///< @deprecated Declared obsolete starting in SDK 16.2. The "PCI Access Frame" register had no effect on the hardware, but was used to store the next/pending output frame. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetPCIAccessFrame (const NTV2Channel inChannel, ULWord & outValue)); ///< @deprecated Declared obsolete starting in SDK 16.2. The "PCI Access Frame" register had no effect on the hardware, but was used to store the next/pending output frame. +#endif // !defined(NTV2_DEPRECATE_16_2) +#if !defined(NTV2_DEPRECATE_16_0) + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool SetEnableVANCData (const NTV2ChannelSet & inChannels, const bool inVANCenable, const bool inTallerVANC = false)) {return SetVANCMode(inChannels, NTV2VANCModeFromBools(inVANCenable, inTallerVANC));} + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool SetVANCMode (const NTV2VANCMode inVancMode, const NTV2Standard st, const NTV2FrameGeometry fg, + const NTV2Channel inChannel = NTV2_CHANNEL1)) {(void) st; (void) fg; return SetVANCMode(inVancMode, inChannel);} + #define Set425FrameEnable SetTsiFrameEnable // Replace calls to Set425FrameEnable with calls to SetTsiFrameEnable instead + #define Get425FrameEnable GetTsiFrameEnable // Replace calls to Get425FrameEnable with calls to GetTsiFrameEnable instead +#endif // NTV2_DEPRECATE_16_0 +#if !defined(NTV2_DEPRECATE_15_2) + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetQuadFrameEnable (ULWord & outValue, const NTV2Channel inChannel = NTV2_CHANNEL1)) { bool enb(false); if(!GetQuadFrameEnable(enb, inChannel)) return false; outValue = enb?1:0; return true; } ///< @deprecated Call the 'bool &' flavor of this function instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetQuadQuadFrameEnable (ULWord & outValue, const NTV2Channel inChannel = NTV2_CHANNEL1)) { bool enb(false); if(!GetQuadQuadFrameEnable(enb, inChannel)) return false; outValue = enb?1:0; return true; } ///< @deprecated Call the 'bool &' flavor of this function instead. +#endif // NTV2_DEPRECATE_15_2 + + + /** + @name Mixer/Keyer & Video Processing + **/ + ///@{ + + /** + @brief Sets the VANC source for the given mixer/keyer to the foreground video (or not). + See the \ref ancillarydata discussion for more information. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer to be affected as a zero-based index number. + @param[in] inFromForegroundSource If true, sets the mixer/keyer's VANC source to its foreground video input; + otherwise, sets it to its background video input. + @see CNTV2Card::GetMixerVancOutputFromForeground, \ref vidop-mixerkeyer, \ref widget_mixkey + **/ + AJA_VIRTUAL bool SetMixerVancOutputFromForeground (const UWord inWhichMixer, const bool inFromForegroundSource = true); + + /** + @brief Answers whether or not the VANC source for the given mixer/keyer is currently the foreground video. + See the \ref ancillarydata discussion for more information. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[out] outIsFromForegroundSource Receives True if the mixer/keyer's VANC source is its foreground video input; + otherwise False if it's its background video input. + @see CNTV2Card::SetMixerVancOutputFromForeground, \ref vidop-mixerkeyer, \ref widget_mixkey + **/ + AJA_VIRTUAL bool GetMixerVancOutputFromForeground (const UWord inWhichMixer, bool & outIsFromForegroundSource); + + + /** + @brief Sets the foreground input control value for the given mixer/keyer. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[in] inInputControl Specifies the mixer/keyer's foreground input control value. + @see CNTV2Card::GetMixerFGInputControl, \ref vidop-mixerkeyer, \ref widget_mixkey + **/ + AJA_VIRTUAL bool SetMixerFGInputControl (const UWord inWhichMixer, const NTV2MixerKeyerInputControl inInputControl); + + /** + @brief Returns the current foreground input control value for the given mixer/keyer. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[out] outInputControl Receives the mixer/keyer's foreground input control value; otherwise NTV2MIXERINPUTCONTROL_INVALID upon failure. + @see CNTV2Card::SetMixerFGInputControl, \ref vidop-mixerkeyer, \ref widget_mixkey + **/ + AJA_VIRTUAL bool GetMixerFGInputControl (const UWord inWhichMixer, NTV2MixerKeyerInputControl & outInputControl); + + /** + @brief Sets the background input control value for the given mixer/keyer. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[in] inInputControl Specifies the mixer/keyer's background input control value. + @see CNTV2Card::GetMixerBGInputControl, \ref vidop-mixerkeyer, \ref widget_mixkey + **/ + AJA_VIRTUAL bool SetMixerBGInputControl (const UWord inWhichMixer, const NTV2MixerKeyerInputControl inInputControl); + + /** + @brief Returns the current background input control value for the given mixer/keyer. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[out] outInputControl Receives the mixer/keyer's background input control value; otherwise NTV2MIXERINPUTCONTROL_INVALID upon failure. + @see CNTV2Card::SetMixerBGInputControl, \ref vidop-mixerkeyer, \ref widget_mixkey + **/ + AJA_VIRTUAL bool GetMixerBGInputControl (const UWord inWhichMixer, NTV2MixerKeyerInputControl & outInputControl); + + /** + @brief Sets the mode for the given mixer/keyer. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[in] inMode Specifies the mode value. + @see CNTV2Card::GetMixerMode, \ref vidop-mixerkeyer, \ref widget_mixkey + **/ + AJA_VIRTUAL bool SetMixerMode (const UWord inWhichMixer, const NTV2MixerKeyerMode inMode); + + /** + @brief Returns the current operating mode of the given mixer/keyer. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[out] outMode Receives the mode value. + @see CNTV2Card::SetMixerMode, \ref vidop-mixerkeyer, \ref widget_mixkey + **/ + AJA_VIRTUAL bool GetMixerMode (const UWord inWhichMixer, NTV2MixerKeyerMode & outMode); + + /** + @brief Sets the current mix coefficient of the given mixer/keyer. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[in] inMixCoefficient Specifies the new mix coefficient value, where \c 0x10000 is the maximum. + @see CNTV2Card::GetMixerCoefficient, \ref vidop-mixerkeyer, \ref widget_mixkey + **/ + AJA_VIRTUAL bool SetMixerCoefficient (const UWord inWhichMixer, const ULWord inMixCoefficient); + + /** + @brief Returns the current mix coefficient the given mixer/keyer. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[out] outMixCoefficient Receives the current mix coefficient value, where \c 0x10000 is the maximum. + @see CNTV2Card::SetMixerCoefficient, \ref vidop-mixerkeyer, \ref widget_mixkey + **/ + AJA_VIRTUAL bool GetMixerCoefficient (const UWord inWhichMixer, ULWord & outMixCoefficient); + + /** + @brief Returns the current sync state of the given mixer/keyer. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[out] outIsSyncOK Receives the mixer's current sync state. If true, the mixer is synchronized to its inputs. + If false, the mixer is not synchronized to its inputs. + @see See \ref vidop-mixerkeyer for more information + **/ + AJA_VIRTUAL bool GetMixerSyncStatus (const UWord inWhichMixer, bool & outIsSyncOK); + + /** + @brief Answers if the given mixer/keyer's foreground matte is enabled or not. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[out] outIsEnabled Receives true if the mixer's foreground matte is currently enabled; otherwise false. + @see CNTV2Card::SetMixerFGMatteEnabled, CNTV2Card::GetMixerBGMatteEnabled, \ref vidop-mixerkeyer, \ref widget_mixkey + **/ + AJA_VIRTUAL bool GetMixerFGMatteEnabled (const UWord inWhichMixer, bool & outIsEnabled); + + /** + @brief Answers if the given mixer/keyer's foreground matte is enabled or not. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[in] inIsEnabled Specify true to enable the mixer's foreground matte; otherwise false to disable it. + @see CNTV2Card::GetMixerFGMatteEnabled, CNTV2Card::SetMixerBGMatteEnabled, \ref vidop-mixerkeyer, \ref widget_mixkey + **/ + AJA_VIRTUAL bool SetMixerFGMatteEnabled (const UWord inWhichMixer, const bool inIsEnabled); + + /** + @brief Answers if the given mixer/keyer's background matte is enabled or not. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[out] outIsEnabled Receives true if the mixer's background matte is currently enabled; otherwise false. + @see CNTV2Card::SetMixerBGMatteEnabled, CNTV2Card::GetMixerFGMatteEnabled, \ref vidop-mixerkeyer, \ref widget_mixkey + **/ + AJA_VIRTUAL bool GetMixerBGMatteEnabled (const UWord inWhichMixer, bool & outIsEnabled); + + /** + @brief Answers if the given mixer/keyer's background matte is enabled or not. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[in] inIsEnabled Specify true to enable the mixer's background matte; otherwise false to disable it. + @see CNTV2Card::GetMixerBGMatteEnabled, CNTV2Card::SetMixerFGMatteEnabled, \ref vidop-mixerkeyer, \ref widget_mixkey + **/ + AJA_VIRTUAL bool SetMixerBGMatteEnabled (const UWord inWhichMixer, const bool inIsEnabled); + + /** + @brief Answers with the given mixer/keyer's current matte color value being used. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[out] outYCbCrValue Receives the mixer's current matte color value. + @see CNTV2Card::SetMixerMatteColor, \ref vidop-mixerkeyer, \ref widget_mixkey + **/ + AJA_VIRTUAL bool GetMixerMatteColor (const UWord inWhichMixer, YCbCr10BitPixel & outYCbCrValue); + + /** + @brief Sets the matte color to use for the given mixer/keyer. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[in] inYCbCrValue Specifies the new matte color value to use. + @see CNTV2Card::GetMixerMatteColor, CNTV2Card::GetMixerFGMatteEnabled, CNTV2Card::SetMixerFGMatteEnabled, CNTV2Card::GetMixerBGMatteEnabled, CNTV2Card::SetMixerBGMatteEnabled, \ref vidop-mixerkeyer, \ref widget_mixkey + **/ + AJA_VIRTUAL bool SetMixerMatteColor (const UWord inWhichMixer, const YCbCr10BitPixel inYCbCrValue); + + /** + @brief Answers if the given mixer/keyer's has RGB mode support. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[out] outIsSupported Receives true if the mixer has RGB mode support. + **/ + AJA_VIRTUAL bool MixerHasRGBModeSupport (const UWord inWhichMixer, bool & outIsSupported); + + /** + @brief Sets the RGB range for the given mixer/keyer. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[in] inRGBRange Specifies the new RGB range value to use. + **/ + AJA_VIRTUAL bool SetMixerRGBRange (const UWord inWhichMixer, const NTV2MixerRGBRange inRGBRange); + + /** + @brief Answers with the given mixer/keyer's current RGB Range. + @return True if successful; otherwise false. + @param[in] inWhichMixer Specifies the mixer/keyer of interest as a zero-based index number. + @param[out] outRGBRange Receives the mixer's current matte color value. + **/ + AJA_VIRTUAL bool GetMixerRGBRange (const UWord inWhichMixer, NTV2MixerRGBRange & outRGBRange); + ///@} + + + /** + @name Audio + **/ + ///@{ + + /** + @brief Sets the number of audio channels to be concurrently captured or played for a given Audio System on the AJA device. + @return True if successful; otherwise false. + @param[in] inNumChannels Specifies the number of audio channels the device will record or play to/from a + given Audio System. For most applications, this should always be set to the maximum + number of audio channels the device is capable of capturing or playing, which can + be obtained by calling the ::NTV2DeviceGetMaxAudioChannels function. + @param[in] inAudioSystem Optionally specifies the Audio System of interest. Defaults to ::NTV2_AUDIOSYSTEM_1. + **/ + AJA_VIRTUAL bool SetNumberAudioChannels (const ULWord inNumChannels, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief Sets the number of audio channels to be concurrently captured or played for the given Audio System(s). + @return True if successful; otherwise false. + @param[in] inNumChannels Specifies the number of audio channels the device will record or play. + For most applications, this should always be set to the maximum number of audio channels + the device is capable of capturing or playing (see ::NTV2DeviceGetMaxAudioChannels ). + @param[in] inAudioSystems Specifies the Audio System(s) of interest. + **/ + AJA_VIRTUAL bool SetNumberAudioChannels (const ULWord inNumChannels, const NTV2AudioSystemSet & inAudioSystems); // New in SDK 16.2 + + /** + @brief Returns the current number of audio channels being captured or played by a given Audio System on the AJA device. + @return True if successful; otherwise false. + @param[out] outNumChannels Receives the number of audio channels that the AJA device hardware is currently capturing + or playing for the given Audio System. If the function result is true, the variable's + contents will be valid, and for most AJA devices will be 6, 8, or 16. + @param[in] inAudioSystem Optionally specifies the Audio System of interest. Defaults to ::NTV2_AUDIOSYSTEM_1. + @details This function allows client applications to determine how many audio channels the AJA hardware is + currently capturing/playing into/from the given Audio System on the device. + **/ + AJA_VIRTUAL bool GetNumberAudioChannels (ULWord & outNumChannels, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief Sets the NTV2AudioRate for the given Audio System. + @return True if successful; otherwise false. + @param[in] inRate Specifies the new NTV2AudioRate. + @param[in] inAudioSystem Optionally specifies the Audio System of interest. Defaults to ::NTV2_AUDIOSYSTEM_1. + @note Current generation NTV2 devices only support a fixed 48 kHz sample rate. + **/ + AJA_VIRTUAL bool SetAudioRate (const NTV2AudioRate inRate, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief Returns the current NTV2AudioRate for the given Audio System. + @return True if successful; otherwise false. + @param[out] outRate Receives the current NTV2AudioRate. + @param[in] inAudioSystem Optionally specifies the Audio System of interest. Defaults to ::NTV2_AUDIOSYSTEM_1. + @note Current generation NTV2 devices only support a fixed 48 kHz sample rate. + **/ + AJA_VIRTUAL bool GetAudioRate (NTV2AudioRate & outRate, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief Changes the size of the audio buffer that is used for a given Audio System in the AJA device. + @return True if successful; otherwise false. + @param[in] inValue Specifies the desired size of the capture/playout audio buffer to be used on the AJA device. + All modern AJA devices use ::NTV2_AUDIO_BUFFER_BIG (4 MB). + @param[in] inAudioSystem Optionally specifies the Audio System of interest. Defaults to ::NTV2_AUDIOSYSTEM_1. + **/ + AJA_VIRTUAL bool SetAudioBufferSize (const NTV2AudioBufferSize inValue, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief Changes the size of the audio buffer used for the given Audio System(s). + @return True if successful; otherwise false. + @param[in] inValue Specifies the desired size of the capture/playout audio buffer to be used on the AJA device. + All modern AJA devices use ::NTV2_AUDIO_BUFFER_BIG (4 MB). + @param[in] inAudioSystems Specifies the Audio System(s) of interest. + **/ + AJA_VIRTUAL bool SetAudioBufferSize (const NTV2AudioBufferSize inMode, const NTV2AudioSystemSet & inAudioSystems); // New in SDK 16.2 + + /** + @brief Retrieves the size of the input or output audio buffer being used for a given Audio System on the AJA device. + @return True if successful; otherwise false. + @param[out] outSize Receives the size of the capture/playout audio buffer for the given Audio System on the AJA device. + @param[in] inAudioSystem Optionally specifies the Audio System of interest. Defaults to ::NTV2_AUDIOSYSTEM_1. + **/ + AJA_VIRTUAL bool GetAudioBufferSize (NTV2AudioBufferSize & outSize, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief Enables or disables 20-bit mode for the ::NTV2AudioSystem. + @return True if successful; otherwise false. + @param[in] inAudioSystem Specifies the ::NTV2AudioSystem on the device to be affected. + @param[in] inEnable Specify \c true to use 20-bit mode; specify \c false for normal (24-bit) mode. + @note This function is relevant only for the \ref konaip or \ref ioip. + **/ + AJA_VIRTUAL bool SetAudio20BitMode (const NTV2AudioSystem inAudioSystem, const bool inEnable); + + /** + @brief Answers whether or not the device's ::NTV2AudioSystem is currently operating in 20-bit mode. + Normally the ::NTV2AudioSystem operates in 24-bit mode. + @return True if successful; otherwise false. + @param[in] inAudioSystem Specifies the ::NTV2AudioSystem of interest. + @param[out] outEnable Receives 'true' if the Audio System is in 20 bit mode, or 'false' + if audio is in 24 bit mode. + @note This function is relevant only for the \ref konaip or \ref ioip. + **/ + AJA_VIRTUAL bool GetAudio20BitMode (const NTV2AudioSystem inAudioSystem, bool & outEnable); + + /** + @brief Enables or disables ::NTV2AudioLoopBack mode for the given ::NTV2AudioSystem. + @return True if successful; otherwise false. + @param[in] inMode Specify ::NTV2_AUDIO_LOOPBACK_ON to force the Audio System's output embedder, to pull audio samples + from the Audio System's input de-embedder. + Specify ::NTV2_AUDIO_LOOPBACK_OFF to have the output embedder emit silence (zeroes). + @param[in] inAudioSystem Optionally specifies the Audio System on the device to be affected. Defaults to ::NTV2_AUDIOSYSTEM_1. + @see CNTV2Card::GetAudioLoopBack, \ref audioplayout + **/ + AJA_VIRTUAL bool SetAudioLoopBack (const NTV2AudioLoopBack inMode, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief Enables or disables ::NTV2AudioLoopBack mode for the given Audio Systems. + @return True if successful; otherwise false. + @param[in] inMode Specify ::NTV2_AUDIO_LOOPBACK_ON to force each Audio System's output embedder to pull audio samples + from its corresponding SDI input de-embedder; otherwise specify ::NTV2_AUDIO_LOOPBACK_OFF. + @param[in] inAudioSystems Specifies the Audio System(s) on the device to be affected. + @see CNTV2Card::GetAudioLoopBack, \ref audioplayout + **/ + AJA_VIRTUAL bool SetAudioLoopBack (const NTV2AudioLoopBack inMode, const NTV2AudioSystemSet & inAudioSystems); // New in SDK 16.2 + + /** + @brief Answers if ::NTV2AudioLoopBack mode is currently on or off for the given ::NTV2AudioSystem. + @return True if successful; otherwise false. + @param[out] outMode Receives ::NTV2_AUDIO_LOOPBACK_ON if the Audio System's output embedder will pull audio samples from + the Audio System's input de-embedder; otherwise receives ::NTV2_AUDIO_LOOPBACK_OFF if the output + embedder emits silence (zeroes). + @param[in] inAudioSystem Optionally specifies the Audio System on the device to be affected. Defaults to ::NTV2_AUDIOSYSTEM_1. + @see CNTV2Card::SetAudioLoopBack, \ref audioplayout + **/ + AJA_VIRTUAL bool GetAudioLoopBack (NTV2AudioLoopBack & outMode, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + + AJA_VIRTUAL bool SetAudioAnalogLevel (const NTV2AudioLevel value, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + AJA_VIRTUAL bool GetAudioAnalogLevel (NTV2AudioLevel & outValue, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + AJA_VIRTUAL bool SetEncodedAudioMode (const NTV2EncodedAudioMode value, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + AJA_VIRTUAL bool GetEncodedAudioMode (NTV2EncodedAudioMode & outValue, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief Sets the ::NTV2EmbeddedAudioClock setting for the given ::NTV2AudioSystem. + @return True if successful; otherwise false. + @param[in] inValue Specifies the ::NTV2EmbeddedAudioClock setting to use. + @param[in] inAudioSystem Specifies the ::NTV2AudioSystem of interest. Defaults to ::NTV2_AUDIOSYSTEM_1. + @see CNTV2Card::SetEmbeddedAudioClock, ::NTV2DeviceCanChangeEmbeddedAudioClock, \ref audiocapture + **/ + AJA_VIRTUAL bool SetEmbeddedAudioClock (const NTV2EmbeddedAudioClock inValue, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief For the given ::NTV2AudioSystem, answers with the current ::NTV2EmbeddedAudioClock setting. + @return True if successful; otherwise false. + @param[out] outValue Receives the current ::NTV2EmbeddedAudioClock setting. + @param[in] inAudioSystem Specifies the ::NTV2AudioSystem of interest. Defaults to ::NTV2_AUDIOSYSTEM_1. + @see CNTV2Card::SetEmbeddedAudioClock, ::NTV2DeviceCanChangeEmbeddedAudioClock, \ref audiocapture + **/ + AJA_VIRTUAL bool GetEmbeddedAudioClock (NTV2EmbeddedAudioClock & outValue, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief For the given Audio System, answers with the wrap address, the threshold at which input/record or output/play transfers + will likely need to account for "wrapping" around the end of the buffer back to the start of the buffer to continue + recording/playing. + @note Since input/record wrap detection is simple -- i.e., the value returned from CNTV2Card::ReadAudioLastIn has decreased -- + this function is provided to detect when an output wrap will occur. + @return True if successful; otherwise false. + @param[out] outWrapAddress Receives the byte offset in the audio output buffer at which a "wrap" will occur. + This is typically 16KB from the end of the buffer. If the current offset plus the audio bytes to be + written will go past this position, the caller should split the DMA transfer into two separate ones: + one to fill to the end of the buffer, and the remainder from the start of the buffer. + @param[in] inAudioSystem Optionally specifies the Audio System of interest. Defaults to ::NTV2_AUDIOSYSTEM_1. + **/ + AJA_VIRTUAL bool GetAudioWrapAddress (ULWord & outWrapAddress, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief For the given Audio System, answers with the byte offset from the start of the audio buffer to the first byte + of the input/capture buffer. (The capture buffer immediately follows the playout buffer in increasing memory + address order.) + @return True if successful; otherwise false. + @param[out] outReadOffset Receives the offset to the audio capture buffer from the start of the audio buffer. + This will typically be 4MB. + @param[in] inAudioSystem Optionally specifies the Audio System of interest. Defaults to ::NTV2_AUDIOSYSTEM_1. + **/ + AJA_VIRTUAL bool GetAudioReadOffset (ULWord & outReadOffset, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief Answers with the byte offset in device SDRAM into the specified Audio System's audio buffer. + @return True if successful; otherwise false. + @param[in] inOffsetBytes Specifies a byte offset as measured from the top of the Audio System's audio buffer memory. + If "inCaptureBuffer" is set to 'true', this value represents the offset as measured from + the top of the Audio System's capture buffer. + @param[out] outAbsByteOffset Receives the equivalent absolute byte offset in device SDRAM. + @param[in] inAudioSystem Specifies the Audio System of interest. + @param[in] inCaptureBuffer If true, "inOffsetBytes" is to be interpreted as relative to the start of the audio + capture buffer. If false, the default, "inOffsetBytes" is relative to the start of + the audio playout buffer. + **/ + AJA_VIRTUAL bool GetAudioMemoryOffset (const ULWord inOffsetBytes, ULWord & outAbsByteOffset, + const NTV2AudioSystem inAudioSystem, const bool inCaptureBuffer = false); + + /** + @brief For the given Audio System, specifies the byte offset in the device's output audio buffer + where its audio embedder will fetch the next chunk of audio samples. This essentially moves + the "Play Head" for audio output. + @param[in] inValue Specifies the new byte offset into the device's output audio buffer. The firmware + will truncate or round this as appropriate for proper 4-byte alignment. + @param[in] inAudioSystem Specifies the ::NTV2AudioSystem (output audio de-embedder) of interest. + @return True if successful; otherwise false. + @see CNTV2Card::ReadAudioLastOut, \ref audioplayout + **/ + AJA_VIRTUAL bool WriteAudioLastOut (const ULWord inValue, NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief For the given Audio System, answers with the byte offset of the tail end of the last chunk of + audio samples read by the device's output audio embedder. This is essentially the position of + the "Play Head" during audio output. + @param[out] outValue Receives the byte offset of the tail end of the last chunk of audio samples read + by the device's output audio embedder in its output audio buffer. + @param[in] inAudioSystem Specifies the ::NTV2AudioSystem (output audio de-embedder) of interest. + @return True if successful; otherwise false. + @see CNTV2Card::WriteAudioLastOut, \ref audioplayout + **/ + AJA_VIRTUAL bool ReadAudioLastOut (ULWord & outValue, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief For the given Audio System, answers with the byte offset of the last chunk of audio samples + written by the device's input audio de-embedder. This is essentially the position of the + "Write Head" during audio capture. + @param[out] outValue Receives the byte offset of the last chunk of audio samples written by the device's + input audio de-embedder in its input audio buffer. + @param[in] inAudioSystem Specifies the ::NTV2AudioSystem (input audio de-embedder) of interest. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool ReadAudioLastIn (ULWord & outValue, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief Starts the playout side of the given ::NTV2AudioSystem, reading outgoing audio samples + from the Audio System's playout buffer. + @return True if successful; otherwise false. + @param[in] inAudioSystem Specifies the Audio System of interest. + @param[in] inWaitForVBI If 'false', the default, immediately starts reading audio samples from the + playout buffer and inserting into the HANC stream. If 'true', checks if + the required firmware feature is present, and if so, waits until the next + output VBI before starting to read samples from the playout buffer. + @note It is not an error to call this function when the Audio System's playout side is already running. + @note Applications using \ref aboutautocirculate won't need to call this function, since AutoCirculate + configures the Audio System automatically. + @see CNTV2Card::StopAudioOutput, CNTV2Card::IsAudioOutputRunning, \ref audioplayout + **/ + AJA_VIRTUAL bool StartAudioOutput (const NTV2AudioSystem inAudioSystem, const bool inWaitForVBI = false); + + /** + @brief Stops the playout side of the given ::NTV2AudioSystem, parking the "Read Head" at the start + of the playout buffer. + @return True if successful; otherwise false. + @param[in] inAudioSystem Specifies the Audio System of interest. + @note It is not an error to call this function when the Audio System's playout side is already stopped. + @note Applications using \ref aboutautocirculate won't need to call this function, since AutoCirculate + configures the Audio System automatically. + @see CNTV2Card::StartAudioOutput, CNTV2Card::IsAudioOutputRunning, \ref audioplayout + **/ + AJA_VIRTUAL bool StopAudioOutput (const NTV2AudioSystem inAudioSystem); + + /** + @brief Answers whether or not the playout side of the given ::NTV2AudioSystem is currently running. + @return True if successful; otherwise false. + @param[in] inAudioSystem Specifies the Audio System of interest. + @param[out] outIsRunning Receives 'true' if the Audio System's playout side is currently running; + otherwise receives 'false'. + @see CNTV2Card::StartAudioOutput, CNTV2Card::StopAudioOutput, CNTV2Card::SetAudioOutputPause, + CNTV2Card::GetAudioOutputPause, \ref audioplayout + **/ + AJA_VIRTUAL bool IsAudioOutputRunning (const NTV2AudioSystem inAudioSystem, bool & outIsRunning); + + /** + @brief Pauses or resumes output of audio samples and advancement of the audio buffer pointer + ("play head") of the given Audio System. + @return True if successful; otherwise false. + @param[in] inAudioSystem Specifies the Audio System of interest. + @param[in] inPausePlayout Specify 'true' to pause producing audio samples ("paused"). + Specify 'false' to resume producing audio samples ("running"). + @note This function doesn't alter the Audio Output Buffer Pointer ("play head") position. + To reset the "play head" back to the beginning of the buffer, use CNTV2Card::SetAudioOutputReset instead. + @see CNTV2Card::GetAudioOutputPause, CNTV2Card::StartAudioOutput, CNTV2Card::StopAudioOutput, \ref audioplayout + **/ + AJA_VIRTUAL bool SetAudioOutputPause (const NTV2AudioSystem inAudioSystem, const bool inPausePlayout); + + /** + @brief Answers if the device's Audio System is currently paused or not. + @return True if successful; otherwise false. + @param[in] inAudioSystem Specifies the Audio System of interest. + @param[out] outIsPaused Receives 'true' if audio output is paused, or 'false' if audio + playout is running normally. + @see CNTV2Card::SetAudioOutputPause, CNTV2Card::IsAudioOutputRunning, \ref audioplayout + **/ + AJA_VIRTUAL bool GetAudioOutputPause (const NTV2AudioSystem inAudioSystem, bool & outIsPaused); + + /** + @brief Starts the capture side of the given ::NTV2AudioSystem, writing incoming audio samples + into the Audio System's capture buffer. + @return True if successful; otherwise false. + @param[in] inAudioSystem Specifies the Audio System of interest. + @param[in] inWaitForVBI If 'false', the default, immediately starts writing captured audio samples + into the capture buffer. If 'true', checks if the required firmware feature + is present, and if so, waits until the next input VBI before starting to + write captured samples into the capture buffer. + @note It is not an error to call this function when the Audio System's capture side is already running. + @note Applications using \ref aboutautocirculate won't need to call this function, since AutoCirculate + configures the Audio System automatically. + @see CNTV2Card::StopAudioInput, CNTV2Card::IsAudioInputRunning, \ref audiocapture + **/ + AJA_VIRTUAL bool StartAudioInput (const NTV2AudioSystem inAudioSystem, const bool inWaitForVBI = false); + + /** + @brief Stops the capture side of the given ::NTV2AudioSystem, and resets the capture position + (i.e. "Write Head") back to the start of the Audio System's capture buffer (offset zero). + This can be useful for resynchronizing audio and video. + @return True if successful; otherwise false. + @param[in] inAudioSystem Specifies the Audio System of interest. + @note It is not an error to call this function when the Audio System's capture side is already stopped. + @note Applications using \ref aboutautocirculate won't need to call this function, since AutoCirculate + configures the Audio System automatically. + @see CNTV2Card::StartAudioInput, CNTV2Card::IsAudioInputRunning, \ref audiocapture + **/ + AJA_VIRTUAL bool StopAudioInput (const NTV2AudioSystem inAudioSystem); + + /** + @brief Answers whether or not the capture side of the given ::NTV2AudioSystem is currently running. + @return True if successful; otherwise false. + @param[in] inAudioSystem Specifies the Audio System of interest. + @param[out] outIsRunning Receives 'true' if the Audio System's capture side is currently running; + otherwise receives 'false'. + @see CNTV2Card::StartAudioInput, CNTV2Card::StopAudioInput, \ref audiocapture + **/ + AJA_VIRTUAL bool IsAudioInputRunning (const NTV2AudioSystem inAudioSystem, bool & outIsRunning); + + /** + @brief Enables or disables the writing of incoming audio into the given Audio System's capture buffer. + @return True if successful; otherwise false. + @param[in] inAudioSystem Specifies the Audio System of interest. + @param[in] inEnable If true, the Audio System will write captured samples into device audio buffer + memory (if currently running). If false, the Audio System will not write captured + samples into device audio buffer memory. + @note Applications using \ref aboutautocirculate won't need to call this function, since AutoCirculate + configures the Audio System automatically. + @see CNTV2Card::GetAudioCaptureEnable, \ref audiocapture + **/ + AJA_VIRTUAL bool SetAudioCaptureEnable (const NTV2AudioSystem inAudioSystem, const bool inEnable); + + /** + @brief Answers whether or not the Audio System is configured to write captured audio samples into + device audio buffer memory. + @return True if successful; otherwise false. + @param[in] inAudioSystem Specifies the Audio System of interest. + @param[out] outEnable Receives 'true' if the Audio System will write captured samples into device + audio buffer memory when running; otherwise 'false' if the Audio System is + prohibited from writing captured samples into device audio buffer memory. + @see CNTV2Card::SetAudioCaptureEnable, \ref audiocapture + **/ + AJA_VIRTUAL bool GetAudioCaptureEnable (const NTV2AudioSystem inAudioSystem, bool & outEnable); + + /** + @brief Enables or disables a special mode for the given Audio System whereby its embedder and + deembedder both start from the audio base address, instead of operating independently. + @return True if successful; otherwise false. + @param[in] inAudioSystem Specifies the Audio System on the device to be affected. + @param[in] inEnable If true, de-embedder and embedder both start from the audio base address. + If false, the Audio System operates normally. + **/ + AJA_VIRTUAL bool SetAudioPlayCaptureModeEnable (const NTV2AudioSystem inAudioSystem, const bool inEnable); + + /** + @brief Answers whether or not the device's Audio System is currently operating in a special mode + in which its embedder and deembedder both start from the audio base address, instead of + operating independently. + @return True if successful; otherwise false. + @param[in] inAudioSystem Specifies the Audio System of interest. + @param[out] outEnable A boolean variable that is to receive 'true' if the Audio System's + de-embedder and embedder both start from the audio base address, + or 'false' if the Audio System is operating normally. + **/ + AJA_VIRTUAL bool GetAudioPlayCaptureModeEnable (const NTV2AudioSystem inAudioSystem, bool & outEnable); + + /** + @brief Sets the audio input delay for the given Audio System on the device. + @param[in] inAudioSystem Specifies the Audio System whose input delay is to be set. + @param[in] inDelay Specifies the new audio input delay value for the Audio System. + Each increment of this value increases the delay by exactly 512 bytes + in the Audio System's audio buffer, or about 166.7 microseconds. + Values from 0 thru 8159 are valid, which gives a maximum delay of about + 1.36 seconds. + @return True if successful; otherwise false. + @see CNTV2Card::GetAudioInputDelay, \ref audiocapture + **/ + AJA_VIRTUAL bool SetAudioInputDelay (const NTV2AudioSystem inAudioSystem, const ULWord inDelay); + + /** + @brief Answers with the audio input delay for the given Audio System on the device. + @param[in] inAudioSystem Specifies the Audio System whose input delay is to be retrieved. + @param[out] outDelay A ULWord variable that is to receive the Audio System's current input delay + value, expressed as an integral number of 512 byte chunks in the Audio System's + audio buffer on the device. This can be translated into microseconds by multiplying + the received value by 166.7. + @return True if successful; otherwise false. + @see CNTV2Card::SetAudioInputDelay, \ref audiocapture + **/ + AJA_VIRTUAL bool GetAudioInputDelay (const NTV2AudioSystem inAudioSystem, ULWord & outDelay); + + + /** + @brief Sets the audio output delay for the given Audio System on the device. + @param[in] inAudioSystem Specifies the Audio System whose output delay is to be set. + @param[in] inDelay Specifies the new audio output delay value for the Audio System. Each increment of this + value increases the delay by exactly 512 bytes in the Audio System's audio buffer, or + about 166.7 microseconds (when configured for 16 audio channels). Values from 0 to 8159 + are valid, which gives a maximum delay of about 1.36 seconds. + @return True if successful; otherwise false. + @see CNTV2Card::GetAudioOutputDelay, \ref audioplayout + **/ + AJA_VIRTUAL bool SetAudioOutputDelay (const NTV2AudioSystem inAudioSystem, const ULWord inDelay); + + /** + @brief Answers with the audio output delay for the given Audio System on the device. + @param[in] inAudioSystem Specifies the Audio System whose output delay is to be retrieved. + @param[out] outDelay A ULWord variable that is to receive the Audio System's current output delay + value, expressed as an integral number of 512-byte chunks in the Audio System's + audio buffer on the device. This can be translated into microseconds by multiplying + the received value by 166.7. + @return True if successful; otherwise false. + @see CNTV2Card::SetAudioOutputDelay, \ref audioplayout + **/ + AJA_VIRTUAL bool GetAudioOutputDelay (const NTV2AudioSystem inAudioSystem, ULWord & outDelay); + + + /** + @brief Determines whether or not all outgoing audio channel pairs are to be flagged as non-PCM for the given Audio + System on the device. + @param[in] inAudioSystem Specifies the Audio System of interest. + @param[in] inIsNonPCM If true, the "non-PCM" indicator in the AES header of all outgoing audio channel pairs is set "On"; + otherwise, the indicator is set "Off" (to indicate normal PCM audio). + @return True if successful; otherwise false. + @note This setting, if non-PCM, overrides per-audio-channel-pair PCM control on those devices that support it + (see ::NTV2DeviceCanDoPCMControl). + @see CNTV2Card::GetAudioPCMControl, \ref audioplayout + **/ + AJA_VIRTUAL bool SetAudioPCMControl (const NTV2AudioSystem inAudioSystem, const bool inIsNonPCM); + + + /** + @brief Answers whether or not all outgoing audio channel pairs are currently being flagged as non-PCM for the + given Audio System on the device. + @param[in] inAudioSystem Specifies the Audio System of interest. + @param[out] outIsNonPCM Receives true if all outgoing audio channel pairs are currently flagged as non-PCM; + otherwise receives false if the non-PCM indicator is set "Off". + @return True if successful; otherwise false. + @see CNTV2Card::SetAudioPCMControl, \ref audioplayout + **/ + AJA_VIRTUAL bool GetAudioPCMControl (const NTV2AudioSystem inAudioSystem, bool & outIsNonPCM); + + + /** + @brief Determines whether the given audio channel pair being transmitted by the given Audio System is to be + flagged as non-PCM or not. + @param[in] inAudioSystem Specifies the Audio System of interest. + @param[in] inChannelPair Specifies the audio channel pair of interest. + @param[in] inIsNonPCM If true, the "non-PCM" indicator in the AES header of the channel pair is set "On"; + otherwise, the indicator is set "Off" (to indicate normal PCM audio). + @return True if successful; otherwise false. + @note Call ::NTV2DeviceCanDoPCMControl to determine if per-audio-channel-pair PCM control capability is available on this device. + @note This function has no effect if the Audio-System-wide non-PCM control setting is set to non-PCM. + (See the two-parameter overloaded version of this function.) + @see CNTV2Card::GetAudioPCMControl, \ref audioplayout + **/ + AJA_VIRTUAL bool SetAudioPCMControl (const NTV2AudioSystem inAudioSystem, const NTV2AudioChannelPair inChannelPair, const bool inIsNonPCM); + + + /** + @brief Sets the non-PCM indicator in the AES header of the given channel pairs for the given Audio System on the device. + @param[in] inAudioSystem Specifies the Audio System of interest. + @param[in] inNonPCMChannelPairs Specifies the audio channel pairs whose non-PCM indicators will be set "On". + @return True if successful; otherwise false. + @note Call ::NTV2DeviceCanDoPCMControl to determine if this device supports per-audio-channel-pair PCM control. + @see CNTV2Card::GetAudioPCMControl, \ref audioplayout + **/ + AJA_VIRTUAL bool SetAudioPCMControl (const NTV2AudioSystem inAudioSystem, const NTV2AudioChannelPairs & inNonPCMChannelPairs); + + + /** + @brief Answers whether or not the given audio channel pair in the given Audio System on the device is being treated + as normal PCM audio. + @param[in] inAudioSystem Specifies the Audio System of interest. + @param[in] inChannelPair Specifies the channel pair of interest. + @param[out] outIsNonPCM Receives true if the audio channel pair is currently being flagged as non-PCM; + otherwise false. + @return True if successful; otherwise false. + @note Call ::NTV2DeviceCanDoPCMControl to determine if this device supports per-audio-channel-pair PCM control. + @note This function's answer is irrelevant if the Audio-System-wide non-PCM control setting is set to non-PCM. + (See the two-parameter overloaded version of this function.) + @see CNTV2Card::SetAudioPCMControl, \ref audioplayout + **/ + AJA_VIRTUAL bool GetAudioPCMControl (const NTV2AudioSystem inAudioSystem, const NTV2AudioChannelPair inChannelPair, bool & outIsNonPCM); + + + /** + @brief Answers which ::NTV2AudioChannelPairs being transmitted by the given ::NTV2AudioSystem are currently + being flagged as non-PCM. + @param[in] inAudioSystem Specifies the ::NTV2AudioSystem of interest. + @param[out] outNonPCMChannelPairs Receives the ::NTV2AudioChannelPairs that are currently being flagged as non-PCM. + @return True if successful; otherwise false. + @note Call ::NTV2DeviceCanDoPCMControl to determine if this device supports per-audio-channel-pair PCM control. + @see CNTV2Card::SetAudioPCMControl, \ref audioplayout + **/ + AJA_VIRTUAL bool GetAudioPCMControl (const NTV2AudioSystem inAudioSystem, NTV2AudioChannelPairs & outNonPCMChannelPairs); + + + /** + @brief Answers whether or not the given ::NTV2AudioChannelPair in the given ::NTV2AudioSystem on the device is present in the input signal. + @param[in] inAudioSystem Specifies the ::NTV2AudioSystem of interest. + @param[in] inChannelPair Specifies the ::NTV2AudioChannelPair of interest. + @param[out] outIsPresent Receives true if the ::NTV2AudioChannelPair is present; otherwise false if it's not present. + @return True if successful; otherwise false. + @see CNTV2Card::GetDetectedAudioChannelPairs, \ref audiocapture + **/ + AJA_VIRTUAL bool IsAudioChannelPairPresent (const NTV2AudioSystem inAudioSystem, const NTV2AudioChannelPair inChannelPair, bool & outIsPresent); + + + /** + @brief Answers which audio channel pairs are present in the given Audio System's input stream. + @param[in] inAudioSystem Specifies the ::NTV2AudioSystem of interest. + @param[out] outDetectedChannelPairs Receives the ::NTV2AudioChannelPairs that are present in the Audio System's input stream. + @return True if successful; otherwise false. + @note NTV2 device firmware performs this detection using a simple method of detecting the presence of the Audio Group's data packet. + It does not perform detailed inspection of the packet -- i.e., checking bits b1/b2 of the AES sub-frame per SMPTE 272, nor + checking the V/U/C/P bits per SMPTE 299. + @see CNTV2Card::IsAudioChannelPairPresent, \ref audiocapture + **/ + AJA_VIRTUAL bool GetDetectedAudioChannelPairs (const NTV2AudioSystem inAudioSystem, NTV2AudioChannelPairs & outDetectedChannelPairs); + + + /** + @brief Answers which AES/EBU audio channel pairs are present on the device. + @param[out] outDetectedChannelPairs Receives the set of unique audio channel pairs that are present in any of the device's AES/EBU inputs. + @return True if successful; otherwise false. + @see CNTV2Card::IsAudioChannelPairPresent, \ref audiocapture + **/ + AJA_VIRTUAL bool GetDetectedAESChannelPairs (NTV2AudioChannelPairs & outDetectedChannelPairs); + + + /** + @brief Sets the audio source for the given ::NTV2AudioSystem on the device. + @param[in] inAudioSystem Specifies the ::NTV2AudioSystem of interest. + @param[in] inAudioSource Specifies the ::NTV2AudioSource to use for the given ::NTV2AudioSystem + e.g., ::NTV2_AUDIO_EMBEDDED, ::NTV2_AUDIO_AES, ::NTV2_AUDIO_ANALOG, etc.). + @param[in] inEmbeddedInput If the audio source is set to ::NTV2_AUDIO_EMBEDDED, and the device has multiple SDI inputs, use \c inEmbeddedInput + to specify which ::NTV2EmbeddedAudioInput to use. This parameter is ignored if \c inAudioSource is not ::NTV2_AUDIO_EMBEDDED. + @return True if successful; otherwise false. + @note Use the ::NTV2DeviceGetNumAudioSystems function to determine how many independent Audio Systems are available on the device. + @see CNTV2Card::GetAudioSystemInputSource, \ref audiocapture + **/ + AJA_VIRTUAL bool SetAudioSystemInputSource (const NTV2AudioSystem inAudioSystem, const NTV2AudioSource inAudioSource, const NTV2EmbeddedAudioInput inEmbeddedInput); + + /** + @brief Answers with the device's current ::NTV2AudioSource (and also possibly its ::NTV2EmbeddedAudioInput) for the given ::NTV2AudioSystem. + @param[in] inAudioSystem Specifies the ::NTV2AudioSystem of interest. + @param[out] outAudioSource Receives the ::NTV2AudioSource that's currently being used for the given ::NTV2AudioSystem + (e.g., ::NTV2_AUDIO_EMBEDDED, ::NTV2_AUDIO_AES, ::NTV2_AUDIO_ANALOG, etc.). + @param[out] outEmbeddedSource Receives the ::NTV2EmbeddedAudioInput. + Ignore this result if the audio source is not ::NTV2_AUDIO_EMBEDDED. + @return True if successful; otherwise false. + @note Use the ::NTV2DeviceGetNumAudioSystems function to determine how many independent Audio Systems are available on the device. + @see CNTV2Card::SetAudioSystemInputSource, \ref audiocapture + **/ + AJA_VIRTUAL bool GetAudioSystemInputSource (const NTV2AudioSystem inAudioSystem, NTV2AudioSource & outAudioSource, NTV2EmbeddedAudioInput & outEmbeddedSource); + + /** + @brief Sets the embedded (SDI) audio source for the given ::NTV2AudioSystem on the device. + @param[in] inEmbeddedSource If the audio source is set to ::NTV2_AUDIO_EMBEDDED, and the device has multiple SDI inputs, use \c inEmbeddedInput + to specify which ::NTV2EmbeddedAudioInput to use. This parameter is ignored if \c inAudioSource is not ::NTV2_AUDIO_EMBEDDED. + @param[in] inAudioSystem Specifies the ::NTV2AudioSystem of interest. + @return True if successful; otherwise false. + @note Use the ::NTV2DeviceGetNumAudioSystems function to determine how many independent Audio Systems are available on the device. + @note This function will have no effect if the device's current ::NTV2AudioSource is something other than ::NTV2_AUDIO_EMBEDDED. + Usually it's best to call CNTV2Card::SetAudioSystemInputSource instead of this function. + @see CNTV2Card::GetEmbeddedAudioInput, CNTV2Card::SetAudioSystemInputSource, \ref audiocapture + **/ + AJA_VIRTUAL bool SetEmbeddedAudioInput (const NTV2EmbeddedAudioInput inEmbeddedSource, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief Answers with the device's current embedded (SDI) audio source for the given ::NTV2AudioSystem. + @param[out] outEmbeddedSource Receives the ::NTV2EmbeddedAudioInput (SDI audio source). + @param[in] inAudioSystem Specifies the ::NTV2AudioSystem of interest. + @return True if successful; otherwise false. + @note Use the ::NTV2DeviceGetNumAudioSystems function to determine how many independent Audio Systems are available on the device. + @note This function assumes the device's current ::NTV2AudioSource is ::NTV2_AUDIO_EMBEDDED. + Usually it's best to call CNTV2Card::GetAudioSystemInputSource instead of this function. + @see CNTV2Card::SetEmbeddedAudioInput, CNTV2Card::GetAudioSystemInputSource, \ref audiocapture + **/ + AJA_VIRTUAL bool GetEmbeddedAudioInput (NTV2EmbeddedAudioInput & outEmbeddedSource, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief Sets the device's ::NTV2AudioSystem that will provide audio for the given SDI output's audio embedder. + For 3G-capable SDI outputs, this affects Data Stream 1 (or Link A). + @param[in] inSDIOutputConnector Specifies the SDI output connector of interest as an ::NTV2Channel (a zero-based index number). + @param[in] inAudioSystem Specifies the Audio System to be used (e.g., ::NTV2_AUDIOSYSTEM_1). + @return True if successful; otherwise false. + @note Use the ::NTV2DeviceGetNumAudioSystems function to determine how many independent Audio Systems are available on the device. + @note Use the ::NTV2DeviceGetNumVideoOutputs function to determine the number of SDI output jacks the device has. + @see CNTV2Card::GetSDIOutputAudioSystem, CNTV2Card::SetSDIOutputDS2AudioSystem, CNTV2Card::GetSDIOutputDS2AudioSystem, \ref audioplayout + **/ + AJA_VIRTUAL bool SetSDIOutputAudioSystem (const NTV2Channel inSDIOutputConnector, const NTV2AudioSystem inAudioSystem); + + /** + @brief Sets the device's ::NTV2AudioSystem that will provide audio for the given SDI outputs' audio embedders. + For 3G-capable SDI outputs, this affects Data Stream 1 (or Link A). + @param[in] inSDIOutputs Specifies the SDI output connectors of interest as an ::NTV2ChannelSet (a set of zero-based index numbers). + @param[in] inAudioSystem Specifies the Audio System to be used (e.g., ::NTV2_AUDIOSYSTEM_1). + @param[in] inDS2 Optionally specifies if Data Stream 2 should be configured. Defaults to false (DS1). + @return True if successful; otherwise false. + @note Use the ::NTV2DeviceGetNumAudioSystems function to determine how many independent Audio Systems are available on the device. + @note Use the ::NTV2DeviceGetNumVideoOutputs function to determine the number of SDI output jacks the device has. + @see CNTV2Card::GetSDIOutputAudioSystem, CNTV2Card::GetSDIOutputDS2AudioSystem, \ref audioplayout + **/ + AJA_VIRTUAL bool SetSDIOutputAudioSystem (const NTV2ChannelSet & inSDIOutputs, const NTV2AudioSystem inAudioSystem, const bool inDS2 = false); // New in SDK 16.2 + + /** + @brief Answers with the device's ::NTV2AudioSystem that is currently providing audio for the given SDI output's audio embedder. + (For 3G-capable SDI outputs, this is for Data Stream 1, or Link A.) + @param[in] inSDIOutputConnector Specifies the SDI output connector of interest as an ::NTV2Channel (a zero-based index number). + @param[out] outAudioSystem Receives the Audio System that's currently being used (e.g., ::NTV2_AUDIOSYSTEM_1). + @return True if successful; otherwise false. + @note Use the ::NTV2DeviceGetNumAudioSystems function to determine how many independent Audio Systems are available on the device. + @note Use the ::NTV2DeviceGetNumVideoOutputs function to determine the number of SDI output jacks the device has. + @see CNTV2Card::SetSDIOutputAudioSystem, CNTV2Card::GetSDIOutputDS2AudioSystem, CNTV2Card::SetSDIOutputDS2AudioSystem, \ref audioplayout + **/ + AJA_VIRTUAL bool GetSDIOutputAudioSystem (const NTV2Channel inSDIOutputConnector, NTV2AudioSystem & outAudioSystem); + + /** + @brief Sets the Audio System that will supply audio for the given SDI output's audio embedder for Data Stream 2 + (Link B) for dual-link playout. + @param[in] inSDIOutputConnector Specifies the SDI output connector of interest as an ::NTV2Channel (a zero-based index number). + @param[in] inAudioSystem Specifies the Audio System that is to be used by the SDI output's embedder (e.g., ::NTV2_AUDIOSYSTEM_1). + @return True if successful; otherwise false. + @note Use the ::NTV2DeviceGetNumAudioSystems function to determine how many independent Audio Systems are available on the device. + @see CNTV2Card::GetSDIOutputAudioSystem, CNTV2Card::SetSDIOutputAudioSystem, CNTV2Card::GetSDIOutputDS2AudioSystem, \ref audioplayout + **/ + AJA_VIRTUAL bool SetSDIOutputDS2AudioSystem (const NTV2Channel inSDIOutputConnector, const NTV2AudioSystem inAudioSystem); + + /** + @brief Answers with the device's Audio System that is currently providing audio for the given SDI output's audio + embedder for Data Stream 2 (Link B) for dual-link output. + @param[in] inSDIOutputConnector Specifies the SDI output connector of interest as an ::NTV2Channel (a zero-based index number). + @param[out] outAudioSystem Receives the Audio System that's currently being used (e.g., ::NTV2_AUDIOSYSTEM_1). + @return True if successful; otherwise false. + @note Use the ::NTV2DeviceGetNumAudioSystems function to determine how many independent Audio Systems are available on the device. + @see CNTV2Card::SetSDIOutputAudioSystem, CNTV2Card::GetSDIOutputAudioSystem, CNTV2Card::SetSDIOutputDS2AudioSystem, \ref audioplayout + **/ + AJA_VIRTUAL bool GetSDIOutputDS2AudioSystem (const NTV2Channel inSDIOutputConnector, NTV2AudioSystem & outAudioSystem); + + /** + @brief For the given SDI input (specified as a channel number), answers if the specified audio channel pair is currently PCM-encoded or not. + @param[in] inSDIInputConnector Specifies the SDI input connector of interest as an ::NTV2Channel (a zero-based index number). + @param[in] inAudioChannelPair Specifies the audio channel pair of interest. + @param[out] outIsPCM Receives true if the channel pair is currently PCM-encoded; otherwise false. + @return True if successful; otherwise false. + **/ + virtual bool InputAudioChannelPairHasPCM (const NTV2Channel inSDIInputConnector, const NTV2AudioChannelPair inAudioChannelPair, bool & outIsPCM); + + /** + @brief For the given SDI input (specified as a channel number), returns the set of audio channel pairs that are currently PCM-encoded. + @param[in] inSDIInputConnector Specifies the SDI input connector of interest as an ::NTV2Channel (a zero-based index number). + @param[out] outChannelPairs Receives the channel pairs that are currently PCM-encoded. + @return True if successful; otherwise false. + @note The audio de-embedder firmware sets non-PCM-detect bits in registers independently of its channel-pair-detection registers. + Non-PCM-detect bits representing missing channel pairs are always clear. Therefore, callers of this function may wish to also + call CNTV2Card::GetDetectedAudioChannelPairs (or CNTV2Card::GetDetectedAESChannelPairs), and then use std::set_intersection to + produce a more realistic set of PCM channel pairs. + **/ + virtual bool GetInputAudioChannelPairsWithPCM (const NTV2Channel inSDIInputConnector, NTV2AudioChannelPairs & outChannelPairs); + + /** + @brief For the given SDI input (specified as a channel number), returns the set of audio channel pairs that are currently not PCM-encoded. + @param[in] inSDIInputConnector Specifies the SDI input connector of interest as an ::NTV2Channel (a zero-based index number). + @param[out] outChannelPairs Receives the channel pairs that are not currently PCM-encoded. + @return True if successful; otherwise false. + **/ + virtual bool GetInputAudioChannelPairsWithoutPCM (const NTV2Channel inSDIInputConnector, NTV2AudioChannelPairs & outChannelPairs); + + /** + @brief Answers as to whether or not the host OS audio services for the AJA device (e.g. CoreAudio on MacOS) + are currently suspended or not. + @param[out] outIsSuspended Receives 'true' if the host OS audio service is currently suspended for the AJA + device; otherwise, receives 'false'. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetSuspendHostAudio (bool & outIsSuspended); + + /** + @brief Suspends or resumes host OS audio (e.g. CoreAudio on MacOS) for the AJA device. + @param[in] inSuspend If true, suspends host OS audio for the AJA device; otherwise, resumes it. + @return True if successful; otherwise false. + @note This function is currently only implemented on MacOS, and is used to suspend or resume CoreAudio + when an application uses AutoCirculate to capture or play audio, to keep the two Audio Systems + from conflicting with each other. + **/ + AJA_VIRTUAL bool SetSuspendHostAudio (const bool inSuspend); + + /** + @brief Answers with the current audio source for a given quad of AES audio output channels. + By default, at power-up, for AJA devices that support AES audio output, the content of AES audio output channels 1/2/3/4 + reflect what's being output from audio channels 1/2/3/4 from NTV2_AUDIOSYSTEM_1, likewise with audio channels 5/6/7/8, etc. + @param[in] inAESAudioChannels Specifies the AES audio output channel quad of interest. + @param[out] outSrcAudioSystem Receives the NTV2AudioSystem that is currently driving the given AES audio output channel quad. + @param[out] outSrcAudioChannels Receives the audio channel quad from the Audio System that's sourcing the given AES audio output channel quad. + @return True if successful; otherwise false. + @see CNTV2Card::SetAESOutputSource, \ref audioplayout + **/ + AJA_VIRTUAL bool GetAESOutputSource (const NTV2Audio4ChannelSelect inAESAudioChannels, NTV2AudioSystem & outSrcAudioSystem, NTV2Audio4ChannelSelect & outSrcAudioChannels); + + /** + @brief Changes the audio source for the given quad of AES audio output channels. + By default, at power-up, for AJA devices that support AES audio output, the content of AES audio output channels 1/2/3/4 + reflect what's being output from audio channels 1/2/3/4 from NTV2_AUDIOSYSTEM_1, likewise with audio channels 5/6/7/8, etc. + @param[in] inAESAudioChannels Specifies the AES audio output channel quad of interest. + @param[in] inSrcAudioSystem Specifies the NTV2AudioSystem that should drive the given AES audio output channel quad. + @param[in] inSrcAudioChannels Specifies the audio channel quad from the given Audio System that should drive the given AES audio output channel quad. + @return True if successful; otherwise false. + @see CNTV2Card::GetAESOutputSource, \ref audioplayout + **/ + AJA_VIRTUAL bool SetAESOutputSource (const NTV2Audio4ChannelSelect inAESAudioChannels, const NTV2AudioSystem inSrcAudioSystem, const NTV2Audio4ChannelSelect inSrcAudioChannels); + + /** + @brief Sets the audio monitor output source to a specified audio system and channel pair. The audio output monitor + is typically a pair of RCA jacks (white + red) and/or a headphone jack. + @param[in] inAudioSystem Specifies the audio system to use. + @param[in] inChannelPair Specifies the audio channel pair to use. + @return True if successful; otherwise false. + @see CNTV2Card::GetAudioOutputMonitorSource, \ref audioplayout + **/ + AJA_VIRTUAL bool SetAudioOutputMonitorSource (const NTV2AudioChannelPair inChannelPair, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief Answers with the current audio monitor source. The audio output monitor + is typically a pair of RCA jacks (white + red) and/or a headphone jack. + @param[out] outAudioSystem Receives the current audio system being used. + @param[out] outChannelPair Receives the current audio channel pair being used. + @return True if successful; otherwise false. + @see CNTV2Card::SetAudioOutputMonitorSource, \ref audioplayout + **/ + AJA_VIRTUAL bool GetAudioOutputMonitorSource (NTV2AudioChannelPair & outChannelPair, NTV2AudioSystem & outAudioSystem); + + /** + @brief Answers with the current state of the audio output embedder for the given SDI output connector (specified as a channel number). + When the embedder is disabled, the device will not embed any SMPTE 299M (HD) or SMPTE 272M (SD) packets in the HANC in the SDI output stream. + @param[in] inSDIOutputConnector Specifies the SDI output of interest. + @param[out] outIsEnabled Receives 'true' if the audio output embedder is enabled; otherwise 'false' if disabled. + @return True if successful; otherwise false. + @see CNTV2Card::SetAudioOutputEmbedderState, \ref audioplayout + **/ + AJA_VIRTUAL bool GetAudioOutputEmbedderState (const NTV2Channel inSDIOutputConnector, bool & outIsEnabled); + + /** + @brief Enables or disables the audio output embedder for the given SDI output connector (specified as a channel number). + When the embedder is disabled, the device will not embed any SMPTE 299M (HD) or SMPTE 272M (SD) packets in the HANC in the SDI output stream. + @param[in] inSDIOutputConnector Specifies the SDI output of interest. + @param[in] inEnable Specify 'true' to enable the audio output embedder (normal operation). + Specify 'false' to disable the embedder. + @return True if successful; otherwise false. + @see CNTV2Card::GetAudioOutputEmbedderState, \ref audioplayout + **/ + AJA_VIRTUAL bool SetAudioOutputEmbedderState (const NTV2Channel inSDIOutputConnector, const bool & inEnable); + + /** + @brief Answers with the current state of the audio output erase mode for the given Audio System. + If enabled, the Audio System automatically writes zeroes into the audio output buffer behind the output read head during playout. + @param[in] inAudioSystem Specifies the audio system of interest. + @param[out] outEraseModeEnabled Receives 'true' if enabled; otherwise 'false' if disabled (normal operation). + @return True if successful; otherwise false. + @see CNTV2Card::SetAudioOutputEraseMode, \ref audioplayout + **/ + AJA_VIRTUAL bool GetAudioOutputEraseMode (const NTV2AudioSystem inAudioSystem, bool & outEraseModeEnabled); + + /** + @brief Enables or disables output erase mode for the given Audio System, which, when enabled, automatically writes zeroes into the audio output buffer + behind the output read head. + @param[in] inAudioSystem Specifies the audio system of interest. + @param[in] inEraseModeEnabled Specify 'true' to enable output erase mode; otherwise 'false' for normal operation. + @return True if successful; otherwise false. + @see CNTV2Card::GetAudioOutputEraseMode, \ref audioplayout + **/ + AJA_VIRTUAL bool SetAudioOutputEraseMode (const NTV2AudioSystem inAudioSystem, const bool & inEraseModeEnabled); + + /** + @brief Answers with the current state of the AES Sync Mode bit for the given Audio System's output. + @param[in] inAudioSystem Specifies the audio system of interest. + @param[out] outAESSyncModeBitSet Receives 'true' if the bit is set; otherwise 'false' (normal operation). + @return True if successful; otherwise false. + @see CNTV2Card::SetAudioOutputAESSyncModeBit, \ref audioplayout + **/ + AJA_VIRTUAL bool GetAudioOutputAESSyncModeBit (const NTV2AudioSystem inAudioSystem, bool & outAESSyncModeBitSet); + + /** + @brief Sets or clears the AES Sync Mode bit for the given Audio System's output. + @param[in] inAudioSystem Specifies the audio system of interest. + @param[in] inAESSyncModeBitSet Specify 'true' to set the AES Sync Mode bit; otherwise 'false' for normal operation. + @return True if successful; otherwise false. + @see CNTV2Card::GetAudioOutputAESSyncModeBit, \ref audioplayout + **/ + AJA_VIRTUAL bool SetAudioOutputAESSyncModeBit (const NTV2AudioSystem inAudioSystem, const bool & inAESSyncModeBitSet); + + /** + @brief Sets the specified bidirectional XLR audio connectors to collectively act as inputs or outputs. + @param[in] inChannelQuad Specifies the XLR audio connectors of interest. + @param[in] inEnable If true, specifies that the connectors are to be used as outputs. + If false, specifies they're to be used as inputs. + @return True if successful; otherwise false. + @see CNTV2Card::GetAnalogAudioTransmitEnable + **/ + AJA_VIRTUAL bool SetAnalogAudioTransmitEnable (const NTV2Audio4ChannelSelect inChannelQuad, const bool inEnable); // New in SDK 16.1 + + /** + @brief Answers whether or not the specified bidirectional XLR audio connectors are collectively acting as inputs or outputs. + @param[in] inChannelQuad Specifies the XLR audio connectors of interest. + @param[out] outEnabled Receives true if the XLR connectors are currently transmitting (output), + or false if they're receiving (input). + @return True if successful; otherwise false. + @see CNTV2Card::SetAnalogAudioTransmitEnable + **/ + AJA_VIRTUAL bool GetAnalogAudioTransmitEnable (const NTV2Audio4ChannelSelect inChannelQuad, bool & outEnabled); // New in SDK 16.1 + + /** + @brief Answers with the current value of the 48kHz audio clock counter. + @return True if successful; otherwise false. + @param[out] outValue Receives the number of 48kHz "ticks" that have transpired since the + device was powered up. + @param[in] inAudioSystem Specifies the ::NTV2AudioSystem of interest. Currently ignored, but + may be used if a future NTV2 device has more than one audio clock. + @note This counter will overflow and wrap back to zero in 24:51:00 [hh:mm:ss]. + **/ + AJA_VIRTUAL bool GetRawAudioTimer (ULWord & outValue, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + AJA_VIRTUAL bool CanDoAudioWaitForVBI (void); ///< @return True if the device firmware supports audio start delay-til-VBI. + + AJA_VIRTUAL bool SetMultiLinkAudioMode (const NTV2AudioSystem inAudioSystem, bool inEnable); ///< @brief Sets the specified audio systems multi-link mode bit + AJA_VIRTUAL bool GetMultiLinkAudioMode (const NTV2AudioSystem inAudioSystem, bool & outEnabled); + +#if !defined(NTV2_DEPRECATE_16_0) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteAudioSource (const ULWord inValue, const NTV2Channel inChannel = NTV2_CHANNEL1)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadAudioSource (ULWord & outValue, const NTV2Channel inChannel = NTV2_CHANNEL1)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetAudioOutputReset (const NTV2AudioSystem inAudioSystem, const bool inIsReset)) {return inIsReset ? StopAudioOutput(inAudioSystem) : StartAudioOutput(inAudioSystem);} ///< @deprecated Call CNTV2Card::StartAudioOutput or CNTV2Card::StopAudioOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetAudioOutputReset (const NTV2AudioSystem inAudioSystem, bool & outIsReset)) {if(!IsAudioOutputRunning(inAudioSystem, outIsReset)) return false; outIsReset = !outIsReset; return true; } ///< @deprecated Call CNTV2Card::IsAudioOutputRunning instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetAudioInputReset (const NTV2AudioSystem inAudioSystem, const bool inIsReset)) {return inIsReset ? StopAudioInput(inAudioSystem) : StartAudioInput(inAudioSystem);} ///< @deprecated Call CNTV2Card::StartAudioInput or CNTV2Card::StopAudioInput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetAudioInputReset (const NTV2AudioSystem inAudioSystem, bool & outIsReset)) {if(!IsAudioInputRunning(inAudioSystem, outIsReset)) return false; outIsReset = !outIsReset; return true; } ///< @deprecated Call CNTV2Card::IsAudioInputRunning instead. +#endif // !defined(NTV2_DEPRECATE_16_0) +#if !defined(NTV2_DEPRECATE_16_1) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAnalogAudioIOConfiguration (const NTV2AnalogAudioIO inConfig)); ///< @deprecated Use CNTV2Card::SetAnalogAudioTransmitEnable instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAnalogAudioIOConfiguration (NTV2AnalogAudioIO & outConfig)); ///< @deprecated Use CNTV2Card::GetAnalogAudioTransmitEnable instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool WriteAudioLastOut (ULWord & outValue, const NTV2Channel inChannel)) {return WriteAudioLastOut(outValue, NTV2AudioSystem(inChannel));} ///< @deprecated Use CNTV2Card::WriteAudioLastOut(ULWord &, const NTV2AudioSystem) instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadAudioLastOut (ULWord & outValue, const NTV2Channel inChannel)) {return ReadAudioLastOut(outValue, NTV2AudioSystem(inChannel));} ///< @deprecated Use CNTV2Card::ReadAudioLastOut(ULWord &, const NTV2AudioSystem) instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadAudioLastIn (ULWord & outValue, const NTV2Channel inChannel)) {return ReadAudioLastIn(outValue, NTV2AudioSystem(inChannel));} ///< @deprecated Use CNTV2Card::ReadAudioLastIn(ULWord &, const NTV2AudioSystem) instead. +#endif // !defined(NTV2_DEPRECATE_16_1) + ///@} + + /** + @name Audio Mixer + **/ + ///@{ + + /** + @brief Answers with the Audio System that's currently driving the given input of the Audio Mixer. + @param[in] inMixerInput Specifies the Audio Mixer's input of interest. + @param[out] outAudioSystem Receives the ::NTV2AudioSystem that's currently driving the Audio Mixer's input. + @return True if successful; otherwise false. + @see CNTV2Card::SetAudioMixerInputAudioSystem, \ref audiomixer + **/ + AJA_VIRTUAL bool GetAudioMixerInputAudioSystem (const NTV2AudioMixerInput inMixerInput, NTV2AudioSystem & outAudioSystem); // New in SDK 15.5 + + /** + @brief Sets the Audio System that will drive the given input of the Audio Mixer. + @param[in] inMixerInput Specifies the Audio Mixer's input of interest. + @param[in] inAudioSystem Specifies the new ::NTV2AudioSystem that is to drive the Audio Mixer's input. + @return True if successful; otherwise false. + @see CNTV2Card::GetAudioMixerInputAudioSystem, \ref audiomixer + **/ + AJA_VIRTUAL bool SetAudioMixerInputAudioSystem (const NTV2AudioMixerInput inMixerInput, const NTV2AudioSystem inAudioSystem); // New in SDK 15.5 + + /** + @brief Answers with the Audio Channel Pair that's currently driving the given input of the Audio Mixer. + @param[in] inMixerInput Specifies the Audio Mixer's input of interest. + @param[out] outChannelPair Receives the ::NTV2AudioChannelPair that's currently driving the audio mixer's input. + @return True if successful; otherwise false. + @note Audio mixer inputs ::NTV2_AudioMixerInputAux1 and ::NTV2_AudioMixerInputAux2 currently return ::NTV2_AudioChannel1_2. + @see CNTV2Card::SetAudioMixerInputChannelSelect, \ref audiomixer + **/ + AJA_VIRTUAL bool GetAudioMixerInputChannelSelect (const NTV2AudioMixerInput inMixerInput, NTV2AudioChannelPair & outChannelPair); // New in SDK 15.5 + + /** + @brief Specifies the Audio Channel Pair that will drive the given input of the Audio Mixer. + @param[in] inMixerInput Specifies the Audio Mixer's input of interest. + @param[in] inChannelPair Specifies the new ::NTV2AudioChannelPair that is to drive the audio mixer's input. + @return True if successful; otherwise false. + @note Audio mixer inputs ::NTV2_AudioMixerInputAux1 and ::NTV2_AudioMixerInputAux2 are currently fixed to ::NTV2_AudioChannel1_2 and cannot be changed. + @see CNTV2Card::SetAudioMixerInputChannelSelect, \ref audiomixer + **/ + AJA_VIRTUAL bool SetAudioMixerInputChannelSelect (const NTV2AudioMixerInput inMixerInput, const NTV2AudioChannelPair inChannelPair); // New in SDK 15.5 + + /** + @brief Answers with the current gain setting for the Audio Mixer's given input. + @param[in] inMixerInput Specifies the Audio Mixer's input of interest. + @param[in] inChannel Specifies the audio channel of interest. + @param[out] outGainValue Receives the current main input gain level. + This is a signed 18-bit value, where unity gain is 0x10000. + @return True if successful; otherwise false. + @note Currently, the Audio Mixer's Main input gain control affects both audio channels 1 & 2 (L & R), + while the Aux 1 & 2 inputs have separate gain settings for audio channels 1 & 2 (L & R). + @see CNTV2Card::GetAudioMixerInputGain, \ref audiomixer + **/ + AJA_VIRTUAL bool GetAudioMixerInputGain (const NTV2AudioMixerInput inMixerInput, const NTV2AudioMixerChannel inChannel, ULWord & outGainValue); // New in SDK 15.5 + + /** + @brief Sets the gain for the given input of the Audio Mixer. + @param[in] inMixerInput Specifies the Audio Mixer's input of interest. + @param[in] inChannel Specifies the audio channel of interest. + @param[in] inGainValue Specifies the new input gain level. + This is a signed 18-bit value, where unity gain is 0x10000. + @return True if successful; otherwise false. + @note Currently, the Audio Mixer's Main input gain control affects both audio channels 1 & 2 (L & R), + while the Aux 1 & 2 inputs have separate gain settings for audio channels 1 & 2 (L & R). + @see CNTV2Card::SetAudioMixerInputGain, \ref audiomixer + **/ + AJA_VIRTUAL bool SetAudioMixerInputGain (const NTV2AudioMixerInput inMixerInput, const NTV2AudioMixerChannel inChannel, const ULWord inGainValue); // New in SDK 15.5 + + /** + @brief Answers with the current gain setting for the Audio Mixer's output. + @param[out] outGainValue Receives the current main input gain level. + This is a signed 18-bit value, where unity gain is 0x10000. + @return True if successful; otherwise false. + @see CNTV2Card::GetAudioMixerOutputGain, \ref audiomixer + **/ + AJA_VIRTUAL bool GetAudioMixerOutputGain (ULWord & outGainValue); // New in SDK 15.5 + + /** + @brief Sets the gain for the output of the Audio Mixer. + @param[in] inGainValue Specifies the new input gain level. + This is a signed 18-bit value, where unity gain is 0x10000. + @return True if successful; otherwise false. + @see CNTV2Card::SetAudioMixerOutputGain, \ref audiomixer + **/ + AJA_VIRTUAL bool SetAudioMixerOutputGain (const ULWord inGainValue); // New in SDK 15.5 + + /** + @brief Answers with the Audio Mixer's current audio output levels. + @param[in] inChannelPairs Specifies the audio channel pair(s) of interest. + Use an empty list to retrieve all available audio channels. + @param[out] outLevels A std::vector of ULWord values, one per audio channel, in ascending audio + channel order (per the ::NTV2AudioChannelPairs that were specified). + @return True if successful; otherwise false. + @see See \ref audiomixer + **/ + AJA_VIRTUAL bool GetAudioMixerOutputLevels (const NTV2AudioChannelPairs & inChannelPairs, std::vector & outLevels); // New in SDK 15.5 + + /** + @brief Answers with the current gain setting for the headphone out. + @param[out] outGainValue Receives the current headphone gain level. + This is a signed 18-bit value, where unity gain is 0x10000. + @return True if successful; otherwise false. + @see CNTV2Card::GetHeadphoneOutputGain, \ref audiomixer + **/ + AJA_VIRTUAL bool GetHeadphoneOutputGain (ULWord & outGainValue); + + /** + @brief Sets the gain for the headphone out. + @param[in] inGainValue Specifies the new headphone gain level. + This is a signed 18-bit value, where unity gain is 0x10000. + @return True if successful; otherwise false. + @see CNTV2Card::SetHeadphoneOutputGain, \ref audiomixer + **/ + AJA_VIRTUAL bool SetHeadphoneOutputGain (const ULWord inGainValue); + + /** + @brief Answers with a std::bitset that indicates which input audio channels of the given Audio Mixer input are currently muted. + @param[in] inMixerInput Specifies the Audio Mixer's input of interest. + @param[out] outMutes Receives the bitset. Call its "test" method, passing it a valid ::NTV2AudioMixerChannel + to determine if that channel is muted (true) or not (false). + Note that only audio channels ::NTV2_AudioMixerChannel1 and ::NTV2_AudioMixerChannel2 are relevant. + @return True if successful; otherwise false. + @see CNTV2Card::SetAudioMixerInputChannelsMute, \ref audiomixer + **/ + AJA_VIRTUAL bool GetAudioMixerInputChannelsMute (const NTV2AudioMixerInput inMixerInput, NTV2AudioChannelsMuted16 & outMutes); // New in SDK 15.5 + + /** + @brief Mutes (or enables) the given output audio channel of the Audio Mixer. + @param[in] inMixerInput Specifies the Audio Mixer's input of interest. + @param[in] inMutes Specifies the mute state for each audio channel as a std::bitset. + The index in the bitset directly correlates with the ::NTV2AudioMixerChannel. + Set the bit to mute the channel; clear/reset the bit to unmute/enable the channel. + Note that only audio channels ::NTV2_AudioMixerChannel1 and ::NTV2_AudioMixerChannel2 are relevant. + @return True if successful; otherwise false. + @see CNTV2Card::GetAudioMixerInputChannelsMute, \ref audiomixer + **/ + AJA_VIRTUAL bool SetAudioMixerInputChannelsMute (const NTV2AudioMixerInput inMixerInput, const NTV2AudioChannelsMuted16 inMutes); // New in SDK 15.5 + + /** + @brief Answers with the Audio Mixer's current audio input levels. + @param[in] inMixerInput Specifies the Audio Mixer's input of interest. + @param[in] inChannelPairs Specifies the audio channel pair(s) of interest. + Use an empty list to retrieve all available audio channels. + @param[out] outLevels A std::vector of ULWord values, one per audio channel, in ascending audio + channel order (per the ::NTV2AudioChannelPairs that were specified). + @return True if successful; otherwise false. + @see See \ref audiomixer + **/ + AJA_VIRTUAL bool GetAudioMixerInputLevels (const NTV2AudioMixerInput inMixerInput, const NTV2AudioChannelPairs & inChannelPairs, std::vector & outLevels); // New in SDK 15.5 + + /** + @brief Answers with the Audio Mixer's current sample count used for measuring audio levels. + @param[out] outSampleCount Receives the current sample count. + @return True if successful; otherwise false. + @see See \ref audiomixer + **/ + AJA_VIRTUAL bool GetAudioMixerLevelsSampleCount (ULWord & outSampleCount); // New in SDK 15.5 + + /** + @brief Sets the Audio Mixer's sample count it uses for measuring audio levels. + @param[in] inSampleCount Specifies the new sample count. Must be a power of two + (e.g. 1, 2, 4, 8 ...) up to 0x8000 maximum. + @return True if successful; otherwise false. + @see See \ref audiomixer + **/ + AJA_VIRTUAL bool SetAudioMixerLevelsSampleCount (const ULWord inSampleCount); // New in SDK 15.5 + + /** + @brief Answers with a std::bitset that indicates which output audio channels of the Audio Mixer are currently muted. + @param[out] outMutes Receives the bitset. Call its "test" method, passing it a valid ::NTV2AudioMixerChannel + to determine if that channel is muted (true) or not (false). + @return True if successful; otherwise false. + @see CNTV2Card::SetAudioMixerOutputChannelsMute, \ref audiomixer + **/ + AJA_VIRTUAL bool GetAudioMixerOutputChannelsMute (NTV2AudioChannelsMuted16 & outMutes); // New in SDK 15.5 + + /** + @brief Mutes or enables the individual output audio channels of the Audio Mixer. + @param[in] inMutes Specifies the mute state for each audio channel as a std::bitset. + The index in the bitset directly correlates with the ::NTV2AudioMixerChannel. + Set the bit to mute the channel; clear/reset the bit to unmute/enable the channel. + @return True if successful; otherwise false. + @see CNTV2Card::GetAudioMixerOutputChannelsMute, \ref audiomixer + **/ + AJA_VIRTUAL bool SetAudioMixerOutputChannelsMute (const NTV2AudioChannelsMuted16 inMutes); // New in SDK 15.5 + +#if !defined(NTV2_DEPRECATE_15_5) + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool GetAudioMixerMainInputAudioSystem(NTV2AudioSystem & outAudioSystem)) {return GetAudioMixerInputAudioSystem(NTV2_AudioMixerInputMain, outAudioSystem);} ///< @deprecated Call CNTV2Card::GetAudioMixerInputAudioSystem instead. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool SetAudioMixerMainInputAudioSystem(const NTV2AudioSystem inAudioSystem)) {return SetAudioMixerInputAudioSystem(NTV2_AudioMixerInputMain, inAudioSystem);} ///< @deprecated Call CNTV2Card::SetAudioMixerInputAudioSystem instead. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool GetAudioMixerMainInputChannelSelect(NTV2AudioChannelPair & outChannelPair)) {return GetAudioMixerInputChannelSelect(NTV2_AudioMixerInputMain, outChannelPair);} ///< @deprecated Call CNTV2Card::GetAudioMixerInputChannelSelect instead. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool SetAudioMixerMainInputChannelSelect(const NTV2AudioChannelPair inChannelPair)){return SetAudioMixerInputChannelSelect(NTV2_AudioMixerInputMain, inChannelPair);} ///< @deprecated Call CNTV2Card::SetAudioMixerInputChannelSelect instead. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool GetAudioMixerMainInputGain(ULWord & outGainValue)) {return GetAudioMixerInputGain(NTV2_AudioMixerInputMain, NTV2_AudioMixerChannel1, outGainValue);} ///< @deprecated Call CNTV2Card::GetAudioMixerInputGain instead. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool SetAudioMixerMainInputGain (const ULWord inGainValue)) {return SetAudioMixerInputGain(NTV2_AudioMixerInputMain, NTV2_AudioMixerChannel1, inGainValue);} ///< @deprecated Call CNTV2Card::SetAudioMixerInputGain instead. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool GetAudioMixerAux1x2chInputAudioSystem(NTV2AudioSystem & outAudioSystem)) {return GetAudioMixerInputAudioSystem(NTV2_AudioMixerInputAux1, outAudioSystem);} ///< @deprecated Call CNTV2Card::GetAudioMixerInputAudioSystem instead. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool SetAudioMixerAux1x2chInputAudioSystem(const NTV2AudioSystem inAudioSystem)) {return SetAudioMixerInputAudioSystem(NTV2_AudioMixerInputAux1, inAudioSystem);} ///< @deprecated Call CNTV2Card::SetAudioMixerInputAudioSystem instead. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool GetAudioMixerAux1InputGain(const NTV2AudioMixerChannel inChannel, ULWord & outGainValue)) {return GetAudioMixerInputGain(NTV2_AudioMixerInputAux1, inChannel, outGainValue);} ///< @deprecated Call CNTV2Card::GetAudioMixerInputGain instead. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool GetAudioMixerAux2x2chInputAudioSystem(NTV2AudioSystem & outAudioSystem)) {return GetAudioMixerInputAudioSystem(NTV2_AudioMixerInputAux2, outAudioSystem);} ///< @deprecated Call CNTV2Card::GetAudioMixerInputAudioSystem instead. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool SetAudioMixerAux2x2chInputAudioSystem(const NTV2AudioSystem inAudioSystem)) {return SetAudioMixerInputAudioSystem(NTV2_AudioMixerInputAux2, inAudioSystem);} ///< @deprecated Call CNTV2Card::SetAudioMixerInputAudioSystem instead. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool GetAudioMixerAux2InputGain(const NTV2AudioMixerChannel inChannel, ULWord & outGainValue)) {return GetAudioMixerInputGain(NTV2_AudioMixerInputAux2, inChannel, outGainValue);} ///< @deprecated Call CNTV2Card::GetAudioMixerInputGain instead. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool SetAudioMixerAux1InputGain (const NTV2AudioMixerChannel inChannel, const ULWord inGainValue)); ///< @deprecated Call CNTV2Card::SetAudioMixerInputGain instead. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool SetAudioMixerAux2InputGain (const NTV2AudioMixerChannel inChannel, const ULWord inGainValue)); ///< @deprecated Call CNTV2Card::SetAudioMixerInputGain instead. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool GetAudioMixerMainInputEnable(bool & outEnabled)); ///< @deprecated Call CNTV2Card::GetAudioMixerInputChannelsMute instead. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool SetAudioMixerMainInputEnable(const bool inEnable)) {return SetAudioMixerInputChannelsMute(NTV2_AudioMixerInputMain, inEnable ? NTV2AudioChannelsEnableAll : NTV2AudioChannelsMuteAll);} ///< @deprecated Call CNTV2Card::SetAudioMixerInputChannelsMute instead. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool GetAudioMixerAux1InputEnable (bool & outEnabled)); ///< @deprecated Call CNTV2Card::GetAudioMixerInputChannelsMute instead. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool SetAudioMixerAux1InputEnable (const bool inEnable)) {return SetAudioMixerInputChannelsMute(NTV2_AudioMixerInputAux1, inEnable ? NTV2AudioChannelsEnableAll : NTV2AudioChannelsMuteAll);} ///< @deprecated Call CNTV2Card::SetAudioMixerInputChannelsMute instead. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool GetAudioMixerAux2InputEnable (bool & outEnabled)); ///< @deprecated Call CNTV2Card::GetAudioMixerInputChannelsMute instead. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool SetAudioMixerAux2InputEnable (const bool inEnable)) {return SetAudioMixerInputChannelsMute(NTV2_AudioMixerInputAux2, inEnable ? NTV2AudioChannelsEnableAll : NTV2AudioChannelsMuteAll);} ///< @deprecated Call CNTV2Card::SetAudioMixerInputChannelsMute instead. + AJA_VIRTUAL ULWord GetAudioMixerMainInputChannelLevel (const NTV2AudioMixerChannel inChannel); + AJA_VIRTUAL ULWord GetAudioMixerAux1InputChannelLevel (const NTV2AudioMixerChannel inChannel); + AJA_VIRTUAL ULWord GetAudioMixerAux2InputChannelLevel (const NTV2AudioMixerChannel inChannel); +#endif // !defined(NTV2_DEPRECATE_15_5) + ///@} + + // + // Read/Write Particular Register routines + // + AJA_VIRTUAL bool WriteGlobalControl (ULWord value); + AJA_VIRTUAL bool ReadGlobalControl (ULWord *value); + + #if !defined (NTV2_DEPRECATE) + virtual NTV2_DEPRECATED_f(bool SetBoard (UWord inDeviceIndex)); ///< @deprecated Use ::CNTV2DeviceScanner instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(NTV2BoardID GetBoardID (void)) {return GetDeviceID ();} ///< @deprecated Use GetDeviceID instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(UWord GetBoardNumber (void) const) {return GetIndexNumber ();} ///< @deprecated Use GetIndexNumber instead. + NTV2_DEPRECATED_f(AJA_VIRTUAL NTV2BoardType GetBoardType (void) const); ///< @deprecated NTV2BoardType is obsolete. + NTV2_DEPRECATED_f(AJA_VIRTUAL NTV2BoardSubType GetBoardSubType (void)); ///< @deprecated NTV2BoardSubType is obsolete. + static NTV2_DEPRECATED_f(UWord GetNumNTV2Boards (void)); ///< @deprecated Use CNTV2DeviceScanner instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DmaRead (const NTV2DMAEngine inDMAEngine, const ULWord inFrameNumber, ULWord * pFrameBuffer, + const ULWord inOffsetBytes, const ULWord inByteCount, const bool inSynchronous = true)); ///< @deprecated Use CNTV2Card::DMARead instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DmaWrite (const NTV2DMAEngine inDMAEngine, const ULWord inFrameNumber, const ULWord * pFrameBuffer, + const ULWord inOffsetBytes, const ULWord inByteCount, const bool inSynchronous = true)); ///< @deprecated Use CNTV2Card::DMAWrite instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DmaReadFrame (const NTV2DMAEngine inDMAEngine, const ULWord inFrameNumber, ULWord * pFrameBuffer, + const ULWord inByteCount, const bool inSynchronous = true)); ///< @deprecated Use CNTV2Card::DMAReadFrame instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DmaWriteFrame (const NTV2DMAEngine inDMAEngine, const ULWord inFrameNumber, const ULWord * pFrameBuffer, + const ULWord inByteCount, const bool inSynchronous = true)); ///< @deprecated Use CNTV2Card::DMAWriteFrame instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DmaReadSegment (const NTV2DMAEngine inDMAEngine, const ULWord inFrameNumber, ULWord * pFrameBuffer, + const ULWord inOffsetBytes, const ULWord inByteCount, + const ULWord inNumSegments, const ULWord inSegmentHostPitch, const ULWord inSegmentCardPitch, + const bool inSynchronous = true)); ///< @deprecated Use CNTV2Card::DMAReadSegments instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DmaWriteSegment (const NTV2DMAEngine inDMAEngine, const ULWord inFrameNumber, const ULWord * pFrameBuffer, + const ULWord inOffsetBytes, const ULWord inByteCount, + const ULWord inNumSegments, const ULWord inSegmentHostPitch, const ULWord inSegmentCardPitch, + const bool inSynchronous = true)); ///< @deprecated Use CNTV2Card::DMAWriteSegments instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DmaAudioRead ( const NTV2DMAEngine inDMAEngine, + const NTV2AudioSystem inAudioEngine, + ULWord * pOutAudioBuffer, + const ULWord inOffsetBytes, + const ULWord inByteCount, + const bool inSynchronous = true)); ///< @deprecated Use CNTV2Card::DMAReadAudio instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DmaAudioWrite ( const NTV2DMAEngine inDMAEngine, + const NTV2AudioSystem inAudioEngine, + const ULWord * pInAudioBuffer, + const ULWord inOffsetBytes, + const ULWord inByteCount, + const bool inSynchronous = true)); ///< @deprecated Use CNTV2Card::DMAWriteAudio instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DmaReadField (NTV2DMAEngine DMAEngine, ULWord frameNumber, NTV2FieldID fieldID, ULWord *pFrameBuffer, + ULWord bytes, bool bSync = true)); ///< @deprecated This function is obsolete, as no current AJA devices use non-interleaved fields. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DmaWriteField (NTV2DMAEngine DMAEngine, ULWord frameNumber, NTV2FieldID fieldID, ULWord *pFrameBuffer, + ULWord bytes, bool bSync = true)); ///< @deprecated This function is obsolete, as no current AJA devices use non-interleaved fields. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetReferenceSource (NTV2ReferenceSource value, bool ajaRetail = AJA_RETAIL_DEFAULT)); ///< @deprecated Use SetReference instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetReferenceSource (NTV2ReferenceSource* value, bool ajaRetail = AJA_RETAIL_DEFAULT)); ///< @deprecated Use GetReference instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UpdateK2ColorSpaceMatrixSelect (NTV2VideoFormat currFormat = NTV2_FORMAT_UNKNOWN, bool ajaRetail = AJA_RETAIL_DEFAULT)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UpdateK2LUTSelect (NTV2VideoFormat currFormat = NTV2_FORMAT_UNKNOWN, bool ajaRetail = AJA_RETAIL_DEFAULT)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(NTV2BitfileType BitfileSwitchNeeded (NTV2DeviceID deviceID, NTV2VideoFormat value, bool ajaRetail = AJA_RETAIL_DEFAULT)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetActiveFramebufferSize (SIZE * pOutFrameDimensions, const NTV2Channel inChannel = NTV2_CHANNEL1)); ///< @deprecated Use GetActiveFrameDimensions instead. + static NTV2_DEPRECATED_f(bool IsSDVideoADCMode (NTV2LSVideoADCMode mode)); ///< @deprecated This function is obsolete. + static NTV2_DEPRECATED_f(bool IsHDVideoADCMode (NTV2LSVideoADCMode mode)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetReferenceVoltage (NTV2RefVoltage value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetReferenceVoltage (NTV2RefVoltage* value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFrameBufferMode (NTV2Channel inChannel, NTV2FrameBufferMode inValue)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFrameBufferMode (NTV2Channel inChannel, NTV2FrameBufferMode & outValue)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetFrameBufferMode (NTV2Channel inChannel, NTV2FrameBufferMode * pOutValue)) {return pOutValue ? GetFrameBufferMode (inChannel, *pOutValue) : false;} ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WritePanControl (ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadPanControl (ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetNumberAudioChannels(ULWord numChannels, NTV2Channel channel)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetNumberAudioChannels(ULWord *numChannels, NTV2Channel channel = NTV2_CHANNEL1)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAudioRate(NTV2AudioRate value, NTV2Channel channel)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioRate(NTV2AudioRate *value, NTV2Channel channel)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAudioBufferSize(NTV2AudioBufferSize value, NTV2Channel channel)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioBufferSize(NTV2AudioBufferSize *value, NTV2Channel channel)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAudioAnalogLevel(NTV2AudioLevel value, NTV2Channel channel)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioAnalogLevel(NTV2AudioLevel *value, NTV2Channel channel)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAudioLoopBack(NTV2AudioLoopBack value, NTV2Channel channel)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioLoopBack(NTV2AudioLoopBack *value, NTV2Channel channel)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetEncodedAudioMode(NTV2EncodedAudioMode value, NTV2Channel channel)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetEncodedAudioMode(NTV2EncodedAudioMode *value, NTV2Channel channel)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetEmbeddedAudioInput(NTV2EmbeddedAudioInput value, NTV2Channel channel)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetEmbeddedAudioInput(NTV2EmbeddedAudioInput *value, NTV2Channel channel)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetEmbeddedAudioClock(NTV2EmbeddedAudioClock value, NTV2Channel channel)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetEmbeddedAudioClock(NTV2EmbeddedAudioClock *value, NTV2Channel channel)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioWrapAddress(ULWord *wrapAddress, NTV2Channel channel)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioReadOffset(ULWord *readOffset, NTV2Channel channel)); ///< @deprecated Use the equivalent function that accepts an NTV2AudioSystem instead of an NTV2Channel. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAverageAudioLevelChan1_2(ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteAudioControl (ULWord inValue, NTV2Channel inChannel = NTV2_CHANNEL1)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadAudioControl (ULWord *value, NTV2Channel inChannel = NTV2_CHANNEL1)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioPlayCaptureModeEnable (const NTV2AudioSystem inAudioSystem, bool * pOutEnable)); ///< @deprecated Use GetAudioPlayCaptureModeEnable(NTV2AudioSystem,bool&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioInputDelay (const NTV2AudioSystem inAudioSystem, ULWord * pOutDelay)); ///< @deprecated Use GetAudioInputDelay(NTV2AudioSystem,ULWord&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioOutputDelay (const NTV2AudioSystem inAudioSystem, ULWord * pOutDelay)); ///< @deprecated Use GetAudioOutputDelay(NTV2AudioSystem,ULWord&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAudioSystemInputSource (const NTV2AudioSystem inAudioSystem, const NTV2AudioSource inAudioSource)); ///< @deprecated Call CNTV2Card::SetAudioSystemInputSource(const NTV2AudioSystem, const NTV2AudioSource, const NTV2EmbeddedAudioInput) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAudioSystemInputSource (const NTV2AudioSystem inAudioSystem, const NTV2InputSource inInputSource)); ///< @deprecated Call CNTV2Card::SetAudioSystemInputSource(const NTV2AudioSystem, const NTV2AudioSource, const NTV2EmbeddedAudioInput) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioSystemInputSource (const NTV2AudioSystem inAudioSystem, NTV2AudioSource & outAudioSource)); ///< @deprecated Call CNTV2Card::GetAudioSystemInputSource(const NTV2AudioSystem, NTV2AudioSource&, NTV2EmbeddedAudioInput&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioSystemInputSource (const NTV2AudioSystem inAudioSystem, NTV2AudioSource * pOutAudioSource)); ///< @deprecated Call CNTV2Card::GetAudioSystemInputSource(const NTV2AudioSystem, NTV2AudioSource&, NTV2EmbeddedAudioInput&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetSDIOutAudioSource (const ULWord inValue, const NTV2Channel channel = NTV2_CHANNEL1)); ///< @deprecated Use SetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDIOutAudioSource (ULWord & outValue, const NTV2Channel channel = NTV2_CHANNEL1)); ///< @deprecated Use GetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI1OutAudioSource(ULWord value)); ///< @deprecated Use SetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI1OutAudioSource(ULWord* value)); ///< @deprecated Use GetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI2OutAudioSource(ULWord value)); ///< @deprecated Use SetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI2OutAudioSource(ULWord* value)); ///< @deprecated Use GetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI3OutAudioSource(ULWord value)); ///< @deprecated Use SetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI3OutAudioSource(ULWord* value)); ///< @deprecated Use GetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI4OutAudioSource(ULWord value)); ///< @deprecated Use SetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI4OutAudioSource(ULWord* value)); ///< @deprecated Use GetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI5OutAudioSource(ULWord value)); ///< @deprecated Use SetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI5OutAudioSource(ULWord* value)); ///< @deprecated Use GetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI6OutAudioSource(ULWord value)); ///< @deprecated Use SetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI6OutAudioSource(ULWord* value)); ///< @deprecated Use GetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI7OutAudioSource(ULWord value)); ///< @deprecated Use SetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI7OutAudioSource(ULWord* value)); ///< @deprecated Use GetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI8OutAudioSource(ULWord value)); ///< @deprecated Use SetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI8OutAudioSource(ULWord* value)); ///< @deprecated Use GetSDIOutputAudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetSDIOutDS2AudioSource (const ULWord inValue, const NTV2Channel channel = NTV2_CHANNEL1)); ///< @deprecated Use SetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDIOutDS2AudioSource (ULWord & outValue, const NTV2Channel channel = NTV2_CHANNEL1)); ///< @deprecated Use GetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI1OutDS2AudioSource(ULWord value)); ///< @deprecated Use SetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI1OutDS2AudioSource(ULWord* value)); ///< @deprecated Use GetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI2OutDS2AudioSource(ULWord value)); ///< @deprecated Use SetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI2OutDS2AudioSource(ULWord* value)); ///< @deprecated Use GetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI3OutDS2AudioSource(ULWord value)); ///< @deprecated Use SetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI3OutDS2AudioSource(ULWord* value)); ///< @deprecated Use GetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI4OutDS2AudioSource(ULWord value)); ///< @deprecated Use SetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI4OutDS2AudioSource(ULWord* value)); ///< @deprecated Use GetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI5OutDS2AudioSource(ULWord value)); ///< @deprecated Use SetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI5OutDS2AudioSource(ULWord* value)); ///< @deprecated Use GetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI6OutDS2AudioSource(ULWord value)); ///< @deprecated Use SetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI6OutDS2AudioSource(ULWord* value)); ///< @deprecated Use GetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI7OutDS2AudioSource(ULWord value)); ///< @deprecated Use SetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI7OutDS2AudioSource(ULWord* value)); ///< @deprecated Use GetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI8OutDS2AudioSource(ULWord value)); ///< @deprecated Use SetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI8OutDS2AudioSource(ULWord* value)); ///< @deprecated Use GetSDIOutputDS2AudioSystem(NTV2Channel,NTV2AudioSystem&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteCh1Control (ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadCh1Control (ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteCh1PCIAccessFrame (ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadCh1PCIAccessFrame (ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteCh1OutputFrame (ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadCh1OutputFrame (ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteCh1InputFrame (ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadCh1InputFrame (ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteCh2Control (ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadCh2Control (ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteCh2PCIAccessFrame (ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadCh2PCIAccessFrame (ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteCh2OutputFrame (ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadCh2OutputFrame (ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteCh2InputFrame (ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadCh2InputFrame (ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteCh3Control (ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadCh3Control (ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteCh3PCIAccessFrame (ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadCh3PCIAccessFrame (ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteCh3OutputFrame (ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadCh3OutputFrame (ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteCh3InputFrame (ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadCh3InputFrame (ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteCh4Control (ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadCh4Control (ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteCh4PCIAccessFrame (ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadCh4PCIAccessFrame (ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteCh4OutputFrame (ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadCh4OutputFrame (ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WriteCh4InputFrame (ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadCh4InputFrame (ULWord *value)); ///< @deprecated This function is obsolete. + #endif // !defined (NTV2_DEPRECATE) + + + /** + @name Programming + **/ + ///@{ + AJA_VIRTUAL bool ReadFlashProgramControl(ULWord & outValue); + AJA_VIRTUAL bool IsXilinxProgrammed(); + AJA_VIRTUAL bool ProgramMainFlash(const std::string & inFileName, const bool bInForceUpdate = false, const bool bInQuiet = false); // inFileName became const std::string& in SDK 16.2 + AJA_VIRTUAL bool GetProgramStatus(SSC_GET_FIRMWARE_PROGRESS_STRUCT *statusStruct); + + /** + @brief Reports the revision number of the currently-running firmware package. + KonaIP style boards have a package. + @param[out] outRevision Receives the revision number. + @return True if successful; otherwise false. + @note This may differ from the revision number of the installed firmware package if, after + erasing or reflashing, the device was not power-cycled to force its FPGA to reload. + **/ + AJA_VIRTUAL bool GetRunningFirmwarePackageRevision (ULWord & outRevision); + + + /** + @brief Reports the revision number of the currently-running firmware. + @param[out] outRevision Receives the revision number. + @return True if successful; otherwise false. + @note This may differ from the revision number of the installed firmware if, after + erasing or reflashing, the device was not power-cycled to force its FPGA to reload. + @see CNTV2Card::GetRunningFirmwareDate, CNTV2Card::GetRunningFirmwareTime, \ref devicefirmware. + **/ + AJA_VIRTUAL bool GetRunningFirmwareRevision (UWord & outRevision); + + /** + @brief Reports the (local Pacific) build date of the currently-running firmware. + @param[out] outYear Receives the year portion of the build date, an unsigned integer + representing a standard Gregorian calendar year (e.g., 2017). + @param[out] outMonth Receives the month portion of the build date, an unsigned integer + representing a standard 1-based Gregorian calendar month (e.g., 1 == January). + @param[out] outDay Receives the day portion of the build date, an unsigned integer + representing a standard 1-based Gregorian calendar day (i.e., 1 thru 31). + @return True if successful; otherwise false. + @note This date may differ from the build date of the installed firmware if, after erasing + or reflashing, the device was never power-cycled to force its FPGA to reload. + @see CNTV2Card::GetRunningFirmwareTime, CNTV2Card::GetRunningFirmwareRevision, \ref devicefirmware. + **/ + AJA_VIRTUAL bool GetRunningFirmwareDate (UWord & outYear, UWord & outMonth, UWord & outDay); + + /** + @brief Reports the (local Pacific) build time of the currently-running firmware. + @param[out] outHours Receives the hours portion of the build time, an unsigned integer + representing the number of hours past the start of day (0 thru 23). + @param[out] outMinutes Receives the minutes portion of the build time, an unsigned integer + representing the number of minutes past the hour (0 thru 59). + @param[out] outSeconds Receives the seconds portion of the build time, an unsigned integer + representing the number of seconds past the minute (0 thru 59). + @return True if successful; otherwise false. + @note This date may differ from the build date of the installed firmware if, after erasing + or reflashing, the device was never power-cycled to force its FPGA to reload. + @see CNTV2Card::GetRunningFirmwareDate, CNTV2Card::GetRunningFirmwareRevision, \ref devicefirmware. + **/ + AJA_VIRTUAL bool GetRunningFirmwareTime (UWord & outHours, UWord & outMinutes, UWord & outSeconds); + + /** + @brief Reports the (local Pacific) build date and time of the currently-running firmware. + @param[out] outDate Receives a string containing the human-readable running firmware build date, + in the form 'YYYY/MM/DD', where YYYY, MM and DD are the numeric Gregorian year, + month and day values, expressed as unsigned decimal values (with leading zeroes). + @param[out] outTime Receives a string containing the human-readable running firmware build time, + in the form 'HH:MM:SS', where HH, MM and SS are the numeric hour, minute and second + values, expressed as unsigned decimal values (with leading zeroes), and a 24-hour + clock format. + @return True if successful; otherwise false. + @note This date/time may differ from the build date/time of the installed firmware if, after erasing + or reflashing, the device was never power-cycled to force its FPGA to reload. + @see CNTV2Card::GetRunningFirmwareTime, CNTV2Card::GetRunningFirmwareRevision, \ref devicefirmware. + **/ + AJA_VIRTUAL bool GetRunningFirmwareDate (std::string & outDate, std::string & outTime); + + /** + @brief Reports the UserID number of the currently-running firmware. + @param[out] outUserID Receives the UserID. + @return True if successful; otherwise false. + @see CNTV2Card::GetRunningFirmwareDate, CNTV2Card::GetRunningFirmwareTime, \ref devicefirmware. + **/ + AJA_VIRTUAL bool GetRunningFirmwareUserID (ULWord & outUserID); // New in SDK 16.1 + +#if !defined(NTV2_DEPRECATE_14_2) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFirmwareRev (ULWord * pOutRevisionNumber)); ///< @deprecated Use GetRunningFirmwareRevision instead. +#endif + ///@} + +#if !defined(NTV2_DEPRECATE_16_0) + // OEM Mapping to Userspace Functions + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetBaseAddress(NTV2Channel channel, ULWord **pBaseAddress)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetBaseAddress(ULWord **pBaseAddress)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetRegisterBaseAddress(ULWord regNumber, ULWord ** pRegAddress)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetXena2FlashBaseAddress(ULWord ** pXena2FlashAddress)); ///< @deprecated Obsolete starting in SDK 16.0. +#endif // !defined(NTV2_DEPRECATE_16_0) + + // + // Read-Only Status Registers + // + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool ReadStatusRegister (ULWord *value)); + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool ReadStatus2Register (ULWord *value)); + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool ReadInputStatusRegister (ULWord *value)); + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool ReadInputStatus2Register (ULWord *value)); + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool ReadInput56StatusRegister (ULWord *value)); + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool ReadInput78StatusRegister (ULWord *value)); + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool Read3GInputStatusRegister(ULWord *value)); + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool Read3GInputStatus2Register(ULWord *value)); + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool Read3GInput5678StatusRegister(ULWord *value)); + + AJA_VIRTUAL bool SupportsP2PTransfer (void); ///< @return True if this device can directly transmit data to another PCIe device via DMA; otherwise false. + AJA_VIRTUAL bool SupportsP2PTarget (void); ///< @return True if this device can directly receive data from another PCIe device via DMA; otherwise false. + + + /** + @name On-Device LEDs + **/ + ///@{ + /** + @brief The four on-board LEDs can be set by writing 0-15 + @param[in] inValue Sets the state of the four on-board LEDs using the least significant + four bits of the given ULWord value. + @return True if successful; otherwise, false. + **/ + AJA_VIRTUAL bool SetLEDState (ULWord inValue); + + /** + @brief Answers with the current state of the four on-board LEDs. + @param[out] outValue Receives the current state of the four on-board LEDs. + Only the least significant four bits of the ULWord have any meaning. + @return True if successful; otherwise, false. + **/ + AJA_VIRTUAL bool GetLEDState (ULWord & outValue); + ///@} + + + /** + @name RP-188 + **/ + ///@{ + /** + @brief Sets the current RP188 mode -- ::NTV2_RP188_INPUT or ::NTV2_RP188_OUTPUT -- for the given channel. + @param[in] inChannel Specifies the channel of interest. + @param[in] inMode Specifies the new RP-188 mode for the given channel. + Must be one of ::NTV2_RP188_INPUT or ::NTV2_RP188_OUTPUT. All other values are illegal. + @return True if successful; otherwise false. + @see CNTV2Card::GetRP188Mode, \ref anctimecode + **/ + AJA_VIRTUAL bool SetRP188Mode (const NTV2Channel inChannel, const NTV2_RP188Mode inMode); + + /** + @brief Returns the current RP188 mode -- ::NTV2_RP188_INPUT or ::NTV2_RP188_OUTPUT -- for the given channel. + @param[in] inChannel Specifies the channel of interest. + @param[out] outMode Receives the RP-188 mode for the given channel. + @return True if successful; otherwise false. + @see CNTV2Card::SetRP188Mode, \ref anctimecode + **/ + AJA_VIRTUAL bool GetRP188Mode (const NTV2Channel inChannel, NTV2_RP188Mode & outMode); + + /** + @brief Writes the raw RP188 data into the DBB/Low/Hi registers for the given SDI output. + These values are latched and sent at the next VBI. + @param[in] inSDIOutput Specifies the SDI output of interest as an ::NTV2Channel value. + @param[in] inRP188Data Specifies the raw RP188 data values to be written. + @note This call will have no effect if the SDI output is in "bypass mode". + @see CNTV2Card::GetRP188Data, CNTV2Card::IsRP188BypassEnabled, CNTV2Card::DisableRP188Bypass, \ref anctimecode + **/ + AJA_VIRTUAL bool SetRP188Data (const NTV2Channel inSDIOutput, const NTV2_RP188 & inRP188Data); + + /** + @brief Reads the raw RP188 data from the DBB/Low/Hi registers for the given SDI input. + On newer devices with bi-directional SDI connectors -- see \ref anctimecode for details -- + if the device is configured for... + - input: answers with the last timecode received at the SDI input (subject to + the SDI input's RP188 source filter -- see CNTV2Card::GetRP188SourceFilter); + - output: answers with the timecode that's to be embedded into the SDI output + (usually the last timecode written via CNTV2Card::SetRP188Data). + @param[in] inSDIInput Specifies the SDI input of interest, expressed as an ::NTV2Channel. + For bi-directional SDI devices, specifies the SDI connector of interest, + which can specify an SDI output. + @param[out] outRP188Data Receives the raw RP188 data values. + @see CNTV2Card::SetRP188Data, CNTV2Card::GetRP188SourceFilter, \ref anctimecode + **/ + AJA_VIRTUAL bool GetRP188Data (const NTV2Channel inSDIInput, NTV2_RP188 & outRP188Data); + + /** + @brief Sets the RP188 DBB filter for the given SDI input. + @param[in] inSDIInput Specifies the SDI input of interest, expressed as an NTV2Channel. + @param[in] inFilterValue Specifies the new filter value to use. Only the lower 8 bits are used. + Use 0x00 for LTC; 0x01 for VITC1; 0x02 for VITC2; 0xFF for unfiltered. + @return True if successful; otherwise false. + @see CNTV2Card::GetRP188SourceFilter, CNTV2Card::SetRP188BypassSource, \ref anctimecode + **/ + AJA_VIRTUAL bool SetRP188SourceFilter (const NTV2Channel inSDIInput, const UWord inFilterValue); + + /** + @brief Returns the current RP188 filter setting for the given SDI input. + @param[in] inSDIInput Specifies the SDI input of interest, expressed as an NTV2Channel. + @param[out] outFilterValue Receives the given SDI input's current RP188 SDI input filter, an 8-bit value. + 0x00 is LTC; 0x01 is VITC1; 0x02 is VITC2; 0xFF is unfiltered, which results + in the timecode registers containing the last received timecode packet for the + input frame. + @return True if successful; otherwise false. + @see CNTV2Card::SetRP188SourceFilter, CNTV2Card::IsRP188BypassEnabled, CNTV2Card::GetRP188BypassSource, \ref anctimecode + **/ + AJA_VIRTUAL bool GetRP188SourceFilter (const NTV2Channel inSDIInput, UWord & outFilterValue); + + #if !defined(NTV2_DEPRECATE_15_2) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetRP188Data(const NTV2Channel inChannel, const ULWord frame, const RP188_STRUCT & inRP188Data)); + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetRP188Data(const NTV2Channel inChannel, const ULWord frame, RP188_STRUCT & outRP188Data)); + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetRP188Source(const NTV2Channel inChannel, const ULWord inFilterValue)) {return SetRP188SourceFilter(inChannel, UWord(inFilterValue));} ///< @deprecated Use SetRP188SourceFilter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetRP188Source(const NTV2Channel inChannel, ULWord & outFilterValue)) {UWord val(0); bool result(GetRP188SourceFilter(inChannel, val)); outFilterValue = ULWord(val); return result;} ///< @deprecated Use GetRP188SourceFilter instead. + #endif // !defined(NTV2_DEPRECATE_15_2) + + /** + @brief Answers if the SDI output's RP-188 bypass mode is enabled or not. + @param[in] inSDIOutput Specifies the SDI output of interest, expressed as an NTV2Channel. + @param[out] outIsBypassEnabled Receives true if the SDI output's RP188 timecode is currently sourced from its + RP188 registers (see CNTV2Card::SetRP188Data). + Receives false if its output timecode is currently sourced from an SDI input + (see CNTV2Card::GetRP188BypassSource and CNTV2Card::GetRP188SourceFilter). + @return True if successful; otherwise false. + @see CNTV2Card::EnableRP188Bypass, CNTV2Card::DisableRP188Bypass, CNTV2Card::GetRP188BypassSource, CNTV2Card::GetRP188SourceFilter + **/ + AJA_VIRTUAL bool IsRP188BypassEnabled (const NTV2Channel inSDIOutput, bool & outIsBypassEnabled); + + /** + @brief Configures the SDI output's embedder to embed SMPTE 12M timecode specified in calls to CNTV2Card::SetRP188Data. + @param[in] inSDIOutput Specifies the SDI output of interest, expressed as an NTV2Channel. + @return True if successful; otherwise false. + @note The SDI output's ::NTV2_RP188Mode must be set to ::NTV2_RP188_OUTPUT. + @see CNTV2Card::EnableRP188Bypass, CNTV2Card::SetRP188Data, CNTV2Card::SetRP188Mode, \ref anctimecode + **/ + AJA_VIRTUAL bool DisableRP188Bypass (const NTV2Channel inSDIOutput); + + /** + @brief Configures the SDI output's embedder to embed SMPTE 12M timecode obtained from an SDI input, + which is often useful in E-E mode. + @param[in] inSDIOutput Specifies the SDI output of interest, expressed as an NTV2Channel. + @return True if successful; otherwise false. + @see CNTV2Card::DisableRP188Bypass, CNTV2Card::SetRP188SourceFilter, CNTV2Card::SetRP188BypassSource, \ref anctimecode + **/ + AJA_VIRTUAL bool EnableRP188Bypass (const NTV2Channel inSDIOutput); + + /** + @brief For the given SDI output that's in RP188 bypass mode (E-E), specifies the SDI input + to be used as a timecode source. + @param[in] inSDIOutput Specifies the SDI output of interest, expressed as an NTV2Channel. + @param[in] inSDIInput Specifies the SDI input to be used as a timecode source, + expressed as a zero-based index number. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetRP188BypassSource (const NTV2Channel inSDIOutput, const UWord inSDIInput); + + /** + @brief For the given SDI output that's in RP188 bypass mode (E-E), answers with the SDI input + that's currently being used as a timecode source. + @param[in] inSDIOutput Specifies the SDI output of interest, expressed as an NTV2Channel. + @param[out] outSDIInput Receives the SDI input being used as a timecode source, expressed + as a zero-based index number. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetRP188BypassSource (const NTV2Channel inSDIOutput, UWord & outSDIInput); + + #if !defined(NTV2_DEPRECATE_14_0) + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool DisableRP188Bypass (const NTV2Channel inChannel, const bool inBypassDisabled)) + {(void) inBypassDisabled; return DisableRP188Bypass (inChannel);} ///< @deprecated Use DisableRP188Bypass(const NTV2Channel) instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetRP188Mode (NTV2Channel inChannel, NTV2_RP188Mode * pOutMode)) + {return pOutMode ? GetRP188Mode (inChannel, *pOutMode) : false;} ///< @deprecated Use GetRP188Mode(const NTV2Channel, NTV2_RP188Mode &) instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetRP188Data (NTV2Channel inChannel, ULWord inFrame, RP188_STRUCT * pOutRP188Data)) + {return pOutRP188Data ? GetRP188Data (inChannel, inFrame, *pOutRP188Data) : false;} ///< @deprecated Use GetRP188Mode(const NTV2Channel, const ULWord, RP188_STRUCT &) instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetRP188Source (NTV2Channel inChannel, ULWord * pOutValue)) + {return pOutValue ? GetRP188Source (inChannel, *pOutValue) : false;} ///< @deprecated Use GetRP188Mode(const NTV2Channel, ULWord &) instead. + #endif // NTV2_DEPRECATE_14_0 + ///@} + + + /** + @name Interrupts & Events + **/ + ///@{ + // + // Enable Interrupt/Event + // + AJA_VIRTUAL bool EnableInterrupt (const INTERRUPT_ENUMS inEventCode); // GENERIC! + + /** + @brief Allows the CNTV2Card instance to wait for and respond to output vertical blanking interrupts + originating from the given frameStore on the receiver's AJA device. + @param[in] channel Specifies the frameStore of interest. Defaults to ::NTV2_CHANNEL1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool EnableOutputInterrupt (const NTV2Channel channel = NTV2_CHANNEL1); + + /** + @brief Allows the CNTV2Card instance to wait for and respond to input vertical blanking interrupts + originating from the given input channel on the receiver's AJA device. + @param[in] channel Specifies the input channel of interest. Defaults to ::NTV2_CHANNEL1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool EnableInputInterrupt (const NTV2Channel channel = NTV2_CHANNEL1); + + /** + @brief Allows the CNTV2Card instance to wait for and respond to input vertical blanking interrupts + originating from the given FrameStore(s). + @param[in] inFrameStores The input frameStore(s) of interest. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool EnableInputInterrupt (const NTV2ChannelSet & inFrameStores); + + + // + // Disable Interrupt/Event + // + AJA_VIRTUAL bool DisableInterrupt (const INTERRUPT_ENUMS inEventCode); // GENERIC! + + /** + @brief Prevents the CNTV2Card instance from waiting for and responding to vertical blanking + interrupts originating from the given output channel on the device. + @param[in] channel Specifies the output channel of interest. Defaults to ::NTV2_CHANNEL1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool DisableOutputInterrupt (const NTV2Channel channel = NTV2_CHANNEL1); + + /** + @brief Prevents the CNTV2Card instance from waiting for and responding to vertical blanking + interrupts originating from the given input channel on the device. + @param[in] channel Specifies the input channel of interest. Defaults to ::NTV2_CHANNEL1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool DisableInputInterrupt (const NTV2Channel channel = NTV2_CHANNEL1); + + /** + @brief Prevents the CNTV2Card instance from waiting for and responding to input vertical blanking + interrupts originating from the given frameStore(s) on the device. + @param[in] inFrameStores Specifies the frameStore(s) of interest. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool DisableInputInterrupt (const NTV2ChannelSet & inFrameStores); + + AJA_VIRTUAL bool GetCurrentInterruptMasks (NTV2InterruptMask & outIntMask1, NTV2Interrupt2Mask & outIntMask2); + + + // + // Subscribe to events + // + /** + @brief Causes me to be notified when the given event/interrupt is triggered for the AJA device. + @param[in] inEventCode Specifies the INTERRUPT_ENUMS of interest. + @return True if successful; otherwise false, which can indicate communication with the device has been lost, + or on the Windows platform, there are no more event subscription handles available. + @see CNTV2Card::UnsubscribeEvent, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool SubscribeEvent (const INTERRUPT_ENUMS inEventCode); // GENERIC! + + /** + @brief Causes me to be notified when an output vertical blanking interrupt is generated for the given output channel. + @param[in] inChannel Specifies the output channel of interest. + @return True if successful; otherwise false, which can indicate communication with the device has been lost, + or on the Windows platform, there are no more event subscription handles available. + @note Windows Users: AJA recommends calling this function on the same thread that will call + CNTV2Card::WaitForOutputVerticalInterrupt or CNTV2Card::WaitForOutputFieldID. + @see CNTV2Card::UnsubscribeOutputVerticalEvent, CNTV2Card::SubscribeEvent, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool SubscribeOutputVerticalEvent (const NTV2Channel inChannel); + + /** + @brief Causes me to be notified when an output vertical blanking interrupt is generated for the given output channel(s). + @param[in] inChannels Specifies the output channel(s) of interest. + @return True if successful; otherwise false, which can indicate communication with the device has been lost, + or on the Windows platform, there are no more event subscription handles available. + @note Windows Users: AJA recommends calling this function on the same thread that will call + CNTV2Card::WaitForOutputVerticalInterrupt or CNTV2Card::WaitForOutputFieldID. + @see CNTV2Card::UnsubscribeOutputVerticalEvents, CNTV2Card::SubscribeEvent, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool SubscribeOutputVerticalEvent (const NTV2ChannelSet & inChannels); + + + /** + @brief Causes me to be notified when an input vertical blanking interrupt occurs on the given input channel. + @param[in] inChannel Specifies the input channel of interest. Defaults to ::NTV2_CHANNEL1. + @return True if successful; otherwise false, which can indicate communication with the device has been lost, + or on the Windows platform, there are no more event subscription handles available. + @note Windows Users: AJA recommends calling this function on the same thread that will call + CNTV2Card::WaitForInputVerticalInterrupt or CNTV2Card::WaitForInputFieldID. + @see CNTV2Card::UnsubscribeInputVerticalEvent, CNTV2Card::SubscribeEvent, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool SubscribeInputVerticalEvent (const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Causes me to be notified when an input vertical blanking interrupt occurs on the given input channel(s). + @param[in] inChannels Specifies the input channel(s) of interest. + @return True if successful; otherwise false, which can indicate communication with the device has been lost, + or on the Windows platform, there are no more event subscription handles available. + @note Windows Users: AJA recommends calling this function on the same thread that will call + CNTV2Card::WaitForInputVerticalInterrupt or CNTV2Card::WaitForInputFieldID. + @see CNTV2Card::UnsubscribeInputVerticalEvent, CNTV2Card::SubscribeEvent, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool SubscribeInputVerticalEvent (const NTV2ChannelSet & inChannels); + + + // + // Unsubscribe from events + // + /** + @brief Unregisters me so I'm no longer notified when the given event/interrupt is triggered on the AJA device. + @param[in] inEventCode Specifies the INTERRUPT_ENUMS of interest. + @return True if successful; otherwise false. + @see CNTV2Card::SubscribeEvent, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool UnsubscribeEvent (const INTERRUPT_ENUMS inEventCode); // GENERIC! + + /** + @brief Unregisters me so I'm no longer notified when an output VBI is signaled on the given output channel. + @param[in] inChannel Specifies the output channel of interest. Defaults to ::NTV2_CHANNEL1. + @return True if successful; otherwise false. + @details This function undoes the effect of a prior call to SubscribeOutputVerticalEvent. + @see CNTV2Card::SubscribeOutputVerticalEvent, CNTV2Card::UnsubscribeEvent, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool UnsubscribeOutputVerticalEvent (const NTV2Channel inChannel); + + /** + @brief Unregisters me so I'm no longer notified when an output VBI is signaled on the given output channel(s). + @param[in] inChannels Specifies the output channel(s) of interest. + @return True if successful; otherwise false. + @details This function undoes the effect of a prior call to SubscribeOutputVerticalEvents. + @see CNTV2Card::SubscribeOutputVerticalEvents, CNTV2Card::UnsubscribeEvent, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool UnsubscribeOutputVerticalEvent (const NTV2ChannelSet & inChannels); + + /** + @brief Unregisters me so I'm no longer notified when an input VBI is signaled on the given input channel. + @param[in] inChannel Specifies the input channel of interest. Defaults to ::NTV2_CHANNEL1. + @return True if successful; otherwise false. + @details This function undoes the effects of a prior call to SubscribeInputVerticalEvent. + @see CNTV2Card::SubscribeInputVerticalEvent, CNTV2Card::UnsubscribeEvent, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool UnsubscribeInputVerticalEvent (const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Unregisters me so I'm no longer notified when an input VBI is signaled on the given input channel(s). + @param[in] inChannels Specifies the input channel(s) of interest. + @return True if successful; otherwise false. + @details This function undoes the effects of a prior call to SubscribeInputVerticalEvents. + @see CNTV2Card::SubscribeInputVerticalEvents, CNTV2Card::UnsubscribeEvent, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool UnsubscribeInputVerticalEvent (const NTV2ChannelSet & inChannels); + + + // + // Get interrupt counts + // + /** + @brief Answers with the number of output vertical interrupts handled by the driver for the given output channel. + @param[out] outCount Receives the number of output VBIs handled by the driver since it was loaded. + @param[in] inChannel Specifies the output channel of interest. Defaults to ::NTV2_CHANNEL1. + @return True if successful; otherwise false. + @see CNTV2Card::SetOutputVerticalEventCount, CNTV2DriverInterface::GetInterruptEventCount, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool GetOutputVerticalInterruptCount (ULWord & outCount, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers with the number of input vertical interrupts handled by the driver for the given input channel. + @param[out] outCount Receives the number of input VBIs handled by the driver since it was loaded. + @param[in] inChannel Specifies the input channel of interest. Defaults to ::NTV2_CHANNEL1. + @return True if successful; otherwise false. + @see CNTV2Card::SetInputVerticalEventCount, CNTV2DriverInterface::GetInterruptEventCount, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool GetInputVerticalInterruptCount (ULWord & outCount, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers with the number of output interrupt events that I successfully waited for on the given channel. + @param[out] outCount Receives the number of output interrupt events that were successfully waited for. + @param[in] inChannel Specifies the NTV2Channel of interest. + @return True if successful; otherwise false. + @see CNTV2Card::SetOutputVerticalEventCount, CNTV2DriverInterface::GetInterruptEventCount, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool GetOutputVerticalEventCount (ULWord & outCount, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers with the number of input interrupt events that I successfully waited for on the given channel. + @param[out] outCount Receives the number of input interrupt events that were successfully waited for. + @param[in] inChannel Specifies the NTV2Channel of interest. + @return True if successful; otherwise false. + @see CNTV2Card::SetInputVerticalEventCount, CNTV2Card::GetInterruptEventCount, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool GetInputVerticalEventCount (ULWord & outCount, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Resets my output interrupt event tally for the given channel. + @param[in] inCount Specifies the new count value. Use zero to reset the tally. + @param[in] inChannel Specifies the [output] channel. + @return True if successful; otherwise false. + @see CNTV2Card::GetOutputVerticalEventCount, CNTV2Card::SetInterruptEventCount, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool SetOutputVerticalEventCount (const ULWord inCount, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Resets my input interrupt event tally for the given channel. + @param[in] inCount Specifies the new count value. Use zero to reset the tally. + @param[in] inChannel Specifies the [input] channel. + @return True if successful; otherwise false. + @see CNTV2Card::GetInputVerticalEventCount, CNTV2Card::SetInterruptEventCount, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool SetInputVerticalEventCount (const ULWord inCount, const NTV2Channel inChannel = NTV2_CHANNEL1); + + // + // Current field ID + // + + /** + @brief Returns the current field ID of the specified output channel. + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel (a zero-based index number). + @param[out] outFieldID The current field ID of the specified output channel. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetOutputFieldID (const NTV2Channel channel, NTV2FieldID & outFieldID); + + /** + @brief Returns the current field ID of the specified input channel. + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel (a zero-based index number). + @param[out] outFieldID The current field ID of the specified input channel. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetInputFieldID (const NTV2Channel channel, NTV2FieldID & outFieldID); + + // + // Wait for event + // + /** + @brief Efficiently sleeps the calling thread/process until the next one or more field (interlaced video) + or frame (progressive or interlaced video) VBIs occur for the specified output channel. + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel (a zero-based index number). + Defaults to ::NTV2_CHANNEL1. Note that this parameter is irrelevant for all currently + supported NTV2 devices, which use one common hardware clock that drives all SDI outputs. + @param[in] inRepeatCount Specifies the number of output VBIs to wait for until returning. Defaults to 1. + @return True if successful; otherwise false. A false result usually indicates the wait timed out. + @note The device's timing reference source affects how often -- or even if -- the VBI occurs. + See \ref deviceclockingandsync for more information. + @note For interlaced video, callers that need to know whether the field or frame interrupt occurred should + call CNTV2Card::WaitForOutputFieldID instead. + @bug On the Windows platform, the SDK uses an event to wait on, which only gets cleared by a prior call to + WaitForOutputVerticalInterrupt. This is historically different from Linux and MacOS, where the event + is always cleared before the Wait. Each method has advantages and disadvantages. To work around this: + - Call CNTV2Card::GetOutputVerticalInterruptCount before and after calling this function to verify + that an interrupt really occurred; + - Call CNTV2WinDriverInterface::GetInterruptEvent to obtain the Windows event \c HANDLE, and + manually clear it before calling this function. + @see CNTV2Card::WaitForOutputFieldID, \ref fieldframeinterrupts, \ref deviceclockingandsync + **/ + AJA_VIRTUAL bool WaitForOutputVerticalInterrupt (const NTV2Channel inChannel = NTV2_CHANNEL1, UWord inRepeatCount = 1); + + /** + @brief Efficiently sleeps the calling thread/process until the next output VBI for the given field and output + channel. + @param[in] inFieldID Specifies the field identifier of interest. Use ::NTV2_FIELD0 to wait for the frame + interrupt of progressive or interlaced video. Use ::NTV2_FIELD1 to wait for the field + interrupt of interlaced video. + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel (a zero-based index number). + Defaults to ::NTV2_CHANNEL1. Note that this parameter is irrelevant for all currently + supported NTV2 devices, which use one common hardware clock that drives all SDI outputs. + @return True if successful; otherwise false. A false result usually indicates the wait timed out. + @note The device's timing reference source affects how often -- or even if -- the VBI occurs. + See \ref deviceclockingandsync for more information. + @bug On the Windows platform, the SDK uses an event to wait on, which only gets cleared by a prior call to + CNTV2Card::WaitForOutputFieldID. This is historically different from Linux and MacOS, where the event + is always cleared before the Wait. Each method has advantages and disadvantages. To work around this: + - Call CNTV2Card::GetOutputVerticalInterruptCount before and after calling this function to verify + that an interrupt really occurred; + - Call CNTV2WinDriverInterface::GetInterruptEvent to get the event handle, and manually clear the + event before calling this function. + @see CNTV2Card::WaitForOutputVerticalInterrupt, \ref fieldframeinterrupts, \ref deviceclockingandsync + **/ + AJA_VIRTUAL bool WaitForOutputFieldID (const NTV2FieldID inFieldID, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Efficiently sleeps the calling thread/process until the next one or more field (interlaced video) + or frame (progressive or interlaced video) VBIs occur for the specified input channel. + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel (a zero-based index number). + Defaults to ::NTV2_CHANNEL1. + @param[in] inRepeatCount Specifies the number of input VBIs to wait for until returning. Defaults to 1. + @return True if successful; otherwise false. A false result usually indicates the wait timed out, + which is often due to the FrameStore being configured for playout, or if its input is not receiving + a valid signal. + @bug On the Windows platform, the SDK uses an event to wait on, which only gets cleared by a previous call to + Wait. Unfortunately, this is historically different from Linux and MacOS, where the event is always + cleared before the Wait. Each method has advantages and disadvantages. To work around this: + - Call GetInputVerticalInterruptCount before and after calling this function to verify that an + interrupt really occurred; + - Call CNTV2WinDriverInterface::GetInterruptEvent to get the event handle, and manually clear the + event before calling this function. + @see CNTV2Card::WaitForInputFieldID, \ref fieldframeinterrupts, \ref deviceclockingandsync + **/ + AJA_VIRTUAL bool WaitForInputVerticalInterrupt (const NTV2Channel inChannel = NTV2_CHANNEL1, UWord inRepeatCount = 1); + + /** + @brief Efficiently sleeps the calling thread/process until the next input VBI for the given field and input + channel. + @param[in] inFieldID Specifies the field identifier of interest. Use ::NTV2_FIELD0 to wait for the frame + interrupt of progressive or interlaced video. Use ::NTV2_FIELD1 to wait for the field + interrupt of interlaced or Psf video. + @param[in] inChannel Specifies the FrameStore of interest as an ::NTV2Channel (a zero-based index number). + Defaults to ::NTV2_CHANNEL1. + @return True if successful; otherwise false. A false result usually indicates the wait timed out, + which is often due to the FrameStore being configured for playout, or if its input is not receiving + a valid signal. + @bug On the Windows platform, the SDK uses an event to wait on, which only gets cleared by a previous call to + Wait. Unfortunately, this is historically different from Linux and MacOS, where the event is always + cleared before the Wait. Each method has advantages and disadvantages. To work around this: + - Call GetInputVerticalInterruptCount before and after calling this function to verify that an + interrupt really occurred; + - Call CNTV2WinDriverInterface::GetInterruptEvent to get the event handle, and manually clear the + event before calling this function. + @see CNTV2Card::WaitForInputVerticalInterrupt, \ref fieldframeinterrupts, \ref deviceclockingandsync + **/ + AJA_VIRTUAL bool WaitForInputFieldID (const NTV2FieldID inFieldID, const NTV2Channel inChannel = NTV2_CHANNEL1); + + // + // RegisterAccess Control + // + /** + @brief Sets the FrameStore's ::NTV2RegisterWriteMode, which determines when CNTV2Card::SetInputFrame or + CNTV2Card::SetOutputFrame calls (and others) actually take effect. + @param[in] inValue Specifies the ::NTV2RegisterWriteMode to set for the FrameStore. + @param[in] inFrameStore Specifies the FrameStore of interest as an ::NTV2Channel, a zero-based index number. + If omitted, defaults to ::NTV2_CHANNEL1. + @see CNTV2Card::GetRegisterWriteMode, CNTV2Card::SetInputFrame, CNTV2Card::SetOutputFrame, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool SetRegisterWriteMode (const NTV2RegisterWriteMode inValue, const NTV2Channel inFrameStore = NTV2_CHANNEL1); + + /** + @brief Answers with the FrameStore's current ::NTV2RegisterWriteMode setting, which determines when + CNTV2Card::SetInputFrame or CNTV2Card::SetOutputFrame calls (and others) actually take effect. + @param[out] outValue Receives the ::NTV2RegisterWriteMode that's currently being used by the FrameStore. + @param[in] inFrameStore Specifies the FrameStore of interest as an ::NTV2Channel, a zero-based index number. + If omitted, defaults to ::NTV2_CHANNEL1. + @see CNTV2Card::SetRegisterWriteMode, CNTV2Card::SetInputFrame, CNTV2Card::SetOutputFrame, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool GetRegisterWriteMode (NTV2RegisterWriteMode & outValue, const NTV2Channel inFrameStore = NTV2_CHANNEL1); + + #if !defined (NTV2_DEPRECATE_16_0) + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetRegisterWritemode(NTV2RegisterWriteMode inVal, const NTV2Channel inChan=NTV2_CHANNEL1)) {return SetRegisterWriteMode(inVal,inChan);} ///< @deprecated Use CNTV2Card::SetRegisterWriteMode instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetRegisterWritemode(NTV2RegisterWriteMode & outVal, const NTV2Channel inChan=NTV2_CHANNEL1)) {return SetRegisterWriteMode(outVal,inChan);} ///< @deprecated Use CNTV2Card::GetRegisterWriteMode instead. + #endif // NTV2_DEPRECATE_16_0 + #if !defined (NTV2_DEPRECATE) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableVerticalInterrupt(void)); ///< @deprecated Use EnableOutputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableOutput2VerticalInterrupt(void)); ///< @deprecated Use EnableOutputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableOutput3VerticalInterrupt(void)); ///< @deprecated Use EnableOutputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableOutput4VerticalInterrupt(void)); ///< @deprecated Use EnableOutputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableOutput5VerticalInterrupt(void)); ///< @deprecated Use EnableOutputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableOutput6VerticalInterrupt(void)); ///< @deprecated Use EnableOutputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableOutput7VerticalInterrupt(void)); ///< @deprecated Use EnableOutputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableOutput8VerticalInterrupt(void)); ///< @deprecated Use EnableOutputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableInput1Interrupt(void)); ///< @deprecated Use EnableInputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableInput2Interrupt(void)); ///< @deprecated Use EnableInputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableInput3Interrupt(void)); ///< @deprecated Use EnableInputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableInput4Interrupt(void)); ///< @deprecated Use EnableInputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableInput5Interrupt(void)); ///< @deprecated Use EnableInputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableInput6Interrupt(void)); ///< @deprecated Use EnableInputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableInput7Interrupt(void)); ///< @deprecated Use EnableInputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableInput8Interrupt(void)); ///< @deprecated Use EnableInputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableAudioInterrupt(void)); ///< @deprecated Use EnableInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableAudioInWrapInterrupt(void)); ///< @deprecated Use EnableInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableAudioOutWrapInterrupt(void)); ///< @deprecated Use EnableInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableUartTxInterrupt(void)); ///< @deprecated Use EnableInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableUart2TxInterrupt(void)); ///< @deprecated Use EnableInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableUartRxInterrupt(void)); ///< @deprecated Use EnableInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableUart2RxInterrupt(void)); ///< @deprecated Use EnableInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableHDMIHotplugInterrupt(void)); ///< @deprecated Use EnableInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool EnableAuxVerticalInterrupt(void)); ///< @deprecated Use EnableInterrupt(INTERRUPT_ENUMS) instead. + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableVerticalInterrupt(void)); ///< @deprecated Use DisableOutputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableOutput2VerticalInterrupt(void)); ///< @deprecated Use DisableOutputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableOutput3VerticalInterrupt(void)); ///< @deprecated Use DisableOutputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableOutput4VerticalInterrupt(void)); ///< @deprecated Use DisableOutputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableOutput5VerticalInterrupt(void)); ///< @deprecated Use DisableOutputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableOutput6VerticalInterrupt(void)); ///< @deprecated Use DisableOutputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableOutput7VerticalInterrupt(void)); ///< @deprecated Use DisableOutputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableOutput8VerticalInterrupt(void)); ///< @deprecated Use DisableOutputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableInput1Interrupt(void)); ///< @deprecated Use DisableInputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableInput2Interrupt(void)); ///< @deprecated Use DisableInputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableInput3Interrupt(void)); ///< @deprecated Use DisableInputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableInput4Interrupt(void)); ///< @deprecated Use DisableInputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableInput5Interrupt(void)); ///< @deprecated Use DisableInputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableInput6Interrupt(void)); ///< @deprecated Use DisableInputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableInput7Interrupt(void)); ///< @deprecated Use DisableInputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableInput8Interrupt(void)); ///< @deprecated Use DisableInputInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableAudioInterrupt(void)); ///< @deprecated Use DisableInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableAudioInWrapInterrupt(void)); ///< @deprecated Use DisableInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableAudioOutWrapInterrupt(void)); ///< @deprecated Use DisableInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableUartTxInterrupt(void)); ///< @deprecated Use DisableInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableUart2TxInterrupt(void)); ///< @deprecated Use DisableInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableUartRxInterrupt(void)); ///< @deprecated Use DisableInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableUart2RxInterrupt(void)); ///< @deprecated Use DisableInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableHDMIHotplugInterrupt(void)); ///< @deprecated Use DisableInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool DisableAuxVerticalInterrupt(void)); ///< @deprecated Use DisableInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetCurrentInterruptMask (NTV2InterruptMask * outInterruptMask)); ///< @deprecated Use GetCurrentInterruptMasks instead. + + // Subscribe to events + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeOutputVerticalEvent(void)); ///< @deprecated Use SubscribeOutputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeOutput2VerticalEvent(void)); ///< @deprecated Use SubscribeOutputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeOutput3VerticalEvent(void)); ///< @deprecated Use SubscribeOutputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeOutput4VerticalEvent(void)); ///< @deprecated Use SubscribeOutputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeOutput5VerticalEvent(void)); ///< @deprecated Use SubscribeOutputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeOutput6VerticalEvent(void)); ///< @deprecated Use SubscribeOutputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeOutput7VerticalEvent(void)); ///< @deprecated Use SubscribeOutputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeOutput8VerticalEvent(void)); ///< @deprecated Use SubscribeOutputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeInput1VerticalEvent(void)); ///< @deprecated Use SubscribeInputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeInput2VerticalEvent(void)); ///< @deprecated Use SubscribeInputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeInput3VerticalEvent(void)); ///< @deprecated Use SubscribeInputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeInput4VerticalEvent(void)); ///< @deprecated Use SubscribeInputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeInput5VerticalEvent(void)); ///< @deprecated Use SubscribeInputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeInput6VerticalEvent(void)); ///< @deprecated Use SubscribeInputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeInput7VerticalEvent(void)); ///< @deprecated Use SubscribeInputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeInput8VerticalEvent(void)); ///< @deprecated Use SubscribeInputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeAudioInterruptEvent(void)); ///< @deprecated Use SubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeAudioInWrapInterruptEvent(void)); ///< @deprecated Use SubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeAudioOutWrapInterruptEvent(void)); ///< @deprecated Use SubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeUartTxInterruptEvent(void)); ///< @deprecated Use SubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeUartRxInterruptEvent(void)); ///< @deprecated Use SubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeUart2TxInterruptEvent(void)); ///< @deprecated Use SubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeUart2RxInterruptEvent(void)); ///< @deprecated Use SubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeHDMIHotplugInterruptEvent(void)); ///< @deprecated Use SubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeAuxVerticalInterruptEvent(void)); ///< @deprecated Use SubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeDMA1InterruptEvent(void)); ///< @deprecated Use SubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeDMA2InterruptEvent(void)); ///< @deprecated Use SubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeDMA3InterruptEvent(void)); ///< @deprecated Use SubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeDMA4InterruptEvent(void)); ///< @deprecated Use SubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SubscribeChangeEvent(void)); // subscribe to get notified upon any Register changes + + // Unsubscribe from events + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeOutputVerticalEvent(void)); ///< @deprecated Use UnsubscribeOutputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeOutput2VerticalEvent(void)); ///< @deprecated Use UnsubscribeOutputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeOutput3VerticalEvent(void)); ///< @deprecated Use UnsubscribeOutputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeOutput4VerticalEvent(void)); ///< @deprecated Use UnsubscribeOutputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeOutput5VerticalEvent(void)); ///< @deprecated Use UnsubscribeOutputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeOutput6VerticalEvent(void)); ///< @deprecated Use UnsubscribeOutputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeOutput7VerticalEvent(void)); ///< @deprecated Use UnsubscribeOutputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeOutput8VerticalEvent(void)); ///< @deprecated Use UnsubscribeOutputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeInput1VerticalEvent(void)); ///< @deprecated Use UnsubscribeInputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeInput2VerticalEvent(void)); ///< @deprecated Use UnsubscribeInputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeInput3VerticalEvent(void)); ///< @deprecated Use UnsubscribeInputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeInput4VerticalEvent(void)); ///< @deprecated Use UnsubscribeInputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeInput5VerticalEvent(void)); ///< @deprecated Use UnsubscribeInputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeInput6VerticalEvent(void)); ///< @deprecated Use UnsubscribeInputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeInput7VerticalEvent(void)); ///< @deprecated Use UnsubscribeInputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeInput8VerticalEvent(void)); ///< @deprecated Use UnsubscribeInputVerticalEvent(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeAudioInterruptEvent(void)); ///< @deprecated Use UnsubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeAudioInWrapInterruptEvent(void)); ///< @deprecated Use UnsubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeAudioOutWrapInterruptEvent(void)); ///< @deprecated Use UnsubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeUartTxInterruptEvent(void)); ///< @deprecated Use UnsubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeUartRxInterruptEvent(void)); ///< @deprecated Use UnsubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeUart2TxInterruptEvent(void)); ///< @deprecated Use UnsubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeUart2RxInterruptEvent(void)); ///< @deprecated Use UnsubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeHDMIHotplugInterruptEvent(void)); ///< @deprecated Use UnsubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeAuxVerticalInterruptEvent(void)); ///< @deprecated Use UnsubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeDMA1InterruptEvent(void)); ///< @deprecated Use UnsubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeDMA2InterruptEvent(void)); ///< @deprecated Use UnsubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeDMA3InterruptEvent(void)); ///< @deprecated Use UnsubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeDMA4InterruptEvent(void)); ///< @deprecated Use UnsubscribeEvent(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool UnsubscribeChangeEvent(void)); + + // Get interrupt counts + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetOutputVerticalInterruptCount (ULWord *pCount)); ///< @deprecated Use GetOutputVerticalInterruptCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetOutput2VerticalInterruptCount (ULWord *pCount)); ///< @deprecated Use GetOutputVerticalInterruptCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetOutput3VerticalInterruptCount (ULWord *pCount)); ///< @deprecated Use GetOutputVerticalInterruptCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetOutput4VerticalInterruptCount (ULWord *pCount)); ///< @deprecated Use GetOutputVerticalInterruptCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetOutput5VerticalInterruptCount (ULWord *pCount)); ///< @deprecated Use GetOutputVerticalInterruptCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetOutput6VerticalInterruptCount (ULWord *pCount)); ///< @deprecated Use GetOutputVerticalInterruptCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetOutput7VerticalInterruptCount (ULWord *pCount)); ///< @deprecated Use GetOutputVerticalInterruptCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetOutput8VerticalInterruptCount (ULWord *pCount)); ///< @deprecated Use GetOutputVerticalInterruptCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetInput1VerticalInterruptCount (ULWord *pCount)); ///< @deprecated Use GetInputVerticalInterruptCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetInput2VerticalInterruptCount (ULWord *pCount)); ///< @deprecated Use GetInputVerticalInterruptCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetInput3VerticalInterruptCount (ULWord *pCount)); ///< @deprecated Use GetInputVerticalInterruptCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetInput4VerticalInterruptCount (ULWord *pCount)); ///< @deprecated Use GetInputVerticalInterruptCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetInput5VerticalInterruptCount (ULWord *pCount)); ///< @deprecated Use GetInputVerticalInterruptCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetInput6VerticalInterruptCount (ULWord *pCount)); ///< @deprecated Use GetInputVerticalInterruptCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetInput7VerticalInterruptCount (ULWord *pCount)); ///< @deprecated Use GetInputVerticalInterruptCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetInput8VerticalInterruptCount (ULWord *pCount)); ///< @deprecated Use GetInputVerticalInterruptCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioInterruptCount (ULWord *pCount)); ///< @deprecated Use GetInterruptEventCount(INTERRUPT_ENUMS,ULWord&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioInWrapInterruptCount (ULWord *pCount)); ///< @deprecated Use GetInterruptEventCount(INTERRUPT_ENUMS,ULWord&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioOutWrapInterruptCount (ULWord *pCount)); ///< @deprecated Use GetInterruptEventCount(INTERRUPT_ENUMS,ULWord&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAuxVerticalInterruptCount (ULWord *pCount)); ///< @deprecated Use GetInterruptEventCount(INTERRUPT_ENUMS,ULWord&) instead. + + // Get event counts + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetOutputVerticalEventCount (ULWord *pCount)); ///< @deprecated Use GetOutputVerticalEventCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetOutput2VerticalEventCount (ULWord *pCount)); ///< @deprecated Use GetOutputVerticalEventCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetOutput3VerticalEventCount (ULWord *pCount)); ///< @deprecated Use GetOutputVerticalEventCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetOutput4VerticalEventCount (ULWord *pCount)); ///< @deprecated Use GetOutputVerticalEventCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetOutput5VerticalEventCount (ULWord *pCount)); ///< @deprecated Use GetOutputVerticalEventCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetOutput6VerticalEventCount (ULWord *pCount)); ///< @deprecated Use GetOutputVerticalEventCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetOutput7VerticalEventCount (ULWord *pCount)); ///< @deprecated Use GetOutputVerticalEventCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetOutput8VerticalEventCount (ULWord *pCount)); ///< @deprecated Use GetOutputVerticalEventCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetInput1VerticalEventCount (ULWord *pCount)); ///< @deprecated Use GetInputVerticalEventCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetInput2VerticalEventCount (ULWord *pCount)); ///< @deprecated Use GetInputVerticalEventCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetInput3VerticalEventCount (ULWord *pCount)); ///< @deprecated Use GetInputVerticalEventCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetInput4VerticalEventCount (ULWord *pCount)); ///< @deprecated Use GetInputVerticalEventCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetInput5VerticalEventCount (ULWord *pCount)); ///< @deprecated Use GetInputVerticalEventCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetInput6VerticalEventCount (ULWord *pCount)); ///< @deprecated Use GetInputVerticalEventCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetInput7VerticalEventCount (ULWord *pCount)); ///< @deprecated Use GetInputVerticalEventCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetInput8VerticalEventCount (ULWord *pCount)); ///< @deprecated Use GetInputVerticalEventCount(ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioInterruptEventCount (ULWord *pCount)); ///< @deprecated Use GetInterruptEventCount(INTERRUPT_ENUMS,ULWord&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioInWrapInterruptEventCount (ULWord *pCount)); ///< @deprecated Use GetInterruptEventCount(INTERRUPT_ENUMS,ULWord&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioOutWrapInterruptEventCount (ULWord *pCount)); ///< @deprecated Use GetInterruptEventCount(INTERRUPT_ENUMS,ULWord&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAuxVerticalEventCount (ULWord *pCount)); ///< @deprecated Use GetInterruptEventCount(INTERRUPT_ENUMS,ULWord&) instead. + + // Set event counts + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetOutput2VerticalEventCount (ULWord Count)); ///< @deprecated Use SetOutputVerticalEventCount(ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetOutput3VerticalEventCount (ULWord Count)); ///< @deprecated Use SetOutputVerticalEventCount(ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetOutput4VerticalEventCount (ULWord Count)); ///< @deprecated Use SetOutputVerticalEventCount(ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetOutput5VerticalEventCount (ULWord Count)); ///< @deprecated Use SetOutputVerticalEventCount(ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetOutput6VerticalEventCount (ULWord Count)); ///< @deprecated Use SetOutputVerticalEventCount(ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetOutput7VerticalEventCount (ULWord Count)); ///< @deprecated Use SetOutputVerticalEventCount(ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetOutput8VerticalEventCount (ULWord Count)); ///< @deprecated Use SetOutputVerticalEventCount(ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetInput1VerticalEventCount (ULWord Count)); ///< @deprecated Use SetInputVerticalEventCount(ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetInput2VerticalEventCount (ULWord Count)); ///< @deprecated Use SetInputVerticalEventCount(ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetInput3VerticalEventCount (ULWord Count)); ///< @deprecated Use SetInputVerticalEventCount(ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetInput4VerticalEventCount (ULWord Count)); ///< @deprecated Use SetInputVerticalEventCount(ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetInput5VerticalEventCount (ULWord Count)); ///< @deprecated Use SetInputVerticalEventCount(ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetInput6VerticalEventCount (ULWord Count)); ///< @deprecated Use SetInputVerticalEventCount(ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetInput7VerticalEventCount (ULWord Count)); ///< @deprecated Use SetInputVerticalEventCount(ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetInput8VerticalEventCount (ULWord Count)); ///< @deprecated Use SetInputVerticalEventCount(ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAudioInterruptEventCount (ULWord Count)); ///< @deprecated Use SetInterruptEventCount(INTERRUPT_ENUMS,ULWord) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAudioInWrapInterruptEventCount (ULWord Count)); ///< @deprecated Use SetInterruptEventCount(INTERRUPT_ENUMS,ULWord) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAudioOutWrapInterruptEventCount (ULWord Count)); ///< @deprecated Use SetInterruptEventCount(INTERRUPT_ENUMS,ULWord) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAuxVerticalEventCount (ULWord Count)); ///< @deprecated Use SetInterruptEventCount(INTERRUPT_ENUMS,ULWord) instead. + + // Wait for event + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForVerticalInterrupt(void)); ///< @deprecated Use WaitForOutputVerticalInterrupt or WaitForInputVerticalInterrupt, as appropriate, instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForOutput1VerticalInterrupt(void)); ///< @deprecated Use WaitForOutputVerticalInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForOutput2VerticalInterrupt(void)); ///< @deprecated Use WaitForOutputVerticalInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForOutput3VerticalInterrupt(void)); ///< @deprecated Use WaitForOutputVerticalInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForOutput4VerticalInterrupt(void)); ///< @deprecated Use WaitForOutputVerticalInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForOutput5VerticalInterrupt(void)); ///< @deprecated Use WaitForOutputVerticalInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForOutput6VerticalInterrupt(void)); ///< @deprecated Use WaitForOutputVerticalInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForOutput7VerticalInterrupt(void)); ///< @deprecated Use WaitForOutputVerticalInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForOutput8VerticalInterrupt(void)); ///< @deprecated Use WaitForOutputVerticalInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForFieldID (NTV2FieldID fieldID)); ///< @deprecated Use WaitForOutputFieldID(NTV2FieldID,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForOutput1FieldID (NTV2FieldID fieldID)); ///< @deprecated Use WaitForOutputFieldID(NTV2FieldID,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForOutput2FieldID (NTV2FieldID fieldID)); ///< @deprecated Use WaitForOutputFieldID(NTV2FieldID,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForOutput3FieldID (NTV2FieldID fieldID)); ///< @deprecated Use WaitForOutputFieldID(NTV2FieldID,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForOutput4FieldID (NTV2FieldID fieldID)); ///< @deprecated Use WaitForOutputFieldID(NTV2FieldID,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForOutput5FieldID (NTV2FieldID fieldID)); ///< @deprecated Use WaitForOutputFieldID(NTV2FieldID,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForOutput6FieldID (NTV2FieldID fieldID)); ///< @deprecated Use WaitForOutputFieldID(NTV2FieldID,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForOutput7FieldID (NTV2FieldID fieldID)); ///< @deprecated Use WaitForOutputFieldID(NTV2FieldID,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForOutput8FieldID (NTV2FieldID fieldID)); ///< @deprecated Use WaitForOutputFieldID(NTV2FieldID,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForInput1FieldID (NTV2FieldID fieldID)); ///< @deprecated Use WaitForInputFieldID(NTV2FieldID,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForInput2FieldID (NTV2FieldID fieldID)); ///< @deprecated Use WaitForInputFieldID(NTV2FieldID,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForInput3FieldID (NTV2FieldID fieldID)); ///< @deprecated Use WaitForInputFieldID(NTV2FieldID,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForInput4FieldID (NTV2FieldID fieldID)); ///< @deprecated Use WaitForInputFieldID(NTV2FieldID,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForInput5FieldID (NTV2FieldID fieldID)); ///< @deprecated Use WaitForInputFieldID(NTV2FieldID,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForInput6FieldID (NTV2FieldID fieldID)); ///< @deprecated Use WaitForInputFieldID(NTV2FieldID,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForInput7FieldID (NTV2FieldID fieldID)); ///< @deprecated Use WaitForInputFieldID(NTV2FieldID,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForInput8FieldID (NTV2FieldID fieldID)); ///< @deprecated Use WaitForInputFieldID(NTV2FieldID,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForInput1Vertical(void)); ///< @deprecated Use WaitForInputVerticalInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForInput2Vertical(void)); ///< @deprecated Use WaitForInputVerticalInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForInput3Vertical(void)); ///< @deprecated Use WaitForInputVerticalInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForInput4Vertical(void)); ///< @deprecated Use WaitForInputVerticalInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForInput5Vertical(void)); ///< @deprecated Use WaitForInputVerticalInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForInput6Vertical(void)); ///< @deprecated Use WaitForInputVerticalInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForInput7Vertical(void)); ///< @deprecated Use WaitForInputVerticalInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForInput8Vertical(void)); ///< @deprecated Use WaitForInputVerticalInterrupt(NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForAudioInterrupt(void)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForAudioInWrapInterrupt(void)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForAudioOutWrapInterrupt(void)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForUartTxInterruptEvent(ULWord timeoutMS=15)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForUart2TxInterruptEvent(ULWord timeoutMS=15)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForUartRxInterruptEvent(ULWord timeoutMS=15)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForUart2RxInterruptEvent(ULWord timeoutMS=15)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForHDMIHotplugInterruptEvent(ULWord timeoutMS=15)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForAuxVerticalInterrupt(void)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForDMA1Interrupt(void)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForDMA2Interrupt(void)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForDMA3Interrupt(void)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForDMA4Interrupt(void)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForPushButtonChangeInterrupt(ULWord timeoutMS=200)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForLowPowerInterrupt(ULWord timeoutMS=1000)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForDisplayFIFOInterrupt(ULWord timeoutMS=1000)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForSATAChangeInterrupt(ULWord timeoutMS=200)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForTemp1HighInterrupt(ULWord timeoutMS=1000)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForTemp2HighInterrupt(ULWord timeoutMS=1000)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForPowerButtonChangeInterrupt(ULWord timeoutMS=1000)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool WaitForChangeEvent(void)); ///< @deprecated Use WaitForInterrupt(INTERRUPT_ENUMS) instead. + #endif // !defined (NTV2_DEPRECATE) + ///@} + + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool SetForce64(ULWord force64)); + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool GetForce64(ULWord* force64)); + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool Get64BitAutodetect(ULWord* autodetect64)); + + /** + @name AutoCirculate + **/ + ///@{ + #if !defined (NTV2_DEPRECATE) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool InitAutoCirculate (NTV2Crosspoint inChannelSpec, + LWord inStartFrameNumber, + LWord inEndFrameNumber, + bool bWithAudio = false, + bool bWithRP188 = false, + bool bFbfChange = false, + bool bFboChange = false, + bool bWithColorCorrection = false, + bool bWithVidProc = false, + bool bWithCustomAncData = false, + bool bWithLTC = false, + bool bUseAudioSystem2 = false)); ///< @deprecated This function is obsolete. + #endif // !defined (NTV2_DEPRECATE) + #if !defined (NTV2_DEPRECATE_12_6) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool InitAutoCirculate (NTV2Crosspoint inChannelSpec, + LWord inStartFrameNumber, + LWord inEndFrameNumber, + LWord inNumChannels, + NTV2AudioSystem inAudioSystem, + bool bWithAudio = false, + bool bWithRP188 = false, + bool bFbfChange = false, + bool bFboChange = false, + bool bWithColorCorrection = false, + bool bWithVidProc = false, + bool bWithCustomAncData = false, + bool bWithLTC = false)); ///< @deprecated Use CNTV2Card::AutoCirculateInitForInput or CNTV2Card::AutoCirculateInitForOutput instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool StartAutoCirculate (const NTV2Crosspoint inChannelSpec, const ULWord64 inStartTime = 0)); ///< @deprecated Use CNTV2Card::AutoCirculateStart instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool StartAutoCirculateAtTime (NTV2Crosspoint channelSpec, ULWord64 startTime)) {return StartAutoCirculate (channelSpec, startTime);} ///< @deprecated Use CNTV2Card::AutoCirculateStart instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool StopAutoCirculate (NTV2Crosspoint channelSpec)); ///< @deprecated Use CNTV2Card::AutoCirculateStop instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool AbortAutoCirculate (NTV2Crosspoint channelSpec)); ///< @deprecated Use CNTV2Card::AutoCirculateStop instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool PauseAutoCirculate (NTV2Crosspoint channelSpec, bool bPlay)); ///< @deprecated Use CNTV2Card::AutoCirculatePause or CNTV2Card::AutoCirculateResume instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFrameStampEx2 (NTV2Crosspoint channelSpec, ULWord frameNum, + FRAME_STAMP_STRUCT* pFrameStamp, + PAUTOCIRCULATE_TASK_STRUCT pTaskStruct = NULL)); ///< @deprecated Use CNTV2Card::AutoCirculateGetFrame instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool FlushAutoCirculate (NTV2Crosspoint channelSpec)); ///< @deprecated Use CNTV2Card::AutoCirculateFlush instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetActiveFrameAutoCirculate (NTV2Crosspoint channelSpec, ULWord lActiveFrame)); ///< @deprecated Use CNTV2Card::AutoCirculateSetActiveFrame instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool PrerollAutoCirculate (NTV2Crosspoint channelSpec, ULWord lPrerollFrames)); ///< @deprecated Use CNTV2Card::AutoCirculatePreRoll instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool TransferWithAutoCirculate (PAUTOCIRCULATE_TRANSFER_STRUCT pTransferStruct, + PAUTOCIRCULATE_TRANSFER_STATUS_STRUCT pTransferStatusStruct)); ///< @deprecated Use CNTV2Card::AutoCirculateTransfer instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool TransferWithAutoCirculateEx(PAUTOCIRCULATE_TRANSFER_STRUCT pTransferStruct, + PAUTOCIRCULATE_TRANSFER_STATUS_STRUCT pTransferStatusStruct, + NTV2RoutingTable* pXena2RoutingTable = NULL)); ///< @deprecated Use CNTV2Card::AutoCirculateTransfer instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool TransferWithAutoCirculateEx2(PAUTOCIRCULATE_TRANSFER_STRUCT pTransferStruct, + PAUTOCIRCULATE_TRANSFER_STATUS_STRUCT pTransferStatusStruct, + NTV2RoutingTable* pXena2RoutingTable = NULL, + PAUTOCIRCULATE_TASK_STRUCT pTaskStruct = NULL)); ///< @deprecated Use CNTV2Card::AutoCirculateTransfer instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAutoCirculateCaptureTask(NTV2Crosspoint channelSpec, PAUTOCIRCULATE_TASK_STRUCT pTaskStruct)); ///< @deprecated Use CNTV2Card::AutoCirculateTransfer instead. + #endif // !defined (NTV2_DEPRECATE_12_6) + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool GetFrameStamp (NTV2Crosspoint channelSpec, ULWord frameNum, FRAME_STAMP_STRUCT* pFrameStamp)); ///< @deprecated Use CNTV2Card::AutoCirculateGetFrame instead. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool GetAutoCirculate (NTV2Crosspoint channelSpec, AUTOCIRCULATE_STATUS_STRUCT* autoCirculateStatus)); ///< @deprecated Use CNTV2Card::AutoCirculateGetStatus instead. + + + /** + @brief Prepares for subsequent AutoCirculate ingest, designating a contiguous block of frame buffers on the device for use + by the FrameStore/channel, and specifies other optional behaviors. + Upon successful return, the channel's ::NTV2AutoCirculateState is set to ::NTV2_AUTOCIRCULATE_INIT where + it will remain until a subsequent call is made to CNTV2Card::AutoCirculateStart or CNTV2Card::AutoCirculateStop. + @return \c true if successful; otherwise \c false. + @param[in] inChannel Specifies the ::NTV2Channel to use. Call ::NTV2DeviceGetNumFrameStores to discover how many + FrameStores (and therefore channels) are available on the device. + @param[in] inFrameCount Optionally specifies the number of contiguous device frame buffers to be continuously cycled + through if zero is specified for both \c inStartFrameNumber and \c inEndFrameNumber. + Defaults to 7. This value is ignored if a legitimate frame range is specified in the + \c inStartFrameNumber and \c inEndFrameNumber parameters (see below). + @param[in] inAudioSystem Specifies the Audio System to use, if any. Defaults to ::NTV2_AUDIOSYSTEM_INVALID (no audio). + @param[in] inOptionFlags A bit mask that specifies additional AutoCirculate options (e.g., ::AUTOCIRCULATE_WITH_RP188, + ::AUTOCIRCULATE_WITH_LTC, ::AUTOCIRCULATE_WITH_ANC, etc.). Defaults to zero (no options). + @param[in] inNumChannels Optionally specifies the number of channels to operate on when CNTV2Card::AutoCirculateStart or + CNTV2Card::AutoCirculateStop are called. Defaults to 1. Must be greater than zero. + @param[in] inStartFrameNumber Specifies the starting frame index number as a zero-based unsigned decimal integer. Defaults to zero. + This parameter always overrides \c inFrameCount if, when specified with \c inEndFrameNumber, + are both non-zero. If specified, must be less than \c inEndFrameNumber -- see \ref vidop-fbindexing + for more information. + @param[in] inEndFrameNumber Specifies the ending frame number as a zero-based unsigned decimal integer. Defaults to zero. + This parameter always overrides \c inFrameCount if, when specified with \c inEndFrameNumber, + are both non-zero. If specified, must be larger than \c inStartFrameNumber -- see \ref vidop-fbindexing + for more information. + @note For Multi-Channel or 4K/8K applications (i.e. where more than one channel is used for streaming video), AJA + recommends specifying zero for \c inFrameCount, and explicitly specifying a frame range using \c inStartFrameNumber + and \c inEndFrameNumber parameters. + @note Fewer frames reduces latency, but increases the likelihood of frame drops. See \ref autocirculatelowlatency. + @note All \ref ntv2signalrouting should be completed prior to calling this function. + @note This function logs \ref autocirculatemsgs to \ref usingajalogger or the \ref usinglogreader. + Be sure the AutoCirculate_39 message group is enabled, and the client application has called AJADebug::Open. + @details If this function succeeds, the driver will have designated a contiguous set of device frame buffers to be written by + the FrameStore, and placed the channel into the ::NTV2_AUTOCIRCULATE_INIT state. The channel will then be ready for + a subsequent call to CNTV2Card::AutoCirculateStart or CNTV2Card::AutoCirculateTransfer. + If the device's ::NTV2EveryFrameTaskMode (see CNTV2Card::GetEveryFrameServices ) is ::NTV2_OEM_TASKS, the driver + will perform most of the device setup, including configuring the FrameStore, etc.; + otherwise (if ::NTV2_DISABLE_TASKS ), the caller must manage all aspects of the FrameStore ( ::NTV2Mode, + ::NTV2VideoFormat, etc.) before calling this function. + @see CNTV2Card::AutoCirculateStop, CNTV2Card::AutoCirculateInitForOutput, \ref autocirculatecapture + **/ + + AJA_VIRTUAL bool AutoCirculateInitForInput ( const NTV2Channel inChannel, + const UWord inFrameCount = 7, + const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_INVALID, + const ULWord inOptionFlags = 0, + const UByte inNumChannels = 1, + const UWord inStartFrameNumber = 0, + const UWord inEndFrameNumber = 0); + + /** + @brief Prepares for subsequent AutoCirculate playout, designating a contiguous block of frame buffers on the device for use + by the FrameStore/channel, and specifies other optional behaviors. + Upon successful return, the channel's ::NTV2AutoCirculateState is set to ::NTV2_AUTOCIRCULATE_INIT where + it will remain until a subsequent call is made to CNTV2Card::AutoCirculateStart or CNTV2Card::AutoCirculateStop. + @return \c true if successful; otherwise \c false. + @param[in] inChannel Specifies the ::NTV2Channel to use. Call ::NTV2DeviceGetNumFrameStores to discover how many + FrameStores (and therefore channels) are available on the device. + @param[in] inFrameCount Optionally specifies the number of contiguous device frame buffers to be continuously cycled + through if zero is specified for both \c inStartFrameNumber and \c inEndFrameNumber. + Defaults to 7. This value is ignored if a legitimate frame range is specified in the + \c inStartFrameNumber and \c inEndFrameNumber parameters (see below). + @param[in] inAudioSystem Specifies the Audio System to use, if any. Defaults to ::NTV2_AUDIOSYSTEM_INVALID (no audio). + @param[in] inOptionFlags A bit mask that specifies additional AutoCirculate options (e.g., ::AUTOCIRCULATE_WITH_RP188, + ::AUTOCIRCULATE_WITH_LTC, ::AUTOCIRCULATE_WITH_ANC, etc.). Defaults to zero (no options). + @param[in] inNumChannels Optionally specifies the number of channels to operate on when CNTV2Card::AutoCirculateStart or + CNTV2Card::AutoCirculateStop are called. Defaults to 1. Must be greater than zero. + @param[in] inStartFrameNumber Specifies the starting frame index number as a zero-based unsigned decimal integer. Defaults to zero. + This parameter always overrides \c inFrameCount if, when specified with \c inEndFrameNumber, + are both non-zero. If specified, must be less than \c inEndFrameNumber -- see \ref vidop-fbindexing + for more information. + @param[in] inEndFrameNumber Specifies the ending frame index number as a zero-based unsigned decimal integer. Defaults to zero. + This parameter always overrides \c inFrameCount if, when specified with \c inEndFrameNumber, + are both non-zero. If specified, must be larger than \c inStartFrameNumber -- see \ref vidop-fbindexing + for more information. + @note For Multi-Channel or 4K/8K applications (i.e. where more than one channel is used for streaming video), AJA + recommends specifying zero for \c inFrameCount, and explicitly specifying a frame range using \c inStartFrameNumber + and \c inEndFrameNumber parameters. + @note Fewer frames reduces latency, but increases the likelihood of frame drops. See \ref autocirculatelowlatency. + @note All \ref ntv2signalrouting should be completed prior to calling this function. + @note This function logs \ref autocirculatemsgs to \ref usingajalogger or the \ref usinglogreader. + Be sure the AutoCirculate_39 message group is enabled, and the client application has called AJADebug::Open. + @details If this function succeeds, the driver will have designated a contiguous set of device frame buffers to be read by + the FrameStore, and placed the channel into the ::NTV2_AUTOCIRCULATE_INIT state. The channel will then be ready for + a subsequent call to CNTV2Card::AutoCirculateStart or CNTV2Card::AutoCirculateTransfer. + If the device's ::NTV2EveryFrameTaskMode (see CNTV2Card::GetEveryFrameServices ) is ::NTV2_OEM_TASKS, the driver + will perform most of the device setup, including configuring the FrameStore, setting the output standard, etc.; + otherwise (if ::NTV2_DISABLE_TASKS ), the caller must manage all aspects of the FrameStore ( ::NTV2Mode, + ::NTV2VideoFormat, etc.) before calling this function. + @see CNTV2Card::AutoCirculateStop, CNTV2Card::AutoCirculateInitForInput, \ref autocirculateplayout + **/ + + AJA_VIRTUAL bool AutoCirculateInitForOutput (const NTV2Channel inChannel, + const UWord inFrameCount = 7, + const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_INVALID, + const ULWord inOptionFlags = 0, + const UByte inNumChannels = 1, + const UWord inStartFrameNumber = 0, + const UWord inEndFrameNumber = 0); + + /** + @brief Starts AutoCirculating the specified channel that was previously initialized by CNTV2Card::AutoCirculateInitForInput or + CNTV2Card::AutoCirculateInitForOutput. + @return True if successful; otherwise false. + @param[in] inChannel Specifies the ::NTV2Channel to use. Call ::NTV2DeviceGetNumFrameStores to discover how many + FrameStores (and therefore channels) are available on the device. + @param[in] inStartTime Optionally specifies a future start time as an unsigned 64-bit host-OS-dependent time value. + If zero, the default, AutoCirculate will switch to the ::NTV2_AUTOCIRCULATE_RUNNING state at + the next VBI received by the given channel. If non-zero, AutoCirculate will remain in the + ::NTV2_AUTOCIRCULATE_STARTING_AT_TIME state until the system tick clock exceeds this value, at + which point it will switch to the ::NTV2_AUTOCIRCULATE_RUNNING state. This value is denominated + in the same time units as the finest-grained time counter available on the host's operating system. + @details This function performs the following tasks: + - It sets the state of the channel in the driver from ::NTV2_AUTOCIRCULATE_INIT to ::NTV2_AUTOCIRCULATE_STARTING. + - At the next VBI, the driver's interrupt service routine (ISR) will check the OS tick clock, and if it exceeds + \c inStartTime value, it will continue starting AutoCirculate -- otherwise the channel will remain in the + ::NTV2_AUTOCIRCULATE_STARTING phase, with the driver re-checking the clock at every subsequent VBI. + - The driver will change the channel's state to ::NTV2_AUTOCIRCULATE_RUNNING. + - The driver will start tracking which memory frames are available and which are empty. + Capture/Input Mode -- The next frame to be recorded is determined, and the current last input audio sample is + written into the next frame's FRAME_STAMP's acAudioInStartAddress field. Finally, the channel's active frame + is set to the next frame number. + Playout/Output Mode -- The next frame to go out the jack is determined, and the current last output audio + sample is written into the next frame's FRAME_STAMP::acAudioOutStartAddress field. Finally, the channel's active + frame is set to the next frame number. + - Finally, the driver will AutoCirculate frames at every VBI on a per-channel basis. + @note This method will fail if the specified channel's AutoCirculate state is not ::NTV2_AUTOCIRCULATE_INIT. + @note Calling CNTV2Card::AutoCirculateStart while in the ::NTV2_AUTOCIRCULATE_PAUSED state won't un-pause AutoCirculate. + (Instead, it will restart it.) + @see CNTV2Card::AutoCirculateStop, CNTV2Card::AutoCirculatePause, \ref aboutautocirculate + **/ + AJA_VIRTUAL bool AutoCirculateStart (const NTV2Channel inChannel, const ULWord64 inStartTime = 0); + + /** + @brief Stops AutoCirculate for the given channel, and releases the on-device frame buffers that were allocated to it. + @return True if successful; otherwise false. + @param[in] inChannel Specifies the ::NTV2Channel to use. Call ::NTV2DeviceGetNumFrameStores to discover how many + FrameStores (and therefore channels) are available on the device. + @param[in] inAbort Specifies if AutoCirculate is to be immediately stopped, not gracefully. + Defaults to false (graceful stop). + @details If asked to stop gracefully (the default), the channel's AutoCirculate state is set to ::NTV2_AUTOCIRCULATE_STOPPING, + and at the next VBI, AutoCirculate is explicitly stopped, after which the channel's state is set to ::NTV2_AUTOCIRCULATE_DISABLED. + Once this method has been called, the channel cannot be used until it gets reinitialized by a subsequent call + to CNTV2Card::AutoCirculateInitForInput or CNTV2Card::AutoCirculateInitForOutput. + When called with \c inAbort set to \c true, audio capture or playback is immediately stopped (if a valid ::NTV2AudioSystem + was specified in the AutoCirculateInit call), and the AutoCirculate channel status is changed to ::NTV2_AUTOCIRCULATE_DISABLED. + @see CNTV2Card::AutoCirculatePause, CNTV2Card::AutoCirculateResume, CNTV2Card::AutoCirculateStart, \ref aboutautocirculate + **/ + AJA_VIRTUAL bool AutoCirculateStop (const NTV2Channel inChannel, const bool inAbort = false); + + /** + @brief Pauses AutoCirculate for the given channel. Once paused, AutoCirculate can be resumed later by calling + CNTV2Card::AutoCirculateResume, picking up at the next frame without any loss of audio synchronization. + @return True if successful; otherwise false. + @param[in] inChannel Specifies the ::NTV2Channel to use. Call ::NTV2DeviceGetNumFrameStores to discover how many + FrameStores (and therefore channels) are available on the device. + @param[in] inAtFrameNum Reserved for future use. (Added to API in SDK 16.2) + @details When pausing, if the channel is in the ::NTV2_AUTOCIRCULATE_RUNNING state, it will be set to ::NTV2_AUTOCIRCULATE_PAUSED, + and at the next VBI, the driver will explicitly stop audio circulating. + @see CNTV2Card::AutoCirculateResume, \ref aboutautocirculate + **/ + AJA_VIRTUAL bool AutoCirculatePause (const NTV2Channel inChannel, const UWord inAtFrameNum = 0xFFFF); // Added inAtFrameNum in SDK 16.2 + + /** + @brief Resumes AutoCirculate for the given channel, picking up at the next frame without loss of audio synchronization. + @return True if successful; otherwise false. + @param[in] inChannel Specifies the ::NTV2Channel to use. Call ::NTV2DeviceGetNumFrameStores to discover how many + FrameStores (and therefore channels) are available on the device. + @param[in] inClearDropCount Specify \c true to clear the AUTOCIRCULATE_STATUS::acFramesDropped counter; otherwise + leaves it unchanged. Defaults to \c false (don't clear it). + @details When resuming, if the channel is in the ::NTV2_AUTOCIRCULATE_PAUSED state, it will be changed to ::NTV2_AUTOCIRCULATE_RUNNING, and at the next VBI, the + driver will restart audio AutoCirculate. + @see CNTV2Card::AutoCirculatePause, \ref aboutautocirculate + **/ + AJA_VIRTUAL bool AutoCirculateResume (const NTV2Channel inChannel, const bool inClearDropCount = false); + + /** + @brief Flushes AutoCirculate for the given channel. + @return True if successful; otherwise false. + @param[in] inChannel Specifies the ::NTV2Channel to use. Call ::NTV2DeviceGetNumFrameStores to discover how many + FrameStores (and therefore channels) are available on the device. + @param[in] inClearDropCount Specify \c true to clear the AUTOCIRCULATE_STATUS::acFramesDropped counter; otherwise + leaves it unchanged. Defaults to \c false (don't clear it). + @details On capture, flushes all recorded frames that haven't yet been transferred to the host. + On playout, all queued frames that have already been transferred to the device (that haven't yet played) + are discarded. + In either mode, this function has no effect on the Active Frame (the frame currently being captured + or played by the device hardware at the moment the function was called). + The ::NTV2AutoCirculateState (::NTV2_AUTOCIRCULATE_RUNNING, etc.) for the given channel will remain unchanged. + @see See \ref aboutautocirculate + **/ + AJA_VIRTUAL bool AutoCirculateFlush (const NTV2Channel inChannel, const bool inClearDropCount = false); + + /** + @brief Tells AutoCirculate how many frames to skip before playout starts for the given channel. + @return True if successful; otherwise false. + @param[in] inChannel Specifies the ::NTV2Channel to use. Call ::NTV2DeviceGetNumFrameStores to discover how many + FrameStores (and therefore channels) are available on the device. + @param[in] inPreRollFrames Specifies the number of frames to skip (ignore) before starting AutoCirculate. + @details Normally used for playout, this method instructs the driver to mark the given number of frames as valid. + It's useful only in the rare case when, after CNTV2Card::AutoCirculateInitForOutput was called, several + frames have already been transferred to the device (perhaps using CNTV2Card::DMAWrite), and calling + CNTV2Card::AutoCirculateStart will ignore those pre-rolled frames without an intervening + CNTV2Card::AutoCirculateTransfer call. + @note This method does nothing if the channel's state is not currently ::NTV2_AUTOCIRCULATE_STARTING, + ::NTV2_AUTOCIRCULATE_RUNNING or ::NTV2_AUTOCIRCULATE_PAUSED, or if the channel was initialized by + CNTV2Card::AutoCirculateInitForInput. + @see See \ref autocirculateplayout + **/ + AJA_VIRTUAL bool AutoCirculatePreRoll (const NTV2Channel inChannel, const ULWord inPreRollFrames); + + /** + @brief Returns the current AutoCirculate status for the given channel. + @return True if successful; otherwise false. + @param[in] inChannel Specifies the ::NTV2Channel to use. Call ::NTV2DeviceGetNumFrameStores to discover how many + FrameStores (and therefore channels) are available on the device. + @param[out] outStatus Receives the ::AUTOCIRCULATE_STATUS information for the channel. + @details Clients can use the ::AUTOCIRCULATE_STATUS information to determine if there are sufficient readable frames + in the driver to safely support a DMA transfer to host memory (for capture); or to determine if any frames + have been dropped. + @see See \ref aboutautocirculate + **/ + AJA_VIRTUAL bool AutoCirculateGetStatus (const NTV2Channel inChannel, AUTOCIRCULATE_STATUS & outStatus); + + + /** + @brief Returns precise timing information for the given frame and channel that's currently AutoCirculating. + @return True if successful; otherwise false. + @param[in] inChannel Specifies the ::NTV2Channel to use. Call ::NTV2DeviceGetNumFrameStores to discover how many + FrameStores (and therefore channels) are available on the device. + @param[in] inFrameNumber Specifies the zero-based frame number of interest. This value must be no less than + AUTOCIRCULATE_STATUS::acStartFrame and no more than AUTOCIRCULATE_STATUS::acEndFrame + for the given channel. For capture/ingest, it should be "behind the record head". + For playout, it should be "behind the play head." + @param[out] outFrameInfo Receives the ::FRAME_STAMP information for the given frame number and channel. + @details When the given channel is AutoCirculating, the driver will continuously fill in a ::FRAME_STAMP record for the frame + it's currently working on, which is intended to give enough information to determine if frames have been dropped + either on input or output. Moreover, it allows for synchronization of audio and video by time-stamping the audio + input address at the start and end of a video frame. + @see See \ref aboutautocirculate + **/ + AJA_VIRTUAL bool AutoCirculateGetFrameStamp (const NTV2Channel inChannel, const ULWord inFrameNumber, FRAME_STAMP & outFrameInfo); + + /** + @brief Immediately changes the Active Frame for the given channel. + @return True if successful; otherwise false. + @param[in] inChannel Specifies the ::NTV2Channel to use. Call ::NTV2DeviceGetNumFrameStores to discover how many + FrameStores (and therefore channels) are available on the device. + @param[in] inNewActiveFrame Specifies the zero-based frame number to use. This value must be no less than acStartFrame + and no more than acEndFrame for the given channel (see AUTOCIRCULATE_STATUS). + @details This method, assuming it succeeds, changes the Active Frame for the given channel by having the driver + change the FrameStore's InputFrame register (input) or OutputFrame register (output). When one + of these registers change on the device, it won't take effect until the next VBI, which ensures, for example, + that an outgoing frame won't suddenly change mid-frame. + @note This method does nothing if the channel's AutoCirculate state is not currently ::NTV2_AUTOCIRCULATE_STARTING, + ::NTV2_AUTOCIRCULATE_RUNNING or ::NTV2_AUTOCIRCULATE_PAUSED. + @see See \ref aboutautocirculate, \ref videooperation + **/ + AJA_VIRTUAL bool AutoCirculateSetActiveFrame (const NTV2Channel inChannel, const ULWord inNewActiveFrame); + + /** + @brief Transfers all or part of a frame as specified in the given ::AUTOCIRCULATE_TRANSFER object to/from the host. + @param[in] inChannel Specifies the ::NTV2Channel to use. Call ::NTV2DeviceGetNumFrameStores to discover how many + FrameStores (and therefore channels) are available on the device. + @param transferInfo On entry, specifies the ::AUTOCIRCULATE_TRANSFER details. + Upon return, contains information about the (successful) transfer. + @details It is recommended that this method be called from inside a loop in a separate execution thread, with a way to gracefully + exit the loop. Once outside of the loop, CNTV2Card::AutoCirculateStop can then be called. + @warning It is the caller's responsibility to provide valid video, audio and ancillary data pointers (and byte counts) + via the AUTOCIRCULATE_TRANSFER::SetBuffers function(s). Bad addresses and/or sizes can cause crashes. + @note Do not call this method with an ::NTV2Channel that's in the ::NTV2_AUTOCIRCULATE_DISABLED state. + @note The calling thread will block until the transfer completes (or fails). + @note For capture, there should be an available frame buffer on the device waiting to be transferred to the host. + Call CNTV2Card::AutoCirculateGetStatus, and check AUTOCIRCULATE_STATUS::HasAvailableInputFrame. + @note For playout, there should be a free frame buffer on the device to accommodate the new frame being transferred. + Call CNTV2Card::AutoCirculateGetStatus, and check AUTOCIRCULATE_STATUS::CanAcceptMoreOutputFrames. + @note For playout to IP devices running S2110 firmware, this method will automatically insert VPID and RP188 + timecode packets into the outgoing RTP Anc streams, even if CNTV2Card::AutoCirculateInitForOutput was called + without ::AUTOCIRCULATE_WITH_ANC, or if Anc buffers weren't specified in the ::AUTOCIRCULATE_TRANSFER object. + This default behavior can be overridden or disabled: + - To disable the default insertion of VPID, call CNTV2Card::SetSDIOutVPID, passing zeroes for the VPID values. + - To override the default VPID packets, call CNTV2Card::AutoCirculateInitForOutput with ::AUTOCIRCULATE_WITH_ANC, + and insert your own VPID packet(s) into the ::AUTOCIRCULATE_TRANSFER object's Anc buffers. + - To disable the default insertion of RP188, nullify (clear) the AUTOCIRCULATE_TRANSFER::acOutputTimeCodes + array storage. + - To override the default RP188 packet(s), be sure CNTV2Card::AutoCirculateInitForOutput was called with + ::AUTOCIRCULATE_WITH_ANC, and insert your own RP188 packets into the ::AUTOCIRCULATE_TRANSFER object's + Anc buffers. + @note For capture from IP devices running S2110 firmware, this method will automatically extract VPID and + RP188 timecode packets from the incoming RTP Anc streams, even if not ::AUTOCIRCULATE_WITH_ANC, or without + Anc buffers in the "transferInfo". + @bug For IP devices running S2110 firmware, this method performs many heap allocations in order to transparently + support normal (VPID and RP188) and custom ancillary data. This feature should be re-implemented + to use separate, per-channel, private, pre-allocated heaps for the STL objects and other buffers it uses. + @see CNTV2Card::DMAReadFrame, CNTV2Card::DMAWriteFrame, \ref aboutautocirculate + **/ + AJA_VIRTUAL bool AutoCirculateTransfer (const NTV2Channel inChannel, AUTOCIRCULATE_TRANSFER & transferInfo); + + /** + @brief Returns the device frame buffer numbers of the first unallocated contiguous band of frame buffers having the given + size that are available for use. This function is called by CNTV2Card::AutoCirculateInitForInput and + CNTV2Card::AutoCirculateInitForOutput whenever a frame count is specified in lieu of explicit frame ranges. + @param[in] inFrameCount Specifies the desired number of contiguous device frame buffers. Must exceed zero. + @param[out] outStartFrame Receives the starting device frame buffer number (or -1 upon failure). + @param[out] outEndFrame Receives the ending device frame buffer number (or -1 upon failure). + @param[in] inFrameStore Optionally specifies the FrameStore of interest for the desired frame count. Any memory + being read or written by this FrameStore will be excluded when collecting unallocated + regions of device SDRAM, and also its ::NTV2VideoFormat will determine if the frames are + quad-sized or quad-quad-sized. Defaults to ::NTV2_CHANNEL_INVALID for backward compatibility. + @return True if successful; otherwise false. + @note Prior to SDK 16.1, this function returned invalid frame numbers if any AutoCirculate channels were actively + processing UHD/4K or UHD2/8K. In SDK 16.2, this function failed (returned false) if any AutoCirculate channels + were actively processing UHD/4K or UHD2/8K. In SDK 16.3, the function was corrected to work with UHD/4K and UHD2/8K, + but requires specifying a FrameStore of interest. + @see See \ref aboutautocirculate + **/ + AJA_VIRTUAL bool FindUnallocatedFrames (const UWord inFrameCount, LWord & outStartFrame, LWord & outEndFrame, + const NTV2Channel inFrameStore = NTV2_CHANNEL_INVALID); + ///@} + +#if defined(READREGMULTICHANGE) + /** + @brief Reads the given set of registers. + @param[in] inRegNums Specifies the set of registers to be read. + @param[out] outValues Receives the resulting register/value map. Any registers + in the "inRegNums" set that don't appear in this map were + not able to be read successfully. + @return True if all requested registers were successfully read; otherwise false. + @note This operation is not guaranteed to be performed atomically. + A VBI may occur while the requested registers are being read. + **/ + AJA_VIRTUAL bool ReadRegisters (const NTV2RegNumSet & inRegNums, NTV2RegisterValueMap & outValues); +#endif // defined(READREGMULTICHANGE) + + /** + @brief Reads the given set of registers from the bank specified in position 0 + @param[in] inBankSelect Specifies the bank select register. + @param[in] inOutRegInfo Specifies the register to be read (plus mask/shift/value). + @return True if all requested registers were successfully read; otherwise false. + @note This operation is not guaranteed to be performed atomically. + **/ + AJA_VIRTUAL bool BankSelectReadRegister (const NTV2RegInfo & inBankSelect, NTV2RegInfo & inOutRegInfo); + + /** + @brief Writes the given sequence of NTV2RegInfo's. + @param[in] inRegWrites Specifies the sequence of NTV2RegInfo's to be written. + @return True if all registers were written successfully; otherwise false. + @note This operation is not guaranteed to be performed atomically. + **/ + AJA_VIRTUAL bool WriteRegisters (const NTV2RegisterWrites & inRegWrites); + + /** + @brief Writes the given set of registers to the bank specified at position 0. + @param[in] inBankSelect Specifies the bank select register. + @param[in] inRegInfo Specifies the register to be written, and its mask, shift and value. + @return True if all requested registers were successfully written; otherwise false. + @note This operation is not guaranteed to be performed atomically. + **/ + AJA_VIRTUAL bool BankSelectWriteRegister (const NTV2RegInfo & inBankSelect, const NTV2RegInfo & inRegInfo); + + /** + @brief Writes the block of virtual data. + @param[in] inTag Tag for the virtual data. + @param[in] inVirtualData Virtual data to be written + @param[in] inVirtualDataSize Virtual data size to write + @return True if all requested data was successfully written; otherwise false. + @note This operation is not guaranteed to be performed atomically. + **/ + AJA_VIRTUAL bool WriteVirtualData (const ULWord inTag, const void* inVirtualData, const ULWord inVirtualDataSize); + + /** + @brief Reads the block of virtual data for a specific tag + @param[in] inTag Tag for the virtual data. + @param[out] outVirtualData Virtual data buffer to be written + @param[in] inVirtualDataSize Virtual data size to read + @return True if all requested data was successfully read; otherwise false. + @note This operation is not guaranteed to be performed atomically. + **/ + AJA_VIRTUAL bool ReadVirtualData (const ULWord inTag, void* outVirtualData, const ULWord inVirtualDataSize); + + /** + @brief For devices that support it (see the ::NTV2DeviceCanDoSDIErrorChecks function in "ntv2devicefeatures.h"), + this function fetches the SDI statistics for all SDI input spigots. + @param[out] outStats Receives the SDI statistics for all SDI input spigots. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool ReadSDIStatistics (NTV2SDIInStatistics & outStats); + + /** + @brief Sets the device's intrinsic frame buffer size. + @param[in] inSize Specifies the intrinsic frame size the hardware should use. + @return True if successful; otherwise false. Failure usually indicates the intrinsic frame size is not + software-changeable. + @see \ref vidop-fbindexing, CNTV2Card::GetFrameBufferSize + **/ + AJA_VIRTUAL bool SetFrameBufferSize (const NTV2Framesize inSize); + + /** + @brief Sets the device's intrinsic frame buffer size. + @param[in] inChannel Specifies the FrameStore to be affected. (Currently ignored -- see note below.) + @param[in] inValue Specifies the new frame size. Must be NTV2_FRAMESIZE_8MB or NTV2_FRAMESIZE_16MB. + @return True if successful; otherwise false. + @see \ref vidop-fbindexing, CNTV2Card::GetFrameBufferSize + **/ + AJA_VIRTUAL bool SetFrameBufferSize (const NTV2Channel inChannel, const NTV2Framesize inValue); + + /** + @brief Answers with the frame size currently being used on the device. + @param[in] inChannel Currently ignored. Use ::NTV2_CHANNEL1. + @param[out] outValue Receives the device's current frame size. + @return True if successful; otherwise false. + @see \ref vidop-fbindexing, CNTV2Card::SetFrameBufferSize + **/ + AJA_VIRTUAL bool GetFrameBufferSize (const NTV2Channel inChannel, NTV2Framesize & outValue); +#if !defined(NTV2_DEPRECATE_14_3) + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetFrameBufferSize (NTV2Channel inChannel, NTV2Framesize * pOutValue)) {return pOutValue ? GetFrameBufferSize (inChannel, *pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. +#endif // NTV2_DEPRECATE_14_3 + using CNTV2DriverInterface::GetFrameBufferSize; // Keep CNTV2DriverInterface::GetFrameBufferSize visible after being shadowed by CNTV2Card::GetFrameBufferSize + + /** + @return True if the device intrinsic frame buffer size is currently settable and set by software + (overriding the firmware); otherwise false. + @see \ref vidop-fbindexing + **/ + AJA_VIRTUAL bool IsBufferSizeSetBySW (void); + + /** + @brief Disables the given FrameStore. + @param[in] inChannel Specifies the FrameStore as an NTV2Channel value. + @return True if successful; otherwise false. + @note It is not an error to disable a FrameStore that is already disabled. + @see CNTV2Card::EnableChannel, CNTV2Card::DisableChannels, \ref vidop-fs + **/ + AJA_VIRTUAL bool DisableChannel (const NTV2Channel inChannel); + + /** + @brief Disables the given FrameStore(s). + @param[in] inChannels Specifies the FrameStore(s) to be disabled. + @return True if successful; otherwise false. + @note It is not an error to disable a FrameStore that is already disabled. + @see CNTV2Card::EnableChannels, CNTV2Card::DisableChannel, \ref vidop-fs + **/ + AJA_VIRTUAL bool DisableChannels (const NTV2ChannelSet & inChannels); + + /** + @brief Enables the given FrameStore. + @param[in] inChannel Specifies the FrameStore as an NTV2Channel value. + @return True if successful; otherwise false. + @note It is not an error to enable a FrameStore that is already enabled. + @see CNTV2Card::DisableChannel, CNTV2Card::EnableChannels, \ref vidop-fs + **/ + AJA_VIRTUAL bool EnableChannel (const NTV2Channel inChannel); + + /** + @brief Enables the given FrameStore(s). + @param[in] inChannels Specifies the FrameStore(s) to be enabled. + @param[in] inDisableOthers If true, disables all other FrameStores on the device. + Otherwise, leaves other FrameStores untouched. + Defaults to false. + @return True if successful; otherwise false. + @note It is not an error to enable a FrameStore that is already enabled. + @see CNTV2Card::EnableChannel, CNTV2Card::DisableChannels, \ref vidop-fs + **/ + AJA_VIRTUAL bool EnableChannels (const NTV2ChannelSet & inChannels, const bool inDisableOthers = false); + + /** + @brief Answers whether or not the given FrameStore is enabled. + @param[in] inChannel Specifies the FrameStore, as identified by an NTV2Channel value. + @param[out] outEnabled Receives "true" if the FrameStore is enabled, or "false" if disabled. + @return True if successful; otherwise false. + @see See \ref vidop-fs + **/ + AJA_VIRTUAL bool IsChannelEnabled (const NTV2Channel inChannel, bool & outEnabled); + + #if !defined (NTV2_DEPRECATE) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetChannel2Disable (bool value)); ///< @deprecated Use EnableChannel or DisableChannel instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetChannel2Disable (bool* value)); ///< @deprecated Use IsChannelEnabled instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetChannel3Disable (bool value)); ///< @deprecated Use EnableChannel or DisableChannel instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetChannel3Disable (bool* value)); ///< @deprecated Use IsChannelEnabled instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetChannel4Disable (bool value)); ///< @deprecated Use EnableChannel or DisableChannel instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetChannel4Disable (bool* value)); ///< @deprecated Use IsChannelEnabled instead. + #endif // !defined (NTV2_DEPRECATE) + + AJA_VIRTUAL bool SetVideoDACMode (NTV2VideoDACMode inValue); + AJA_VIRTUAL bool GetVideoDACMode (NTV2VideoDACMode & outValue); + + + /** + @name Timing/Offset Control + **/ + ///@{ + AJA_VIRTUAL bool GetNominalMinMaxHV (int & outNominalH, int & outMinH, int & outMaxH, int & outNominalV, int & outMinV, int & outMaxV); + + /** + @brief Adjusts the horizontal timing offset, in pixels, for the given SDI output connector. + @param[in] inHOffset Specifies the horizontal output timing offset, a signed value, in pixels after or before the nominal value. + @param[in] inOutputSpigot (Added in SDK v16.1) Optionally specifies the SDI output connector of interest. Defaults to 0 (SDI Out 1). + @note The output timing can only be adjusted when the device's reference source is set for external reference. + @note The "inOutputSpigot" parameter is respected only if the device is multi-format-capable (see ::NTV2DeviceCanDoMultiFormat) + and the device is currently in multi-format mode (see CNTV2Card::GetMultiFormatMode and CNTV2Card::SetMultiFormatMode). + Otherwise, this function sets the horizontal timing offset for SDI Output 1 (i.e., the "global" output timing). + @return True if successful; otherwise false. + @see CNTV2Card::GetVideoHOffset, CNTV2Card::SetVideoVOffset + **/ + AJA_VIRTUAL bool SetVideoHOffset (const int inHOffset, const UWord inOutputSpigot = 0); + + /** + @brief Answers with the current horizontal timing offset, in pixels, for the given SDI output connector. + @param[out] outHOffset Receives the current horizontal output timing offset, a signed value, in pixels after or before the nominal value. + @param[in] inOutputSpigot (Added in SDK v16.1) Optionally specifies the SDI output connector of interest. Defaults to 0 (SDI Out 1). + @note The "inOutputSpigot" parameter is respected only if the device is multi-format-capable (see ::NTV2DeviceCanDoMultiFormat) + and the device is currently in multi-format mode (see CNTV2Card::GetMultiFormatMode and CNTV2Card::SetMultiFormatMode). + Otherwise, this function only reports the horizontal timing offset for SDI Output 1 (i.e., the "global" output timing). + @return True if successful; otherwise false. + @see CNTV2Card::SetVideoHOffset, CNTV2Card::GetVideoVOffset + **/ + AJA_VIRTUAL bool GetVideoHOffset (int & outHOffset, const UWord inOutputSpigot = 0); + + /** + @brief Adjusts the vertical timing offset, in lines, for the given SDI output connector. + @param[in] inVOffset Specifies the vertical output timing offset, a signed value, in lines after or before the nominal value. + @param[in] inOutputSpigot (Added in SDK v16.1) Optionally specifies the SDI output connector of interest. Defaults to 0 (SDI Out 1). + @note The output timing can only be adjusted when the device's reference source is set for external reference. + @note The "inOutputSpigot" parameter is respected only if the device is multi-format-capable (see ::NTV2DeviceCanDoMultiFormat) + and the device is currently in multi-format mode (see CNTV2Card::GetMultiFormatMode and CNTV2Card::SetMultiFormatMode). + Otherwise, this function sets the vertical timing offset for SDI Output 1 (i.e., the "global" output timing). + @return True if successful; otherwise false. + @see CNTV2Card::GetVideoVOffset, CNTV2Card::SetVideoHOffset + **/ + AJA_VIRTUAL bool SetVideoVOffset (const int inVOffset, const UWord inOutputSpigot = 0); + + /** + @brief Answers with the current vertical timing offset, in lines, for the given SDI output connector. + @param[out] outVOffset Receives the current vertical output timing offset, a signed value, in lines after or before the nominal value. + @param[in] inOutputSpigot (Added in SDK v16.1) Optionally specifies the SDI output spigot of interest. Defaults to 0 (SDI Out 1). + @note The "inOutputSpigot" parameter is respected only if the device is multi-format-capable (see ::NTV2DeviceCanDoMultiFormat) + and the device is currently in multi-format mode (see CNTV2Card::GetMultiFormatMode and CNTV2Card::SetMultiFormatMode). + Otherwise, this function only reports the vertical timing offset for SDI Output 1 (i.e., the "global" output timing). + @return True if successful; otherwise false. + @see CNTV2Card::SetVideoVOffset, CNTV2Card::GetVideoHOffset + **/ + AJA_VIRTUAL bool GetVideoVOffset (int & outVOffset, const UWord inOutputSpigot = 0); + #if !defined (NTV2_DEPRECATE) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetVideoFinePhase (int fOffset)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetVideoFinePhase (int* fOffset)); ///< @deprecated This function is obsolete. + #endif // !defined (NTV2_DEPRECATE) + + AJA_VIRTUAL bool SetAnalogOutHTiming (ULWord inValue); + AJA_VIRTUAL bool GetAnalogOutHTiming (ULWord & outValue); + + /** + @brief Adjusts the output timing for the given SDI output connector. + @param[in] inValue Specifies the output timing control value to use. The lower 16 bits of this 32-bit value + control the horizontal timing, while the upper 16 bits control the vertical. + Each horizontal increment/decrement moves the output relative to the reference by one pixel. + Each vertical increment/decrement moves the output relative to the reference by one line. + @param[in] inOutputSpigot Optionally specifies the SDI output connector of interest. Defaults to zero (SDI Out 1). + @note The output timing can only be adjusted when the device's reference source is set for external reference. + @note The "inOutputSpigot" parameter is respected only if the device is multi-format-capable (see ::NTV2DeviceCanDoMultiFormat) + and the device is currently in multi-format mode (see CNTV2Card::GetMultiFormatMode and CNTV2Card::SetMultiFormatMode). + Otherwise, the timing is changed for all SDI outputs. + @return True if successful; otherwise false. + @see CNTV2Card::ReadOutputTimingControl, CNTV2Card::SetVideoVOffset, CNTV2Card::SetVideoHOffset + **/ + AJA_VIRTUAL bool WriteOutputTimingControl (const ULWord inValue, const UWord inOutputSpigot = 0); + + /** + @brief Returns the current output timing control value for the given SDI output connector. + @param[out] outValue Receives the current output timing control value. + @param[in] inOutputSpigot Optionally specifies the SDI output connector of interest. Defaults to 0 (SDI Out 1). + @note The "inOutputSpigot" parameter is respected only if the device is multi-format-capable (see ::NTV2DeviceCanDoMultiFormat) + and the device is currently in multi-format mode (see CNTV2Card::GetMultiFormatMode and CNTV2Card::SetMultiFormatMode). + Otherwise, this function only reports the timing for SDI Output 1 (i.e., the "global" output timing). + @return True if successful; otherwise false. + @see CNTV2Card::WriteOutputTimingControl, CNTV2Card::GetVideoVOffset, CNTV2Card::GetVideoHOffset + **/ + AJA_VIRTUAL bool ReadOutputTimingControl (ULWord & outValue, const UWord inOutputSpigot = 0); + + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool SetSDI1OutHTiming (ULWord value)); + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool GetSDI1OutHTiming(ULWord* value)); + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool SetSDI2OutHTiming (ULWord value)); + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool GetSDI2OutHTiming(ULWord* value)); + ///@} + + /** + @name VPID + **/ + ///@{ + /* + @brief Sets the VPID payload value(s) for each link of the given 3G SDI output. + @param[in] inValueA Specifies the "Link A" VPID value to be embedded in the "A" link output signal. + @param[in] inValueB Specifies the "Link B" VPID value to be embedded in the "B" link output signal. + @param[in] inOutputSpigot Specifies the SDI output connector of interest as a zero-based index value. + Defaults to zero, the first SDI output connector. + @return True if successful; otherwise false. + */ + AJA_VIRTUAL bool SetSDIOutVPID (const ULWord inValueA, const ULWord inValueB, const UWord inOutputSpigot = NTV2_CHANNEL1); + + /* + @brief Answers with the VPID payload value(s) that are currently being embedded for each link of the given 3G SDI output. + @param[out] outValueA Receives the VPID payload value currently being embedded in the "A" link output signal. + @param[out] outValueB Receives the VPID payload value currently being embedded in the "B" link output signal. + @param[in] inOutputSpigot Specifies the SDI output connector of interest as a zero-based index value. + Defaults to zero, the first SDI output connector. + @return True if successful; otherwise false. + */ + AJA_VIRTUAL bool GetSDIOutVPID (ULWord & outValueA, ULWord & outValueB, const UWord inOutputSpigot = NTV2_CHANNEL1); + + /* + @brief Reads the latest received VPID payload value(s) for each link of the given SDI input. + @param[in] inSDIInput Specifies the 3G SDI input connector as an ::NTV2Channel, a zero-based index value. + @param[out] outValueA Receives the "Link A" VPID payload value -- or zero if VPID was not present. + @param[out] outValueB Receives the "Link B" VPID payload value -- or zero if VPID was not present. + @return True if successful; otherwise false. + */ + AJA_VIRTUAL bool ReadSDIInVPID (const NTV2Channel inSDIInput, ULWord & outValueA, ULWord & outValueB); + + /** + @return True if the SDI VPID link A input status is valid; otherwise false. + @param[in] inChannel Specifies the SDI input connector of interest, specified as an ::NTV2Channel, a zero-based index value. + **/ + AJA_VIRTUAL bool GetVPIDValidA (const NTV2Channel inChannel); + + /** + @return True if the SDI VPID link B input status is valid; otherwise false. + @param[in] inChannel Specifies the SDI input connector of interest, specified as an ::NTV2Channel, a zero-based index value. + **/ + AJA_VIRTUAL bool GetVPIDValidB (const NTV2Channel inChannel); + + #if !defined (NTV2_DEPRECATE) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadSDIInVPID(NTV2Channel channel, ULWord* valueA, ULWord* valueB = NULL)); ///< @deprecated Use ReadSDIInVPID(NTV2Channel,ULWord&,ULWord&) instead + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadSDI1InVPID(ULWord* valueA, ULWord* valueB = NULL)); ///< @deprecated Use ReadSDIInVPID(NTV2Channel,ULWord&,ULWord&) instead + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadSDI2InVPID(ULWord* valueA, ULWord* valueB = NULL)); ///< @deprecated Use ReadSDIInVPID(NTV2Channel,ULWord&,ULWord&) instead + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadSDI3InVPID(ULWord* valueA, ULWord* valueB = NULL)); ///< @deprecated Use ReadSDIInVPID(NTV2Channel,ULWord&,ULWord&) instead + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadSDI4InVPID(ULWord* valueA, ULWord* valueB = NULL)); ///< @deprecated Use ReadSDIInVPID(NTV2Channel,ULWord&,ULWord&) instead + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI1OutVPID(ULWord valueA, ULWord valueB = 0)); ///< @deprecated Use SetSDIOutVPID(ULWord,ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI1OutVPID(ULWord* valueA, ULWord* valueB = NULL)); ///< @deprecated Use GetSDIOutVPID(ULWord&,ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI2OutVPID(ULWord valueA, ULWord valueB = 0)); ///< @deprecated Use SetSDIOutVPID(ULWord,ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI2OutVPID(ULWord* valueA, ULWord* valueB = NULL)); ///< @deprecated Use GetSDIOutVPID(ULWord&,ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI3OutVPID(ULWord valueA, ULWord valueB = 0)); ///< @deprecated Use SetSDIOutVPID(ULWord,ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI3OutVPID(ULWord* valueA, ULWord* valueB = NULL)); ///< @deprecated Use GetSDIOutVPID(ULWord&,ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI4OutVPID(ULWord valueA, ULWord valueB = 0)); ///< @deprecated Use SetSDIOutVPID(ULWord,ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI4OutVPID(ULWord* valueA, ULWord* valueB = NULL)); ///< @deprecated Use GetSDIOutVPID(ULWord&,ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI5OutVPID(ULWord valueA, ULWord valueB = 0)); ///< @deprecated Use SetSDIOutVPID(ULWord,ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI5OutVPID(ULWord* valueA, ULWord* valueB = NULL)); ///< @deprecated Use GetSDIOutVPID(ULWord&,ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI6OutVPID(ULWord valueA, ULWord valueB = 0)); ///< @deprecated Use SetSDIOutVPID(ULWord,ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI6OutVPID(ULWord* valueA, ULWord* valueB = NULL)); ///< @deprecated Use GetSDIOutVPID(ULWord&,ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI7OutVPID(ULWord valueA, ULWord valueB = 0)); ///< @deprecated Use SetSDIOutVPID(ULWord,ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI7OutVPID(ULWord* valueA, ULWord* valueB = NULL)); ///< @deprecated Use GetSDIOutVPID(ULWord&,ULWord&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI8OutVPID(ULWord valueA, ULWord valueB = 0)); ///< @deprecated Use SetSDIOutVPID(ULWord,ULWord,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI8OutVPID(ULWord* valueA, ULWord* valueB = NULL)); ///< @deprecated Use GetSDIOutVPID(ULWord&,ULWord&,NTV2Channel) instead. + #endif // !defined (NTV2_DEPRECATE) + ///@} + + /** + @brief Sets the SDI output spigot's video standard. + @param[in] inOutputSpigot Specifies the SDI output spigot of interest as a zero-based index number, where zero is "SDI Out 1". + @param[in] inValue Specifies the video standard. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetSDIOutputStandard (const UWord inOutputSpigot, const NTV2Standard inValue); + + /** + @brief Sets the video standard for the given SDI output(s). + @param[in] inSDIOutputs Specifies the SDI output connector(s) of interest. + Each is a zero-based index number, where zero is "SDIOut1". + @param[in] inValue Specifies the video standard. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetSDIOutputStandard (const NTV2ChannelSet & inSDIOutputs, const NTV2Standard inValue); // New in SDK v16.0 + + /** + @brief Answers with the current video standard of the given SDI output spigot. + @param[in] inOutputSpigot Specifies the SDI output spigot of interest as a zero-based index number, where zero is "SDI Out 1". + @param[out] outValue Receives the video standard. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetSDIOutputStandard (const UWord inOutputSpigot, NTV2Standard & outValue); + + #if !defined (NTV2_DEPRECATE) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetSDIOutStandard (const NTV2Standard value, const NTV2Channel channel = NTV2_CHANNEL1)); ///< @deprecated Use SetSDIOutputStandard instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDIOutStandard (NTV2Standard & outStandard, const NTV2Channel channel = NTV2_CHANNEL1)); ///< @deprecated Use GetSDIOutputStandard instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDIOutStandard (NTV2Standard* value, NTV2Channel channel)); ///< @deprecated Use GetSDIOutputStandard instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI1OutStandard (NTV2Standard value)); ///< @deprecated Use SetSDIOutputStandard(NTV2Channel,NTV2Standard) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI1OutStandard (NTV2Standard* value)); ///< @deprecated Use GetSDIOutputStandard(NTV2Channel,NTV2Standard&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI2OutStandard (NTV2Standard value)); ///< @deprecated Use SetSDIOutputStandard(NTV2Channel,NTV2Standard) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI2OutStandard (NTV2Standard* value)); ///< @deprecated Use GetSDIOutputStandard(NTV2Channel,NTV2Standard&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI3OutStandard (NTV2Standard value)); ///< @deprecated Use SetSDIOutputStandard(NTV2Channel,NTV2Standard) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI3OutStandard (NTV2Standard* value)); ///< @deprecated Use GetSDIOutputStandard(NTV2Channel,NTV2Standard&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI4OutStandard (NTV2Standard value)); ///< @deprecated Use SetSDIOutputStandard(NTV2Channel,NTV2Standard) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI4OutStandard (NTV2Standard* value)); ///< @deprecated Use GetSDIOutputStandard(NTV2Channel,NTV2Standard&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI5OutStandard (NTV2Standard value)); ///< @deprecated Use SetSDIOutputStandard(NTV2Channel,NTV2Standard) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI5OutStandard (NTV2Standard* value)); ///< @deprecated Use GetSDIOutputStandard(NTV2Channel,NTV2Standard&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI6OutStandard (NTV2Standard value)); ///< @deprecated Use SetSDIOutputStandard(NTV2Channel,NTV2Standard) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI6OutStandard (NTV2Standard* value)); ///< @deprecated Use GetSDIOutputStandard(NTV2Channel,NTV2Standard&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI7OutStandard (NTV2Standard value)); ///< @deprecated Use SetSDIOutputStandard(NTV2Channel,NTV2Standard) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI7OutStandard (NTV2Standard* value)); ///< @deprecated Use GetSDIOutputStandard(NTV2Channel,NTV2Standard&) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2SDI8OutStandard (NTV2Standard value)); ///< @deprecated Use SetSDIOutputStandard(NTV2Channel,NTV2Standard) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2SDI8OutStandard (NTV2Standard* value)); ///< @deprecated Use GetSDIOutputStandard(NTV2Channel,NTV2Standard&) instead. + #endif // !NTV2_DEPRECATE + + + /** + @name Up/Down Conversion + **/ + ///@{ + AJA_VIRTUAL bool SetUpConvertMode (const NTV2UpConvertMode inValue); + AJA_VIRTUAL bool GetUpConvertMode (NTV2UpConvertMode & outValue); + AJA_VIRTUAL bool SetConverterOutStandard (const NTV2Standard inValue); + AJA_VIRTUAL bool GetConverterOutStandard (NTV2Standard & outValue); + AJA_VIRTUAL bool SetConverterOutRate (const NTV2FrameRate inValue); + AJA_VIRTUAL bool GetConverterOutRate (NTV2FrameRate & outValue); + AJA_VIRTUAL bool SetConverterInStandard (const NTV2Standard inValue); + AJA_VIRTUAL bool GetConverterInStandard (NTV2Standard & outValue); + AJA_VIRTUAL bool SetConverterInRate (const NTV2FrameRate inValue); + AJA_VIRTUAL bool GetConverterInRate (NTV2FrameRate & outValue); + AJA_VIRTUAL bool SetConverterPulldown (const ULWord inValue); + AJA_VIRTUAL bool GetConverterPulldown (ULWord & outValue); + AJA_VIRTUAL bool SetUCPassLine21 (const ULWord inValue); + AJA_VIRTUAL bool GetUCPassLine21 (ULWord & outValue); + AJA_VIRTUAL bool SetUCAutoLine21 (const ULWord inValue); + AJA_VIRTUAL bool GetUCAutoLine21 (ULWord & outValue); + + AJA_VIRTUAL bool SetDownConvertMode (const NTV2DownConvertMode inValue); + AJA_VIRTUAL bool GetDownConvertMode (NTV2DownConvertMode & outValue); + AJA_VIRTUAL bool SetIsoConvertMode (const NTV2IsoConvertMode inValue); + AJA_VIRTUAL bool GetIsoConvertMode (NTV2IsoConvertMode & outValue); + AJA_VIRTUAL bool SetEnableConverter (const bool inValue); + AJA_VIRTUAL bool GetEnableConverter (bool & outValue); + AJA_VIRTUAL bool SetDeinterlaceMode (const ULWord inValue); + AJA_VIRTUAL bool GetDeinterlaceMode (ULWord & outValue); + + AJA_VIRTUAL bool SetConversionMode (const NTV2ConversionMode inConversionMode); + AJA_VIRTUAL bool GetConversionMode (NTV2ConversionMode & outConversionMode); + ///@} + + #if !defined (NTV2_DEPRECATE) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetSecondConverterOutStandard (const NTV2Standard inValue)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSecondConverterOutStandard (NTV2Standard & outValue)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetSecondConverterInStandard (const NTV2Standard inValue)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSecondConverterInStandard (NTV2Standard & outValue)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetSecondDownConvertMode (const NTV2DownConvertMode inValue)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSecondDownConvertMode (NTV2DownConvertMode & outValue)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetSecondIsoConvertMode (const NTV2IsoConvertMode inValue)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSecondIsoConvertMode (NTV2IsoConvertMode & outValue)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetSecondConverterPulldown (const ULWord inValue)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSecondConverterPulldown (ULWord & outValue)); ///< @deprecated This function is obsolete. + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2FrameSyncControlFrameDelay (NTV2FrameSyncSelect select, ULWord value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2FrameSyncControlFrameDelay (NTV2FrameSyncSelect select, ULWord *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2FrameSyncControlStandard (NTV2FrameSyncSelect select, NTV2Standard value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2FrameSyncControlStandard (NTV2FrameSyncSelect select, NTV2Standard *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2FrameSyncControlGeometry (NTV2FrameSyncSelect select, NTV2FrameGeometry value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2FrameSyncControlGeometry (NTV2FrameSyncSelect select, NTV2FrameGeometry *value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetK2FrameSyncControlFrameFormat (NTV2FrameSyncSelect select, NTV2FrameBufferFormat value)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetK2FrameSyncControlFrameFormat (NTV2FrameSyncSelect select, NTV2FrameBufferFormat *value)); ///< @deprecated This function is obsolete. + #endif // !defined (NTV2_DEPRECATE) + + /** + @name CSCs, LUTs & Color Correction + **/ + ///@{ + + /** + @brief Selects the color space converter operation method. + @param[in] inCSCMethod Specifies the method by which the color space converter will transform its input into its output. + @param[in] inChannel Specifies the CSC of interest, a zero-based index value expressed as an ::NTV2Channel. + @return True if the call was successful; otherwise false. + @note When selecting ::NTV2_CSC_Method_Enhanced_4K as the method, the channel must be ::NTV2_CHANNEL1 or ::NTV2_CHANNEL5. + This will group four CSCs together to process the 4K image. To leave 4K, take CSC 1 (or CSC 5) out of 4K mode. + @see CNTV2Card::GetColorSpaceMethod, \ref vidop-csc and \ref widget_csc + **/ + AJA_VIRTUAL bool SetColorSpaceMethod (const NTV2ColorSpaceMethod inCSCMethod, const NTV2Channel inChannel); + + /** + @brief Answers with the current operating mode of the given color space converter. + @param[out] outMethod Receives the CSC's current operating method. + @param[in] inChannel Optionally specifies the CSC of interest, a zero-based index value expressed as an ::NTV2Channel. + Defaults to ::NTV2_CHANNEL1 (CSC1). + @return True if successful; otherwise false. + @see CNTV2Card::SetColorSpaceMethod, \ref vidop-csc and \ref widget_csc + **/ + AJA_VIRTUAL bool GetColorSpaceMethod (NTV2ColorSpaceMethod & outMethod, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Sets the matrix type to be used for the given CSC, typically ::NTV2_Rec601Matrix or ::NTV2_Rec709Matrix. + @param[in] inType Specifies the matrix type to be used. + @param[in] inChannel Optionally specifies the CSC of interest, a zero-based index value expressed as an ::NTV2Channel. + Defaults to ::NTV2_CHANNEL1 (CSC1). + @return True if successful; otherwise false. + @see CNTV2Card::GetColorSpaceMatrixSelect, \ref vidop-csc and \ref widget_csc + **/ + AJA_VIRTUAL bool SetColorSpaceMatrixSelect (const NTV2ColorSpaceMatrixType inType, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers with the current matrix type being used for the given CSC. + @param[out] outType Receives the matrix type being used, typically ::NTV2_Rec601Matrix or ::NTV2_Rec709Matrix. + @param[in] inChannel Optionally specifies the CSC of interest, a zero-based index value expressed as an ::NTV2Channel. + Defaults to ::NTV2_CHANNEL1 (CSC1). + @return True if successful; otherwise false. + @see CNTV2Card::SetColorSpaceMatrixSelect, \ref vidop-csc and \ref widget_csc + **/ + AJA_VIRTUAL bool GetColorSpaceMatrixSelect (NTV2ColorSpaceMatrixType & outType, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Sends the given color lookup tables (LUTs) to the given LUT and bank. + @param[in] inRedLUT The Red LUT, a std::vector of double-precision floating-point values. + @param[in] inGreenLUT The Green LUT, a std::vector of double-precision floating-point values. + @param[in] inBlueLUT The Blue LUT, a std::vector of double-precision floating-point values. + @param[in] inLUT Specifies the LUT of interest, expressed as an ::NTV2Channel (a zero-based index number). + @param[in] inBank Specifies the LUT bank of interest (0 or 1). + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool DownloadLUTToHW (const NTV2DoubleArray & inRedLUT, const NTV2DoubleArray & inGreenLUT, const NTV2DoubleArray & inBlueLUT, + const NTV2Channel inLUT, const int inBank); + AJA_VIRTUAL bool Download12BitLUTToHW (const NTV2DoubleArray & inRedLUT, const NTV2DoubleArray & inGreenLUT, const NTV2DoubleArray & inBlueLUT, + const NTV2Channel inLUT, const int inBank); + + /** + @brief Writes the LUT tables to the given LUT and bank. + @param[in] inRedLUT The Red LUT, a std::vector of UWord values. + @param[in] inGreenLUT The Green LUT, a std::vector of UWord values. + @param[in] inBlueLUT The Blue LUT, a std::vector of UWord values. + @param[in] inLUT Specifies the LUT of interest, expressed as an ::NTV2Channel (a zero-based index number). + @param[in] inBank Specifies the LUT bank of interest (0 or 1). + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool DownloadLUTToHW (const UWordSequence & inRedLUT, const UWordSequence & inGreenLUT, const UWordSequence & inBlueLUT, + const NTV2Channel inLUT, const int inBank); + AJA_VIRTUAL bool Download12BitLUTToHW (const UWordSequence & inRedLUT, const UWordSequence & inGreenLUT, const UWordSequence & inBlueLUT, + const NTV2Channel inLUT, const int inBank); + + /** + @brief Enables or disables the given LUT. + @param[in] inEnable Specify true to enable, or false to disable. + @param[in] inLUT Specifies the LUT of interest, expressed as an ::NTV2Channel (a zero-based index number). + @return True if successful; otherwise false. + @note This function only affects devices having version 2 LUTs (see ::NTV2DeviceGetLUTVersion). + **/ + AJA_VIRTUAL bool SetLUTEnable (const bool inEnable, const NTV2Channel inLUT); + + static bool GenerateGammaTable (const NTV2LutType inLUTType, const int inBank, NTV2DoubleArray & outTable, const NTV2LutBitDepth inBitDepth = NTV2_LUT10Bit); + static bool GenerateGammaTable (const NTV2LutType inLUTType, const int inBank, UWordSequence & outTable, const NTV2LutBitDepth inBitDepth = NTV2_LUT10Bit); + + /** + @brief Writes the LUT tables. + @param[in] inRedLUT The Red LUT, a std::vector of double-precision floating-point values. + @param[in] inGreenLUT The Green LUT, a std::vector of double-precision floating-point values. + @param[in] inBlueLUT The Blue LUT, a std::vector of double-precision floating-point values. + @return True if successful; otherwise false. + @note Version 2 LUTs (see ::NTV2DeviceGetLUTVersion) require setup of ::kRegLUTV2Control (register 376) + for this function to work properly. + **/ + AJA_VIRTUAL bool LoadLUTTables (const NTV2DoubleArray & inRedLUT, const NTV2DoubleArray & inGreenLUT, const NTV2DoubleArray & inBlueLUT); + AJA_VIRTUAL bool Load12BitLUTTables (const NTV2DoubleArray & inRedLUT, const NTV2DoubleArray & inGreenLUT, const NTV2DoubleArray & inBlueLUT); + + /** + @brief Writes the LUT tables. + @param[in] inRedLUT The Red LUT, a std::vector of unsigned 10-bit integer values. + @param[in] inGreenLUT The Green LUT, a std::vector of unsigned 10-bit integer values. + @param[in] inBlueLUT The Blue LUT, a std::vector of unsigned 10-bit integer values. + @return True if successful; otherwise false. + @note Version 2 LUTs (see ::NTV2DeviceGetLUTVersion) require setup of ::kRegLUTV2Control (register 376) + for this function to work properly. + **/ + AJA_VIRTUAL bool WriteLUTTables (const UWordSequence & inRedLUT, const UWordSequence & inGreenLUT, const UWordSequence & inBlueLUT); + AJA_VIRTUAL bool Write12BitLUTTables (const UWordSequence & inRedLUT, const UWordSequence & inGreenLUT, const UWordSequence & inBlueLUT); + + /** + @brief Reads the LUT tables (as double-precision floating point values). + @param[out] outRedLUT Receives the Red LUT, a std::vector of double-precision floating-point values. + @param[out] outGreenLUT Receives the Green LUT, a std::vector of double-precision floating-point values. + @param[out] outBlueLUT Receives the Blue LUT, a std::vector of double-precision floating-point values. + @return True if successful; otherwise false. + @note Version 2 LUTs (see ::NTV2DeviceGetLUTVersion) require setup of ::kRegLUTV2Control (register 376) + for this function to work properly. + **/ + AJA_VIRTUAL bool GetLUTTables (NTV2DoubleArray & outRedLUT, NTV2DoubleArray & outGreenLUT, NTV2DoubleArray & outBlueLUT); + AJA_VIRTUAL bool Get12BitLUTTables (NTV2DoubleArray & outRedLUT, NTV2DoubleArray & outGreenLUT, NTV2DoubleArray & outBlueLUT); + + /** + @brief Reads the LUT tables (as raw, unsigned 10-bit integers). + @param[out] outRedLUT Receives the Red LUT as a vector of unsigned 10-bit values (0-1023). + @param[out] outGreenLUT Receives the Green LUT as a vector of unsigned 10-bit values (0-1023). + @param[out] outBlueLUT Receives the Blue LUT as a vector of unsigned 10-bit values (0-1023). + @return True if successful; otherwise false. + @note Version 2 LUTs (see ::NTV2DeviceGetLUTVersion) require setup of ::kRegLUTV2Control (register 376) + for this function to work properly. + **/ + AJA_VIRTUAL bool ReadLUTTables (UWordSequence & outRedLUT, UWordSequence & outGreenLUT, UWordSequence & outBlueLUT); + AJA_VIRTUAL bool Read12BitLUTTables (UWordSequence & outRedLUT, UWordSequence & outGreenLUT, UWordSequence & outBlueLUT); + + AJA_VIRTUAL bool SetLUTV2HostAccessBank (const NTV2ColorCorrectionHostAccessBank inValue); + AJA_VIRTUAL bool GetLUTV2HostAccessBank (NTV2ColorCorrectionHostAccessBank & outValue, const NTV2Channel inChannel); + + AJA_VIRTUAL bool SetLUTV2OutputBank (const NTV2Channel inLUTWidget, const ULWord inBank); + AJA_VIRTUAL bool GetLUTV2OutputBank (const NTV2Channel inLUTWidget, ULWord & outBank); + + AJA_VIRTUAL bool Has12BitLUTSupport (void); + + /** + @brief Sets the LUT plane. + @param[in] inLUTPlane Specifies the LUT plane of interest. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool Set12BitLUTPlaneSelect (const NTV2LUTPlaneSelect inLUTPlane); + + /** + @brief Answers with the current LUT plane. + @param[out] outLUTPlane Receives the current LUT plane. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool Get12BitLUTPlaneSelect (NTV2LUTPlaneSelect & outLUTPlane); + + /** + @brief Sets the RGB range for the given CSC. + @param[in] inRange Specifies the new RGB range (::NTV2_CSC_RGB_RANGE_FULL or ::NTV2_CSC_RGB_RANGE_SMPTE). + @param[in] inChannel Optionally specifies the CSC of interest, a zero-based index value expressed as an ::NTV2Channel. + Call ::NTV2DeviceGetNumCSCs to determine the number of available CSCs on the device. + Defaults to ::NTV2_CHANNEL1 (CSC1). + @return True if successful; otherwise false. + @see CNTV2Card::GetColorSpaceRGBBlackRange, \ref vidop-csc and \ref widget_csc + **/ + AJA_VIRTUAL bool SetColorSpaceRGBBlackRange (const NTV2_CSC_RGB_Range inRange, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers with the current RGB range being used by a given CSC. + @param[out] outRange Receives the RGB range (::NTV2_CSC_RGB_RANGE_FULL, ::NTV2_CSC_RGB_RANGE_SMPTE, or ::NTV2_CSC_RGB_RANGE_INVALID upon failure). + @param[in] inChannel Optionally specifies the CSC of interest, a zero-based index value expressed as an ::NTV2Channel. + Call ::NTV2DeviceGetNumCSCs to determine the number of available CSCs on the device. + Defaults to ::NTV2_CHANNEL1 (CSC1). + @return True if successful; otherwise false. + @see CNTV2Card::SetColorSpaceRGBBlackRange, \ref vidop-csc and \ref widget_csc + **/ + AJA_VIRTUAL bool GetColorSpaceRGBBlackRange (NTV2_CSC_RGB_Range & outRange, const NTV2Channel inChannel = NTV2_CHANNEL1); + + AJA_VIRTUAL bool SetColorSpaceUseCustomCoefficient (const ULWord inUseCustomCoefficient, const NTV2Channel inChannel = NTV2_CHANNEL1); + AJA_VIRTUAL bool GetColorSpaceUseCustomCoefficient (ULWord & outUseCustomCoefficient, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Specifies whether or not the given CSC will produce alpha channel data from its key input. + @param[in] inMakeAlphaFromKey Specify true to have the CSC generate alpha channel data from a YCbCr video signal + applied to its Key Input; otherwise specify false to have it generate an "opaque" value. + @param[in] inChannel Optionally specifies the CSC of interest, a zero-based index value expressed as an ::NTV2Channel. + Call ::NTV2DeviceGetNumCSCs to determine the number of available CSCs on the device. + Defaults to ::NTV2_CHANNEL1 (CSC1). + @return True if successful; otherwise false. + @see CNTV2Card::GetColorSpaceMakeAlphaFromKey, \ref vidop-csc and \ref widget_csc + **/ + AJA_VIRTUAL bool SetColorSpaceMakeAlphaFromKey (const bool inMakeAlphaFromKey, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers whether or not the given CSC is set to produce alpha channel data from its key input. + @param[out] outMakeAlphaFromKey Receives true if the CSC is generating alpha channel data from the YCbCr video signal + being applied to its Key Input; otherwise receives false. + @param[in] inChannel Optionally specifies the CSC of interest, a zero-based index value expressed as an ::NTV2Channel. + Call ::NTV2DeviceGetNumCSCs to determine the number of available CSCs on the device. + Defaults to ::NTV2_CHANNEL1 (CSC1). + @return True if successful; otherwise false. + @see CNTV2Card::SetColorSpaceMakeAlphaFromKey, \ref vidop-csc and \ref widget_csc + **/ + AJA_VIRTUAL bool GetColorSpaceMakeAlphaFromKey (ULWord & outMakeAlphaFromKey, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers whether or not the video signal present at the CSC’s Key Input is in sync with the video signal present + at its Video Input. + @param[out] outVideoKeySyncFail Receives true if the video signal present at the CSC’s Key Input is NOT sync'd to the + video signal present at its Video Input; otherwise receives false. + @param[in] inChannel Optionally specifies the CSC of interest, a zero-based index value expressed as an ::NTV2Channel. + Call ::NTV2DeviceGetNumCSCs to determine the number of available CSCs on the device. + Defaults to ::NTV2_CHANNEL1 (CSC1). + @return True if successful; otherwise false. + @see CNTV2Card::GetColorSpaceMakeAlphaFromKey, CNTV2Card::SetColorSpaceMakeAlphaFromKey, \ref vidop-csc and \ref widget_csc + @note The "outVideoKeySyncFail" result is valid and trustworthy when all of the following are true: + - the Video Input is connected to a YCbCr signal source crosspoint; + - the CSC's "Make Alpha From Key" setting is enabled; + - the Key Input is connected to a YCbCr signal source crosspoint. + **/ + AJA_VIRTUAL bool GetColorSpaceVideoKeySyncFail (bool & outVideoKeySyncFail, const NTV2Channel inChannel = NTV2_CHANNEL1); + + AJA_VIRTUAL bool SetColorSpaceCustomCoefficients (const NTV2CSCCustomCoeffs & inCustomCoefficients, const NTV2Channel inChannel = NTV2_CHANNEL1); + AJA_VIRTUAL bool GetColorSpaceCustomCoefficients (NTV2CSCCustomCoeffs & outCustomCoefficients, const NTV2Channel inChannel = NTV2_CHANNEL1); + + AJA_VIRTUAL bool SetColorSpaceCustomCoefficients12Bit (const NTV2CSCCustomCoeffs & inCustomCoefficients, const NTV2Channel inChannel = NTV2_CHANNEL1); + AJA_VIRTUAL bool GetColorSpaceCustomCoefficients12Bit (NTV2CSCCustomCoeffs & outCustomCoefficients, const NTV2Channel inChannel = NTV2_CHANNEL1); + + AJA_VIRTUAL bool SetLUTControlSelect (const NTV2LUTControlSelect inLUTSelect); + AJA_VIRTUAL bool GetLUTControlSelect (NTV2LUTControlSelect & outLUTSelect); + + // + // Color Correction Functions (KHD only ) + // + AJA_VIRTUAL bool SetColorCorrectionMode(const NTV2Channel inChannel, const NTV2ColorCorrectionMode inMode); + AJA_VIRTUAL bool GetColorCorrectionMode(const NTV2Channel inChannel, NTV2ColorCorrectionMode & outMode); + + /** + @brief Sets the LUT bank to be used for the given LUT. + @param[in] inLUTWidget Specifies the LUT widget of interest as an ::NTV2Channel, a zero-based index number. + @param[in] inBank Specifies the bank number to be used. Must be 0 or 1. + @return True if successful; otherwise false. + @see CNTV2Card::GetColorCorrectionOutputBank, \ref vidop-lut + **/ + AJA_VIRTUAL bool SetColorCorrectionOutputBank (const NTV2Channel inLUTWidget, const ULWord inBank); + + /** + @brief Answers with the current LUT bank in use for the given LUT. + @param[in] inLUTWidget Specifies the LUT widget of interest as an ::NTV2Channel, a zero-based index number. + @param[out] outBank Receives the bank number that's currently in use (0 or 1). + @return True if successful; otherwise false. + @see CNTV2Card::SetColorCorrectionOutputBank, \ref vidop-lut + **/ + AJA_VIRTUAL bool GetColorCorrectionOutputBank (const NTV2Channel inLUTWidget, ULWord & outBank); + + AJA_VIRTUAL bool SetColorCorrectionHostAccessBank (const NTV2ColorCorrectionHostAccessBank inValue); + AJA_VIRTUAL bool GetColorCorrectionHostAccessBank (NTV2ColorCorrectionHostAccessBank & outValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + + AJA_VIRTUAL bool SetColorCorrectionSaturation (const NTV2Channel inChannel, const ULWord inValue); + AJA_VIRTUAL bool GetColorCorrectionSaturation (const NTV2Channel inChannel, ULWord & outValue); + + AJA_VIRTUAL bool SetDitherFor8BitInputs (const NTV2Channel inChannel, const ULWord inDither); + AJA_VIRTUAL bool GetDitherFor8BitInputs (const NTV2Channel inChannel, ULWord & outDither); + + // Old APIs + static NTV2_SHOULD_BE_DEPRECATED(bool GenerateGammaTable (const NTV2LutType inLUTType, const int inBank, double * pOutTable)); + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(NTV2ColorSpaceMethod GetColorSpaceMethod (const NTV2Channel inChannel)); + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool DownloadLUTToHW(const double * pInTable, const NTV2Channel inChannel, const int inBank)); + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool LoadLUTTable (const double * pInTable)); + ///@} + + + AJA_VIRTUAL bool SetSecondaryVideoFormat(NTV2VideoFormat inFormat); // RETAIL USE ONLY + AJA_VIRTUAL bool GetSecondaryVideoFormat(NTV2VideoFormat & outFormat); // RETAIL USE ONLY + + #if !defined(R2_DEPRECATE) + AJA_VIRTUAL bool SetInputVideoSelect (NTV2InputVideoSelect inInputSelect); // RETAIL USE ONLY + AJA_VIRTUAL bool GetInputVideoSelect(NTV2InputVideoSelect & outInputSelect); // RETAIL USE ONLY + #endif + + // -------------------------------------------- + // GetNTV2VideoFormat functions + // @deprecated These static functions don't work correctly, and will be deprecated. + // For a given frame rate, geometry and transport, there may be 2 (or more!) possible matching video formats. + // The improved GetNTV2VideoFormat function may return a new CNTV2SDIVideoInfo object that can be interrogated about many things. + // @note This function originated in CNTV2Status. + static NTV2VideoFormat GetNTV2VideoFormat (NTV2FrameRate frameRate, UByte inputGeometry, bool progressiveTransport, bool isThreeG, bool progressivePicture=false); + static NTV2VideoFormat GetNTV2VideoFormat (NTV2FrameRate frameRate, NTV2Standard standard, bool isThreeG, UByte inputGeometry=0, bool progressivePicture=false, bool isSquareDivision = true); + // -------------------------------------------- + + #if !defined (NTV2_DEPRECATE) + AJA_VIRTUAL NTV2_DEPRECATED_f(NTV2VideoFormat GetNTV2VideoFormat(UByte status, UByte frameRateHiBit)); ///< @deprecated Does not support progressivePicture, 3G, 2K, etc. + AJA_VIRTUAL NTV2_DEPRECATED_f(NTV2VideoFormat GetNTV2VideoFormat(NTV2FrameRate frameRate, NTV2Standard standard)); ///< @deprecated Does not support progressivePicture, 3G, 2K, etc. + AJA_VIRTUAL NTV2_DEPRECATED_f(NTV2VideoFormat GetNTV2VideoFormat(NTV2FrameRate frameRate, UByte inputGeometry, bool progressiveTransport)); ///< @deprecated Does not support progressivePicture, 3G, etc. + #else // else defined (NTV2_DEPRECATE) +protected: + #endif // else defined (NTV2_DEPRECATE) + #if !defined (NTV2_DEPRECATE) + AJA_VIRTUAL NTV2_DEPRECATED_f(NTV2VideoFormat GetInput1VideoFormat (bool progressivePicture = false)); ///< @deprecated Use GetInputVideoFormat or GetSDIInputVideoFormat instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(NTV2VideoFormat GetInput2VideoFormat (bool progressivePicture = false)); ///< @deprecated Use GetInputVideoFormat or GetSDIInputVideoFormat instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(NTV2VideoFormat GetInput3VideoFormat (bool progressivePicture = false)); ///< @deprecated Use GetInputVideoFormat or GetSDIInputVideoFormat instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(NTV2VideoFormat GetInput4VideoFormat (bool progressivePicture = false)); ///< @deprecated Use GetInputVideoFormat or GetSDIInputVideoFormat instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(NTV2VideoFormat GetInput5VideoFormat (bool progressivePicture = false)); ///< @deprecated Use GetInputVideoFormat or GetSDIInputVideoFormat instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(NTV2VideoFormat GetInput6VideoFormat (bool progressivePicture = false)); ///< @deprecated Use GetInputVideoFormat or GetSDIInputVideoFormat instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(NTV2VideoFormat GetInput7VideoFormat (bool progressivePicture = false)); ///< @deprecated Use GetInputVideoFormat or GetSDIInputVideoFormat instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(NTV2VideoFormat GetInput8VideoFormat (bool progressivePicture = false)); ///< @deprecated Use GetInputVideoFormat or GetSDIInputVideoFormat instead. + #endif + +public: + /** + @brief Returns the video format of the signal that is present on the given input source. + @param[in] inVideoSource Specifies the video input source as an ::NTV2InputSource. + @param[in] inIsProgressive Optionally specifies if the video format is expected to be progressive or not. + Defaults to false (presumed to be interlaced). + @return A valid ::NTV2VideoFormat if successful; otherwise returns ::NTV2_FORMAT_UNKNOWN. + @details This function allows client applications to determine the kind of video signal, if any, is being presented + to a given input source of the device. Because the hardware has no way of knowing if the incoming signal + is progressive or interlaced (e.g., 525/29.97fps progressive versus 525/59.94fps interlaced), + the function assumes interlaced, but the caller can override the function's "interlace" assumption. + **/ + AJA_VIRTUAL NTV2VideoFormat GetInputVideoFormat (const NTV2InputSource inVideoSource = NTV2_INPUTSOURCE_SDI1, const bool inIsProgressive = false); + + /** + @brief Returns the video format of the signal that is present on the given SDI input source. + @param[in] inChannel Specifies the SDI input connector as an ::NTV2Channel value, a zero-based index number. + @param[in] inIsProgressive Optionally specifies if the video format is expected to be progressive or not. + Defaults to false (presumed to be interlaced). + @return A valid ::NTV2VideoFormat if successful; otherwise returns ::NTV2_FORMAT_UNKNOWN. + @details This function allows client applications to determine the kind of video signal, if any, is being presented + to a given input source of the device. Because the hardware has no way of knowing if the incoming signal + is progressive or interlaced (e.g., 525/29.97fps progressive versus 525/59.94fps interlaced), + the function assumes interlaced, but the caller can override this assumption. + **/ + AJA_VIRTUAL NTV2VideoFormat GetSDIInputVideoFormat (NTV2Channel inChannel, bool inIsProgressive = false); + + /** + @return A valid ::NTV2VideoFormat if successful; otherwise returns ::NTV2_FORMAT_UNKNOWN. + @param[in] inHDMIInput Specifies the HDMI input of interest as an ::NTV2Channel, a zero-based index value. + Defaults to ::NTV2_CHANNEL1 (the first HDMI input). + **/ + AJA_VIRTUAL NTV2VideoFormat GetHDMIInputVideoFormat (NTV2Channel inHDMIInput = NTV2_CHANNEL1); + + /** + @brief Returns the video format of the signal that is present on the device's analog video input. + @return A valid ::NTV2VideoFormat if successful; otherwise returns ::NTV2_FORMAT_UNKNOWN. + **/ + AJA_VIRTUAL NTV2VideoFormat GetAnalogInputVideoFormat (void); + + /** + @brief Returns the video format of the signal that is present on the device's composite video input. + @return A valid ::NTV2VideoFormat if successful; otherwise returns ::NTV2_FORMAT_UNKNOWN. + **/ + AJA_VIRTUAL NTV2VideoFormat GetAnalogCompositeInputVideoFormat (void); + + /** + @brief Returns the video format of the signal that is present on the device's reference input. + @return A valid ::NTV2VideoFormat if successful; otherwise returns ::NTV2_FORMAT_UNKNOWN. + @note The returned video format, if valid, will be an SD format for black burst and HD for tri-level. + **/ + AJA_VIRTUAL NTV2VideoFormat GetReferenceVideoFormat (void); + + AJA_VIRTUAL NTV2FrameRate GetSDIInputRate (const NTV2Channel channel); + AJA_VIRTUAL NTV2FrameGeometry GetSDIInputGeometry (const NTV2Channel channel); + AJA_VIRTUAL bool GetSDIInputIsProgressive (const NTV2Channel channel); + + AJA_VIRTUAL bool GetSDIInput3GPresent (bool & outValue, const NTV2Channel channel); + #if !defined (NTV2_DEPRECATE) + AJA_VIRTUAL NTV2_DEPRECATED_f(NTV2VideoFormat GetInputVideoFormat (int inputNum, bool progressivePicture = false)); ///< @deprecated Use GetInputVideoFormat(NTV2InputSource...) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDIInput3GPresent (bool* value, NTV2Channel channel)); ///< @deprecated Use GetSDIInput3GPresent(bool&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDI1Input3GPresent (bool* value)); ///< @deprecated Use GetSDIInput3GPresent(bool&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDI2Input3GPresent (bool* value)); ///< @deprecated Use GetSDIInput3GPresent(bool&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDI3Input3GPresent (bool* value)); ///< @deprecated Use GetSDIInput3GPresent(bool&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDI4Input3GPresent (bool* value)); ///< @deprecated Use GetSDIInput3GPresent(bool&,NTV2Channel) instead. + #endif // !NTV2_DEPRECATE + + AJA_VIRTUAL bool GetSDIInput3GbPresent (bool & outValue, const NTV2Channel channel); + + AJA_VIRTUAL bool GetSDIInput6GPresent (bool & outValue, const NTV2Channel channel); + AJA_VIRTUAL bool GetSDIInput12GPresent (bool & outValue, const NTV2Channel channel); + + #if !defined (NTV2_DEPRECATE) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDIInput3GbPresent (bool* value, NTV2Channel channel)); ///< @deprecated Use GetSDIInput3GbPresent(bool&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDI1Input3GbPresent (bool* value)); ///< @deprecated Use GetSDIInput3GbPresent(bool&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDI2Input3GbPresent (bool* value)); ///< @deprecated Use GetSDIInput3GbPresent(bool&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDI3Input3GbPresent (bool* value)); ///< @deprecated Use GetSDIInput3GbPresent(bool&,NTV2Channel) instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDI4Input3GbPresent (bool* value)); ///< @deprecated Use GetSDIInput3GbPresent(bool&,NTV2Channel) instead. + + // Kona/Xena LS specific + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetLSVideoADCMode(NTV2LSVideoADCMode value)); ///< @deprecated The Kona/Xena LS is obsolete and unsupported. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetLSVideoADCMode(NTV2LSVideoADCMode* value)); ///< @deprecated The Kona/Xena LS is obsolete and unsupported. + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetKLSInputSelect(NTV2InputSource value)); ///< @deprecated The Kona/Xena LS is obsolete and unsupported. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetKLSInputSelect(NTV2InputSource* value)); ///< @deprecated The Kona/Xena LS is obsolete and unsupported. + + // Kona/Xena LH specific + // Used to pick downconverter on inputs(sd bitfile only) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetLHDownconvertInput(bool value)); ///< @deprecated The Kona/Xena LH is obsolete and unsupported. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetLHDownconvertInput(bool* value)); ///< @deprecated The Kona/Xena LH is obsolete and unsupported. + + // Used to pick downconverter on outputs(hd bitfile only) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetLHSDIOutput1Select(NTV2LHOutputSelect value)); ///< @deprecated The Kona/Xena LH is obsolete and unsupported. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetLHSDIOutput1Select(NTV2LHOutputSelect* value)); ///< @deprecated The Kona/Xena LH is obsolete and unsupported. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetLHSDIOutput2Select(NTV2LHOutputSelect value)); ///< @deprecated The Kona/Xena LH is obsolete and unsupported. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetLHSDIOutput2Select(NTV2LHOutputSelect* value)); ///< @deprecated The Kona/Xena LH is obsolete and unsupported. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetLHAnalogOutputSelect(NTV2LHOutputSelect value)); ///< @deprecated The Kona/Xena LH is obsolete and unsupported. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetLHAnalogOutputSelect(NTV2LHOutputSelect* value)); ///< @deprecated The Kona/Xena LH is obsolete and unsupported. + #endif // !NTV2_DEPRECATE + +#if !defined (NTV2_DEPRECATE) + + #define GETXPTMACRO(_InputXpt_) if (!pOutOutputXpt) return false; \ + NTV2OutputCrosspointID outputXpt (NTV2_XptBlack); \ + if (!GetConnectedOutput ((_InputXpt_), outputXpt)) return false; \ + *pOutOutputXpt = outputXpt; \ + return true; + + /** + @brief Backtraces the current signal routing from the given output channel to determine the video format being used, + then sets the output standard based on that format. + @note This functionality is now performed automatically by the driver when AutoCirculate is initialized. + @note This function will be deprecated in a future SDK. + **/ + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetVideoOutputStandard (const NTV2Channel inChannel)); ///< @deprecated This function is obsolete. + // kRegXptSelectGroup1 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptCompressionModInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptCompressionModInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptCompressionModInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptCompressionModInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptConversionModInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptConversionModInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptConversionModInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptConversionModInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptColorSpaceConverterInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptCSC1VidInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptColorSpaceConverterInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptCSC1VidInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptCSC1VidInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptCSC1VidInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptCSC1VidInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptCSC1VidInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptLUTInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptLUT1Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptLUTInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptLUT1Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup2 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptDuallinkOutInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptDualLinkOut1Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptDuallinkOutInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptDualLinkOut1Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptFrameSync2InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptFrameSync2Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptFrameSync2InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptFrameSync2Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptFrameSync1InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptFrameSync1Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptFrameSync1InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptFrameSync1Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptFrameBuffer1InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptFrameBuffer1Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptFrameBuffer1InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptFrameBuffer1Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup3 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptCSC1KeyInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptCSC1KeyInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptCSC1KeyInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptCSC1KeyInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptSDIOut2InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptSDIOut2Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptSDIOut2InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptSDIOut2Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptSDIOut1InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptSDIOut1Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptSDIOut1InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptSDIOut1Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptAnalogOutInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptAnalogOutInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptAnalogOutInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptAnalogOutInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup4 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptMixer1BGKeyInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptMixer1BGKeyInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptMixer1BGKeyInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptMixer1BGKeyInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptMixer1BGVidInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptMixer1BGVidInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptMixer1BGVidInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptMixer1BGVidInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptMixer1FGKeyInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptMixer1FGKeyInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptMixer1FGKeyInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptMixer1FGKeyInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptMixer1FGVidInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptMixer1FGVidInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptMixer1FGVidInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptMixer1FGVidInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup5 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptCSC2KeyInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptCSC2KeyInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptCSC2KeyInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptCSC2KeyInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptCSC2VidInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptCSC2VidInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptCSC2VidInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptCSC2VidInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptLUT2InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptLUT2Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptLUT2InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptLUT2Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptFrameBuffer2InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptFrameBuffer2Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptFrameBuffer2InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptFrameBuffer2Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup6 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptWaterMarkerInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptWaterMarker1Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptWaterMarkerInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptWaterMarker1Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptIICTInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptIICT1Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptIICTInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptIICT1Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptHDMIOutInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptHDMIOutInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptHDMIOutInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptHDMIOutInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptSecondConverterInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptConversionMod2Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptSecondConverterInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptConversionMod2Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup7 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptWaterMarker2InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptWaterMarker2Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptWaterMarker2InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptWaterMarker2Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptIICT2InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptIICT2Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptIICT2InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptIICT2Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptDuallinkOut2InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptDualLinkOut2Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptDuallinkOut2InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptDualLinkOut2Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup8 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptSDIOut3InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptSDIOut3Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptSDIOut3InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptSDIOut3Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptSDIOut4InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptSDIOut4Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptSDIOut4InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptSDIOut4Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptSDIOut5InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptSDIOut5Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptSDIOut5InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptSDIOut5Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup9 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptMixer2BGKeyInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptMixer2BGKeyInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptMixer2BGKeyInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptMixer2BGKeyInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptMixer2BGVidInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptMixer2BGVidInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptMixer2BGVidInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptMixer2BGVidInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptMixer2FGKeyInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptMixer2FGKeyInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptMixer2FGKeyInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptMixer2FGKeyInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptMixer2FGVidInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptMixer2FGVidInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptMixer2FGVidInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptMixer2FGVidInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup10 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptSDIOut1DS2InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptSDIOut1InputDS2, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptSDIOut1DS2InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptSDIOut1InputDS2);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptSDIOut2DS2InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptSDIOut2InputDS2, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptSDIOut2DS2InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptSDIOut2InputDS2);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup11 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptDualLinkIn1Select (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptDualLinkIn1Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptDualLinkIn1Select (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptDualLinkIn1Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptDualLinkIn1DSSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptDualLinkIn1DSInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptDualLinkIn1DSSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptDualLinkIn1DSInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptDualLinkIn2Select (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptDualLinkIn2Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptDualLinkIn2Select (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptDualLinkIn2Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptDualLinkIn2DSSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptDualLinkIn2DSInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptDualLinkIn2DSSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptDualLinkIn2DSInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup12 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptLUT3InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptLUT3Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptLUT3InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptLUT3Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptLUT4InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptLUT4Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptLUT4InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptLUT4Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptLUT5InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptLUT5Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptLUT5InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptLUT5Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup13 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptFrameBuffer3InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptFrameBuffer3Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptFrameBuffer3InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptFrameBuffer3Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptFrameBuffer4InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptFrameBuffer4Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptFrameBuffer4InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptFrameBuffer4Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup14 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptSDIOut3DS2InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptSDIOut3InputDS2, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptSDIOut3DS2InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptSDIOut3InputDS2);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptSDIOut4DS2InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptSDIOut4InputDS2, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptSDIOut4DS2InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptSDIOut4InputDS2);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptSDIOut5DS2InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptSDIOut5InputDS2, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptSDIOut5DS2InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptSDIOut5InputDS2);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup15 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptDualLinkIn3Select (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptDualLinkIn3Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptDualLinkIn3Select (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptDualLinkIn3Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptDualLinkIn3DSSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptDualLinkIn3DSInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptDualLinkIn3DSSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptDualLinkIn3DSInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptDualLinkIn4Select (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptDualLinkIn4Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptDualLinkIn4Select (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptDualLinkIn4Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptDualLinkIn4DSSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptDualLinkIn4DSInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptDualLinkIn4DSSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptDualLinkIn4DSInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup16 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptDuallinkOut3InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptDualLinkOut3Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptDuallinkOut3InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptDualLinkOut3Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptDuallinkOut4InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptDualLinkOut4Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptDuallinkOut4InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptDualLinkOut4Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptDuallinkOut5InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptDualLinkOut5Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptDuallinkOut5InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptDualLinkOut5Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup17 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptCSC3VidInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptCSC3VidInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptCSC3VidInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptCSC3VidInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptCSC3KeyInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptCSC3KeyInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptCSC3KeyInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptCSC3KeyInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptCSC4VidInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptCSC4VidInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptCSC4VidInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptCSC4VidInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptCSC4KeyInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptCSC4KeyInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptCSC4KeyInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptCSC4KeyInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup18 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptCSC5VidInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptCSC5VidInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptCSC5VidInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptCSC5VidInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptCSC5KeyInputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptCSC5KeyInput, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptCSC5KeyInputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptCSC5KeyInput);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup19 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXpt4KDCQ1InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_Xpt4KDCQ1Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXpt4KDCQ1InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_Xpt4KDCQ1Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXpt4KDCQ2InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_Xpt4KDCQ2Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXpt4KDCQ2InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_Xpt4KDCQ2Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXpt4KDCQ3InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_Xpt4KDCQ3Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXpt4KDCQ3InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_Xpt4KDCQ3Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXpt4KDCQ4InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_Xpt4KDCQ4Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXpt4KDCQ4InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_Xpt4KDCQ4Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + // kRegXptSelectGroup20 + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptHDMIOutV2Q1InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptHDMIOutQ1Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptHDMIOutV2Q1InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptHDMIOutQ1Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptHDMIOutV2Q2InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptHDMIOutQ2Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptHDMIOutV2Q2InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptHDMIOutQ2Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptHDMIOutV2Q3InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptHDMIOutQ3Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptHDMIOutV2Q3InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptHDMIOutQ3Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetXptHDMIOutV2Q4InputSelect (const NTV2OutputCrosspointID inOutputXpt)) {return Connect (NTV2_XptHDMIOutQ4Input, inOutputXpt);} ///< @deprecated Use CNTV2Card::Connect or CNTV2Card::Disconnect instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetXptHDMIOutV2Q4InputSelect (NTV2OutputCrosspointID * pOutOutputXpt)) {GETXPTMACRO (NTV2_XptHDMIOutQ4Input);} ///< @deprecated Use CNTV2Card::GetConnectedOutput instead. +#endif // !defined (NTV2_DEPRECATE) + + /** + @name Signal Routing + **/ + ///@{ + + /** + @brief Answers with the currently connected NTV2OutputCrosspointID for the given NTV2InputCrosspointID. + @param[in] inInputXpt Specifies the input (signal sink) of interest. + @param[out] outOutputXpt Receives the output (signal source) the given input is connected to (if connected), + or NTV2_XptBlack if not connected. + @return True if successful; otherwise false. + @see \ref ntv2signalrouting, CNTV2Card::GetConnectedInput, CNTV2Card::IsConnected + **/ + AJA_VIRTUAL bool GetConnectedOutput (const NTV2InputCrosspointID inInputXpt, NTV2OutputCrosspointID & outOutputXpt); + + /** + @brief Answers with a connected NTV2InputCrosspointID for the given NTV2OutputCrosspointID. + @param[in] inOutputXpt Specifies the output (signal source) of interest. + @param[out] outInputXpt Receives one of the input (signal sink) the given output is connected to (if connected), + or NTV2_XptBlack if not connected. + @return True if successful; otherwise false. + @see \ref ntv2signalrouting, CNTV2Card::GetConnectedOutput, CNTV2Card::IsConnected + @bug If the output is connected to more than one widget input, this function only returns the first one found. + **/ + AJA_VIRTUAL bool GetConnectedInput (const NTV2OutputCrosspointID inOutputXpt, NTV2InputCrosspointID & outInputXpt); + + /** + @brief Answers with all of the NTV2InputCrosspointIDs that are connected to the given NTV2OutputCrosspointID. + @param[in] inOutputXpt Specifies the output (signal source) of interest. + @param[out] outInputXpts Receives the ::NTV2InputCrosspointIDSet of the inputs (signal sinks) the given output + is connected to (if connected). If none are connected, the set will be empty. + @return True if successful; otherwise false. + @see \ref ntv2signalrouting, CNTV2Card::GetConnectedOutput, CNTV2Card::IsConnected + **/ + AJA_VIRTUAL bool GetConnectedInputs (const NTV2OutputCrosspointID inOutputXpt, NTV2InputCrosspointIDSet & outInputXpts); // New in SDK 15.5 + + /** + @brief Connects the given widget signal input (sink) to the given widget signal output (source). + @param[in] inInputXpt Specifies the input (signal sink) to be connected to the given output. + @param[in] inOutputXpt Specifies the output (signal source) to be connected to the given input. + Specifying NTV2_XptBlack effects a disconnect. + @param[in] inValidate If true, calls NTV2Card::CanConnect to verify that the connection exists in firmware + before writing the crosspoint register; otherwise writes the crosspoint register + regardless. Defaults to false. + @return True if successful; otherwise false. + @see \ref ntv2signalrouting, CNTV2Card::Disconnect, CNTV2Card::IsConnected + **/ + AJA_VIRTUAL bool Connect (const NTV2InputCrosspointID inInputXpt, const NTV2OutputCrosspointID inOutputXpt, const bool inValidate = false); + + /** + @brief Disconnects the given widget signal input (sink) from whatever output (source) it may be connected. + @param[in] inInputXpt Specifies the input (signal sink) to be disconnected. + @return True if successful; otherwise false. + @see \ref ntv2signalrouting, CNTV2Card::Connect + **/ + AJA_VIRTUAL bool Disconnect (const NTV2InputCrosspointID inInputXpt); + + /** + @brief Answers whether or not the given widget signal input (sink) is connected to another output (source). + @param[in] inInputXpt Specifies the input (signal sink) of interest. + @param[out] outIsConnected Receives true if the input is connected to any other output (other than NTV2_XptBlack). + @return True if successful; otherwise false. + @note If the input is connected to NTV2_XptBlack, "outIsConnected" will be "false". + @see \ref ntv2signalrouting, CNTV2Card::IsConnectedTo + **/ + AJA_VIRTUAL bool IsConnected (const NTV2InputCrosspointID inInputXpt, bool & outIsConnected); + + /** + @brief Answers whether or not the given widget signal input (sink) is connected to another output (source). + @param[in] inInputXpt Specifies the input (signal sink) of interest. + @param[in] inOutputXpt Specifies the output (signal source) of interest. It's okay to specify NTV2_XptBlack. + @param[out] outIsConnected Receives true if the input is connected to the specified output. + @return True if successful; otherwise false. + @see CNTV2Card::IsConnected, \ref ntv2signalrouting + **/ + AJA_VIRTUAL bool IsConnectedTo (const NTV2InputCrosspointID inInputXpt, const NTV2OutputCrosspointID inOutputXpt, bool & outIsConnected); + + + /** + @brief Answers whether or not the given widget signal input (sink) can legally be connected to the given signal output (source). + @param[in] inInputXpt Specifies the input (signal sink) of interest. + @param[in] inOutputXpt Specifies the output (signal source) of interest. + @param[out] outCanConnect Receives true if the input can be connected to the specified output; otherwise false. + @return True if successful; otherwise false. + @note This function will return false (failure) if the device firmware doesn't support route validation. + @see \ref ntv2signalrouting, CNTV2Card::Connect + **/ + AJA_VIRTUAL bool CanConnect (const NTV2InputCrosspointID inInputXpt, const NTV2OutputCrosspointID inOutputXpt, bool & outCanConnect); + + + /** + @brief Applies the given routing table to the AJA device. + @return True if successful; otherwise false. + @param[in] inRouter Specifies the CNTV2SignalRouter that contains the routing to be applied to the device. + @param[in] inReplace If true, replaces the device's existing widget routing with the given one. + If false, augments the device's existing widget routing. + Defaults to false. + @details Most modern AJA devices do not have fixed interconnections between inputs, outputs, FrameStores + and the various video processing widgets (e.g., colorspace converters, mixer/keyers, etc.). + Instead, these routing configurations are designated by a set of registers, one for each input + of each widget. The register's value determines which widget output node (crosspoint) the input + is connected to. A zero value in the register means that the input is not connected to anything. + To simplify this process of routing widgets on the device, a set of signal paths (i.e., interconnects) + are built and then applied to the device in this function call. + This function iterates over each connection that's specified in the given routing table and updates + the appropriate register in the device. + @see \ref ntv2signalrouting, CNTV2SignalRouter + **/ + AJA_VIRTUAL bool ApplySignalRoute (const CNTV2SignalRouter & inRouter, const bool inReplace = false); + + + /** + @brief Applies the given widget routing connections to the AJA device. + @return True if successful; otherwise false. + @param[in] inConnections Specifies the routing connections to be applied to the device. + @param[in] inReplace If true, replaces the device's existing widget routing with the given one. + If false, augments the device's existing widget routing. + Defaults to false. + @details Most modern AJA devices do not have fixed interconnections between inputs, outputs, FrameStores + and the various video processing widgets (e.g., colorspace converters, mixer/keyers, etc.). + Instead, these routing configurations are designated by a set of registers, one for each input + of each widget. The register's value determines which widget output node (crosspoint) the input + is connected to. A zero value in the register means that the input is not connected to anything. + To simplify this process of routing widgets on the device, a set of signal paths (i.e., interconnects) + are built and then applied to the device in this function call. + This function iterates over each connection that's specified in the given routing table and updates + the appropriate register in the device. + @see \ref ntv2signalrouting + **/ + AJA_VIRTUAL bool ApplySignalRoute (const NTV2XptConnections & inConnections, const bool inReplace = false); + + /** + @brief Removes the given widget routing connections from the AJA device. + @return True if successful; otherwise false. + @param[in] inConnections Specifies the routing connections to be removed from the device. + @see \ref ntv2signalrouting + **/ + AJA_VIRTUAL bool RemoveConnections (const NTV2XptConnections & inConnections); + + /** + @brief Removes all existing signal path connections between any and all widgets on the AJA device. + @return True if successful; otherwise false. + @details This function writes zeroes into all crosspoint selection registers, effectively + clearing any existing routing configuration on the device. + @see \ref ntv2signalrouting + **/ + AJA_VIRTUAL bool ClearRouting (void); + + /** + @brief Answers with the current signal routing between any and all widgets on the AJA device. + @param[out] outRouting Receives the current signal routing. + @return True if successful; otherwise false. + @see \ref ntv2signalrouting, CNTV2SignalRouter, CNTV2Card::GetRoutingForChannel, CNTV2Card::ApplySignalRoute + **/ + AJA_VIRTUAL bool GetRouting (CNTV2SignalRouter & outRouting); + + /** + @brief Answers with the device's current widget routing connections. + @return True if successful; otherwise false. + @param[out] outConnections Receives the current routing connections. + @see \ref ntv2signalrouting + **/ + AJA_VIRTUAL bool GetConnections (NTV2XptConnections & outConnections); // New in SDK 16.0 + + /** + @brief Answers with the current signal routing for the given channel. + @param[in] inChannel Specifies the NTV2Channel of interest. + @param[out] outRouting Receives the current signal routing for the given channel. + @return True if successful; otherwise false. + @see \ref ntv2signalrouting, CNTV2SignalRouter, CNTV2Card::GetRouting, CNTV2Card::ApplySignalRoute + **/ + AJA_VIRTUAL bool GetRoutingForChannel (const NTV2Channel inChannel, CNTV2SignalRouter & outRouting); + + AJA_VIRTUAL bool HasCanConnectROM (void); ///< @return True if the device firmware has ROM containing legal xpt routes + /** + @brief Answers with the implemented crosspoint connections (if known). + @param[out] outConnections Receives the device's ::NTV2PossibleConnections. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetPossibleConnections (NTV2PossibleConnections & outConnections); + + #if !defined (NTV2_DEPRECATE) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool OutputRoutingTable (const NTV2RoutingTable * pInRoutingTable)); ///< @deprecated Use the ApplySignalRoute call instead. + #endif // !NTV2_DEPRECATE + ///@} + + + /** + @name Analog + @brief These functions only work on devices with analog inputs. + **/ + ///@{ + AJA_VIRTUAL bool WriteSDProcAmpControlsInitialized (const ULWord inNewValue = 1); + AJA_VIRTUAL bool WriteSDBrightnessAdjustment (const ULWord inNewValue); + AJA_VIRTUAL bool WriteSDContrastAdjustment (const ULWord inNewValue); + AJA_VIRTUAL bool WriteSDSaturationAdjustment (const ULWord inNewValue); + AJA_VIRTUAL bool WriteSDHueAdjustment (const ULWord inNewValue); + AJA_VIRTUAL bool WriteSDCbOffsetAdjustment (const ULWord inNewValue); + AJA_VIRTUAL bool WriteSDCrOffsetAdjustment (const ULWord inNewValue); + AJA_VIRTUAL bool WriteHDProcAmpControlsInitialized (const ULWord inNewValue = 1); + AJA_VIRTUAL bool WriteHDBrightnessAdjustment (const ULWord inNewValue); + AJA_VIRTUAL bool WriteHDContrastAdjustment (const ULWord inNewValue); + AJA_VIRTUAL bool WriteHDSaturationAdjustmentCb (const ULWord inNewValue); + AJA_VIRTUAL bool WriteHDSaturationAdjustmentCr (const ULWord inNewValue); + AJA_VIRTUAL bool WriteHDCbOffsetAdjustment (const ULWord inNewValue); + AJA_VIRTUAL bool WriteHDCrOffsetAdjustment (const ULWord inNewValue); + + AJA_VIRTUAL bool ReadSDProcAmpControlsInitialized (ULWord & outValue); + AJA_VIRTUAL bool ReadSDBrightnessAdjustment (ULWord & outValue); + AJA_VIRTUAL bool ReadSDContrastAdjustment (ULWord & outValue); + AJA_VIRTUAL bool ReadSDSaturationAdjustment (ULWord & outValue); + AJA_VIRTUAL bool ReadSDHueAdjustment (ULWord & outValue); + AJA_VIRTUAL bool ReadSDCbOffsetAdjustment (ULWord & outValue); + AJA_VIRTUAL bool ReadSDCrOffsetAdjustment (ULWord & outValue); + AJA_VIRTUAL bool ReadHDProcAmpControlsInitialized (ULWord & outValue); + AJA_VIRTUAL bool ReadHDBrightnessAdjustment (ULWord & outValue); + AJA_VIRTUAL bool ReadHDContrastAdjustment (ULWord & outValue); + AJA_VIRTUAL bool ReadHDSaturationAdjustmentCb (ULWord & outValue); + AJA_VIRTUAL bool ReadHDSaturationAdjustmentCr (ULWord & outValue); + AJA_VIRTUAL bool ReadHDCbOffsetAdjustment (ULWord & outValue); + AJA_VIRTUAL bool ReadHDCrOffsetAdjustment (ULWord & outValue); + + // FS1 (and other?) ProcAmp methods + AJA_VIRTUAL bool WriteProcAmpC1YAdjustment (const ULWord inNewValue); + AJA_VIRTUAL bool WriteProcAmpC1CBAdjustment (const ULWord inNewValue); + AJA_VIRTUAL bool WriteProcAmpC1CRAdjustment (const ULWord inNewValue); + AJA_VIRTUAL bool WriteProcAmpC2CBAdjustment (const ULWord inNewValue); + AJA_VIRTUAL bool WriteProcAmpC2CRAdjustment (const ULWord inNewValue); + AJA_VIRTUAL bool WriteProcAmpOffsetYAdjustment (const ULWord inNewValue); + AJA_VIRTUAL bool ReadProcAmpC1YAdjustment (ULWord & outValue); + AJA_VIRTUAL bool ReadProcAmpC1CBAdjustment (ULWord & outValue); + AJA_VIRTUAL bool ReadProcAmpC1CRAdjustment (ULWord & outValue); + AJA_VIRTUAL bool ReadProcAmpC2CBAdjustment (ULWord & outValue); + AJA_VIRTUAL bool ReadProcAmpC2CRAdjustment (ULWord & outValue); + AJA_VIRTUAL bool ReadProcAmpOffsetYAdjustment (ULWord & outValue); + + #if !defined(R2_DEPRECATE) + AJA_VIRTUAL bool SetAnalogInputADCMode (const NTV2LSVideoADCMode inValue); + AJA_VIRTUAL bool GetAnalogInputADCMode (NTV2LSVideoADCMode & outValue); + #endif + ///@} + + + /** + @name HDMI + **/ + ///@{ + /** + @brief Answers with the current colorspace for the given HDMI input. + @param[out] outValue Receives the HDMI input's current ::NTV2LHIHDMIColorSpace value. + @param[in] inChannel Specifies the HDMI input of interest as an ::NTV2Channel (a zero-based index number). Defaults to NTV2_CHANNEL1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIInputColor (NTV2LHIHDMIColorSpace & outValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Sets the given HDMI input's input range. + @param[in] inNewValue Specifies the new ::NTV2HDMIRange value to be used. + @param[in] inChannel Specifies the HDMI input of interest as an ::NTV2Channel (a zero-based index number). Defaults to NTV2_CHANNEL1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIInputRange (const NTV2HDMIRange inNewValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers with the given HDMI input's current input range setting. + @param[out] outValue Receives the HDMI input's current ::NTV2HDMIRange value. + @param[in] inChannel Specifies the HDMI input of interest as an ::NTV2Channel (a zero-based index number). Defaults to NTV2_CHANNEL1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIInputRange (NTV2HDMIRange & outValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers with the current number of audio channels being received on the given HDMI input. + @param[out] outValue Receives the current ::NTV2HDMIAudioChannels value. + @param[in] inChannel Specifies the HDMI input of interest as an ::NTV2Channel (a zero-based index number). Defaults to NTV2_CHANNEL1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIInputAudioChannels (NTV2HDMIAudioChannels & outValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Sets the given HDMI input's color space. + @param[in] inNewValue Specifies the new ::NTV2HDMIColorSpace value to be used. + @param[in] inChannel Specifies the HDMI input of interest as an ::NTV2Channel (a zero-based index number). Defaults to NTV2_CHANNEL1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIInColorSpace (const NTV2HDMIColorSpace inNewValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers with the given HDMI input's current color space setting. + @param[out] outValue Receives the HDMI input's current ::NTV2HDMIColorSpace value. + @param[in] inChannel Specifies the HDMI input of interest as an ::NTV2Channel (a zero-based index number). Defaults to NTV2_CHANNEL1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIInColorSpace (NTV2HDMIColorSpace & outValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers with the given HDMI input's protocol. + @param[out] outValue Receives the HDMI input's current ::NTV2HDMIProtocol value. + @param[in] inChannel Specifies the HDMI input of interest as an ::NTV2Channel (a zero-based index number). Defaults to NTV2_CHANNEL1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIInProtocol (NTV2HDMIProtocol & outValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers if the given HDMI input is genlocked or not. + @param[out] outIsLocked Receives \c true if the HDMI input is locked; otherwise \c false. + @param[in] inChannel Specifies the HDMI input of interest as an ::NTV2Channel (a zero-based index number). Defaults to NTV2_CHANNEL1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIInIsLocked (bool & outIsLocked, const NTV2Channel inChannel = NTV2_CHANNEL1); + + AJA_VIRTUAL bool SetHDMIInAudioSampleRateConverterEnable (const bool inNewValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + AJA_VIRTUAL bool GetHDMIInAudioSampleRateConverterEnable (bool & outIsEnabled, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Sets the given HDMI input's bit depth. + @param[in] inNewValue Specifies the new ::NTV2HDMIBitDepth value to be used. + @param[in] inChannel Specifies the HDMI input of interest as an ::NTV2Channel (a zero-based index number). Defaults to NTV2_CHANNEL1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIInBitDepth (const NTV2HDMIBitDepth inNewValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers with the given HDMI input's current bit depth setting. + @param[out] outValue Receives the HDMI input's current ::NTV2HDMIBitDepth value. + @param[in] inChannel Specifies the HDMI input of interest as an ::NTV2Channel (a zero-based index number). Defaults to NTV2_CHANNEL1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIInBitDepth (NTV2HDMIBitDepth & outValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers with the given HDMI input's current audio channel 3/4 swap setting. + @param[out] outIsSwapped Receives true if channels 3 & 4 are currently being swapped; otherwise false. + @param[in] inChannel Specifies the HDMI input of interest as an ::NTV2Channel (a zero-based index number). Defaults to NTV2_CHANNEL1. + @return True if successful; otherwise false. + @see CNTV2Card::SetHDMIInAudioChannel34Swap + **/ + AJA_VIRTUAL bool GetHDMIInAudioChannel34Swap (bool & outIsSwapped, const NTV2Channel inChannel = NTV2_CHANNEL1); // New in SDK v16.0 + + /** + @brief Sets the given HDMI input's audio channel 3/4 swap state. + @param[in] inIsSwapped Specify true to swap channels 3 & 4; otherwise false. + @param[in] inChannel Specifies the HDMI input of interest as an ::NTV2Channel (a zero-based index number). Defaults to NTV2_CHANNEL1. + @return True if successful; otherwise false. + @see CNTV2Card::GetHDMIInAudioChannel34Swap + **/ + AJA_VIRTUAL bool SetHDMIInAudioChannel34Swap (const bool inIsSwapped, const NTV2Channel inChannel = NTV2_CHANNEL1); // New in SDK v16.0 + + + /** + @brief Answers with the given HDMI input's video black/white range. + @param[out] outValue Receives the HDMI input's current ::NTV2HDMIRange value. + @param[in] inChannel Specifies the HDMI input of interest as an ::NTV2Channel (a zero-based index number). Defaults to NTV2_CHANNEL1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIInVideoRange (NTV2HDMIRange & outValue, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers with the given HDMI input's video dynamic range and mastering information. + @param[out] outRegValue Receives the HDMI input's current HDRRegValues data. + @param[in] inChannel Specifies the HDMI input of interest as an ::NTV2Channel (a zero-based index number). Defaults to NTV2_CHANNEL1. + @return True if successful; false if no information present. + **/ + AJA_VIRTUAL bool GetHDMIInDynamicRange (HDRRegValues & outRegValues, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers with the given HDMI input's video dynamic range and mastering information. + @param[out] outFloatValue Receives the HDMI input's current HDRFloatValues data. + @param[in] inChannel Specifies the HDMI input of interest as an ::NTV2Channel (a zero-based index number). Defaults to NTV2_CHANNEL1. + @return True if successful; false if no information present. + **/ + AJA_VIRTUAL bool GetHDMIInDynamicRange (HDRFloatValues & outFloatValues, const NTV2Channel inChannel = NTV2_CHANNEL1); + + /** + @brief Answers with the given HDMI input's current colorimetry. + @param[out] outColorimetry Receives the input channels colorimetry. + @param[in] inChannel Specifies the HDMI input of interest as an ::NTV2Channel (a zero-based index number). Defaults to NTV2_CHANNEL1. + @return True if successful; otherwise false. + @see CNTV2Card::SetHDMIInAudioChannel34Swap + **/ + AJA_VIRTUAL bool GetHDMIInColorimetry (NTV2HDMIColorimetry & outColorimetry, const NTV2Channel inChannel = NTV2_CHANNEL1); // New in SDK v16.0 + + /** + @brief Answers with the given HDMI input's Dolby Vision flag is set. + @param[out] outIsDolbyVision Receives true if Dolby Vision input detected; otherwise false. + @param[in] inChannel Specifies the HDMI input of interest as an ::NTV2Channel (a zero-based index number). Defaults to NTV2_CHANNEL1. + @return True if successful; otherwise false. + @see CNTV2Card::SetHDMIInAudioChannel34Swap + **/ + AJA_VIRTUAL bool GetHDMIInDolbyVision (bool & outIsDolbyVision, const NTV2Channel inChannel = NTV2_CHANNEL1); // New in SDK v16.0 + + AJA_VIRTUAL bool SetHDMIOut3DPresent (const bool inIs3DPresent); + AJA_VIRTUAL bool GetHDMIOut3DPresent (bool & outIs3DPresent); + + AJA_VIRTUAL bool SetHDMIOut3DMode (const NTV2HDMIOut3DMode inValue); + AJA_VIRTUAL bool GetHDMIOut3DMode (NTV2HDMIOut3DMode & outValue); + + AJA_VIRTUAL bool SetHDMIV2TxBypass (const bool inBypass); + + AJA_VIRTUAL bool SetHDMIOutVideoStandard (const NTV2Standard inNewValue); + AJA_VIRTUAL bool GetHDMIOutVideoStandard (NTV2Standard & outValue); + + AJA_VIRTUAL bool SetHDMIOutSampleStructure (const NTV2HDMISampleStructure inNewValue); + AJA_VIRTUAL bool GetHDMIOutSampleStructure (NTV2HDMISampleStructure & outValue); + + AJA_VIRTUAL bool SetHDMIOutVideoFPS (const NTV2FrameRate inNewValue); + AJA_VIRTUAL bool GetHDMIOutVideoFPS (NTV2FrameRate & outValue); + + AJA_VIRTUAL bool SetHDMIOutRange (const NTV2HDMIRange inNewValue); + AJA_VIRTUAL bool GetHDMIOutRange (NTV2HDMIRange & outValue); + + AJA_VIRTUAL bool SetHDMIOutAudioChannels (const NTV2HDMIAudioChannels inNewValue); + AJA_VIRTUAL bool GetHDMIOutAudioChannels (NTV2HDMIAudioChannels & outValue); + + AJA_VIRTUAL bool SetHDMIOutColorSpace (const NTV2HDMIColorSpace inNewValue); + AJA_VIRTUAL bool GetHDMIOutColorSpace (NTV2HDMIColorSpace & outValue); + AJA_VIRTUAL bool SetLHIHDMIOutColorSpace (const NTV2LHIHDMIColorSpace inNewValue); + AJA_VIRTUAL bool GetLHIHDMIOutColorSpace (NTV2LHIHDMIColorSpace & outValue); + + AJA_VIRTUAL bool SetHDMIOutBitDepth (const NTV2HDMIBitDepth inNewValue); + AJA_VIRTUAL bool GetHDMIOutBitDepth (NTV2HDMIBitDepth & outValue); + + AJA_VIRTUAL bool SetHDMIOutProtocol (const NTV2HDMIProtocol inNewValue); + AJA_VIRTUAL bool GetHDMIOutProtocol (NTV2HDMIProtocol & outValue); + + AJA_VIRTUAL bool SetHDMIOutForceConfig (const bool inNewValue); + AJA_VIRTUAL bool GetHDMIOutForceConfig (bool & outValue); + + AJA_VIRTUAL bool SetHDMIOutPrefer420 (const bool inNewValue); + AJA_VIRTUAL bool GetHDMIOutPrefer420 (bool & outValue); + + AJA_VIRTUAL bool GetHDMIOutDownstreamBitDepth (NTV2HDMIBitDepth & outValue); + + AJA_VIRTUAL bool GetHDMIOutDownstreamColorSpace (NTV2LHIHDMIColorSpace & outValue); + + /** + @brief Sets the HDMI output's 2-channel audio source. + @param[in] inNewValue Specifies the audio channels from the given Audio System to be used. + @param[in] inAudioSystem Specifies the Audio System that will supply audio samples to the HDMI output. Defaults to NTV2_AUDIOSYSTEM_1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIOutAudioSource2Channel (const NTV2AudioChannelPair inNewValue, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief Answers with the HDMI output's current 2-channel audio source. + @param[out] outValue Receives the audio channels that are currently being used. + @param[out] outAudioSystem Receives the Audio System that is currently supplying audio samples to the HDMI output. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIOutAudioSource2Channel (NTV2AudioChannelPair & outValue, NTV2AudioSystem & outAudioSystem); + + /** + @brief Changes the HDMI output's 8-channel audio source. + @param[in] inNewValue Specifies the audio channels from the given Audio System to be used. + @param[in] inAudioSystem Specifies the Audio System that will supply audio samples to the HDMI output. Defaults to NTV2_AUDIOSYSTEM_1. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIOutAudioSource8Channel (const NTV2Audio8ChannelSelect inNewValue, const NTV2AudioSystem inAudioSystem = NTV2_AUDIOSYSTEM_1); + + /** + @brief Answers with the HDMI output's current 8-channel audio source. + @param[out] outValue Receives the audio channels that are currently being used. + @param[out] outAudioSystem Receives the Audio System that is currently supplying audio samples to the HDMI output. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIOutAudioSource8Channel (NTV2Audio8ChannelSelect & outValue, NTV2AudioSystem & outAudioSystem); + + /** + @brief Answers with the HDMI output's current audio channel 3/4 swap setting. + @param[out] outIsSwapped Receives true if channels 3 & 4 are currently being swapped; otherwise false. + @param[in] inWhichHDMIOut Optionally specifies the HDMI output of interest as an ::NTV2Channel, a zero-based index value. + Defaults to the first HDMI output. + @return True if successful; otherwise false. + @see CNTV2Card::SetHDMIOutAudioChannel34Swap + **/ + AJA_VIRTUAL bool GetHDMIOutAudioChannel34Swap (bool & outIsSwapped, const NTV2Channel inWhichHDMIOut = NTV2_CHANNEL1); // New in SDK v16.0 + + /** + @brief Sets the HDMI output's audio channel 3/4 swap state. + @param[in] inIsSwapped Specify true to swap channels 3 & 4; otherwise false. + @param[in] inWhichHDMIOut Optionally specifies the HDMI output of interest as an ::NTV2Channel, a zero-based index value. + Defaults to the first HDMI output. + @return True if successful; otherwise false. + @see CNTV2Card::GetHDMIOutAudioChannel34Swap + **/ + AJA_VIRTUAL bool SetHDMIOutAudioChannel34Swap (const bool inIsSwapped, const NTV2Channel inWhichHDMIOut = NTV2_CHANNEL1); // New in SDK v16.0 + + /** + @brief Sets the HDMI output's audio rate + @param[in] inNewValue Specifies the audio rate + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIOutAudioRate (const NTV2AudioRate inNewValue); + + /** + @brief Answers with the HDMI output's current audio rate. + @param[out] outValue Receives the HDMI output's current audio rate. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIOutAudioRate (NTV2AudioRate & outValue); + + /** + @brief Sets the HDMI output's audio format + @param[in] inNewValue Specifies the audio format + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIOutAudioFormat (const NTV2AudioFormat inNewValue); + + /** + @brief Answers with the HDMI output's current audio format. + @param[out] outValue Receives the HDMI output's current audio format. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIOutAudioFormat (NTV2AudioFormat & outValue); + + /** + @brief Enables or disables override of HDMI parameters. + @param[in] inEnable Specify true to enable HDMI user-override; otherwise false to disable it. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool EnableHDMIOutUserOverride (const bool inEnable); + + /** + @brief Answers if override of HDMI parameters is enabled or not. + @param[out] outIsEnabled Receives true if enabled; otherwise false. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetEnableHDMIOutUserOverride (bool & outIsEnabled); + + /** + @brief Controls the 4k/2k -> UHD/HD HDMI center cropping feature. + @param[in] inEnable Specify true to enable center cropping; otherwise false to disable it. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool EnableHDMIOutCenterCrop (const bool inEnable); + + /** + @brief Answers if the HDMI 4k/2k -> UHD/HD center cropping is enabled or not. + @param[out] outIsEnabled Receives true if center cropping is enabled; otherwise false. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetEnableHDMIOutCenterCrop (bool & outIsEnabled); + + /** + @brief Enables or disables decimate mode on the device's HDMI rasterizer, which halves the + output frame rate when enabled. This allows a 60 Hz video stream to be displayed on + a 30 Hz HDMI monitor. + @return True if successful; otherwise false. + @param[in] inEnable If true, enables decimation mode; otherwise disables decimation mode. + **/ + AJA_VIRTUAL bool SetHDMIOutDecimateMode (const bool inEnable); + + AJA_VIRTUAL bool GetHDMIOutDecimateMode (bool & outIsEnabled); + + /** + @brief Enables or disables two sample interleave I/O mode on the device's HDMI rasterizer. + @return True if successful; otherwise false. + @param[in] inTsiEnable If true, enables two sample interleave I/O; otherwise disables two sample interleave I/O. + **/ + AJA_VIRTUAL bool SetHDMIOutTsiIO (const bool inTsiEnable); + + AJA_VIRTUAL bool GetHDMIOutTsiIO (bool & tsiEnabled); + + /** + @brief Enables or disables level-B mode on the device's HDMI rasterizer. + @return True if successful; otherwise false. + @param[in] inEnable If true, enables level-B mode; otherwise disables level-B mode. + **/ + AJA_VIRTUAL bool SetHDMIOutLevelBMode (const bool inEnable); + + AJA_VIRTUAL bool GetHDMIOutLevelBMode (bool & outIsEnabled); + + /** + @brief Sets HDMI V2 mode for the device. + @return True if successful; otherwise false. + @param[in] inMode Specifies the HDMI V2 operation mode for the device. + Use ::NTV2_HDMI_V2_HDSD_BIDIRECTIONAL for HD or SD capture and playback. + Use ::NTV2_HDMI_V2_4K_CAPTURE for 4K capture. + Use ::NTV2_HDMI_V2_4K_PLAYBACK for 4K playback. + @note 4K modes are exclusive. + **/ + AJA_VIRTUAL bool SetHDMIV2Mode (const NTV2HDMIV2Mode inMode); + + /** + @brief Answers with the current HDMI V2 mode of the device. + @return True if successful; otherwise false. + @param[out] outMode Receives the current HDMI V2 operation mode for the device. + **/ + AJA_VIRTUAL bool GetHDMIV2Mode (NTV2HDMIV2Mode & outMode); + + + /** + @brief Answers with the current HDMI output status. + @return True if successful; otherwise false. + @param[out] outStatus Receives the current status of the HDMI output. + **/ + AJA_VIRTUAL bool GetHDMIOutStatus (NTV2HDMIOutputStatus & outStatus); // New in SDK 16.1 + + //protected: SHOULD BE PROTECTED/PRIVATE: + AJA_VIRTUAL bool GetHDMIInputStatus (ULWord & outValue, const NTV2Channel inChannel = NTV2_CHANNEL1, const bool in12BitDetection = false); ///< @brief Answers with the contents of the HDMI Input status register for the given HDMI input. + protected: + AJA_VIRTUAL bool GetHDMIInputStatusRegNum (ULWord & outRegNum, const NTV2Channel inChannel = NTV2_CHANNEL1, const bool in12BitDetection = false); ///< @brief Answers with the HDMI Input status register number for the given HDMI input. + + public: + #if !defined(NTV2_DEPRECATE_14_3) + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetHDMIAudioSampleRateConverterEnable (const bool inEnable, const NTV2Channel inChannel = NTV2_CHANNEL1)) {return SetHDMIInAudioSampleRateConverterEnable(inEnable, inChannel);} ///< @deprecated Use CNTV2Card::SetHDMIInAudioSampleRateConverterEnable instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIAudioSampleRateConverterEnable (bool & outIsEnabled, const NTV2Channel inChannel = NTV2_CHANNEL1)) {return GetHDMIInAudioSampleRateConverterEnable(outIsEnabled, inChannel);} ///< @deprecated Use CNTV2Card::GetHDMIInAudioSampleRateConverterEnable instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetHDMISampleStructure (const NTV2HDMISampleStructure inNewValue)) {return SetHDMIOutSampleStructure(inNewValue);} ///< @deprecated Use CNTV2Card::SetHDMIOutSampleStructure instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetHDMIV2DecimateMode (const bool inEnable)) {return SetHDMIOutDecimateMode(inEnable);} ///< @deprecated Use CNTV2Card::SetHDMIOutDecimateMode instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIV2DecimateMode (bool & outIsEnabled)) {return GetHDMIOutDecimateMode(outIsEnabled);} ///< @deprecated Use CNTV2Card::GetHDMIOutDecimateMode instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetHDMIV2TsiIO (const bool inEnable)) {return SetHDMIOutTsiIO(inEnable);} ///< @deprecated Use CNTV2Card::SetHDMIOutTsiIO instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIV2TsiIO (bool & outIsEnabled)) {return GetHDMIOutTsiIO(outIsEnabled);} ///< @deprecated Use CNTV2Card::GetHDMIOutTsiIO instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetHDMIV2LevelBMode (const bool inEnable)) {return SetHDMIOutLevelBMode(inEnable);} ///< @deprecated Use CNTV2Card::SetHDMIOutLevelBMode instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIV2LevelBMode (bool & outIsEnabled)) {return GetHDMIOutLevelBMode(outIsEnabled);} ///< @deprecated Use CNTV2Card::GetHDMIOutLevelBMode instead. + #endif // !defined(NTV2_DEPRECATE_14_3) + ///@} + + #if !defined (NTV2_DEPRECATE) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetHDMIV2OutVideoStandard (NTV2V2Standard inNewValue)); ///< @deprecated Use GetHDMIOutVideoStandard instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetHDMIV2OutVideoStandard (NTV2V2Standard * pOutValue)); ///< @deprecated Use GetHDMIOutVideoStandard instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetHDMIV2OutVideoStandard (NTV2V2Standard & outValue)) {return GetHDMIV2OutVideoStandard (&outValue);} ///< @deprecated Use GetHDMIOutVideoStandard instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetHDMIOutAudioSource2Channel (NTV2AudioChannelPair * pOutValue, NTV2Channel * pOutChannel = NULL)); ///< @deprecated Use the GetHDMIOutAudioSource8Channel function that has an NTV2AudioSystem reference. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetHDMIOutAudioSource2Channel (NTV2AudioChannelPair & outValue, NTV2Channel & outChannel)); ///< @deprecated Use the GetHDMIOutAudioSource8Channel function that has an NTV2AudioSystem reference. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetHDMIOutAudioSource8Channel (NTV2Audio8ChannelSelect * pOutValue, NTV2Channel * pOutChannel = NULL)); ///< @deprecated Use the GetHDMIOutAudioSource8Channel function that has an NTV2AudioSystem reference. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetHDMIOutAudioSource8Channel (NTV2Audio8ChannelSelect & outValue, NTV2Channel & outChannel)); ///< @deprecated Use the GetHDMIOutAudioSource8Channel function that has an NTV2AudioSystem reference. + + //// FS1 //////////////////////////////////////// + // Analog (FS1 / MOAB) + AJA_VIRTUAL NTV2_DEPRECATED_f(NTV2VideoFormat GetFS1AnalogCompositeInputVideoFormat()); ///< @deprecated This SDK no longer supports the FS1. + + // Reg 95 stuff + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1ReferenceSelect(NTV2FS1ReferenceSelect value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1ReferenceSelect(NTV2FS1ReferenceSelect *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1ColorFIDSubcarrierReset(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1ColorFIDSubcarrierReset(bool *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1FreezeOutput(NTV2FS1FreezeOutput value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1FreezeOutput(NTV2FS1FreezeOutput *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1XptProcAmpInputSelect(NTV2OutputCrosspointID value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1XptProcAmpInputSelect(NTV2OutputCrosspointID *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1XptSecondAnalogOutInputSelect(NTV2OutputCrosspointID value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1XptSecondAnalogOutInputSelect(NTV2OutputCrosspointID *value)); ///< @deprecated This SDK no longer supports the FS1. + + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioDelay(int value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1AudioDelay(int *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetLossOfInput(ULWord value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioAnalogLevel(NTV2FS1AudioLevel value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1AudioAnalogLevel(NTV2FS1AudioLevel *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioTone(NTV2FS1AudioTone value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1AudioTone(NTV2FS1AudioTone *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1OutputTone(NTV2FS1OutputTone value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1OutputTone(NTV2FS1OutputTone *value)); ///< @deprecated This SDK no longer supports the FS1. + + // Audio Channel Mapping registers + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioGain_Ch1(int value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioGain_Ch2(int value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioGain_Ch3(int value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioGain_Ch4(int value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioGain_Ch5(int value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioGain_Ch6(int value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioGain_Ch7(int value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioGain_Ch8(int value)); ///< @deprecated This SDK no longer supports the FS1. + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioPhase_Ch1(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioPhase_Ch2(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioPhase_Ch3(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioPhase_Ch4(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioPhase_Ch5(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioPhase_Ch6(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioPhase_Ch7(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioPhase_Ch8(bool value)); ///< @deprecated This SDK no longer supports the FS1. + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioSource_Ch1(NTV2AudioChannelMapping value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioSource_Ch2(NTV2AudioChannelMapping value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioSource_Ch3(NTV2AudioChannelMapping value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioSource_Ch4(NTV2AudioChannelMapping value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioSource_Ch5(NTV2AudioChannelMapping value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioSource_Ch6(NTV2AudioChannelMapping value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioSource_Ch7(NTV2AudioChannelMapping value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioSource_Ch8(NTV2AudioChannelMapping value)); ///< @deprecated This SDK no longer supports the FS1. + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioMute_Ch1(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioMute_Ch2(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioMute_Ch3(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioMute_Ch4(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioMute_Ch5(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioMute_Ch6(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioMute_Ch7(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1AudioMute_Ch8(bool value)); ///< @deprecated This SDK no longer supports the FS1. + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1VideoDAC2Mode (NTV2K2VideoDACMode value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1VideoDAC2Mode (NTV2K2VideoDACMode* value)); ///< @deprecated This SDK no longer supports the FS1. + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1I2C1ControlWrite(ULWord *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1I2C1ControlWrite(ULWord value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1I2C1ControlRead(ULWord *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1I2C1ControlRead(ULWord value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1I2C1ControlBusy(ULWord *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1I2C1ControlError(ULWord *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1I2C1Address(ULWord *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1I2C1Address(ULWord value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1I2C1SubAddress(ULWord *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1I2C1SubAddress(ULWord value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1I2C1Data(ULWord *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1I2C1Data(ULWord value)); ///< @deprecated This SDK no longer supports the FS1. + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1I2C2ControlWrite(ULWord *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1I2C2ControlWrite(ULWord value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1I2C2ControlRead(ULWord *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1I2C2ControlRead(ULWord value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1I2C2ControlBusy(ULWord *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1I2C2ControlError(ULWord *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1I2C2Address(ULWord *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1I2C2Address(ULWord value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1I2C2SubAddress(ULWord *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1I2C2SubAddress(ULWord value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1I2C2Data(ULWord *value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1I2C2Data(ULWord value)); ///< @deprecated This SDK no longer supports the FS1. + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1DownConvertAFDAutoEnable(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1DownConvertAFDAutoEnable(bool* value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1SecondDownConvertAFDAutoEnable(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1SecondDownConvertAFDAutoEnable(bool* value)); ///< @deprecated This SDK no longer supports the FS1. + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1DownConvertAFDDefaultHoldLast(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1DownConvertAFDDefaultHoldLast(bool* value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetFS1SecondDownConvertAFDDefaultHoldLast(bool value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetFS1SecondDownConvertAFDDefaultHoldLast(bool* value)); ///< @deprecated This SDK no longer supports the FS1. + + // Received AFD (Read-only) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAFDReceivedCode(ULWord* value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAFDReceivedAR(ULWord* value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAFDReceivedVANCPresent(bool* value)); ///< @deprecated This SDK no longer supports the FS1. + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAFDInsertMode_SDI1(NTV2AFDInsertMode value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAFDInsertMode_SDI1(NTV2AFDInsertMode* value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAFDInsertMode_SDI2(NTV2AFDInsertMode value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAFDInsertMode_SDI2(NTV2AFDInsertMode* value)); ///< @deprecated This SDK no longer supports the FS1. + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAFDInsertAR_SDI1(NTV2AFDInsertAspectRatio value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAFDInsertAR_SDI1(NTV2AFDInsertAspectRatio* value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAFDInsertAR_SDI2(NTV2AFDInsertAspectRatio value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAFDInsertAR_SDI2(NTV2AFDInsertAspectRatio* value)); ///< @deprecated This SDK no longer supports the FS1. + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAFDInsert_SDI1(NTV2AFDInsertCode value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAFDInsert_SDI1(NTV2AFDInsertCode* value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAFDInsert_SDI2(NTV2AFDInsertCode value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAFDInsert_SDI2(NTV2AFDInsertCode* value)); ///< @deprecated This SDK no longer supports the FS1. + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAFDInsertLineNumber_SDI1(ULWord value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAFDInsertLineNumber_SDI1(ULWord* value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAFDInsertLineNumber_SDI2(ULWord value)); ///< @deprecated This SDK no longer supports the FS1. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAFDInsertLineNumber_SDI2(ULWord* value)); ///< @deprecated This SDK no longer supports the FS1. + #endif // !NTV2_DEPRECATE + + AJA_VIRTUAL bool SetLHIVideoDACStandard (const NTV2Standard inValue); + AJA_VIRTUAL bool GetLHIVideoDACStandard (NTV2Standard & outValue); + AJA_VIRTUAL bool SetLHIVideoDACMode (NTV2LHIVideoDACMode value); + AJA_VIRTUAL bool GetLHIVideoDACMode (NTV2LHIVideoDACMode & outValue); + AJA_VIRTUAL bool SetLHIVideoDACMode (const NTV2VideoDACMode inValue); // overloaded + AJA_VIRTUAL bool GetLHIVideoDACMode (NTV2VideoDACMode & outValue); // overloaded + + /** + @name Analog LTC + **/ + ///@{ + /** + @brief Enables or disables the ability for the device to read analog LTC on the reference input connector. + @param[in] inEnable If true, the device will read analog LTC from the reference input connector. + Otherwise, the device cannot read analog LTC from the reference input connector. + @return True if successful; otherwise false. + @note When enabled, the device cannot genlock to whatever signal is applied to the reference input. + **/ + AJA_VIRTUAL bool SetLTCInputEnable (bool inEnable); + AJA_VIRTUAL bool GetLTCInputEnable (bool & outIsEnabled); + + /** + @brief Answers whether or not a valid analog LTC signal is being applied to the device's analog LTC input connector. + @param[out] outIsPresent Receives 'true' if a valid analog LTC signal is present at the analog LTC input connector; + otherwise 'false'. + @param[in] inLTCInputNdx Optionally specifies the LTC input connector. Defaults to 0 (LTCIn1). + @return True if successful; otherwise false. + @note Some devices share analog LTC input and reference input on one connector. + For these devices, this call should be preceded by a call to NTV2Card::SetLTCInputEnable(true). + **/ + AJA_VIRTUAL bool GetLTCInputPresent (bool & outIsPresent, const UWord inLTCInputNdx = 0); + + AJA_VIRTUAL bool SetLTCOnReference (bool inNewValue); // DEPRECATE?? + AJA_VIRTUAL bool GetLTCOnReference (bool & outLTCIsOnReference); // DEPRECATE?? + + AJA_VIRTUAL bool SetLTCEmbeddedOutEnable (bool inNewValue); + AJA_VIRTUAL bool GetLTCEmbeddedOutEnable (bool & outValue); + + /** + @brief Reads the current contents of the device's analog LTC input registers. + @param[in] inLTCInput Specifies the device's analog LTC input to use. Use 0 for LTC In 1, or 1 for LTC In 2. + (Call ::NTV2DeviceGetNumLTCInputs to determine the number of analog LTC inputs.) + @param[out] outRP188Data Receives the timecode read from the device registers. + @return True if successful; otherwise false. + @note The registers are read immediately, and should contain stable data if called soon after the VBI. + **/ + AJA_VIRTUAL bool ReadAnalogLTCInput (const UWord inLTCInput, RP188_STRUCT & outRP188Data); + + /** + @brief Reads the current contents of the device's analog LTC input registers. + @param[in] inLTCInput Specifies the device's analog LTC input to use. Use 0 for LTC In 1, or 1 for LTC In 2. + (Call ::NTV2DeviceGetNumLTCInputs to determine the number of analog LTC inputs.) + @param[out] outRP188Data Receives the timecode read from the device registers. + @return True if successful; otherwise false. + @note The registers are read immediately, and should contain stable data if called soon after the VBI. + **/ + AJA_VIRTUAL bool ReadAnalogLTCInput (const UWord inLTCInput, NTV2_RP188 & outRP188Data); + + /** + @brief Answers with the (SDI) input channel that's providing the clock reference being used by the given device's analog LTC input. + @param[in] inLTCInput Specifies the device's analog LTC input. Use 0 for LTC In 1, or 1 for LTC In 2. + (Call ::NTV2DeviceGetNumLTCInputs to determine the number of analog LTC inputs.) + @param[out] outChannel Receives the NTV2Channel that is currently providing the clock reference for reading the given analog LTC input. + @return True if successful; otherwise false. + @note This function is provided for devices that are capable of handling multiple, disparate video formats (see ::NTV2DeviceCanDoMultiFormat + and CNTV2Card::GetMultiFormatMode functions). It doesn't make sense to call this function on a device that is running in "UniFormat" mode. + **/ + AJA_VIRTUAL bool GetAnalogLTCInClockChannel (const UWord inLTCInput, NTV2Channel & outChannel); + + /** + @brief Sets the (SDI) input channel that is to provide the clock reference to be used by the given analog LTC input. + @param[in] inLTCInput Specifies the device's analog LTC input. Use 0 for LTC In 1, or 1 for LTC In 2. + (Call ::NTV2DeviceGetNumLTCInputs to determine the number of analog LTC inputs.) + @param[in] inChannel Specifies the NTV2Channel that should provide the clock reference for reading the given analog LTC input. + @return True if successful; otherwise false. + @note This function is provided for devices that are capable of handling multiple, disparate video formats (see ::NTV2DeviceCanDoMultiFormat + and CNTV2Card::GetMultiFormatMode functions). It doesn't make sense to call this function on a device that is running in "UniFormat" mode. + **/ + AJA_VIRTUAL bool SetAnalogLTCInClockChannel (const UWord inLTCInput, const NTV2Channel inChannel); + + /** + @brief Writes the given timecode to the specified analog LTC output register. + @param[in] inLTCOutput Specifies the device's analog LTC output to use. Use 0 for LTC Out 1, 1 for LTC Out 2, etc. + (Call ::NTV2DeviceGetNumLTCOutputs to determine the number of analog LTC outputs.) + @param[in] inRP188Data Specifies the timecode to write into the device registers. + Only the "Low" and "High" fields are used -- the "DBB" field is ignored. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool WriteAnalogLTCOutput (const UWord inLTCOutput, const RP188_STRUCT & inRP188Data); + + /** + @brief Writes the given timecode to the specified analog LTC output register. + @param[in] inLTCOutput Specifies the device's analog LTC output to use. Use 0 for LTC Out 1, 1 for LTC Out 2, etc. + (Call ::NTV2DeviceGetNumLTCOutputs to determine the number of analog LTC outputs.) + @param[in] inRP188Data Specifies the timecode to write into the device registers. + Only the "Low" and "High" fields are used -- the "DBB" field is ignored. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool WriteAnalogLTCOutput (const UWord inLTCOutput, const NTV2_RP188 & inRP188Data); + + /** + @brief Answers with the (SDI) output channel that's providing the clock reference being used by the given device's analog LTC output. + @param[in] inLTCOutput Specifies the device's analog LTC output. Use 0 for LTC Out 1, or 1 for LTC Out 2. + (Call ::NTV2DeviceGetNumLTCOutputs to determine the number of analog LTC outputs.) + @param[out] outChannel Receives the NTV2Channel that is currently providing the clock reference for writing the given analog LTC output. + @return True if successful; otherwise false. + @note This function is provided for devices that are capable of handling multiple, disparate video formats (see ::NTV2DeviceCanDoMultiFormat + and CNTV2Card::GetMultiFormatMode functions). It doesn't make sense to call this function on a device that is running in "UniFormat" mode. + **/ + AJA_VIRTUAL bool GetAnalogLTCOutClockChannel (const UWord inLTCOutput, NTV2Channel & outChannel); + + /** + @brief Sets the (SDI) output channel that is to provide the clock reference to be used by the given analog LTC output. + @param[in] inLTCOutput Specifies the device's analog LTC output. Use 0 for LTC Out 1, 1 for LTC Out 2, etc. + (Call ::NTV2DeviceGetNumLTCOutputs to determine the number of analog LTC outputs.) + @param[in] inChannel Specifies the NTV2Channel that should provide the clock reference for writing the given analog LTC output. + @return True if successful; otherwise false. + @note This function is provided for devices that are capable of handling multiple, disparate video formats (see ::NTV2DeviceCanDoMultiFormat + and CNTV2Card::GetMultiFormatMode functions). It doesn't make sense to call this function on a device that is running in "UniFormat" mode. + **/ + AJA_VIRTUAL bool SetAnalogLTCOutClockChannel (const UWord inLTCOutput, const NTV2Channel inChannel); + ///@} + + /** + @name Stereo Compression + **/ + ///@{ + AJA_VIRTUAL bool SetStereoCompressorOutputMode (const NTV2StereoCompressorOutputMode inNewValue); + AJA_VIRTUAL bool GetStereoCompressorOutputMode (NTV2StereoCompressorOutputMode & outValue); + AJA_VIRTUAL bool SetStereoCompressorFlipMode (const ULWord inNewValue); + AJA_VIRTUAL bool GetStereoCompressorFlipMode (ULWord & outValue); + AJA_VIRTUAL bool SetStereoCompressorFlipLeftHorz (const ULWord inNewValue); + AJA_VIRTUAL bool GetStereoCompressorFlipLeftHorz (ULWord & outValue); + AJA_VIRTUAL bool SetStereoCompressorFlipLeftVert (const ULWord inNewValue); + AJA_VIRTUAL bool GetStereoCompressorFlipLeftVert (ULWord & outValue); + AJA_VIRTUAL bool SetStereoCompressorFlipRightHorz (const ULWord inNewValue); + AJA_VIRTUAL bool GetStereoCompressorFlipRightHorz (ULWord & outValue); + AJA_VIRTUAL bool SetStereoCompressorFlipRightVert (const ULWord inNewValue); + AJA_VIRTUAL bool GetStereoCompressorFlipRightVert (ULWord & outValue); + AJA_VIRTUAL bool SetStereoCompressorStandard (const NTV2Standard inNewValue); + AJA_VIRTUAL bool GetStereoCompressorStandard (NTV2Standard & outValue); + AJA_VIRTUAL bool SetStereoCompressorLeftSource (const NTV2OutputCrosspointID inNewValue); + AJA_VIRTUAL bool GetStereoCompressorLeftSource (NTV2OutputCrosspointID & outValue); + AJA_VIRTUAL bool SetStereoCompressorRightSource (const NTV2OutputCrosspointID inNewValue); + AJA_VIRTUAL bool GetStereoCompressorRightSource (NTV2OutputCrosspointID & outValue); + ///@} + + /** + @name Bi-directional SDI + **/ + ///@{ + /** + @brief Sets the specified bidirectional SDI connector to act as an input or an output. + @return True if successful; otherwise false. + @param[in] inChannel Specifies the SDI connector as an ::NTV2Channel (a zero-based index number). + @param[in] inEnable If true, specifies that the channel connector is to be used as an output. + If false, specifies it's to be used as an input. + @note After switching a bidirectional SDI connector from output to input (i.e., inEnable = false), + it may take the hardware on the device up to approximately 10 frames to synchronize with + the input signal such that the device can accurately report the video format seen at the + input. + @see ::NTV2DeviceHasBiDirectionalSDI, \ref devicesignalinputsoutputs + **/ + AJA_VIRTUAL bool SetSDITransmitEnable (const NTV2Channel inChannel, const bool inEnable); + + /** + @brief Sets the specified SDI connector(s) to act as an input or an output. + @return True if successful; otherwise false. + @param[in] inSDIConnectors Specifies the SDI connector(s) to be affected. + @param[in] inEnable If true, specifies that the channel connector is to be used as an output. + If false, specifies it's to be used as an input. + @note After switching a bidirectional SDI connector from output to input (i.e., inEnable = false), + it may take the hardware on the device up to approximately 10 frames to synchronize with + the input signal such that the device can accurately report the video format seen at the + input. + @see ::NTV2DeviceHasBiDirectionalSDI, \ref devicesignalinputsoutputs + **/ + AJA_VIRTUAL bool SetSDITransmitEnable (const NTV2ChannelSet & inSDIConnectors, const bool inEnable); + + /** + @brief Answers whether or not the specified SDI connector is currently acting as a transmitter + (i.e. an output). + @param[in] inChannel Specifies the SDI connector as an ::NTV2Channel (a zero-based index number). + @param[out] outEnabled Receives true if the SDI channel connector is currently a transmitter (output), + or false if it's acting as an input. + @return True if successful; otherwise false. + @see ::NTV2DeviceHasBiDirectionalSDI, \ref devicesignalinputsoutputs + **/ + AJA_VIRTUAL bool GetSDITransmitEnable (const NTV2Channel inChannel, bool & outEnabled); + ///@} + + AJA_VIRTUAL bool SetSDIOut2Kx1080Enable (const NTV2Channel inChannel, const bool inIsEnabled); + AJA_VIRTUAL bool GetSDIOut2Kx1080Enable (const NTV2Channel inChannel, bool & outIsEnabled); + + AJA_VIRTUAL bool SetSDIOut3GEnable (const NTV2Channel inChannel,const bool inEnable); + AJA_VIRTUAL bool GetSDIOut3GEnable (const NTV2Channel inChannel, bool & outIsEnabled); + + AJA_VIRTUAL bool SetSDIOut3GbEnable (const NTV2Channel inChannel, const bool inEnable); + AJA_VIRTUAL bool GetSDIOut3GbEnable (const NTV2Channel inChannel, bool & outIsEnabled); + + AJA_VIRTUAL bool SetSDIOut6GEnable(const NTV2Channel inChannel, const bool inEnable); + AJA_VIRTUAL bool GetSDIOut6GEnable(const NTV2Channel inChannel, bool & outIsEnabled); + + AJA_VIRTUAL bool SetSDIOut12GEnable(const NTV2Channel inChannel, const bool inEnable); + AJA_VIRTUAL bool GetSDIOut12GEnable(const NTV2Channel inChannel, bool & outIsEnabled); + + + /** + @name SDI Bypass Relays + **/ + ///@{ + /** + @brief Answers if the bypass relays between connectors 1/2 or 3/4 are currently + in bypass or routing the signals through the device. + @return True if successful; otherwise false. + @param[out] outValue Receives the current state of the relays (::NTV2_DEVICE_BYPASSED + or ::NTV2_THROUGH_DEVICE). + @param[in] inIndex0 Specifies the relay/connector pair of interest. + Use 0 for SDI 1&2, or 1 for SDI 3&4. + **/ + AJA_VIRTUAL bool GetSDIRelayPosition (NTV2RelayState & outValue, const UWord inIndex0); + + /** + @brief Answers if the bypass relays between connectors 1 and 2 would be in + bypass or would route signals through the device, if under manual control. + @param[out] outValue Receives the relay state (::NTV2_DEVICE_BYPASSED or ::NTV2_THROUGH_DEVICE). + @param[in] inIndex0 Specifies the relay/connector pair of interest. + Use 0 for SDI 1&2, or 1 for SDI 3&4. + @return True if successful; otherwise false. + @note Manual control will not change the state of the relays if + the watchdog timer for the relays is enabled. + **/ + AJA_VIRTUAL bool GetSDIRelayManualControl (NTV2RelayState & outValue, const UWord inIndex0); + + /** + @brief Sets the state of the given connector pair relays to ::NTV2_DEVICE_BYPASSED + (or ::NTV2_THROUGH_DEVICE if under manual control). + @param[in] inValue Specifies the desired relay state. + @param[in] inIndex0 Specifies the relay/connector pair of interest. + Use 0 for SDI 1&2, or 1 for SDI 3&4. + @return True if successful; otherwise false. + @note Manual control won't change the state of the relays if the watchdog timer for the relays + is enabled. Because this call modifies the control register, it sends a "kick" sequence, + which has the side effect of restarting the timeout counter. + **/ + AJA_VIRTUAL bool SetSDIRelayManualControl (const NTV2RelayState inValue, const UWord inIndex0); + + /** + @brief Answers true if the given connector pair relays are under watchdog timer control, + or false if they're under manual control. + @param[out] outIsEnabled Receives 'true' if the watchdog timer is controlling the relays; + receives 'false' if the relays are under manual control. + @param[in] inIndex0 Specifies the relay/connector pair of interest. + Use 0 for SDI 1&2, or 1 for SDI 3&4. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetSDIWatchdogEnable (bool & outIsEnabled, const UWord inIndex0); + + /** + @brief Sets the connector pair relays to be under watchdog timer control or manual control. + @param[in] inEnable Specify true to have the watchdog timer control the relays. + Specify false to manually control the relays. + @param[in] inIndex0 Specifies the relay/connector pair of interest. + Use 0 for SDI 1&2, or 1 for SDI 3&4. + @return True if successful; otherwise false. + @note Because this call modifies the control register, it sends a kick sequence, + which restarts the timeout counter. + @note If the board's jumpers aren't set in the position to enable the watchdog timer, + this call will have no effect. See the Hardware Jumpers section in the + \ref corvid24 documentation for more information. + **/ + AJA_VIRTUAL bool SetSDIWatchdogEnable (const bool inEnable, const UWord inIndex0); + + /** + @brief Answers if the watchdog timer would put the SDI relays into ::NTV2_DEVICE_BYPASSED + or ::NTV2_THROUGH_DEVICE. + @param[out] outValue Receives the current state of the watchdog timer. + @return True if successful; otherwise false. + @note The watchdog timer won't change the state of the relays if they're under manual control. + **/ + AJA_VIRTUAL bool GetSDIWatchdogStatus (NTV2RelayState & outValue); + + /** + @brief Answers with the amount of time that must elapse before the watchdog timer times out. + @param[out] outValue Receives the time value in units of 8 nanoseconds. + @return True if successful; otherwise false. + @note The timeout interval begins or is reset when a kick sequence is received. + **/ + AJA_VIRTUAL bool GetSDIWatchdogTimeout (ULWord & outValue); + + /** + @brief Specifies the amount of time that must elapse before the watchdog timer times out. + @param[in] inValue Specifies the timeout interval in units of 8 nanoseconds. + @return True if successful; otherwise false. + @note The timeout interval begins or is reset when a kick sequence is received. + This call resets the timeout counter to zero, which will then start counting + until this value is reached, triggering the watchdog timer (if it's enabled). + **/ + AJA_VIRTUAL bool SetSDIWatchdogTimeout (const ULWord inValue); + + /** + @brief Restarts the countdown timer to prevent the watchdog timer from timing out. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool KickSDIWatchdog (void); + + #if !defined(NTV2_DEPRECATE_15_6) + // Old APIs + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDIRelayPosition12 (NTV2RelayState & outValue)) {return GetSDIRelayPosition(outValue,0);} ///< @deprecated Use GetSDIRelayPosition instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDIRelayPosition34 (NTV2RelayState & outValue)) {return GetSDIRelayPosition(outValue,1);} ///< @deprecated Use GetSDIRelayPosition instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDIRelayManualControl12 (NTV2RelayState & outValue)) {return GetSDIRelayManualControl(outValue,0);} ///< @deprecated Use GetSDIRelayManualControl instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDIRelayManualControl34 (NTV2RelayState & outValue)) {return GetSDIRelayManualControl(outValue,1);} ///< @deprecated Use GetSDIRelayManualControl instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDIWatchdogEnable12 (bool & outIsEnabled)) {return GetSDIWatchdogEnable(outIsEnabled,0);} ///< @deprecated Use GetSDIWatchdogEnable instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDIWatchdogEnable34 (bool & outIsEnabled)) {return GetSDIWatchdogEnable(outIsEnabled,1);} ///< @deprecated Use GetSDIWatchdogEnable instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetSDIRelayManualControl12 (const NTV2RelayState inValue)) {return SetSDIRelayManualControl(inValue,0);} ///< @deprecated Use SetSDIRelayManualControl instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetSDIRelayManualControl34 (const NTV2RelayState inValue)) {return SetSDIRelayManualControl(inValue,1);} ///< @deprecated Use SetSDIRelayManualControl instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetSDIWatchdogEnable12 (const bool inEnable)) {return SetSDIWatchdogEnable(inEnable,0);} ///< @deprecated Use SetSDIWatchdogEnable instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetSDIWatchdogEnable34 (const bool inEnable)) {return SetSDIWatchdogEnable(inEnable,1);} ///< @deprecated Use SetSDIWatchdogEnable instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetSDIWatchdogState (NTV2SDIWatchdogState & outState)); ///< @deprecated Use the other GetSDI... functions instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetSDIWatchdogState (const NTV2SDIWatchdogState & inState)); ///< @deprecated Use the other SetSDI... functions instead. + #endif // !defined(NTV2_DEPRECATE_15_6) + ///@} + + /** + @name 4K Conversion + **/ + ///@{ + /** + @brief Sets 4K Down Convert RGB mode + @return True if successful; otherwise false. + @param[in] inEnable If true, specifies RGB mode + If false, specifies YCC mode + **/ + AJA_VIRTUAL bool Enable4KDCRGBMode(bool inEnable); + + AJA_VIRTUAL bool GetEnable4KDCRGBMode(bool & outIsEnabled); + + /** + @brief Sets 4K Down Convert YCC 444 mode + @return True if successful; otherwise false. + @param[in] inEnable If true, specifies YCC 444 + If false, specifies YCC 422 + **/ + AJA_VIRTUAL bool Enable4KDCYCC444Mode(bool inEnable); + + AJA_VIRTUAL bool GetEnable4KDCYCC444Mode(bool & outIsEnabled); + + /** + @brief Sets 4K Down Convert PSF in mode + @return True if successful; otherwise false. + @param[in] inEnable If true, specifies PSF in + If false, specifies P in + **/ + AJA_VIRTUAL bool Enable4KDCPSFInMode(bool inEnable); + + AJA_VIRTUAL bool GetEnable4KDCPSFInMode(bool & outIsEnabled); + + /** + @brief Sets 4K Down Convert PSF out Mode + @return True if successful; otherwise false. + @param[in] inEnable If true, specifies PSF out + If false, specifies P out + **/ + AJA_VIRTUAL bool Enable4KPSFOutMode(bool inEnable); + + AJA_VIRTUAL bool GetEnable4KPSFOutMode(bool & outIsEnabled); + ///@} + + + /** + @brief Enables or disables 3G level B to 3G level A conversion at the SDI input widget (assuming the AJA device can do so). + @return True if successful; otherwise false. + @param[in] inInputSpigot Specifies the SDI input spigot to be affected (where 0 == SDIIn1, 1 == SDIIn2, etc.). + @param[in] inEnable Specify true to automatically convert incoming 3g level B signals to 3g level A. + Specify false for normal operation. + **/ + AJA_VIRTUAL bool SetSDIInLevelBtoLevelAConversion (const UWord inInputSpigot, const bool inEnable); + + /** + @brief Answers with the device's current 3G level B to 3G level A conversion setting for the given SDI input spigot (assuming the device can do such a conversion). + @return True if successful; otherwise false. + @param[in] inInputSpigot Specifies the SDI input widget of interest (0 == SDIIn1, 1 == SDIIn2, etc.). + @param[out] outIsEnabled Receives true if enabled, or false if disabled (normal operation). + **/ + AJA_VIRTUAL bool GetSDIInLevelBtoLevelAConversion (const UWord inInputSpigot, bool & outIsEnabled); + + /** + @brief Enables or disables 3G level A to 3G level B conversion at the SDI output widget (assuming the AJA device can do so). + @return True if successful; otherwise false. + @param[in] inOutputSpigot Specifies the SDI output widget to be affected (where 0 == SDIOut1, 1 == SDIOut2, etc.). + @param[in] inEnable If true, outgoing 3g level a signal converted to 3g level b signal at SDI output widget. + If false, specifies normal operation. + **/ + AJA_VIRTUAL bool SetSDIOutLevelAtoLevelBConversion (const UWord inOutputSpigot, const bool inEnable); + + /** + @brief Enables or disables 3G level A to 3G level B conversion at the given SDI output(s). + @return True if successful; otherwise false. + @param[in] inSDIOutputs Specifies the SDI output(s) to be affected, each specified by an ::NTV2Channel, + a zero-based index (where 0 == SDIOut1, 1 == SDIOut2, etc.). + @param[in] inEnable If true, outgoing 3G level A signal converted to 3G level B signal at SDI output widget. + If false, specifies normal operation. + **/ + AJA_VIRTUAL bool SetSDIOutLevelAtoLevelBConversion (const NTV2ChannelSet & inSDIOutputs, const bool inEnable); // New in SDK v16.0 + + /** + @brief Answers with the device's current 3G level A to 3G level B conversion setting for the given SDI output spigot (assuming the device can do such a conversion). + @return True if successful; otherwise false. + @param[in] inOutputSpigot Specifies the SDI output widget of interest (0 == SDIOut1, 1 == SDIOut2, etc.). + @param[out] outIsEnabled Receives true if enabled, or false if disabled (normal operation). + **/ + AJA_VIRTUAL bool GetSDIOutLevelAtoLevelBConversion (const UWord inOutputSpigot, bool & outIsEnabled); + + /** + @brief Enables or disables an RGB-over-3G-level-A conversion at the SDI output widget (assuming the AJA device can do so). + @return True if successful; otherwise false. + @param[in] inOutputSpigot Specifies the SDI output to be affected (where 0 == SDIOut1, 1 == SDIOut2, etc.). + @param[in] inEnable If true, perform the conversion at the output SDI spigot; otherwise have the SDI output spigot operate normally (no conversion). + **/ + AJA_VIRTUAL bool SetSDIOutRGBLevelAConversion (const UWord inOutputSpigot, const bool inEnable); + + /** + @brief Enables or disables an RGB-over-3G-level-A conversion at the given SDI output(s). + @return True if successful; otherwise false. + @param[in] inSDIOutputs Specifies the SDI output(s) to be affected, each specified by an ::NTV2Channel, + a zero-based index (where 0 == SDIOut1, 1 == SDIOut2, etc.). + @param[in] inEnable If true, perform the conversion at the output SDI spigot; + otherwise have the SDI output spigot operate normally (no conversion). + **/ + AJA_VIRTUAL bool SetSDIOutRGBLevelAConversion (const NTV2ChannelSet & inSDIOutputs, const bool inEnable); // New in SDK v16.0 + + /** + @brief Answers with the device's current RGB-over-3G-level-A conversion at the given SDI output spigot (assuming the device can do such a conversion). + @return True if successful; otherwise false. + @param[in] inOutputSpigot Specifies the SDI output spigot of interest (where 0 is "SDI Out 1"). + @param[out] outIsEnabled Receives true if the device's output spigot is currently performing the conversion; otherwise false (not converting). + **/ + AJA_VIRTUAL bool GetSDIOutRGBLevelAConversion (const UWord inOutputSpigot, bool & outIsEnabled); + + + /** + @name SDI Input Error Detection + **/ + ///@{ + /** + @return True if the given SDI input is currently reporting TRS errors; otherwise false. + @param[in] inChannel Specifies the channel (SDI input) of interest. + **/ + AJA_VIRTUAL bool GetSDITRSError (const NTV2Channel inChannel); + + /** + @return True if the given SDI input is currently locked to a valid signal; otherwise false. + @param[in] inChannel Specifies the channel (SDI input) of interest. + @note This function returns valid information only for devices for which ::NTV2DeviceCanDoSDIErrorChecks returns 'true'. + **/ + AJA_VIRTUAL bool GetSDILock (const NTV2Channel inChannel); + + /** + @return The number of transitions to the "unlocked" state for the given SDI input. + @param[in] inChannel Specifies the channel (SDI input) of interest. + @note This function returns valid information only for devices for which ::NTV2DeviceCanDoSDIErrorChecks returns 'true'. + **/ + AJA_VIRTUAL ULWord GetSDIUnlockCount (const NTV2Channel inChannel); + + /** + @return The current Link A error count for the given SDI input. + @param[in] inChannel Specifies the channel (SDI input) of interest. + @note This function returns valid information only for devices for which ::NTV2DeviceCanDoSDIErrorChecks returns 'true'. + **/ + AJA_VIRTUAL ULWord GetCRCErrorCountA (const NTV2Channel inChannel); + + /** + @return The current Link B error count for the given SDI input. + @param[in] inChannel Specifies the channel (SDI input) of interest. + @note This function returns valid information only for devices for which ::NTV2DeviceCanDoSDIErrorChecks returns 'true'. + **/ + AJA_VIRTUAL ULWord GetCRCErrorCountB (const NTV2Channel inChannel); + ///@} + + /** + @brief Enables or disables multi-format (per channel) device operation. + If enabled, each device channel can handle a different video format (subject to certain limitations). + If disabled, all device channels have the same video format. + @return True if successful; otherwise false. + @param[in] inEnable If true, sets the device in multi-format mode. + If false, sets the device in uni-format mode. + @see ::NTV2DeviceCanDoMultiFormat, CNTV2Card::GetMultiFormatMode, \ref deviceclockingandsync + **/ + AJA_VIRTUAL bool SetMultiFormatMode (const bool inEnable); + + /** + @brief Answers if the device is operating in multiple-format per channel (independent channel) mode or not. + If enabled, each device channel can accommodate a different video format (subject to certain limitations). + If disabled, all device channels have the same video format. + @return True if successful; otherwise false. + @param[out] outIsEnabled Receives true if the device is currently in multi-format mode, + or false if it's in uni-format mode. + @see ::NTV2DeviceCanDoMultiFormat, CNTV2Card::SetMultiFormatMode, \ref deviceclockingandsync + **/ + AJA_VIRTUAL bool GetMultiFormatMode (bool & outIsEnabled); + + +public: + #if !defined (NTV2_DEPRECATE) + // Functions for cards that support more than one bitfile + virtual NTV2_DEPRECATED_f(bool CheckBitfile(NTV2VideoFormat newValue = NTV2_FORMAT_UNKNOWN)); ///< @deprecated This function is obsolete. + static NTV2_DEPRECATED_f(int FormatCompare (NTV2VideoFormat fmt1, NTV2VideoFormat fmt2)); ///< @deprecated This function is obsolete. + #endif // !defined (NTV2_DEPRECATE) + + /** + @name RS-422 + **/ + ///@{ + /** + @brief Sets the parity control on the specified RS422 serial port. + @return True if successful; otherwise false. + @param[in] inSerialPort Specifies the RS422 serial port to be affected, expressed as an ::NTV2Channel + (a zero-based index number). Call ::NTV2DeviceGetNumSerialPorts to determine + the number of available serial ports. + @param[in] inParity Specifies if parity should be used, and if so, whether it should be odd or even. + @note This function only works with programmable RS422 devices. + @see CNTV2Card::GetRS422Parity, CNTV2Card::SetRS422BaudRate, ::NTV2DeviceGetNumSerialPorts, + ::NTV2DeviceCanDoProgrammableRS422 + **/ + AJA_VIRTUAL bool SetRS422Parity (const NTV2Channel inSerialPort, const NTV2_RS422_PARITY inParity); + + /** + @brief Answers with the current parity control for the specified RS422 serial port. + @return True if successful; otherwise false. + @param[in] inSerialPort Specifies the RS422 serial port of interest, expressed as an ::NTV2Channel + (a zero-based index number). Call ::NTV2DeviceGetNumSerialPorts to determine + the number of available serial ports. + @param[out] outParity Receives the serial port's current ::NTV2_RS422_PARITY setting. + @see CNTV2Card::SetRS422Parity, CNTV2Card::GetRS422BaudRate, ::NTV2DeviceGetNumSerialPorts, + ::NTV2DeviceCanDoProgrammableRS422 + **/ + AJA_VIRTUAL bool GetRS422Parity (const NTV2Channel inSerialPort, NTV2_RS422_PARITY & outParity); + + /** + @brief Sets the baud rate of the specified RS422 serial port. + @return True if successful; otherwise false. + @param[in] inSerialPort Specifies the RS422 serial port to be affected, expressed as an ::NTV2Channel + (a zero-based index number). Call ::NTV2DeviceGetNumSerialPorts to determine + the number of available serial ports. + @param[in] inBaudRate Specifies the ::NTV2_RS422_BAUD_RATE to be used. (The default baud rate upon + power-up or reset is ::NTV2_RS422_BAUD_RATE_38400.) + @note This function only works with programmable RS422 devices. + @see CNTV2Card::SetRS422Parity, CNTV2Card::GetRS422BaudRate, ::NTV2DeviceGetNumSerialPorts, + ::NTV2DeviceCanDoProgrammableRS422 + **/ + AJA_VIRTUAL bool SetRS422BaudRate (const NTV2Channel inSerialPort, const NTV2_RS422_BAUD_RATE inBaudRate); + + /** + @brief Answers with the current baud rate of the specified RS422 serial port. + @return True if successful; otherwise false. + @param[in] inSerialPort Specifies the RS422 serial port of interest, expressed as an ::NTV2Channel + (a zero-based index number). Call ::NTV2DeviceGetNumSerialPorts to determine + the number of available serial ports. + @param[out] outBaudRate Receives the ::NTV2_RS422_BAUD_RATE being used. + @see CNTV2Card::GetRS422Parity, CNTV2Card::SetRS422BaudRate, ::NTV2DeviceGetNumSerialPorts, + ::NTV2DeviceCanDoProgrammableRS422 + **/ + AJA_VIRTUAL bool GetRS422BaudRate (const NTV2Channel inSerialPort, NTV2_RS422_BAUD_RATE & outBaudRate); + + #if !defined (NTV2_DEPRECATE) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool ReadUartRxFifoSize (ULWord * pOutSizeInBytes)); + #endif // !defined (NTV2_DEPRECATE) + ///@} + + /** + @name Ancillary Data + **/ + ///@{ + + /** + @brief Sets the capacity of the ANC buffers in device frame memory. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports custom Anc inserter firmware.) + @return True if successful; otherwise false. + @param[in] inF1Size Specifies the capacity of the Field 1 anc buffer, in bytes. + @param[in] inF2Size Specifies the capacity of the Field 2 anc buffer, in bytes. + @note This function should be used before configuring the anc extractors/inserters. + @note Size changes apply to all anc extractors/inserters. + @warning Setting these values too large will result in anc data occupying the bottom of the video raster. + @see CNTV2Card::GetAncRegionOffsetAndSize, \ref anccapture-dataspace + **/ + AJA_VIRTUAL bool AncSetFrameBufferSize (const ULWord inF1Size, const ULWord inF2Size); + + + /** + @brief Initializes the given SDI output's Anc inserter for custom Anc packet insertion. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports custom Anc inserter firmware.) + @return True if successful; otherwise false. + @param[in] inSDIOutput Specifies the SDI output of interest (e.g., 0=SDIOut1, 1=SDIOut2, etc.). + @param[in] inChannel Optionally specifies the ::NTV2Channel (FrameStore) that's driving the SDI output, + if different from the SDI output. The default is to use the same ::NTV2Channel + that corresponds to the given SDI output (e.g., ::NTV2_CHANNEL1 == 0 == SDIOut1). + @param[in] inStandard Optionally overrides the ::NTV2Standard used to initialize the Anc inserter. + Defaults to using the ::NTV2Standard of the ::NTV2Channel being used. + @note This function is provided for playback methods that don't use \ref aboutautocirculate. + \ref aboutautocirculate based applications should not call this function. + **/ + AJA_VIRTUAL bool AncInsertInit (const UWord inSDIOutput, const NTV2Channel inChannel = NTV2_CHANNEL_INVALID, + const NTV2Standard inStandard = NTV2_STANDARD_INVALID); + + /** + @brief Enables or disables individual Anc insertion components for the given SDI output. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports custom Anc inserter firmware.) + @return True if successful; otherwise false. + @param[in] inSDIOutput Specifies the SDI output of interest (e.g., 0=SDIOut1, 1=SDIOut2, etc.). + @param[in] inVancY Specify true to enable Vanc Y component insertion; otherwise false to disable it. + @param[in] inVancC Specify true to enable Vanc C component insertion; otherwise false to disable it. + @param[in] inHancY Specify true to enable Hanc Y component insertion; otherwise false to disable it. + @param[in] inHancC Specify true to enable Hanc C component insertion; otherwise false to disable it. + @note This function is provided for playback methods that don't use \ref aboutautocirculate. + \ref aboutautocirculate based applications should not call this function. + **/ + AJA_VIRTUAL bool AncInsertSetComponents (const UWord inSDIOutput, + const bool inVancY, const bool inVancC, + const bool inHancY, const bool inHancC); + + /** + @brief Enables or disables the given SDI output's Anc inserter frame buffer reads. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports custom Anc inserter firmware.) + @return True if successful; otherwise false. + @param[in] inSDIOutput Specifies the SDI output of interest (e.g., 0=SDIOut1, 1=SDIOut2, etc.). + @param[in] inIsEnabled Specify true to enable the Anc inserter; otherwise false to disable it. + @note This function is provided for playback methods that don't use \ref aboutautocirculate. + \ref aboutautocirculate based applications should not call this function. + **/ + AJA_VIRTUAL bool AncInsertSetEnable (const UWord inSDIOutput, const bool inIsEnabled); + + /** + @brief Answers with the run state of the given Anc inserter -- i.e. if its "memory reader" is enabled or not. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports Anc extractor firmware.) + @return True if successful; otherwise false. + @param[in] inSDIOutput Specifies the SDI output of interest as a zero-based index value (e.g., 0 == SDIOut1). + @param[out] outIsEnabled Receives 'true' if the Anc inserter is enabled (running); otherwise false. + **/ + AJA_VIRTUAL bool AncInsertIsEnabled (const UWord inSDIOutput, bool & outIsEnabled); + + /** + @brief Configures the Anc inserter for the next frame's F1 Anc data to embed/transmit. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports custom Anc inserter firmware.) + @return True if successful; otherwise false. + @param[in] inSDIOutput Specifies the SDI output of interest (e.g., 0=SDIOut1, 1=SDIOut2, etc.). + @param[in] inFrameNumber Tells the Anc inserter where to find the Anc data to transmit, specified as a + zero-based frame number. + @param[in] inF1Size Specifies the maximum number of F1 bytes to process in the Anc data buffer in the frame. + @param[in] inChannel Optionally specifies the ::NTV2Channel (FrameStore) that's driving the SDI output, + if different from the SDI output. The default is to use the same ::NTV2Channel + that corresponds to the given SDI output (e.g., ::NTV2_CHANNEL1 == 0 == SDIOut1). + @param[in] inFrameSize Optionally overrides the ::NTV2Framesize used to calculate the Anc buffer location + in device SDRAM. Defaults to using the ::NTV2Framesize of the ::NTV2Channel being used. + @note This function is provided for playback methods that don't use \ref aboutautocirculate. + \ref aboutautocirculate based applications should not call this function. + **/ + AJA_VIRTUAL bool AncInsertSetReadParams (const UWord inSDIOutput, const ULWord inFrameNumber, const ULWord inF1Size, + const NTV2Channel inChannel = NTV2_CHANNEL_INVALID, + const NTV2Framesize inFrameSize = NTV2_FRAMESIZE_INVALID); + + /** + @brief Configures the Anc inserter for the next frame's F2 Anc data to embed/transmit. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports custom Anc inserter firmware.) + @return True if successful; otherwise false. + @param[in] inSDIOutput Specifies the SDI output of interest (e.g., 0=SDIOut1, 1=SDIOut2, etc.). + @param[in] inFrameNumber Tells the Anc inserter where to find the Anc data to transmit, specified as a + zero-based frame number. + @param[in] inF2Size Specifies the maximum number of F2 bytes to process in the Anc data buffer in the frame. + @param[in] inChannel Optionally specifies the ::NTV2Channel (FrameStore) that's driving the SDI output, + if different from the SDI output. The default is to use the same ::NTV2Channel + that corresponds to the given SDI output (e.g., ::NTV2_CHANNEL1 == 0 == SDIOut1). + @param[in] inFrameSize Optionally overrides the ::NTV2Framesize used to calculate the Anc buffer location + in device SDRAM. Defaults to using the ::NTV2Framesize of the ::NTV2Channel being used. + @note This function is provided for playback methods that don't use \ref aboutautocirculate. + \ref aboutautocirculate based applications should not call this function. + **/ + AJA_VIRTUAL bool AncInsertSetField2ReadParams (const UWord inSDIOutput, const ULWord inFrameNumber, const ULWord inF2Size, + const NTV2Channel inChannel = NTV2_CHANNEL_INVALID, + const NTV2Framesize inFrameSize = NTV2_FRAMESIZE_INVALID); + + /** + @brief Configures the Anc inserter IP specific params. + @return True if successful; otherwise false. + @param[in] inSDIOutput Specifies the SDI output of interest (e.g., 0=SDIOut1, 1=SDIOut2, etc.). + @param[in] ancChannel Tells the IP packetizer which Anc inserter to use (4-7). + @param[in] payloadID Tells the IP packetizer what the RTP Payload Id is. + @param[in] ssrc Tells the IP packetizer what the RTP SSRC is. + **/ + AJA_VIRTUAL bool AncInsertSetIPParams (const UWord inSDIOutput, const UWord ancChannel, const ULWord payloadID, const ULWord ssrc); + + /** + @brief Answers where, in device SDRAM, the given SDI connector's Anc inserter is currently reading Anc data for playout. + @return True if successful; otherwise false. + @param[in] inSDIOutput Specifies the SDI output of interest (e.g., 0=SDIOut1, 1=SDIOut2, etc.). + @param[out] outF1StartAddr Receives the Anc inserter's current F1 starting address. + @param[out] outF2StartAddr Receives the Anc inserter's current F2 starting address. + **/ + AJA_VIRTUAL bool AncInsertGetReadInfo (const UWord inSDIOutput, uint64_t & outF1StartAddr, uint64_t & outF2StartAddr); // New in SDK v16.2 + + + /** + @brief Initializes the given SDI input's Anc extractor for custom Anc packet detection and de-embedding. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports custom Anc extractor firmware.) + @return True if successful; otherwise false. + @param[in] inSDIInput Specifies the SDI input of interest (e.g., 0=SDIOut1, 1=SDIOut2, etc.). + @param[in] inChannel Optionally specifies the ::NTV2Channel (FrameStore) that's fed from the SDI input, + if different from the SDI input. The default is to use the same ::NTV2Channel + that corresponds to the given SDI input (e.g., ::NTV2_CHANNEL1 == 0 == SDIIn1). + @param[in] inStandard Optionally overrides the ::NTV2Standard used to initialize the Anc extractor. + Defaults to using the ::NTV2Standard of the ::NTV2Channel being used. + @note This function is provided for capture methods that don't use \ref aboutautocirculate. + \ref aboutautocirculate based applications should not call this function. + @see CNTV2Card::AncExtractSetEnable, CNTV2Card::AncExtractSetWriteParams, + CNTV2Card::AncExtractSetFilterDIDs, \ref anccapture + **/ + AJA_VIRTUAL bool AncExtractInit (const UWord inSDIInput, const NTV2Channel inChannel = NTV2_CHANNEL_INVALID, + const NTV2Standard inStandard = NTV2_STANDARD_INVALID); + + /** + @brief Enables or disables the Anc extraction components for the given SDI input. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports custom Anc extractor firmware.) + @return True if successful; otherwise false. + @param[in] inSDIInput Specifies the SDI input of interest (e.g., 0=SDIIn1, 1=SDIIn2, etc.). + @param[in] inVancY Specify true to enable Vanc Y component extraction; otherwise false to disable it. + @param[in] inVancC Specify true to enable Vanc C component extraction; otherwise false to disable it. + @param[in] inHancY Specify true to enable Hanc Y component extraction; otherwise false to disable it. + @param[in] inHancC Specify true to enable Hanc C component extraction; otherwise false to disable it. + @note This function is provided for capture methods that don't use \ref aboutautocirculate. + \ref aboutautocirculate based applications should not call this function. + **/ + AJA_VIRTUAL bool AncExtractSetComponents (const UWord inSDIInput, + const bool inVancY, const bool inVancC, + const bool inHancY, const bool inHancC); // New in SDK 16.0 + + /** + @brief Enables or disables the given SDI input's Anc extractor. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports custom Anc extractor firmware.) + @return True if successful; otherwise false. + @param[in] inSDIInput Specifies the SDI input of interest (e.g., 0=SDIIn1, 1=SDIIn2, etc.). + @param[in] inIsEnabled Specify true to enable the Anc extractor; otherwise false to disable it. + @note This function is provided for capture methods that don't use \ref aboutautocirculate. + \ref aboutautocirculate based applications should not call this function. + @see CNTV2Card::AncExtractIsEnabled, \ref anccapture + **/ + AJA_VIRTUAL bool AncExtractSetEnable (const UWord inSDIInput, const bool inIsEnabled); + + /** + @brief Answers whether the given SDI input's Anc extractor is enabled/active or not. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports Anc extractor firmware.) + @return True if successful; otherwise false. + @param[in] inSDIInput Specifies the SDI input of interest as a zero-based index value (e.g., 0 == SDIIn1). + @param[out] outIsEnabled Receives 'true' if the Anc extractor is enabled (running); otherwise false. + @see CNTV2Card::AncExtractSetEnable, \ref anccapture + **/ + AJA_VIRTUAL bool AncExtractIsEnabled (const UWord inSDIInput, bool & outIsEnabled); + + /** + @brief Configures the given SDI input's Anc extractor to receive the next frame's F1 Anc data. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports custom Anc inserter firmware.) + @return True if successful; otherwise false. + @param[in] inSDIInput Specifies the SDI input of interest (e.g., 0=SDIIn1, 1=SDIIn2, etc.). + @param[in] inFrameNumber Tells the Anc inserter where to write the received Anc data, specified as a + frame number. + @param[in] inChannel Optionally specifies the ::NTV2Channel (FrameStore) that's driving the SDI input, + if different from the SDI input. The default is to use the same ::NTV2Channel + that corresponds to the SDI input (e.g., ::NTV2_CHANNEL1 == 0 == SDIIn1). + @param[in] inFrameSize Optionally overrides the ::NTV2Framesize used to calculate the Anc buffer location + in device SDRAM. Defaults to using the ::NTV2Framesize of the ::NTV2Channel being used. + @note This function is provided for capture methods that don't use \ref aboutautocirculate. + \ref aboutautocirculate based applications should not call this function. + @see CNTV2Card::AncExtractSetField2WriteParams, \ref anccapture + **/ + AJA_VIRTUAL bool AncExtractSetWriteParams (const UWord inSDIInput, const ULWord inFrameNumber, + const NTV2Channel inChannel = NTV2_CHANNEL_INVALID, + const NTV2Framesize inFrameSize = NTV2_FRAMESIZE_INVALID); + + /** + @brief Configures the given SDI input's Anc extractor to receive the next frame's F2 Anc data. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports custom Anc inserter firmware.) + @return True if successful; otherwise false. + @param[in] inSDIInput Specifies the SDI input of interest (e.g., 0=SDIIn1, 1=SDIIn2, etc.). + @param[in] inFrameNumber Tells the Anc inserter where to write the received Anc data, specified as a + frame number. + @param[in] inChannel Optionally specifies the ::NTV2Channel (FrameStore) that's driving the SDI input, + if different from the SDI input. The default is to use the same ::NTV2Channel + that corresponds to the SDI input (e.g., ::NTV2_CHANNEL1 == 0 == SDIIn1). + @param[in] inFrameSize Optionally overrides the ::NTV2Framesize used to calculate the Anc buffer location + in device SDRAM. Defaults to using the ::NTV2Framesize of the ::NTV2Channel being used. + @note This function is provided for capture methods that don't use \ref aboutautocirculate. + \ref aboutautocirculate based applications should not call this function. + @see CNTV2Card::AncExtractSetWriteParams, \ref anccapture + **/ + AJA_VIRTUAL bool AncExtractSetField2WriteParams (const UWord inSDIInput, const ULWord inFrameNumber, + const NTV2Channel inChannel = NTV2_CHANNEL_INVALID, + const NTV2Framesize inFrameSize = NTV2_FRAMESIZE_INVALID); + + /** + @brief Answers with the given SDI input's current Anc extractor info. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports custom Anc inserter firmware.) + @return True if successful; otherwise false. + @param[in] inSDIInput Specifies the SDI input of interest (e.g., 0=SDIIn1, 1=SDIIn2, etc.). + @param[out] outF1StartAddr Receives the device SDRAM offset where the extractor starts writing F1 anc data. + @param[out] outF1EndAddr Receives the device SDRAM offset where the extractor will stop writing F1 anc data. + @param[out] outF2StartAddr Receives the device SDRAM offset where the extractor starts writing F2 anc data. + @param[out] outF2EndAddr Receives the device SDRAM offset where the extractor will stop writing F2 anc data. + @see \ref anccapture + **/ + AJA_VIRTUAL bool AncExtractGetWriteInfo (const UWord inSDIInput, + uint64_t & outF1StartAddr, uint64_t & outF1EndAddr, + uint64_t & outF2StartAddr, uint64_t & outF2EndAddr); // New in SDK v16.2 + + /** + @brief Answers with the DIDs currently being excluded (filtered) by the SDI input's Anc extractor. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports Anc extractor firmware.) + @return True if successful; otherwise false. + @param[in] inSDIInput Specifies the SDI input of interest (e.g., 0=SDIIn1, 1=SDIIn2, etc.). + @param[out] outDIDs Receives the ::NTV2DIDSet that contain the DIDs that are currently being + filtered (excluded). + @see CNTV2Card::AncExtractSetFilterDIDs, \ref anccapture-filter + **/ + AJA_VIRTUAL bool AncExtractGetFilterDIDs (const UWord inSDIInput, NTV2DIDSet & outDIDs); + + /** + @brief Replaces the DIDs to be excluded (filtered) by the given SDI input's Anc extractor. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports Anc extractor firmware.) + @return True if successful; otherwise false. + @param[in] inSDIInput Specifies the SDI input of interest (e.g., 0=SDIIn1, 1=SDIIn2, etc.). + @param[in] inDIDs Specifies the DIDs to be filtered (excluded). Specify an empty set to + disable all packet filtering. + @note DIDs having the value 0 (zero) are ignored. + @see CNTV2Card::AncExtractGetFilterDIDs, \ref anccapture-filter + **/ + AJA_VIRTUAL bool AncExtractSetFilterDIDs (const UWord inSDIInput, const NTV2DIDSet & inDIDs); + + /** + @brief Answers with the number of bytes of field 1 ANC extracted. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports Anc extractor firmware.) + @return True if successful; otherwise false. + @param[in] inSDIInput Specifies the SDI input of interest (e.g., 0=SDIIn1, 1=SDIIn2, etc.). + @param[out] outF1Size Receives the number of bytes of field 1 ANC extracted; + **/ + AJA_VIRTUAL bool AncExtractGetField1Size (const UWord inSDIInput, ULWord & outF1Size); + + /** + @brief Answers with the number of bytes of field 2 ANC extracted. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports Anc extractor firmware.) + @return True if successful; otherwise false. + @param[in] inSDIInput Specifies the SDI input of interest (e.g., 0=SDIIn1, 1=SDIIn2, etc.). + @param[out] outF2Size Receives the number of bytes of field 2 ANC extracted; + **/ + AJA_VIRTUAL bool AncExtractGetField2Size (const UWord inSDIInput, ULWord & outF2Size); + + /** + @brief Answers whether or not the given SDI input's Anc extractor reached its buffer limits. + (Call ::NTV2DeviceCanDoCustomAnc to determine if the device supports Anc extractor firmware.) + @return True if successful; otherwise false. + @param[in] inSDIInput Specifies the SDI input of interest (e.g., 0=SDIIn1, 1=SDIIn2, etc.). + @param[out] outIsOverrun Receives true if the extractor is reporting that it overran its buffer limits; + otherwise false if it didn't. + @param[in] inField Optionally specifies the field of interest. Specify 0 for the "total" buffer + overflow between the F1 and F2 buffers; specify 1 for Field 1; specify 2 for Field 2. + Defaults to zero (the "total"). (Added in SDK 16.1) + @note The extractor will not actually write any Anc bytes past its "stop" address, but it will + report that it was about to via this "overrun" flag. + **/ + AJA_VIRTUAL bool AncExtractGetBufferOverrun (const UWord inSDIInput, bool & outIsOverrun, const UWord inField = 0); + + /** + @return The maximum number of distinct DIDs that the device Anc extractor filter can accommodate. + @see CNTV2Card::AncExtractSetFilterDIDs, CNTV2Card::AncExtractGetDefaultDIDs, \ref anccapture-filter + **/ + static UWord AncExtractGetMaxNumFilterDIDs (void); + + /** + @return The default DIDs that the device Anc extractor filter is started with. + @param[in] inHDAudio Optionally specifies the desired audio packet filtering. + Specify true (the default) for the default HD audio packet DIDs; + otherwise false for the default SD audio packet DIDs. + @see CNTV2Card::AncExtractSetFilterDIDs, CNTV2Card::AncExtractGetMaxNumFilterDIDs, \ref anccapture-filter + **/ + static NTV2DIDSet AncExtractGetDefaultDIDs (const bool inHDAudio = true); + + +#if !defined(NTV2_DEPRECATE_14_3) + // Deprecated Anc APIs (to be deprecated in a future SDK): + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetAncInserterRunState (const UWord inSDIOutput, bool & outIsRunning)) {return AncInsertIsEnabled(inSDIOutput, outIsRunning);} ///< @deprecated Use AncInsertIsEnabled instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetAncExtractorRunState (const UWord inSDIInput, bool & outIsRunning)) {return AncExtractIsEnabled(inSDIInput, outIsRunning);} ///< @deprecated Use AncExtractIsEnabled instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetAncExtractorFilterDIDs (const UWord inSDIInput, NTV2DIDSet & outDIDs)) {return AncExtractGetFilterDIDs(inSDIInput, outDIDs);} ///< @deprecated Use AncExtractGetFilterDIDs instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetAncExtractorFilterDIDs (const UWord inSDIInput, const NTV2DIDSet & inDIDs)) {return AncExtractSetFilterDIDs(inSDIInput, inDIDs);} ///< @deprecated Use AncExtractSetFilterDIDs instead. + static inline NTV2_DEPRECATED_f(UWord GetMaxNumAncExtractorFilterDIDs(void)) {return AncExtractGetMaxNumFilterDIDs();} ///< @deprecated Use AncExtractGetMaxNumFilterDIDs instead. + static inline NTV2_DEPRECATED_f(NTV2DIDSet GetDefaultAncExtractorDIDs(void)) {return AncExtractGetDefaultDIDs();} ///< @deprecated Use AncExtractGetDefaultDIDs instead. +#endif // NTV2_DEPRECATE_14_3 + ///@} + + /** + @name TCP/IP + **/ + ///@{ + AJA_VIRTUAL bool AcquireMailBoxLock (void); + AJA_VIRTUAL bool ReleaseMailBoxLock (void); + AJA_VIRTUAL bool AbortMailBoxLock (void); + ///@} + + /** + @name Misc + **/ + ///@{ + /** + @brief Reads the current die temperature of the device. + @param[out] outTemp Receives the temperature value that was read from the device. + @param[in] inTempScale Specifies the temperature unit scale to use. Defaults to Celsius. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetDieTemperature (double & outTemp, const NTV2DieTempScale inTempScale = NTV2DieTempScale_Celsius); + + /** + @brief Reads the current "Vcc" voltage of the device. + @param[out] outVoltage Receives the "Vcc" voltage that was read from the device. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetDieVoltage (double & outVoltage); + ///@} +public: + #if !defined (NTV2_DEPRECATE) + // These functions all came from the CNTV2Status module... + AJA_VIRTUAL NTV2_DEPRECATED_f(NTV2ButtonState GetButtonState (int buttonBit)); ///< @deprecated This function is obsolete. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(Word GetBoardVersion (void)) {return GetDeviceVersion ();} ///< @deprecated Use GetDeviceVersion instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(void GetBoardVersionString (std::string & outString)) {outString = GetDeviceVersionString ();} ///< @deprecated Use GetDeviceVersionString instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(void GetFPGAVersionString (std::string & outString, const NTV2XilinxFPGA inFPGA = eFPGAVideoProc)) {outString = GetFPGAVersionString (inFPGA);} ///< @deprecated Use the GetFPGAVersionString function that returns a std::string instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(void GetPCIFPGAVersionString (std::string & outString)) {outString = GetPCIFPGAVersionString ();} ///< @deprecated Use the GetPCIFPGAVersionString function that returns a std::string instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(void GetBootFPGAVersionString (std::string & outString)) {outString.clear ();} ///< @deprecated This function is obsolete. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(void GetDriverVersionString (std::string & outString)) {outString = GetDriverVersionString ();} ///< @deprecated Use the GetDriverVersionString function that returns a std::string instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(void GetBoardIDString (std::string & outString)); ///< @deprecated Obsolete. Convert the result of GetDeviceID() into a hexa string instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(std::string GetBoardIDString (void)); ///< @deprecated Obsolete. Convert the result of GetDeviceID() into a hex string instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetBitFileInformation (ULWord & outNumBytes, std::string & outDateStr, std::string & outTimeStr, NTV2XilinxFPGA inFPGA = eFPGAVideoProc)); ///< @deprecated This function is obsolete (from CNTV2Status). + AJA_VIRTUAL NTV2_DEPRECATED_f(Word GetFPGAVersion (const NTV2XilinxFPGA inFPGA = eFPGAVideoProc)); ///< @deprecated This function is obsolete (from CNTV2Status). + #endif // !defined (NTV2_DEPRECATE) + + AJA_VIRTUAL std::string GetFPGAVersionString (const NTV2XilinxFPGA inFPGA = eFPGAVideoProc); + + AJA_VIRTUAL Word GetPCIFPGAVersion (void); // From CNTV2Status + AJA_VIRTUAL std::string GetPCIFPGAVersionString (void); + + /** + @brief Returns the size and time/date stamp of the device's currently-installed firmware. + @param[out] outNumBytes Receives the size of the installed firmware image, in bytes. + @param[out] outDateStr Receives a human-readable string containing the date the currently-installed firmware was built. + The string has the format "YYYY/MM/DD", where "YYYY" is the year, "MM" is the month ("00" thru "12"), + and "DD" is the day of the month ("00" thru "31"). + @param[out] outTimeStr Receives a human-readable string containing the time the currently-installed firmware was built + (in local Pacific time). The string has the format "HH:MM:SS", where HH is "00" thru "23", + and both MM and SS are "00" thru "59". + @return True if successful; otherwise false. + @note This function has nothing to do with the firmware bitfiles that are currently installed on the local host's file system. + **/ + AJA_VIRTUAL bool GetInstalledBitfileInfo (ULWord & outNumBytes, std::string & outDateStr, std::string & outTimeStr); + + /** + @brief Generates and returns an info string with date, time and name for the given inBifFileInfo. + @param[in] inBitFileInfo BitFile Info structure to get information from, no validity checks are made on the structure before use. + @return A string containing the bitfile information. + **/ + AJA_VIRTUAL std::string GetBitfileInfoString (const BITFILE_INFO_STRUCT & inBitFileInfo); + + /** + @brief Answers whether or not the "fail-safe" (aka "safe-boot") bitfile is currently loaded and running in the FPGA. + @param[out] outIsFailSafe Receives true if the "fail-safe" bitfile is currently loaded and running in the FPGA; + otherwise receives false. This return value cannot be trusted if the function result + is false. + @return True if successful; otherwise false. + @note The "outIsFailSafe" answer can only be trusted if the function result is true. + @see ::NTV2DeviceCanReportFailSafeLoaded + **/ + AJA_VIRTUAL bool IsFailSafeBitfileLoaded (bool & outIsFailSafe); + + /** + @brief Answers whether or not the FPGA can be reloaded without powering off. + @param[out] outCanWarmBoot Receives true if the FPGA can be reloaded without powering off the device. + Receives false if it can only be reloaded after power-cycling. + @return True if successful; otherwise false. + @note The "outCanWarmBoot" answer can only be trusted if the function result is true. + **/ + AJA_VIRTUAL bool CanWarmBootFPGA (bool & outCanWarmBoot); + + AJA_VIRTUAL bool IsDynamicDevice (void); ///< @return True if this device can quickly change bitfiles; otherwise false. + AJA_VIRTUAL bool IsDynamicFirmwareLoaded(void); ///< @return True if the device has been dynamically reconfigured; otherwise false. + AJA_VIRTUAL NTV2DeviceID GetBaseDeviceID(); ///< @return Return base device id for IsDynamicDevice, otherwise DEVICE_ID_INVALID + AJA_VIRTUAL NTV2DeviceIDList GetDynamicDeviceList (void); ///< @return A list of supported/available dynamic device IDs. + AJA_VIRTUAL NTV2DeviceIDSet GetDynamicDeviceIDs (void); ///< @return A set of supported/available dynamic device IDs. + + /** + @param[in] inDeviceID Specifies the device ID of interest. + @return True if the given ::NTV2DeviceID can be dynamically loaded; otherwise false. + **/ + AJA_VIRTUAL bool CanLoadDynamicDevice (const NTV2DeviceID inDeviceID); + + /** + @brief Quickly, dynamically loads the given device ID firmware. + @param[in] inDeviceID Specifies the device ID of interest. + @return True if loaded successfully; otherwise false. + @note If successful, calling CNTV2Card::GetDeviceID will return the same ::NTV2DeviceID + as "inDeviceID". This CNTV2Card instance will be talking to the same hardware + device, but it will have a different personality with different capabilities. + **/ + AJA_VIRTUAL bool LoadDynamicDevice (const NTV2DeviceID inDeviceID); + + /** + @brief Adds the given bitfile to the list of available dynamic bitfiles. + @param[in] inBitfilePath A string containing the path to the bitfile. + @return True if added successfully; otherwise false. + **/ + AJA_VIRTUAL bool AddDynamicBitfile (const std::string & inBitfilePath); + + /** + @brief Adds all bitfiles found in the given host file directory to the list + of available dynamic bitfiles. + @param[in] inDirectory A string containing the path to the directory. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool AddDynamicDirectory (const std::string & inDirectory); + + /** + @brief Returns a string containing the decoded, human-readable device serial number. + @param[in] inSerialNumber Specifies the 64-bit device serial number. + @return A string containing the decoded, human-readable device serial number. If invalid, returns the string "INVALID?". + **/ + static std::string SerialNum64ToString (const uint64_t inSerialNumber); + + typedef enum + { + RED, + GREEN, + BLUE, + NUM_COLORS + } ColorCorrectionColor; // From CNTV2ColorCorrection + +protected: + static NTV2_POINTER NULL_POINTER; ///< @brief Used for default empty NTV2_POINTER parameters -- do not modify. + +public: + /** + @name HEVC-Specific Functions + **/ + ///@{ + /** + @brief Returns the driver version and time/date stamp of the hevc device's currently-installed firmware. + @param[out] pInfo HevcDeviceInfo structure to receive the information. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool HevcGetDeviceInfo (HevcDeviceInfo* pInfo); + + /** + @brief Write an hevc register. + @param[in] address Hevc register byte address + @param[in] value Hevc register data + @param[in] mask Read bit mask + @param[in] shift Read bit shift + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool HevcWriteRegister (ULWord address, ULWord value, ULWord mask = 0xffffffff, ULWord shift = 0); + + /** + @brief Read an hevc register. + @param[in] address Hevc register byte address + @param[out] pValue Hevc register data + @param[in] mask Read bit mask + @param[in] shift Read bit shift + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool HevcReadRegister (ULWord address, ULWord* pValue, ULWord mask = 0xffffffff, ULWord shift = 0); + + /** + @brief Send a command to the hevc device. See the hevc codec documentation for details on commands. + @param[in] pCommand HevcDeviceCommand structure with the command parameters. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool HevcSendCommand (HevcDeviceCommand* pCommand); + + /** + @brief Transfer video to/from the hevc device. + @param[in] pTransfer HevcDeviceTransfer structure with the transfer parameters. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool HevcVideoTransfer (HevcDeviceTransfer* pTransfer); + + /** + @brief Get the status of the hevc device. + @param[in] pStatus HevcDeviceDebug structure to receive the information. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool HevcGetStatus (HevcDeviceStatus* pStatus); + + /** + @brief Get debug data from the hevc device. + @param[in] pDebug HevcDeviceStatus structure to receive the information. This is an expanded version + of the device status that contains performance information. This structure may change + more often. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool HevcDebugInfo (HevcDeviceDebug* pDebug); + ///@} + + /** + @name HDR Support + **/ + ///@{ + /** + @brief Enables or disables HDMI HDR. + @param[in] inEnableHDMIHDR If true, sets the device to output HDMI HDR Metadata; otherwise sets the device to not output HDMI HDR Metadata. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool EnableHDMIHDR (const bool inEnableHDMIHDR); + AJA_VIRTUAL bool GetHDMIHDREnabled (void); ///< @return True if HDMI HDR metadata output is enabled for the device; otherwise false. + + /** + @brief Enables or disables HDMI HDR Dolby Vision. + @param[in] inEnable If true, sets the device to output HDMI HDR Dolby Vision; otherwise sets the device to not output HDMI HDR Dolby Vision. + @note This function only affects Dolby HDR signaling. The client application is responsible for transferring Dolby-encoded pixel data from the + host to the device frame buffer(s) for HDMI transmission. + @see CNTV2Card::GetHDMIHDRDolbyVisionEnabled + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool EnableHDMIHDRDolbyVision (const bool inEnable); + AJA_VIRTUAL bool GetHDMIHDRDolbyVisionEnabled (void); ///< @return True if HDMI HDR Dolby Vision output is enabled for the device; otherwise false. + + + /** + @brief Enables or disables BT.2020 Y'cC'bcC'rc versus BT.2020 Y'C'bC'r or R'G'B'. + @param[in] inEnableConstantLuminance If true, sets the device to BT.2020 Y'cC'bcC'rc; otherwise sets the device to BT.2020 Y'C'bC'r or R'G'B'. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIHDRConstantLuminance (const bool inEnableConstantLuminance); + AJA_VIRTUAL bool GetHDMIHDRConstantLuminance (void); ///< @return True if BT.2020 Y'cC'bcC'rc is enabled; otherwise false for BT.2020 Y'C'bC'r or R'G'B'. + + /** + @brief Sets the Display Mastering data for Green Primary X as defined in SMPTE ST 2086. This is Byte 3 and 4 of SMDT Type 1. + @param[in] inGreenPrimaryX Specifies the Green Primary X value as defined in SMPTE ST 2086. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIHDRGreenPrimaryX (const uint16_t inGreenPrimaryX); + /** + @brief Answers with the Display Mastering data for Green Primary X as defined in SMPTE ST 2086. This is Byte 3 and 4 of SMDT Type 1. + @param[out] outGreenPrimaryX Receives the Green Primary X value as defined in SMPTE ST 2086. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIHDRGreenPrimaryX (uint16_t & outGreenPrimaryX); + + /** + @brief Sets the Display Mastering data for Green Primary Y as defined in SMPTE ST 2086. This is Byte 5 and 6 of SMDT Type 1. + @param[in] inGreenPrimaryY Specifies the Green Primary Y value as defined in SMPTE ST 2086. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIHDRGreenPrimaryY (const uint16_t inGreenPrimaryY); + /** + @brief Answers with the Display Mastering data for Green Primary Y as defined in SMPTE ST 2086. This is Byte 5 and 6 of SMDT Type 1. + @param[out] outGreenPrimaryY Receives the Green Primary Y value as defined in SMPTE ST 2086. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIHDRGreenPrimaryY (uint16_t & outGreenPrimaryY); + + /** + @brief Sets the Display Mastering data for Blue Primary X as defined in SMPTE ST 2086. This is Byte 7 and 8 of SMDT Type 1. + @param[in] inBluePrimaryX Specifies the Blue Primary X value as defined in SMPTE ST 2086. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIHDRBluePrimaryX (const uint16_t inBluePrimaryX); + /** + @brief Answers with the Display Mastering data for Blue Primary X as defined in SMPTE ST 2086. This is Byte 7 and 8 of SMDT Type 1. + @param[out] outBluePrimaryX Receives the Blue Primary X value as defined in SMPTE ST 2086. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIHDRBluePrimaryX (uint16_t & outBluePrimaryX); + + /** + @brief Sets the Display Mastering data for Blue Primary Y as defined in SMPTE ST 2086. This is Byte 9 and 10 of SMDT Type 1. + @param[in] inBluePrimaryY Specifies the Blue Primary Y value as defined in SMPTE ST 2086. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIHDRBluePrimaryY (const uint16_t inBluePrimaryY); + /** + @brief Answers with the Display Mastering data for Blue Primary Y as defined in SMPTE ST 2086. This is Byte 9 and 10 of SMDT Type 1. + @param[out] outBluePrimaryY Receives the Blue Primary Y value as defined in SMPTE ST 2086. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIHDRBluePrimaryY (uint16_t & outBluePrimaryY); + + /** + @brief Sets the Display Mastering data for Red Primary X as defined in SMPTE ST 2086. This is Byte 11 and 12 of SMDT Type 1. + @param[in] inRedPrimaryX Specifies the Red Primary X value as defined in SMPTE ST 2086. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIHDRRedPrimaryX (const uint16_t inRedPrimaryX); + /** + @brief Answers with the Display Mastering data for Red Primary X as defined in SMPTE ST 2086. This is Byte 11 and 12 of SMDT Type 1. + @param[out] outRedPrimaryX Receives the Red Primary X value as defined in SMPTE ST 2086. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIHDRRedPrimaryX (uint16_t & outRedPrimaryX); + + /** + @brief Sets the Display Mastering data for Red Primary Y as defined in SMPTE ST 2086. This is Byte 13 and 14 of SMDT Type 1. + @param[in] inRedPrimaryY Specifies the Red Primary Y value as defined in SMPTE ST 2086. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIHDRRedPrimaryY (const uint16_t inRedPrimaryY); + /** + @brief Answers with the Display Mastering data for Red Primary Y as defined in SMPTE ST 2086. This is Byte 13 and 14 of SMDT Type 1. + @param[out] outRedPrimaryY Receives the Red Primary Y value as defined in SMPTE ST 2086. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIHDRRedPrimaryY (uint16_t & outRedPrimaryY); + + /** + @brief Sets the Display Mastering data for White Point X as defined in SMPTE ST 2086. This is Byte 15 and 16 of SMDT Type 1. + @param[in] inWhitePointX Specifies the White Point X value as defined in SMPTE ST 2086. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIHDRWhitePointX (const uint16_t inWhitePointX); + /** + @brief Answers with the Display Mastering data for White Point X as defined in SMPTE ST 2086. This is Byte 15 and 16 of SMDT Type 1. + @param[out] outWhitePointX Receives the White Point X value as defined in SMPTE ST 2086. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIHDRWhitePointX (uint16_t & outWhitePointX); + + /** + @brief Sets the Display Mastering data for White Point Y as defined in SMPTE ST 2086. This is Byte 17 and 18 of SMDT Type 1. + @param[in] inWhitePointY Specifies the White Point Y value as defined in SMPTE ST 2086. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIHDRWhitePointY (const uint16_t inWhitePointY); + /** + @brief Answers with the Display Mastering data for White Point Y as defined in SMPTE ST 2086. This is Byte 17 and 18 of SMDT Type 1. + @param[out] outWhitePointY Receives the White Point Y value as defined in SMPTE ST 2086. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIHDRWhitePointY (uint16_t & outWhitePointY); + + /** + @brief Sets the Display Mastering data for the Max Mastering Luminance value as defined in SMPTE ST 2086. This is Byte 19 and 20 of SMDT Type 1. + @param[in] inMaxMasteringLuminance Specifies the Max Mastering Luminance value. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIHDRMaxMasteringLuminance (const uint16_t inMaxMasteringLuminance); + /** + @brief Answers with the Display Mastering data for the Max Mastering Luminance value as defined in SMPTE ST 2086. This is Byte 19 and 20 of SMDT Type 1. + @param[out] outMaxMasteringLuminance Receives the Max Mastering Luminance value. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIHDRMaxMasteringLuminance (uint16_t & outMaxMasteringLuminance); + + /** + @brief Sets the Display Mastering data for the Min Mastering Luminance value as defined in SMPTE ST 2086. This is Byte 21 and 22 of SMDT Type 1. + @param[in] inMinMasteringLuminance Specifies the Min Mastering Luminance value. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIHDRMinMasteringLuminance (const uint16_t inMinMasteringLuminance); + /** + @brief Answers with the Display Mastering data for the Min Mastering Luminance value as defined in SMPTE ST 2086. This is Byte 21 and 22 of SMDT Type 1. + @param[out] outMinMasteringLuminance Receives the Min Mastering Luminance value. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIHDRMinMasteringLuminance (uint16_t & outMinMasteringLuminance); + + /** + @brief Sets the Display Mastering data for the Max Content Light Level(Max CLL) value. This is Byte 23 and 24 of SMDT Type 1. + @param[in] inMaxContentLightLevel Specifies the Max Content Light Level value. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIHDRMaxContentLightLevel (const uint16_t inMaxContentLightLevel); + /** + @brief Answers with the Display Mastering data for the Max Content Light Level(Max CLL) value. This is Byte 23 and 24 of SMDT Type 1. + @param[out] outMaxContentLightLevel Receives the Max Content Light Level value. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIHDRMaxContentLightLevel (uint16_t & outMaxContentLightLevel); + + /** + @brief Sets the Display Mastering data for the Max Frame Average Light Level(Max FALL) value. This is Byte 25 and 26 of SMDT Type 1. + @param[in] inMaxFrameAverageLightLevel Specifies the Max Frame Average Light Level value. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool SetHDMIHDRMaxFrameAverageLightLevel (const uint16_t inMaxFrameAverageLightLevel); + /** + @brief Answers with the Display Mastering data for the Max Frame Average Light Level(Max FALL) value. This is Byte 25 and 26 of SMDT Type 1. + @param[out] outMaxFrameAverageLightLevel Receives the Max Frame Average Light Level value. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetHDMIHDRMaxFrameAverageLightLevel (uint16_t & outMaxFrameAverageLightLevel); + + + AJA_VIRTUAL bool SetHDMIHDRElectroOpticalTransferFunction (const uint8_t inEOTFByte); + AJA_VIRTUAL bool GetHDMIHDRElectroOpticalTransferFunction (uint8_t & outEOTFByte); + AJA_VIRTUAL bool SetHDMIHDRStaticMetadataDescriptorID (const uint8_t inSMDId); + AJA_VIRTUAL bool GetHDMIHDRStaticMetadataDescriptorID (uint8_t & outSMDId); + + AJA_VIRTUAL bool SetHDRData (const HDRFloatValues & inFloatValues); + AJA_VIRTUAL bool SetHDRData (const HDRRegValues & inRegisterValues); + AJA_VIRTUAL bool GetHDRData (HDRFloatValues & outFloatValues); + AJA_VIRTUAL bool GetHDRData (HDRRegValues & outRegisterValues); + AJA_VIRTUAL bool SetHDMIHDRBT2020 (void); + AJA_VIRTUAL bool SetHDMIHDRDCIP3 (void); + + AJA_VIRTUAL bool SetVPIDTransferCharacteristics (const NTV2VPIDTransferCharacteristics inValue, const NTV2Channel inChannel); + AJA_VIRTUAL bool GetVPIDTransferCharacteristics (NTV2VPIDTransferCharacteristics & outValue, const NTV2Channel inChannel); + AJA_VIRTUAL bool SetVPIDColorimetry (const NTV2VPIDColorimetry inValue, const NTV2Channel inChannel); + AJA_VIRTUAL bool GetVPIDColorimetry (NTV2VPIDColorimetry & outValue, const NTV2Channel inChannel); + AJA_VIRTUAL bool SetVPIDLuminance (const NTV2VPIDLuminance inValue, const NTV2Channel inChannel); + AJA_VIRTUAL bool GetVPIDLuminance (NTV2VPIDLuminance & outValue, const NTV2Channel inChannel); + AJA_VIRTUAL bool SetVPIDRGBRange (const NTV2VPIDRGBRange inValue, const NTV2Channel inChannel); + AJA_VIRTUAL bool GetVPIDRGBRange (NTV2VPIDRGBRange & outValue, const NTV2Channel inChannel); + + AJA_VIRTUAL bool Set3DLUTTableLocation (const ULWord inFrameNumber, ULWord inLUTIndex = 0); + AJA_VIRTUAL bool Load3DLUTTable (); + AJA_VIRTUAL bool Set1DLUTTableLocation (const NTV2Channel inChannel, const ULWord inFrameNumber, ULWord inLUTIndex = 0); + AJA_VIRTUAL bool Load1DLUTTable (const NTV2Channel inChannel); + + // MultiViewer/MultiRasterizer + AJA_VIRTUAL bool HasMultiRasterWidget (void); // New in SDK 16.1 + AJA_VIRTUAL bool SetMultiRasterBypassEnable (const bool inEnable); // New in SDK 16.1 + AJA_VIRTUAL bool GetMultiRasterBypassEnable (bool & outEnabled); // New in SDK 16.1 + AJA_VIRTUAL bool IsMultiRasterWidgetChannel (const NTV2Channel inChannel); // New in SDK 16.2 + + ///@} + +#if !defined(NTV2_DEPRECATE_14_3) + // Consolidate all pointer-based "getter" functions here for future deprecation... + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetReference (NTV2ReferenceSource * pOutValue) ) {return pOutValue ? GetReference(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetEveryFrameServices (NTV2EveryFrameTaskMode * pOutMode) ) {return pOutMode ? GetEveryFrameServices(*pOutMode) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetDefaultVideoOutMode (ULWord * pOutMode) ) {return pOutMode ? GetDefaultVideoOutMode(*pOutMode) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetNumberActiveLines (ULWord * pOutNumActiveLines) ) {return pOutNumActiveLines ? GetNumberActiveLines(*pOutNumActiveLines) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetProgressivePicture (ULWord * pOutValue) ) {return pOutValue ? GetProgressivePicture(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetAlphaFromInput2Bit (ULWord * pOutValue) ) {return pOutValue ? GetAlphaFromInput2Bit(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetDualLinkOutputEnable (bool * pOutIsEnabled) ) {return pOutIsEnabled ? GetDualLinkOutputEnable(*pOutIsEnabled) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetDualLinkInputEnable (bool * pOutIsEnabled) ) {return pOutIsEnabled ? GetDualLinkInputEnable(*pOutIsEnabled) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetVideoLimiting (NTV2VideoLimiting * pOutValue) ) {return pOutValue ? GetVideoLimiting(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadLineCount (ULWord * pOutValue) ) {return pOutValue ? ReadLineCount(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadFlashProgramControl (ULWord * pOutValue) ) {return pOutValue ? ReadFlashProgramControl(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetLEDState (ULWord * pOutValue) ) {return pOutValue ? GetLEDState(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetVideoDACMode (NTV2VideoDACMode * pOutValue) ) {return pOutValue ? GetVideoDACMode(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetAnalogOutHTiming (ULWord * pOutValue) ) {return pOutValue ? GetAnalogOutHTiming(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetUpConvertMode (NTV2UpConvertMode * pOutValue) ) {return pOutValue ? GetUpConvertMode(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetConverterOutStandard (NTV2Standard * pOutValue) ) {return pOutValue ? GetConverterOutStandard(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetConverterOutRate (NTV2FrameRate * pOutValue) ) {return pOutValue ? GetConverterOutRate(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetConverterInStandard (NTV2Standard * pOutValue) ) {return pOutValue ? GetConverterInStandard(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetConverterInRate (NTV2FrameRate * pOutValue) ) {return pOutValue ? GetConverterInRate(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetConverterPulldown (ULWord * pOutValue) ) {return pOutValue ? GetConverterPulldown(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetUCPassLine21 (ULWord * pOutValue) ) {return pOutValue ? GetUCPassLine21(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetUCAutoLine21 (ULWord * pOutValue) ) {return pOutValue ? GetUCAutoLine21(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetDownConvertMode (NTV2DownConvertMode * pOutValue) ) {return pOutValue ? GetDownConvertMode(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetIsoConvertMode (NTV2IsoConvertMode * pOutValue) ) {return pOutValue ? GetIsoConvertMode(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetEnableConverter (bool * pOutValue) ) {return pOutValue ? GetEnableConverter(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetDeinterlaceMode (ULWord * pOutValue) ) {return pOutValue ? GetDeinterlaceMode(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetSecondConverterOutStandard (NTV2Standard * pOutValue) ) {return pOutValue ? GetSecondConverterOutStandard(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetSecondConverterInStandard (NTV2Standard * pOutValue) ) {return pOutValue ? GetSecondConverterInStandard(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetSecondDownConvertMode (NTV2DownConvertMode * pOutValue) ) {return pOutValue ? GetSecondDownConvertMode(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetSecondIsoConvertMode (NTV2IsoConvertMode * pOutValue) ) {return pOutValue ? GetSecondIsoConvertMode(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetSecondConverterPulldown (ULWord * pOutValue) ) {return pOutValue ? GetSecondConverterPulldown(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetConversionMode (NTV2ConversionMode * pOutConversionMode) ) {return pOutConversionMode ? GetConversionMode(*pOutConversionMode) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetLUTControlSelect (NTV2LUTControlSelect * pOutLUTSelect) ) {return pOutLUTSelect ? GetLUTControlSelect(*pOutLUTSelect) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetSecondaryVideoFormat (NTV2VideoFormat * pOutFormat) ) {return pOutFormat ? GetSecondaryVideoFormat(*pOutFormat) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + #if !defined(R2_DEPRECATE) + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetInputVideoSelect (NTV2InputVideoSelect * pOutInputSelect) ) {return pOutInputSelect ? GetInputVideoSelect(*pOutInputSelect) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetAnalogInputADCMode (NTV2LSVideoADCMode * pOutValue) ) {return pOutValue ? GetAnalogInputADCMode(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + #endif + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIOut3DPresent (bool * pOut3DPresent) ) {return pOut3DPresent ? GetHDMIOut3DPresent(*pOut3DPresent) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIOut3DMode (NTV2HDMIOut3DMode * pOutValue) ) {return pOutValue ? GetHDMIOut3DMode(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIInputRange (NTV2HDMIRange * pOutValue) ) {return pOutValue ? GetHDMIInputRange(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIOutVideoStandard (NTV2Standard * pOutValue) ) {return pOutValue ? GetHDMIOutVideoStandard(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMISampleStructure (NTV2HDMISampleStructure & outValue) ) {return GetHDMIOutSampleStructure(outValue);} ///< @deprecated Use CNTV2Card::GetHDMIOutSampleStructure instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMISampleStructure (NTV2HDMISampleStructure * pOutValue) ) {return pOutValue ? GetHDMIOutSampleStructure(*pOutValue) : false;} ///< @deprecated Use CNTV2Card::GetHDMIOutSampleStructure instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIOutVideoFPS (NTV2FrameRate * pOutValue) ) {return pOutValue ? GetHDMIOutVideoFPS(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIOutRange (NTV2HDMIRange * pOutValue) ) {return pOutValue ? GetHDMIOutRange(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIOutAudioChannels (NTV2HDMIAudioChannels * pOutValue) ) {return pOutValue ? GetHDMIOutAudioChannels(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIInColorSpace (NTV2HDMIColorSpace * pOutValue) ) {return pOutValue ? GetHDMIInColorSpace(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIOutColorSpace (NTV2HDMIColorSpace * pOutValue) ) {return pOutValue ? GetHDMIOutColorSpace(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetLHIHDMIOutColorSpace (NTV2LHIHDMIColorSpace * pOutValue) ) {return pOutValue ? GetLHIHDMIOutColorSpace(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIOutBitDepth (NTV2HDMIBitDepth * pOutValue) ) {return pOutValue ? GetHDMIOutBitDepth(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIOutProtocol (NTV2HDMIProtocol * pOutValue) ) {return pOutValue ? GetHDMIOutProtocol(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIOutDownstreamBitDepth (NTV2HDMIBitDepth * pOutValue) ) {return pOutValue ? GetHDMIOutDownstreamBitDepth(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIOutDownstreamColorSpace (NTV2LHIHDMIColorSpace * pOutValue) ) {return pOutValue ? GetHDMIOutDownstreamColorSpace(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIAudioSampleRateConverterEnable (bool* pOutIsEnabled) ) {return pOutIsEnabled ? GetHDMIInAudioSampleRateConverterEnable(*pOutIsEnabled) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIV2DecimateMode (bool * pOutIsEnabled) ) {return pOutIsEnabled ? GetHDMIOutDecimateMode(*pOutIsEnabled) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIV2TsiIO (bool * pTsiEnabled) ) {return pTsiEnabled ? GetHDMIOutTsiIO(*pTsiEnabled) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIV2LevelBMode (bool * pOutIsEnabled) ) {return pOutIsEnabled ? GetHDMIOutLevelBMode(*pOutIsEnabled) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIV2Mode (NTV2HDMIV2Mode * pOutMode) ) {return pOutMode ? GetHDMIV2Mode(*pOutMode) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetLTCInputEnable (bool * pOutValue) ) {return pOutValue ? GetLTCInputEnable(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetLTCOnReference (bool * pOutValue) ) {return pOutValue ? GetLTCOnReference(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetLTCEmbeddedOutEnable (bool * pOutValue) ) {return pOutValue ? GetLTCEmbeddedOutEnable(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetStereoCompressorOutputMode (NTV2StereoCompressorOutputMode * pOutValue) ) {return pOutValue ? GetStereoCompressorOutputMode(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetStereoCompressorFlipMode (ULWord * pOutValue) ) {return pOutValue ? GetStereoCompressorFlipMode(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetStereoCompressorFlipLeftHorz (ULWord * pOutValue) ) {return pOutValue ? GetStereoCompressorFlipLeftHorz(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetStereoCompressorFlipLeftVert (ULWord * pOutValue) ) {return pOutValue ? GetStereoCompressorFlipLeftVert(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetStereoCompressorFlipRightHorz (ULWord * pOutValue) ) {return pOutValue ? GetStereoCompressorFlipRightHorz(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetStereoCompressorFlipRightVert (ULWord * pOutValue) ) {return pOutValue ? GetStereoCompressorFlipRightVert(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetStereoCompressorStandard (NTV2Standard * pOutValue) ) {return pOutValue ? GetStereoCompressorStandard(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetStereoCompressorLeftSource (NTV2OutputCrosspointID * pOutValue) ) {return pOutValue ? GetStereoCompressorLeftSource(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetStereoCompressorRightSource (NTV2OutputCrosspointID * pOutValue) ) {return pOutValue ? GetStereoCompressorRightSource(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetEnable4KDCRGBMode (bool * pOutIsEnabled) ) {return pOutIsEnabled ? GetEnable4KDCRGBMode(*pOutIsEnabled) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetEnable4KDCYCC444Mode (bool * pOutIsEnabled) ) {return pOutIsEnabled ? GetEnable4KDCYCC444Mode(*pOutIsEnabled) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetEnable4KDCPSFInMode (bool * pOutIsEnabled) ) {return pOutIsEnabled ? GetEnable4KDCPSFInMode(*pOutIsEnabled) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetEnable4KPSFOutMode (bool * pOutIsEnabled) ) {return pOutIsEnabled ? GetEnable4KPSFOutMode(*pOutIsEnabled) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadSDProcAmpControlsInitialized (ULWord * pOutValue) ) {return pOutValue ? ReadSDProcAmpControlsInitialized(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadSDBrightnessAdjustment (ULWord * pOutValue) ) {return pOutValue ? ReadSDBrightnessAdjustment(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadSDContrastAdjustment (ULWord * pOutValue) ) {return pOutValue ? ReadSDContrastAdjustment(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadSDSaturationAdjustment (ULWord * pOutValue) ) {return pOutValue ? ReadSDSaturationAdjustment(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadSDHueAdjustment (ULWord * pOutValue) ) {return pOutValue ? ReadSDHueAdjustment(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadSDCbOffsetAdjustment (ULWord * pOutValue) ) {return pOutValue ? ReadSDCbOffsetAdjustment(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadSDCrOffsetAdjustment (ULWord * pOutValue) ) {return pOutValue ? ReadSDCrOffsetAdjustment(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadHDProcAmpControlsInitialized (ULWord * pOutValue) ) {return pOutValue ? ReadHDProcAmpControlsInitialized(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadHDBrightnessAdjustment (ULWord * pOutValue) ) {return pOutValue ? ReadHDBrightnessAdjustment(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadHDContrastAdjustment (ULWord * pOutValue) ) {return pOutValue ? ReadHDContrastAdjustment(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadHDSaturationAdjustmentCb (ULWord * pOutValue) ) {return pOutValue ? ReadHDSaturationAdjustmentCb(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadHDSaturationAdjustmentCr (ULWord * pOutValue) ) {return pOutValue ? ReadHDSaturationAdjustmentCr(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadHDCbOffsetAdjustment (ULWord * pOutValue) ) {return pOutValue ? ReadHDCbOffsetAdjustment(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadHDCrOffsetAdjustment (ULWord * pOutValue) ) {return pOutValue ? ReadHDCrOffsetAdjustment(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadProcAmpC1YAdjustment (ULWord * pOutValue) ) {return pOutValue ? ReadProcAmpC1YAdjustment(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadProcAmpC1CBAdjustment (ULWord * pOutValue) ) {return pOutValue ? ReadProcAmpC1CBAdjustment(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadProcAmpC1CRAdjustment (ULWord * pOutValue) ) {return pOutValue ? ReadProcAmpC1CRAdjustment(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadProcAmpC2CBAdjustment (ULWord * pOutValue) ) {return pOutValue ? ReadProcAmpC2CBAdjustment(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadProcAmpC2CRAdjustment (ULWord * pOutValue) ) {return pOutValue ? ReadProcAmpC2CRAdjustment(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadProcAmpOffsetYAdjustment (ULWord * pOutValue) ) {return pOutValue ? ReadProcAmpOffsetYAdjustment(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetLHIVideoDACStandard (NTV2Standard * pOutValue) ) {return pOutValue ? GetLHIVideoDACStandard(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetLHIVideoDACMode (NTV2LHIVideoDACMode * pOutValue) ) {return pOutValue ? GetLHIVideoDACMode(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetLHIVideoDACMode (NTV2VideoDACMode * pOutValue) ) {return pOutValue ? GetLHIVideoDACMode(*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetMultiFormatMode (bool * pOutEnabled) ) {return pOutEnabled ? GetMultiFormatMode(*pOutEnabled) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetVideoHOffset (int * pOutHOffset) ) {return pOutHOffset ? GetVideoHOffset(*pOutHOffset) : false;} + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetVideoVOffset (int * pOutVOffset) ) {return pOutVOffset ? GetVideoVOffset(*pOutVOffset) : false;} + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetNominalMinMaxHV (int* nominalH, int* minH, int* maxH, int* nominalV, int* minV, int* maxV)); + + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetFrameBufferFormat (const NTV2Channel inChannel, NTV2FrameBufferFormat * pOutValue) ) {return pOutValue ? GetFrameBufferFormat(inChannel, *pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetFrameBufferQuarterSizeMode (const NTV2Channel inChannel, NTV2QuarterSizeExpandMode * pOutValue) ) {return pOutValue ? GetFrameBufferQuarterSizeMode(inChannel, *pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetFrameBufferQuality (const NTV2Channel inChannel, NTV2FrameBufferQuality * pOutValue) ) {return pOutValue ? GetFrameBufferQuality(inChannel, *pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetEncodeAsPSF (const NTV2Channel inChannel, NTV2EncodeAsPSF * pOutValue) ) {return pOutValue ? GetEncodeAsPSF(inChannel, *pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetFrameBufferOrientation (const NTV2Channel inChannel, NTV2FBOrientation * pOutValue) ) {return pOutValue ? GetFrameBufferOrientation(inChannel, *pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetVANCShiftMode (const NTV2Channel inChannel, NTV2VANCDataShiftMode * pOutValue) ) {return pOutValue ? GetVANCShiftMode(inChannel, *pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetMode (const NTV2Channel inChannel, NTV2Mode * pOutValue) ) {return pOutValue ? GetMode(inChannel, *pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetColorCorrectionMode (const NTV2Channel inChannel, NTV2ColorCorrectionMode * pOutMode) ) {return pOutMode ? GetColorCorrectionMode(inChannel, *pOutMode) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetRS422BaudRate (const NTV2Channel inChannel, NTV2_RS422_BAUD_RATE * pOutValue) ) {return pOutValue ? GetRS422BaudRate (inChannel, *pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetRS422Parity (const NTV2Channel inChannel, NTV2_RS422_PARITY * pOutValue) ) {return pOutValue ? GetRS422Parity (inChannel, *pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetPCIAccessFrame (const NTV2Channel inChannel, ULWord * pOutValue) ) {return pOutValue ? GetPCIAccessFrame(inChannel, *pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetOutputFrame (const NTV2Channel inChannel, ULWord * pOutValue) ) {return pOutValue ? GetOutputFrame(inChannel, *pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetInputFrame (const NTV2Channel inChannel, ULWord * pOutValue) ) {return pOutValue ? GetInputFrame(inChannel, *pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetColorCorrectionOutputBank (const NTV2Channel inChannel, ULWord * pOutBank) ) {return pOutBank ? GetColorCorrectionOutputBank(inChannel,*pOutBank) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetColorCorrectionSaturation (const NTV2Channel inChannel, ULWord * pOutValue) ) {return pOutValue ? GetColorCorrectionSaturation(inChannel, *pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetDitherFor8BitInputs (const NTV2Channel inChannel, ULWord * pOutDither) ) {return pOutDither ? GetDitherFor8BitInputs(inChannel, *pOutDither) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetLUTV2OutputBank (const NTV2Channel inChannel, ULWord * pOutBank) ) {return pOutBank ? GetLUTV2OutputBank(inChannel, *pOutBank) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetPulldownMode (const NTV2Channel inChannel, bool * pOutValue) ) {return pOutValue ? GetPulldownMode(inChannel, *pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetSDITransmitEnable (const NTV2Channel inChannel, bool * pOutEnabled) ) {return pOutEnabled ? GetSDITransmitEnable (inChannel, *pOutEnabled) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetSDIOut2Kx1080Enable (const NTV2Channel inChannel, bool * pOutIsEnabled) ) {return pOutIsEnabled ? GetSDIOut2Kx1080Enable (inChannel, *pOutIsEnabled) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetSDIOut3GEnable (const NTV2Channel inChannel, bool * pOutIsEnabled) ) {return pOutIsEnabled ? GetSDIOut3GEnable (inChannel, *pOutIsEnabled) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetSDIOut3GbEnable (const NTV2Channel inChannel, bool * pOutIsEnabled) ) {return pOutIsEnabled ? GetSDIOut3GbEnable (inChannel, *pOutIsEnabled) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetSDIInLevelBtoLevelAConversion (const UWord inInputSpigot, bool * pOutIsEnabled) ) {return pOutIsEnabled ? GetSDIInLevelBtoLevelAConversion(inInputSpigot, *pOutIsEnabled) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetSDIOutLevelAtoLevelBConversion (const UWord inOutputSpigot, bool * pOutIsEnabled) ) {return pOutIsEnabled ? GetSDIOutLevelAtoLevelBConversion(inOutputSpigot, *pOutIsEnabled) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadAudioLastOut (ULWord * pOutValue, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutValue ? ReadAudioLastOut(*pOutValue, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadAudioLastIn (ULWord *pOutValue, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutValue ? ReadAudioLastIn(*pOutValue, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadAudioSource (ULWord * pOutValue, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutValue ? ReadAudioSource(*pOutValue, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetRegisterWritemode (NTV2RegisterWriteMode * pOutValue, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutValue ? GetRegisterWriteMode(*pOutValue, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetFrameGeometry (NTV2FrameGeometry * pOutValue, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutValue ? GetFrameGeometry(*pOutValue, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetVideoFormat (NTV2VideoFormat * pOutValue, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutValue ? GetVideoFormat(*pOutValue, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetStandard (NTV2Standard * pOutValue, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutValue ? GetStandard(*pOutValue, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetFrameRate (NTV2FrameRate * pOutValue, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutValue ? GetFrameRate(*pOutValue, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetSmpte372 (ULWord * pOutValue, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutValue ? GetSmpte372(*pOutValue, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetQuadFrameEnable (ULWord * pOutValue, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {bool enb(false); if (pOutValue && GetQuadFrameEnable(enb, inChannel)) {*pOutValue = enb?1:0; return true;} return false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool IsProgressiveStandard (bool * pOutIsProgressive, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutIsProgressive ? IsProgressiveStandard(*pOutIsProgressive, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool IsSDStandard (bool * pOutIsStandardDef, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutIsStandardDef ? IsSDStandard(*pOutIsStandardDef, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool Get4kSquaresEnable (bool * pOutIsEnabled, const NTV2Channel inChannel) ) {return pOutIsEnabled ? Get4kSquaresEnable(*pOutIsEnabled, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetTsiFrameEnable (bool * pOutIsEnabled, const NTV2Channel inChannel) ) {return pOutIsEnabled ? GetTsiFrameEnable(*pOutIsEnabled, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetLUTV2HostAccessBank (NTV2ColorCorrectionHostAccessBank * pOutValue, const NTV2Channel inChannel) ) {return pOutValue ? GetLUTV2HostAccessBank(*pOutValue, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetColorSpaceMatrixSelect (NTV2ColorSpaceMatrixType * pOutType, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutType ? GetColorSpaceMatrixSelect(*pOutType, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetColorSpaceRGBBlackRange (NTV2_CSC_RGB_Range * pOutRange, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutRange ? GetColorSpaceRGBBlackRange(*pOutRange, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetColorSpaceUseCustomCoefficient (ULWord * pOutValue, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutValue ? GetColorSpaceUseCustomCoefficient(*pOutValue, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetColorSpaceMakeAlphaFromKey (ULWord * pOutValue, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutValue ? GetColorSpaceMakeAlphaFromKey(*pOutValue, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetColorSpaceVideoKeySyncFail (bool * pOutValue, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutValue ? GetColorSpaceVideoKeySyncFail(*pOutValue, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetColorSpaceCustomCoefficients (ColorSpaceConverterCustomCoefficients * pOutValues, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutValues ? GetColorSpaceCustomCoefficients(*pOutValues, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetColorSpaceCustomCoefficients12Bit (ColorSpaceConverterCustomCoefficients * pOutValues, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutValues ? GetColorSpaceCustomCoefficients12Bit(*pOutValues, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetColorCorrectionHostAccessBank (NTV2ColorCorrectionHostAccessBank * pOutValue, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutValue ? GetColorCorrectionHostAccessBank(*pOutValue, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIInputStatusRegister (ULWord * pOutValue, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutValue ? GetHDMIInputStatus(*pOutValue, inChannel) : false;} ///< @deprecated Use CNTV2Card::GetHDMIInputStatus instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetHDMIInputColor (NTV2LHIHDMIColorSpace * pOutValue, const NTV2Channel inChannel = NTV2_CHANNEL1) ) {return pOutValue ? GetHDMIInputColor(*pOutValue, inChannel) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadOutputTimingControl (ULWord * pOutValue, const UWord inOutputSpigot = 0) ) {return pOutValue ? ReadOutputTimingControl(*pOutValue, inOutputSpigot) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetLTCInputPresent (bool * pOutValue) ) {return pOutValue ? GetLTCInputPresent (*pOutValue) : false;} ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioOutputMonitorSource (NTV2AudioMonitorSelect * pOutValue, NTV2Channel * pOutChannel = NULL) ); ///< @deprecated Use the alternate function that has the non-constant reference output parameter instead. + + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetEnableVANCData (bool * pOutIsEnabled, bool * pOutIsWideVANCEnabled = NULL, const NTV2Channel inChannel = NTV2_CHANNEL1)); ///< @deprecated Use CNTV2Card::GetVANCMode instead. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetEnableVANCData (bool & outIsEnabled, bool & outIsWideVANCEnabled, const NTV2Channel inChannel = NTV2_CHANNEL1)); ///< @deprecated Use CNTV2Card::GetVANCMode instead. +#endif // NTV2_DEPRECATE_14_3 + +#if !defined(NTV2_DEPRECATE_16_1) + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetAudioOutputMonitorSource (const NTV2AudioMonitorSelect inChannelPair, const NTV2Channel inAudioSystem = NTV2_CHANNEL1)) {return SetAudioOutputMonitorSource(inChannelPair, NTV2AudioSystem(inAudioSystem));} ///< @deprecated Use the function that uses NTV2AudioChannelPair and NTV2AudioSystem params. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetAudioOutputMonitorSource (NTV2AudioMonitorSelect & chp, NTV2Channel & ch)) {NTV2AudioSystem sys; if (GetAudioOutputMonitorSource(chp, sys)) {ch = NTV2Channel(sys); return true;} return false;} ///< @deprecated Use the function that uses NTV2AudioChannelPair and NTV2AudioSystem params. +#endif // NTV2_DEPRECATE_16_1 + +protected: + AJA_VIRTUAL ULWord GetSerialNumberLow (void); // From CNTV2Status + AJA_VIRTUAL ULWord GetSerialNumberHigh (void); // From CNTV2Status + AJA_VIRTUAL inline bool IS_CHANNEL_VALID (const NTV2Channel inChannel) const {return !IS_CHANNEL_INVALID(inChannel);} // New in SDK 16.2 + AJA_VIRTUAL bool IS_CHANNEL_INVALID (const NTV2Channel inChannel) const; + AJA_VIRTUAL bool IS_OUTPUT_SPIGOT_INVALID (const UWord inOutputSpigot) const; + AJA_VIRTUAL bool IS_INPUT_SPIGOT_INVALID (const UWord inInputSpigot) const; + AJA_VIRTUAL bool SetWarmBootFirmwareReload(bool enable); + + // Seamless Anc Playout & Capture + // For AutoCirculate Playout + AJA_VIRTUAL bool S2110DeviceAncToXferBuffers (const NTV2Channel inChannel, AUTOCIRCULATE_TRANSFER & inOutXferInfo); + // For Non-AutoCirculate Playout + AJA_VIRTUAL bool S2110DeviceAncToBuffers (const NTV2Channel inChannel, NTV2_POINTER & ancF1, NTV2_POINTER & ancF2); + // For AutoCirculate Capture + AJA_VIRTUAL bool S2110DeviceAncFromXferBuffers (const NTV2Channel inChannel, AUTOCIRCULATE_TRANSFER & inOutXferInfo); + // For Non-AutoCirculate Capture + AJA_VIRTUAL bool S2110DeviceAncFromBuffers (const NTV2Channel inChannel, NTV2_POINTER & ancF1, NTV2_POINTER & ancF2); + AJA_VIRTUAL bool WriteSDIInVPID (const NTV2Channel inChannel, const ULWord inValA, const ULWord inValB); + +private: + // frame buffer sizing helpers + AJA_VIRTUAL bool GetLargestFrameBufferFormatInUse(NTV2FrameBufferFormat & outFBF); + AJA_VIRTUAL bool GetFrameInfo(const NTV2Channel inChannel, NTV2FrameGeometry & outGeometry, NTV2FrameBufferFormat & outFBF); + AJA_VIRTUAL bool IsBufferSizeChangeRequired(NTV2Channel channel, NTV2FrameGeometry currentGeometry, NTV2FrameGeometry newGeometry, + NTV2FrameBufferFormat format); + AJA_VIRTUAL bool IsBufferSizeChangeRequired(NTV2Channel channel, NTV2FrameGeometry geometry, + NTV2FrameBufferFormat currentFormat, NTV2FrameBufferFormat newFormat); + AJA_VIRTUAL bool GetFBSizeAndCountFromHW(ULWord* size, ULWord* count); + + AJA_VIRTUAL bool IsMultiFormatActive (void); ///< @return True if the device supports the multi format feature and it's enabled; otherwise false. + + /** + @brief Answers with the NTV2RegInfo of the register associated with the given boolean (i.e., "Can Do") device feature. + @param[in] inParamID Specifies the device features parameter of interest. + @param[out] outRegInfo Receives the associated NTV2RegInfo. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetRegInfoForBoolParam (const NTV2BoolParamID inParamID, NTV2RegInfo & outRegInfo); + /** + @brief Answers with the NTV2RegInfo of the register associated with the given numeric (i.e., "Get Num") device feature. + @param[in] inParamID Specifies the device features parameter of interest. + @param[out] outRegInfo Receives the associated NTV2RegInfo. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetRegInfoForNumericParam (const NTV2NumericParamID inParamID, NTV2RegInfo & outRegInfo); + AJA_VIRTUAL bool CopyVideoFormat(const NTV2Channel inSrc, const NTV2Channel inFirst, const NTV2Channel inLast); + +}; // CNTV2Card + + +typedef CNTV2Card CNTV2Device; ///< @brief Instances of this class are able to interrogate and control an NTV2 AJA video/audio capture/playout device. +typedef CNTV2Card CNTV2Status; ///< @deprecated Use CNTV2Card instead. +typedef CNTV2Card CNTV2TestPattern; ///< @deprecated Use CNTV2Card instead. +typedef CNTV2Card CNTV2VidProc; ///< @deprecated Use CNTV2Card instead +typedef CNTV2Card CNTV2ColorCorrection; ///< @deprecated Use CNTV2Card instead. +typedef CNTV2Card CNTV2ProcAmp; ///< @deprecated Use CNTV2Card instead. +typedef CNTV2Card CXena2VidProc; ///< @deprecated Use CNTV2Card instead. + +#define SetTablesToHardware LoadLUTTables +#define GetTablesFromHardware GetLUTTables + +///////////////////////////////////////////////////////////////////////////// + + +#if !defined (NTV2_DEPRECATE) + #define GetK2AnalogOutHTiming GetAnalogOutHTiming ///< @deprecated Use GetAnalogOutHTiming instead. + #define GetK2ColorSpaceCustomCoefficients GetColorSpaceCustomCoefficients ///< @deprecated Use GetColorSpaceCustomCoefficients instead. + #define GetK2ColorSpaceCustomCoefficients12Bit GetColorSpaceCustomCoefficients12Bit ///< @deprecated Use GetColorSpaceCustomCoefficients12Bit instead. + #define GetK2ColorSpaceMakeAlphaFromKey GetColorSpaceMakeAlphaFromKey ///< @deprecated Use GetColorSpaceMakeAlphaFromKey instead. + #define GetK2ColorSpaceMatrixSelect GetColorSpaceMatrixSelect ///< @deprecated Use GetColorSpaceMatrixSelect instead. + #define GetK2ColorSpaceRGBBlackRange GetColorSpaceRGBBlackRange ///< @deprecated Use GetColorSpaceRGBBlackRange instead. + #define GetK2ColorSpaceUseCustomCoefficient GetColorSpaceUseCustomCoefficient ///< @deprecated Use GetColorSpaceUseCustomCoefficient instead. + #define GetK2ColorSpaceVideoKeySyncFail GetColorSpaceVideoKeySyncFail ///< @deprecated Use GetColorSpaceVideoKeySyncFail instead. + #define GetK2ConversionMode GetConversionMode ///< @deprecated Use GetConversionMode instead. + #define GetK2ConverterInRate GetConverterInRate ///< @deprecated Use GetConverterInRate instead. + #define GetK2ConverterInStandard GetConverterInStandard ///< @deprecated Use GetConverterInStandard instead. + #define GetK2ConverterOutRate GetConverterOutRate ///< @deprecated Use GetConverterOutRate instead. + #define GetK2ConverterOutStandard GetConverterOutStandard ///< @deprecated Use GetConverterOutStandard instead. + #define GetK2ConverterPulldown GetConverterPulldown ///< @deprecated Use GetConverterPulldown instead. + #define GetK2DeinterlaceMode GetDeinterlaceMode ///< @deprecated Use GetDeinterlaceMode instead. + #define GetK2DownConvertMode GetDownConvertMode ///< @deprecated Use GetDownConvertMode instead. + #define GetK2EnableConverter GetEnableConverter ///< @deprecated Use GetEnableConverter instead. + #define GetK2FrameBufferSize GetFrameBufferSize ///< @deprecated Use GetFrameBufferSize instead. + #define GetK2InputVideoSelect GetInputVideoSelect ///< @deprecated Use GetInputVideoSelect instead. + #define GetK2IsoConvertMode GetIsoConvertMode ///< @deprecated Use GetIsoConvertMode instead. + #define GetK2PulldownMode GetPulldownMode ///< @deprecated Use GetPulldownMode instead. + #define GetK2SDI1OutHTiming GetSDI1OutHTiming ///< @deprecated Use GetSDI1OutHTiming instead. + #define GetK2SDI2OutHTiming GetSDI2OutHTiming ///< @deprecated Use GetSDI2OutHTiming instead. + #define GetK2SecondaryVideoFormat GetSecondaryVideoFormat ///< @deprecated Use GetSecondaryVideoFormat instead. + #define GetK2SecondConverterInStandard GetSecondConverterInStandard ///< @deprecated Use GetSecondConverterInStandard instead. + #define GetK2SecondConverterOutStandard GetSecondConverterOutStandard ///< @deprecated Use GetSecondConverterOutStandard instead. + #define GetK2SecondConverterPulldown GetSecondConverterPulldown ///< @deprecated Use GetSecondConverterPulldown instead. + #define GetK2SecondDownConvertMode GetSecondDownConvertMode ///< @deprecated Use GetSecondDownConvertMode instead. + #define GetK2SecondIsoConvertMode GetSecondIsoConvertMode ///< @deprecated Use GetSecondIsoConvertMode instead. + #define GetK2UCAutoLine21 GetUCAutoLine21 ///< @deprecated Use GetUCAutoLine21 instead. + #define GetK2UCPassLine21 GetUCPassLine21 ///< @deprecated Use GetUCPassLine21 instead. + #define GetK2UpConvertMode GetUpConvertMode ///< @deprecated Use GetUpConvertMode instead. + #define GetK2VideoDACMode GetVideoDACMode ///< @deprecated Use GetVideoDACMode instead. + #define GetK2Xpt1ColorSpaceConverterInputSelect GetXptColorSpaceConverterInputSelect ///< @deprecated Use GetXptColorSpaceConverterInputSelect instead. + #define GetK2Xpt1CompressionModInputSelect GetXptCompressionModInputSelect ///< @deprecated Use GetXptCompressionModInputSelect instead. + #define GetK2Xpt1ConversionModInputSelect GetXptConversionModInputSelect ///< @deprecated Use GetXptConversionModInputSelect instead. + #define GetK2Xpt1CSC1VidInputSelect GetXptCSC1VidInputSelect ///< @deprecated Use GetXptCSC1VidInputSelect instead. + #define GetK2Xpt1LUTInputSelect GetXptLUTInputSelect ///< @deprecated Use GetXptLUTInputSelect instead. + #define GetK2Xpt2DuallinkOutInputSelect GetXptDuallinkOutInputSelect ///< @deprecated Use GetXptDuallinkOutInputSelect instead. + #define GetK2Xpt2FrameBuffer1InputSelect GetXptFrameBuffer1InputSelect ///< @deprecated Use GetXptFrameBuffer1InputSelect instead. + #define GetK2Xpt2FrameSync1InputSelect GetXptFrameSync1InputSelect ///< @deprecated Use GetXptFrameSync1InputSelect instead. + #define GetK2Xpt2FrameSync2InputSelect GetXptFrameSync2InputSelect ///< @deprecated Use GetXptFrameSync2InputSelect instead. + #define GetK2Xpt3AnalogOutInputSelect GetXptAnalogOutInputSelect ///< @deprecated Use GetXptAnalogOutInputSelect instead. + #define GetK2Xpt3CSC1KeyInputSelect GetXptCSC1KeyInputSelect ///< @deprecated Use GetXptCSC1KeyInputSelect instead. + #define GetK2Xpt3SDIOut1InputSelect GetXptSDIOut1InputSelect ///< @deprecated Use GetXptSDIOut1InputSelect instead. + #define GetK2Xpt3SDIOut2InputSelect GetXptSDIOut2InputSelect ///< @deprecated Use GetXptSDIOut2InputSelect instead. + #define GetK2Xpt4KDCQ1InputSelect GetXpt4KDCQ1InputSelect ///< @deprecated Use GetXpt4KDCQ1InputSelect instead. + #define GetK2Xpt4KDCQ2InputSelect GetXpt4KDCQ2InputSelect ///< @deprecated Use GetXpt4KDCQ2InputSelect instead. + #define GetK2Xpt4KDCQ3InputSelect GetXpt4KDCQ3InputSelect ///< @deprecated Use GetXpt4KDCQ3InputSelect instead. + #define GetK2Xpt4KDCQ4InputSelect GetXpt4KDCQ4InputSelect ///< @deprecated Use GetXpt4KDCQ4InputSelect instead. + #define GetK2Xpt4MixerBGKeyInputSelect GetXptMixerBGKeyInputSelect ///< @deprecated Use GetXptMixerBGKeyInputSelect instead. + #define GetK2Xpt4MixerBGVidInputSelect GetXptMixerBGVidInputSelect ///< @deprecated Use GetXptMixerBGVidInputSelect instead. + #define GetK2Xpt4MixerFGKeyInputSelect GetXptMixerFGKeyInputSelect ///< @deprecated Use GetXptMixerFGKeyInputSelect instead. + #define GetK2Xpt4MixerFGVidInputSelect GetXptMixerFGVidInputSelect ///< @deprecated Use GetXptMixerFGVidInputSelect instead. + #define GetK2Xpt5CSC2KeyInputSelect GetXptCSC2KeyInputSelect ///< @deprecated Use GetXptCSC2KeyInputSelect instead. + #define GetK2Xpt5CSC2VidInputSelect GetXptCSC2VidInputSelect ///< @deprecated Use GetXptCSC2VidInputSelect instead. + #define GetK2Xpt5FrameBuffer2InputSelect GetXptFrameBuffer2InputSelect ///< @deprecated Use GetXptFrameBuffer2InputSelect instead. + #define GetK2Xpt5XptLUT2InputSelect GetXptLUT2InputSelect ///< @deprecated Use GetXptLUT2InputSelect instead. + #define GetK2Xpt6HDMIOutInputSelect GetXptHDMIOutInputSelect ///< @deprecated Use GetXptHDMIOutInputSelect instead. + #define GetK2Xpt6IICTInputSelect GetXptIICTInputSelect ///< @deprecated Use GetXptIICTInputSelect instead. + #define GetK2Xpt6SecondConverterInputSelect GetXptSecondConverterInputSelect ///< @deprecated Use GetXptSecondConverterInputSelect instead. + #define GetK2Xpt6WaterMarkerInputSelect GetXptWaterMarkerInputSelect ///< @deprecated Use GetXptWaterMarkerInputSelect instead. + #define GetK2Xpt7DuallinkOut2InputSelect GetXptDuallinkOut2InputSelect ///< @deprecated Use GetXptDuallinkOut2InputSelect instead. + #define GetK2Xpt7IICT2InputSelect GetXptIICT2InputSelect ///< @deprecated Use GetXptIICT2InputSelect instead. + #define GetK2Xpt7WaterMarker2InputSelect GetXptWaterMarker2InputSelect ///< @deprecated Use GetXptWaterMarker2InputSelect instead. + #define GetK2Xpt8SDIOut3InputSelect GetXptSDIOut3InputSelect ///< @deprecated Use GetXptSDIOut3InputSelect instead. + #define GetK2Xpt8SDIOut4InputSelect GetXptSDIOut4InputSelect ///< @deprecated Use GetXptSDIOut4InputSelect instead. + #define GetK2Xpt8SDIOut5InputSelect GetXptSDIOut5InputSelect ///< @deprecated Use GetXptSDIOut5InputSelect instead. + #define GetK2Xpt9Mixer2BGKeyInputSelect GetXptMixer2BGKeyInputSelect ///< @deprecated Use GetXptMixer2BGKeyInputSelect instead. + #define GetK2Xpt9Mixer2BGVidInputSelect GetXptMixer2BGVidInputSelect ///< @deprecated Use GetXptMixer2BGVidInputSelect instead. + #define GetK2Xpt9Mixer2FGKeyInputSelect GetXptMixer2FGKeyInputSelect ///< @deprecated Use GetXptMixer2FGKeyInputSelect instead. + #define GetK2Xpt9Mixer2FGVidInputSelect GetXptMixer2FGVidInputSelect ///< @deprecated Use GetXptMixer2FGVidInputSelect instead. + #define GetK2Xpt10SDIOut1DS2InputSelect GetXptSDIOut1DS2InputSelect ///< @deprecated Use GetXptSDIOut1DS2InputSelect instead. + #define GetK2Xpt10SDIOut2DS2InputSelect GetXptSDIOut2DS2InputSelect ///< @deprecated Use GetXptSDIOut2DS2InputSelect instead. + #define GetK2Xpt11DualLinkIn1DSSelect GetXptDualLinkIn1DSSelect ///< @deprecated Use GetXptDualLinkIn1DSSelect instead. + #define GetK2Xpt11DualLinkIn1Select GetXptDualLinkIn1Select ///< @deprecated Use GetXptDualLinkIn1Select instead. + #define GetK2Xpt11DualLinkIn2DSSelect GetXptDualLinkIn2DSSelect ///< @deprecated Use GetXptDualLinkIn2DSSelect instead. + #define GetK2Xpt11DualLinkIn2Select GetXptDualLinkIn2Select ///< @deprecated Use GetXptDualLinkIn2Select instead. + #define GetK2Xpt12LUT3InputSelect GetXptLUT3InputSelect ///< @deprecated Use GetXptLUT3InputSelect instead. + #define GetK2Xpt12LUT4InputSelect GetXptLUT4InputSelect ///< @deprecated Use GetXptLUT4InputSelect instead. + #define GetK2Xpt12LUT5InputSelect GetXptLUT5InputSelect ///< @deprecated Use GetXptLUT5InputSelect instead. + #define GetK2Xpt13FrameBuffer3InputSelect GetXptFrameBuffer3InputSelect ///< @deprecated Use GetXptFrameBuffer3InputSelect instead. + #define GetK2Xpt13FrameBuffer4InputSelect GetXptFrameBuffer4InputSelect ///< @deprecated Use GetXptFrameBuffer4InputSelect instead. + #define GetK2Xpt14SDIOut3DS2InputSelect GetXptSDIOut3DS2InputSelect ///< @deprecated Use GetXptSDIOut3DS2InputSelect instead. + #define GetK2Xpt14SDIOut4DS2InputSelect GetXptSDIOut4DS2InputSelect ///< @deprecated Use GetXptSDIOut4DS2InputSelect instead. + #define GetK2Xpt14SDIOut5DS2InputSelect GetXptSDIOut5DS2InputSelect ///< @deprecated Use GetXptSDIOut5DS2InputSelect instead. + #define GetK2Xpt15DualLinkIn3DSSelect GetXptDualLinkIn3DSSelect ///< @deprecated Use GetXptDualLinkIn3DSSelect instead. + #define GetK2Xpt15DualLinkIn3Select GetXptDualLinkIn3Select ///< @deprecated Use GetXptDualLinkIn3Select instead. + #define GetK2Xpt15DualLinkIn4DSSelect GetXptDualLinkIn4DSSelect ///< @deprecated Use GetXptDualLinkIn4DSSelect instead. + #define GetK2Xpt15DualLinkIn4Select GetXptDualLinkIn4Select ///< @deprecated Use GetXptDualLinkIn4Select instead. + #define GetK2Xpt16DuallinkOut3InputSelect GetXptDuallinkOut3InputSelect ///< @deprecated Use GetXptDuallinkOut3InputSelect instead. + #define GetK2Xpt16DuallinkOut4InputSelect GetXptDuallinkOut4InputSelect ///< @deprecated Use GetXptDuallinkOut4InputSelect instead. + #define GetK2Xpt16DuallinkOut5InputSelect GetXptDuallinkOut5InputSelect ///< @deprecated Use GetXptDuallinkOut5InputSelect instead. + #define GetK2Xpt17CSC3KeyInputSelect GetXptCSC3KeyInputSelect ///< @deprecated Use GetXptCSC3KeyInputSelect instead. + #define GetK2Xpt17CSC3VidInputSelect GetXptCSC3VidInputSelect ///< @deprecated Use GetXptCSC3VidInputSelect instead. + #define GetK2Xpt17CSC4KeyInputSelect GetXptCSC4KeyInputSelect ///< @deprecated Use GetXptCSC4KeyInputSelect instead. + #define GetK2Xpt17CSC4VidInputSelect GetXptCSC4VidInputSelect ///< @deprecated Use GetXptCSC4VidInputSelect instead. + #define GetK2XptCSC5KeyInputSelect GetXptCSC5KeyInputSelect ///< @deprecated Use GetXptCSC5KeyInputSelect instead. + #define GetK2XptCSC5VidInputSelect GetXptCSC5VidInputSelect ///< @deprecated Use GetXptCSC5VidInputSelect instead. + #define GetK2XptHDMIOutV2Q1InputSelect GetXptHDMIOutV2Q1InputSelect ///< @deprecated Use GetXptHDMIOutV2Q1InputSelect instead. + #define GetK2XptHDMIOutV2Q2InputSelect GetXptHDMIOutV2Q2InputSelect ///< @deprecated Use GetXptHDMIOutV2Q2InputSelect instead. + #define GetK2XptHDMIOutV2Q3InputSelect GetXptHDMIOutV2Q3InputSelect ///< @deprecated Use GetXptHDMIOutV2Q3InputSelect instead. + #define GetK2XptHDMIOutV2Q4InputSelect GetXptHDMIOutV2Q4InputSelect ///< @deprecated Use GetXptHDMIOutV2Q4InputSelect instead. + #define SetK2AnalogOutHTiming SetAnalogOutHTiming ///< @deprecated Use SetAnalogOutHTiming instead. + #define SetK2ColorSpaceCustomCoefficients SetColorSpaceCustomCoefficients ///< @deprecated Use SetColorSpaceCustomCoefficients instead. + #define SetK2ColorSpaceCustomCoefficients12Bit SetColorSpaceCustomCoefficients12Bit ///< @deprecated Use SetColorSpaceCustomCoefficients12Bit instead. + #define SetK2ColorSpaceMakeAlphaFromKey SetColorSpaceMakeAlphaFromKey ///< @deprecated Use SetColorSpaceMakeAlphaFromKey instead. + #define SetK2ColorSpaceMatrixSelect SetColorSpaceMatrixSelect ///< @deprecated Use SetColorSpaceMatrixSelect instead. + #define SetK2ColorSpaceRGBBlackRange SetColorSpaceRGBBlackRange ///< @deprecated Use SetColorSpaceRGBBlackRange instead. + #define SetK2ColorSpaceUseCustomCoefficient SetColorSpaceUseCustomCoefficient ///< @deprecated Use SetColorSpaceUseCustomCoefficient instead. + #define SetK2ConversionMode SetConversionMode ///< @deprecated Use SetConversionMode instead. + #define SetK2ConverterInRate SetConverterInRate ///< @deprecated Use SetConverterInRate instead. + #define SetK2ConverterInStandard SetConverterInStandard ///< @deprecated Use SetConverterInStandard instead. + #define SetK2ConverterOutRate SetConverterOutRate ///< @deprecated Use SetConverterOutRate instead. + #define SetK2ConverterOutStandard SetConverterOutStandard ///< @deprecated Use SetConverterOutStandard instead. + #define SetK2ConverterPulldown SetConverterPulldown ///< @deprecated Use SetConverterPulldown instead. + #define SetK2DeinterlaceMode SetDeinterlaceMode ///< @deprecated Use SetDeinterlaceMode instead. + #define SetK2DownConvertMode SetDownConvertMode ///< @deprecated Use SetDownConvertMode instead. + #define SetK2EnableConverter SetEnableConverter ///< @deprecated Use SetEnableConverter instead. + #define SetK2FrameBufferSize SetFrameBufferSize ///< @deprecated Use SetFrameBufferSize instead. + #define SetK2InputVideoSelect SetInputVideoSelect ///< @deprecated Use SetInputVideoSelect instead. + #define SetK2IsoConvertMode SetIsoConvertMode ///< @deprecated Use SetIsoConvertMode instead. + #define SetK2PulldownMode SetPulldownMode ///< @deprecated Use SetPulldownMode instead. + #define SetK2SDI1OutHTiming SetSDI1OutHTiming ///< @deprecated Use SetSDI1OutHTiming instead. + #define SetK2SDI2OutHTiming SetSDI2OutHTiming ///< @deprecated Use SetSDI2OutHTiming instead. + #define SetK2SecondaryVideoFormat SetSecondaryVideoFormat ///< @deprecated Use SetSecondaryVideoFormat instead. + #define SetK2SecondConverterInStandard SetSecondConverterInStandard ///< @deprecated Use SetSecondConverterInStandard instead. + #define SetK2SecondConverterOutStandard SetSecondConverterOutStandard ///< @deprecated Use SetSecondConverterOutStandard instead. + #define SetK2SecondConverterPulldown SetSecondConverterPulldown ///< @deprecated Use SetSecondConverterPulldown instead. + #define SetK2SecondDownConvertMode SetSecondDownConvertMode ///< @deprecated Use SetSecondDownConvertMode instead. + #define SetK2SecondIsoConvertMode SetSecondIsoConvertMode ///< @deprecated Use SetSecondIsoConvertMode instead. + #define SetK2UCAutoLine21 SetUCAutoLine21 ///< @deprecated Use SetUCAutoLine21 instead. + #define SetK2UCPassLine21 SetUCPassLine21 ///< @deprecated Use SetUCPassLine21 instead. + #define SetK2UpConvertMode SetUpConvertMode ///< @deprecated Use SetUpConvertMode instead. + #define SetK2VideoDACMode SetVideoDACMode ///< @deprecated Use SetVideoDACMode instead. + #define SetK2Xpt1ColorSpaceConverterInputSelect SetXptColorSpaceConverterInputSelect ///< @deprecated Use SetXptColorSpaceConverterInputSelect instead. + #define SetK2Xpt1CompressionModInputSelect SetXptCompressionModInputSelect ///< @deprecated Use SetXptCompressionModInputSelect instead. + #define SetK2Xpt1ConversionModInputSelect SetXptConversionModInputSelect ///< @deprecated Use SetXptConversionModInputSelect instead. + #define SetK2Xpt1CSC1VidInputSelect SetXptCSC1VidInputSelect ///< @deprecated Use SetXptCSC1VidInputSelect instead. + #define SetK2Xpt1LUTInputSelect SetXptLUTInputSelect ///< @deprecated Use SetXptLUTInputSelect instead. + #define SetK2Xpt2DuallinkOutInputSelect SetXptDuallinkOutInputSelect ///< @deprecated Use SetXptDuallinkOutInputSelect instead. + #define SetK2Xpt2FrameBuffer1InputSelect SetXptFrameBuffer1InputSelect ///< @deprecated Use SetXptFrameBuffer1InputSelect instead. + #define SetK2Xpt2FrameSync1InputSelect SetXptFrameSync1InputSelect ///< @deprecated Use SetXptFrameSync1InputSelect instead. + #define SetK2Xpt2FrameSync2InputSelect SetXptFrameSync2InputSelect ///< @deprecated Use SetXptFrameSync2InputSelect instead. + #define SetK2Xpt3AnalogOutInputSelect SetXptAnalogOutInputSelect ///< @deprecated Use SetXptAnalogOutInputSelect instead. + #define SetK2Xpt3CSC1KeyInputSelect SetXptCSC1KeyInputSelect ///< @deprecated Use SetXptCSC1KeyInputSelect instead. + #define SetK2Xpt3SDIOut1InputSelect SetXptSDIOut1InputSelect ///< @deprecated Use SetXptSDIOut1InputSelect instead. + #define SetK2Xpt3SDIOut2InputSelect SetXptSDIOut2InputSelect ///< @deprecated Use SetXptSDIOut2InputSelect instead. + #define SetK2Xpt4KDCQ1InputSelect SetXpt4KDCQ1InputSelect ///< @deprecated Use SetXpt4KDCQ1InputSelect instead. + #define SetK2Xpt4KDCQ2InputSelect SetXpt4KDCQ2InputSelect ///< @deprecated Use SetXpt4KDCQ2InputSelect instead. + #define SetK2Xpt4KDCQ3InputSelect SetXpt4KDCQ3InputSelect ///< @deprecated Use SetXpt4KDCQ3InputSelect instead. + #define SetK2Xpt4KDCQ4InputSelect SetXpt4KDCQ4InputSelect ///< @deprecated Use SetXpt4KDCQ4InputSelect instead. + #define SetK2Xpt4MixerBGKeyInputSelect SetXptMixerBGKeyInputSelect ///< @deprecated Use SetXptMixerBGKeyInputSelect instead. + #define SetK2Xpt4MixerBGVidInputSelect SetXptMixerBGVidInputSelect ///< @deprecated Use SetXptMixerBGVidInputSelect instead. + #define SetK2Xpt4MixerFGKeyInputSelect SetXptMixerFGKeyInputSelect ///< @deprecated Use SetXptMixerFGKeyInputSelect instead. + #define SetK2Xpt4MixerFGVidInputSelect SetXptMixerFGVidInputSelect ///< @deprecated Use SetXptMixerFGVidInputSelect instead. + #define SetK2Xpt5CSC2KeyInputSelect SetXptCSC2KeyInputSelect ///< @deprecated Use SetXptCSC2KeyInputSelect instead. + #define SetK2Xpt5CSC2VidInputSelect SetXptCSC2VidInputSelect ///< @deprecated Use SetXptCSC2VidInputSelect instead. + #define SetK2Xpt5FrameBuffer2InputSelect SetXptFrameBuffer2InputSelect ///< @deprecated Use SetXptFrameBuffer2InputSelect instead. + #define SetK2Xpt5XptLUT2InputSelect SetXptLUT2InputSelect ///< @deprecated Use SetXptLUT2InputSelect instead. + #define SetK2Xpt6HDMIOutInputSelect SetXptHDMIOutInputSelect ///< @deprecated Use SetXptHDMIOutInputSelect instead. + #define SetK2Xpt6IICTInputSelect SetXptIICTInputSelect ///< @deprecated Use SetXptIICTInputSelect instead. + #define SetK2Xpt6SecondConverterInputSelect SetXptSecondConverterInputSelect ///< @deprecated Use SetXptSecondConverterInputSelect instead. + #define SetK2Xpt6WaterMarkerInputSelect SetXptWaterMarkerInputSelect ///< @deprecated Use SetXptWaterMarkerInputSelect instead. + #define SetK2Xpt7DuallinkOut2InputSelect SetXptDuallinkOut2InputSelect ///< @deprecated Use SetXptDuallinkOut2InputSelect instead. + #define SetK2Xpt7IICT2InputSelect SetXptIICT2InputSelect ///< @deprecated Use SetXptIICT2InputSelect instead. + #define SetK2Xpt7WaterMarker2InputSelect SetXptWaterMarker2InputSelect ///< @deprecated Use SetXptWaterMarker2InputSelect instead. + #define SetK2Xpt8SDIOut3InputSelect SetXptSDIOut3InputSelect ///< @deprecated Use SetXptSDIOut3InputSelect instead. + #define SetK2Xpt8SDIOut4InputSelect SetXptSDIOut4InputSelect ///< @deprecated Use SetXptSDIOut4InputSelect instead. + #define SetK2Xpt8SDIOut5InputSelect SetXptSDIOut5InputSelect ///< @deprecated Use SetXptSDIOut4InputSelect instead. + #define SetK2Xpt9Mixer2BGKeyInputSelect SetXptMixer2BGKeyInputSelect ///< @deprecated Use SetXptSDIOut5InputSelect instead. + #define SetK2Xpt9Mixer2BGVidInputSelect SetXptMixer2BGVidInputSelect ///< @deprecated Use SetXptMixer2BGKeyInputSelect instead. + #define SetK2Xpt9Mixer2FGKeyInputSelect SetXptMixer2FGKeyInputSelect ///< @deprecated Use SetXptMixer2BGVidInputSelect instead. + #define SetK2Xpt9Mixer2FGVidInputSelect SetXptMixer2FGVidInputSelect ///< @deprecated Use SetXptMixer2FGKeyInputSelect instead. + #define SetK2Xpt10SDIOut1DS2InputSelect SetXptSDIOut1DS2InputSelect ///< @deprecated Use SetXptMixer2FGVidInputSelect instead. + #define SetK2Xpt10SDIOut2DS2InputSelect SetXptSDIOut2DS2InputSelect ///< @deprecated Use SetXptSDIOut1DS2InputSelect instead. + #define SetK2Xpt11DualLinkIn1DSSelect SetXptDualLinkIn1DSSelect ///< @deprecated Use SetXptSDIOut2DS2InputSelect instead. + #define SetK2Xpt11DualLinkIn1Select SetXptDualLinkIn1Select ///< @deprecated Use SetXptDualLinkIn1DSSelect instead. + #define SetK2Xpt11DualLinkIn2DSSelect SetXptDualLinkIn2DSSelect ///< @deprecated Use SetXptDualLinkIn1Select instead. + #define SetK2Xpt11DualLinkIn2Select SetXptDualLinkIn2Select ///< @deprecated Use SetXptDualLinkIn2DSSelect instead. + #define SetK2Xpt12LUT3InputSelect SetXptLUT3InputSelect ///< @deprecated Use SetXptDualLinkIn2Select instead. + #define SetK2Xpt12LUT4InputSelect SetXptLUT4InputSelect ///< @deprecated Use SetXptLUT3InputSelect instead. + #define SetK2Xpt12LUT5InputSelect SetXptLUT5InputSelect ///< @deprecated Use SetXptLUT4InputSelect instead. + #define SetK2Xpt13FrameBuffer3InputSelect SetXptFrameBuffer3InputSelect ///< @deprecated Use SetXptLUT5InputSelect instead. + #define SetK2Xpt13FrameBuffer4InputSelect SetXptFrameBuffer4InputSelect ///< @deprecated Use SetXptFrameBuffer3InputSelect instead. + #define SetK2Xpt14SDIOut3DS2InputSelect SetXptSDIOut3DS2InputSelect ///< @deprecated Use SetXptFrameBuffer4InputSelect instead. + #define SetK2Xpt14SDIOut4DS2InputSelect SetXptSDIOut4DS2InputSelect ///< @deprecated Use SetXptSDIOut3DS2InputSelect instead. + #define SetK2Xpt14SDIOut5DS2InputSelect SetXptSDIOut5DS2InputSelect ///< @deprecated Use SetXptSDIOut4DS2InputSelect instead. + #define SetK2Xpt15DualLinkIn3DSSelect SetXptDualLinkIn3DSSelect ///< @deprecated Use SetXptSDIOut5DS2InputSelect instead. + #define SetK2Xpt15DualLinkIn3Select SetXptDualLinkIn3Select ///< @deprecated Use SetXptDualLinkIn3DSSelect instead. + #define SetK2Xpt15DualLinkIn4DSSelect SetXptDualLinkIn4DSSelect ///< @deprecated Use SetXptDualLinkIn3Select instead. + #define SetK2Xpt15DualLinkIn4Select SetXptDualLinkIn4Select ///< @deprecated Use SetXptDualLinkIn4DSSelect instead. + #define SetK2Xpt16DuallinkOut3InputSelect SetXptDuallinkOut3InputSelect ///< @deprecated Use SetXptDualLinkIn4Select instead. + #define SetK2Xpt16DuallinkOut4InputSelect SetXptDuallinkOut4InputSelect ///< @deprecated Use SetXptDuallinkOut3InputSelect instead. + #define SetK2Xpt16DuallinkOut5InputSelect SetXptDuallinkOut5InputSelect ///< @deprecated Use SetXptDuallinkOut4InputSelect instead. + #define SetK2Xpt17CSC3KeyInputSelect SetXptCSC3KeyInputSelect ///< @deprecated Use SetXptDuallinkOut5InputSelect instead. + #define SetK2Xpt17CSC3VidInputSelect SetXptCSC3VidInputSelect ///< @deprecated Use SetXptCSC3KeyInputSelect instead. + #define SetK2Xpt17CSC4KeyInputSelect SetXptCSC4KeyInputSelect ///< @deprecated Use SetXptCSC3VidInputSelect instead. + #define SetK2Xpt17CSC4VidInputSelect SetXptCSC4VidInputSelect ///< @deprecated Use SetXptCSC4KeyInputSelect instead. + #define SetK2XptCSC5KeyInputSelect SetXptCSC5KeyInputSelect ///< @deprecated Use SetXptCSC4VidInputSelect instead. + #define SetK2XptCSC5VidInputSelect SetXptCSC5VidInputSelect ///< @deprecated Use SetXptCSC5KeyInputSelect instead. + #define SetK2XptHDMIOutV2Q1InputSelect SetXptHDMIOutV2Q1InputSelect ///< @deprecated Use SetXptCSC5VidInputSelect instead. + #define SetK2XptHDMIOutV2Q2InputSelect SetXptHDMIOutV2Q2InputSelect ///< @deprecated Use SetXptHDMIOutV2Q1InputSelect instead. + #define SetK2XptHDMIOutV2Q3InputSelect SetXptHDMIOutV2Q3InputSelect ///< @deprecated Use SetXptHDMIOutV2Q2InputSelect instead. + #define SetK2XptHDMIOutV2Q4InputSelect SetXptHDMIOutV2Q4InputSelect ///< @deprecated Use SetXptHDMIOutV2Q4InputSelect instead. + #define SetXena2VideoOutputStandard SetVideoOutputStandard ///< @deprecated Use SetVideoOutputStandard instead. + #define SetXptMixerBGKeyInputSelect SetXptMixer1BGKeyInputSelect ///< @deprecated Use SetXptMixer1BGKeyInputSelect instead. + #define GetXptMixerBGKeyInputSelect GetXptMixer1BGKeyInputSelect ///< @deprecated Use GetXptMixer1BGKeyInputSelect instead. + #define SetXptMixerBGVidInputSelect SetXptMixer1BGVidInputSelect ///< @deprecated Use SetXptMixer1BGVidInputSelect instead. + #define GetXptMixerBGVidInputSelect GetXptMixer1BGVidInputSelect ///< @deprecated Use GetXptMixer1BGVidInputSelect instead. + #define SetXptMixerFGKeyInputSelect SetXptMixer1FGKeyInputSelect ///< @deprecated Use SetXptMixer1FGKeyInputSelect instead. + #define GetXptMixerFGKeyInputSelect GetXptMixer1FGKeyInputSelect ///< @deprecated Use GetXptMixer1FGKeyInputSelect instead. + #define SetXptMixerFGVidInputSelect SetXptMixer1FGVidInputSelect ///< @deprecated Use SetXptMixer1FGVidInputSelect instead. + #define GetXptMixerFGVidInputSelect GetXptMixer1FGVidInputSelect ///< @deprecated Use GetXptMixer1FGVidInputSelect instead. + #define SetXptXptLUT2InputSelect SetXptLUT2InputSelect ///< @deprecated Use SetXptLUT2InputSelect instead. + #define GetXptXptLUT2InputSelect GetXptLUT2InputSelect ///< @deprecated Use GetXptLUT2InputSelect instead. +#endif // !defined (NTV2_DEPRECATE) + + +/** + @brief Audits an NTV2 device's SDRAM utilization, and can report contiguous regions of SDRAM, whether unused/free, + those being read/written by AutoCirculate, those being read/written by non-AutoCirculating FrameStores, + those that are in conflict (AutoCirculate, FrameStore and/or Audio collisions), plus invalid/out-of-bounds + regions being accessed. + @details This implementation currently employs a least-common-denominator 8MB frame size. This was chosen because + the SDRAM complement across all currently-supported devices is evenly divisible by (at most) 8MB. Any 8MB + block can be translated into larger denominations as needed (e.g. 16MB, 32MB, 64MB, etc.). + A memory region is described by an offset and length, both unsigned 16-bit values encoded into a 32-bit ULWord. + Region lists are specified or provided by the ::ULWordSequence data type (a std::vector of ULWord values). + Memory regions can be tagged with one or more std::string tags in an ::NTV2StringList (a std::vector of + std::string values). A region with no tags (an empty list) is considered unallocated/free/unused. A tag string + describes a region that is considered in-use (or potentially in-use). + - Audio System: "Aud1 Write" indicates Audio System 1 is actively capturing; "Aud2 Read" indicates + Audio System 2 is actively playing; "Aud3" indicates the memory region that would be used by Audio System 3 + if it were actively capturing or playing. + - FrameStore: "Ch2 Read" indicates FrameStore 2 is enabled in playback mode; "Ch3 Write" indicates + FrameStore 3 is enabled and configured for capture/ingest. + - AutoCirculate: "AC1 Write" indicates AutoCirculate channel 1 is initialized for capture. + - A region with only one tag is considered "in-use", or, in the case of an "Aud" tag without "Read" or "Write" + is potentially in use. + - A region having more than one tag may be "in-conflict" and considered "bad" or potentially "problematic". +**/ +class SDRAMAuditor +{ + public: + /** + @brief My default constructor. I am not ready for use until my SDRAMAuditor::Assess method has been called. + **/ + explicit SDRAMAuditor () + : mDeviceID (DEVICE_ID_INVALID), + mFrameTags (), + m8MB (0x00800000), + mNumFrames (0), + mIntrinsicSize (0) + { + } + + /** + @brief Constructs me and automatically assesses the given device. + @param[in] inDevice The device of interest, which must be open and ready. + **/ + explicit SDRAMAuditor (CNTV2Card & inDevice) + : mDeviceID (DEVICE_ID_INVALID), + mFrameTags (), + m8MB (0x00800000), + mNumFrames (0), + mIntrinsicSize (0) + { + AssessDevice(inDevice); + } + + /** + @brief Assesses the given device. + @param[in] inDevice The device of interest. + @param[in] inIgnoreStoppedAudioBuffers Optionally specifies how to treat stopped audio system buffer regions. + False means "do not ignore non-running audio engine buffers", which will + tag their buffer regions, making them potentially or likely to be in-use. + True means non-running audio buffers will not be tagged. + Defaults to false (erring on the safe side, to avoid potential conflicts). + **/ + bool AssessDevice (CNTV2Card & inDevice, const bool inIgnoreStoppedAudioBuffers = false); + + /** + @brief Answers with the lists of free, in-use and conflicting 8MB memory blocks. + Each ULWord represents a region -- an 8MB block offset in the most-significant 16 bits, + and the number of 8MB blocks in the least-significant 16 bits. + @param[out] outFree Receives the list of free (unused) memory regions. + @param[out] outUsed Receives the list of used memory regions. + @param[out] outBad Receives the list of colliding and illegal memory regions. + @return True if successful; otherwise false. + **/ + bool GetRegions (ULWordSequence & outFree, ULWordSequence & outUsed, ULWordSequence & outBad) const; + + /** + @brief Answers with the list of free memory regions. + @param[out] outBlks Receives the region list. + **/ + inline bool GetFreeRegions (ULWordSequence & outBlks) const + { + ULWordSequence used, bad; + return GetRegions (outBlks, used, bad); + } + + /** + @brief Answers with the list of colliding and illegal memory regions. + @param[out] outBlks Receives the region list. + **/ + inline bool GetBadRegions (ULWordSequence & outBlks) const + { + ULWordSequence used, free; + return GetRegions (free, used, outBlks); + } + + /** + @brief Answers with the list of used memory regions. + @param[out] outBlks Receives the region list. + **/ + inline bool GetUsedRegions (ULWordSequence & outBlks) const + { + ULWordSequence bad, free; + return GetRegions (free, outBlks, bad); + } + + /** + @brief Answers with the list of tags for the given frame number. + @param[in] inIndex Specifies the zero-based frame index number of the frame of interest. + @param[out] outTags Receives the list of tag strings (if any). + @return True if successful; otherwise false. + **/ + bool GetTagsForFrameIndex (const UWord inIndex, NTV2StringSet & outTags) const; + + bool HasFrameIndex (const UWord inIndex) const {return mFrameTags.find(inIndex) != mFrameTags.end();} ///< @return True if the given frame number is valid. + + size_t GetTagCount (const UWord inIndex) const; ///< @return The number of tags associated with the given frame number. + + inline bool HasTag (const UWord inIndex) const {return GetTagCount(inIndex) > 0;} ///< @return True if the given frame number has a tag associated with it. + inline bool HasConflicts (const UWord inIndex) const {return GetTagCount(inIndex) > 1;} ///< @return True if the given frame number has problems (i.e. more than one tag associated with it). + inline ULWord GetIntrinsicFrameByteCount (void) const {return mIntrinsicSize;} ///< @return The size, in bytes, of the intrinsic frame size; or zero if not known. + + /** + @brief Translates an 8MB-chunked list of regions into another list of regions with frame indexes and sizes + expressed in frame units determined by the device's intrinsic frame size (measured when AssessDevice + was called) and also based on if the given quad or quad-quad mode is active. + @param[out] outRgns Receives the translated region list. + @param[in] inRgns Specifies the 8MB-based region list to be translated. + @param[in] inIsQuad Specify true if translated regions should be Quad-sized. + @param[in] inIsQuadQuad Specify true if translated regions should be Quad-Quad-sized. + @return True if successful; otherwise false. + **/ + bool TranslateRegions (ULWordSequence & outRgns, const ULWordSequence & inRgns, const bool inIsQuad, const bool inIsQuadQuad) const; + + /** + @brief Dumps a human-readable list of regions into the given stream. + @param oss Specifies the output stream to receives the report. + @return A reference to the given output stream. + **/ + std::ostream & RawDump (std::ostream & oss) const; + + /** + @brief Dumps all 8MB blocks/frames and their tags, if any, into the given stream. + @param oss Specifies the output stream to receives the report. + @return A reference to the given output stream. + **/ + std::ostream & DumpBlocks (std::ostream & oss) const; + + // Static/Class Methods + public: + typedef std::set ULWordSet; + typedef ULWordSet::const_iterator ULWordSetConstIter; + + /** + @return The unique set of regions resulting from the union of the given three lists of regions. + **/ + static ULWordSet CoalesceRegions (const ULWordSequence & inRgn1, const ULWordSequence & inRgn2, const ULWordSequence & inRgn3); + + protected: + bool TagAudioBuffers (CNTV2Card & inDevice, const bool inMarkStoppedAudioBuffersFree); + bool TagVideoFrames (CNTV2Card & inDevice); + bool TagMemoryBlock (const ULWord inStartAddr, const ULWord inByteLength, const std::string & inTag); + bool TagMemoryBlock (const uint64_t inStartAddr, const uint64_t inByteLength, const std::string & inTag) + { + return TagMemoryBlock (ULWord(inStartAddr), ULWord(inByteLength), inTag); + } + + private: + typedef std::pair FrameTag; + typedef std::map FrameTags; + typedef FrameTags::const_iterator FrameTagsConstIter; + + NTV2DeviceID mDeviceID; ///< @brief The device ID of the device being assessed. + FrameTags mFrameTags; ///< @brief Stores tag(s) for each 8MB frame. + const ULWord m8MB; ///< @brief 1024 x 1024 x 8 + UWord mNumFrames; ///< @brief Total maximum number of 8MB frames on this device. + ULWord mIntrinsicSize; ///< @brief Intrinsic frame size of device at time of assessment, in bytes (8MB or 16MB). +}; // SDRAMAuditor + +#endif // NTV2CARD_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2choosableboard.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2choosableboard.h new file mode 100644 index 0000000..9fa94e0 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2choosableboard.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2choosableboard.h + @brief Declares the NTV2ChoosableBoard struct used for "nub" discovery. + @copyright (C) 2005-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2CHOOSABLEBOARD_H +#define NTV2CHOOSABLEBOARD_H + +#define MAX_LOCAL_BOARDS 12 +#define MAX_REMOTE_BOARDS 512 +#define MAX_CHOOSABLE_BOARDS ( MAX_LOCAL_BOARDS + MAX_REMOTE_BOARDS) + +#define NO_BOARD_CHOSEN (99999) + +#define CHOOSABLE_BOARD_STRMAX (16) +typedef struct +{ + ULWord boardNumber; // Card number, 0 .. 3 + ULWord boardType; // e.g. BOARDTYPE_KHD + NTV2DeviceID boardID; + char description [NTV2_DISCOVER_BOARDINFO_DESC_STRMAX]; // "IPADDR: board identifier" + char hostname [CHOOSABLE_BOARD_STRMAX]; // 0 len == local board. +} NTV2ChoosableBoard; + +#endif //NTV2CHOOSABLEBOARD_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2config2022.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2config2022.h new file mode 100644 index 0000000..a9c1caf --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2config2022.h @@ -0,0 +1,252 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2config2022.h + @brief Declares the CNTV2Config2022 class. + @copyright (C) 2014-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2_2022CONFIG_H +#define NTV2_2022CONFIG_H + +#include "ntv2card.h" +#include "ntv2enums.h" +#include "ntv2registers2022.h" +#include "ntv2mbcontroller.h" +#include "ntv2tshelper.h" +#include + +/** + @brief Configures a SMPTE 2022 Transmit Channel. +**/ + +class AJAExport tx_2022_channel +{ +public: + tx_2022_channel() { init(); } + + void init(); + + bool operator != ( const tx_2022_channel &other ); + bool operator == ( const tx_2022_channel &other ); + +public: + bool sfp1Enable; + bool sfp2Enable; + + uint32_t sfp1LocalPort; ///< @brief Specifies the local (source) port number. + std::string sfp1RemoteIP; ///< @brief Specifies remote (destination) IP address. + uint32_t sfp1RemotePort; ///< @brief Specifies the remote (destination) port number. + + uint32_t sfp2LocalPort; ///< @brief Specifies the local (source) port number. + std::string sfp2RemoteIP; ///< @brief Specifies remote (destination) IP address. + uint32_t sfp2RemotePort; ///< @brief Specifies the remote (destination) port number. + + uint8_t tos; // type of service + uint8_t ttl; // time to live + uint32_t ssrc; +}; + +/** + @brief Configures a SMPTE 2022 Receive Channel. +**/ + +class AJAExport rx_2022_channel +{ +public: + rx_2022_channel() { init(); } + + void init(); + + bool operator != ( const rx_2022_channel &other ); + bool operator == ( const rx_2022_channel &other ); + +public: + bool sfp1Enable; + bool sfp2Enable; + + uint8_t sfp1RxMatch; ///< @brief Bitmap of rxMatch criteria used + std::string sfp1SourceIP; ///< @brief Specifies the source (sender) IP address (if RX_MATCH_2022_SOURCE_IP set). If it's in the multiclass range, then + /// by default, the IGMP multicast group will be joined (see CNTV2Config2022::SetIGMPDisable). + std::string sfp1DestIP; ///< @brief Specifies the destination (target) IP address (if RX_MATCH_2022_DEST_IP set) + uint32_t sfp1SourcePort; ///< @brief Specifies the source (sender) port number (if RX_MATCH_2022_SOURCE_PORT set) + uint32_t sfp1DestPort; ///< @brief Specifies the destination (target) port number (if RX_MATCH_2022_DEST_PORT set) + uint16_t sfp1Vlan; ///< @brief Specifies the VLAN TCI (if RX_MATCH_2022_VLAN set) + + uint8_t sfp2RxMatch; ///< @brief Bitmap of rxMatch criteria used + std::string sfp2SourceIP; ///< @brief Specifies the source (sender) IP address (if RX_MATCH_2022_SOURCE_IP set). If it's in the multiclass range, then + /// by default, the IGMP multicast group will be joined (see CNTV2Config2022::SetIGMPDisable). + std::string sfp2DestIP; ///< @brief Specifies the destination (target) IP address (if RX_MATCH_2022_DEST_IP set) + uint32_t sfp2SourcePort; ///< @brief Specifies the source (sender) port number (if RX_MATCH_2022_SOURCE_PORT set) + uint32_t sfp2DestPort; ///< @brief Specifies the destination (target) port number (if RX_MATCH_2022_DEST_PORT set) + uint16_t sfp2Vlan; ///< @brief Specifies the VLAN TCI (if RX_MATCH_2022_VLAN set) + + uint32_t ssrc; ///< @brief Specifies the SSRC identifier (if RX_MATCH_2022_SSRC set) + uint32_t playoutDelay; ///< @brief Specifies the wait time in milliseconds to SDI playout from incoming packet (0-150). +}; + +class AJAExport j2kEncoderConfig +{ +public: + j2kEncoderConfig() { init(); } + + void init(); + + bool operator == ( const j2kEncoderConfig &other ); + bool operator != ( const j2kEncoderConfig &other ); + + NTV2VideoFormat videoFormat; ///< @brief Specifies the video format for J2K encode. + uint32_t ullMode; ///< @brief Specifies the ull mode for J2K encode. + uint32_t bitDepth; ///< @brief Specifies the bit depth for J2K encode. + J2KChromaSubSampling chromaSubsamp; ///< @brief Specifies the chroma sub sampling for J2K encode. + uint32_t mbps; ///< @brief Specifies the mbits per-second for J2K encode. + J2KStreamType streamType; ///< @brief Specifies the stream type for J2K encode. + uint32_t audioChannels; ///< @brief Specifies the number of audio channels for J2K encode, a value of 0 indicates no audio. + uint32_t pmtPid; ///< @brief Specifies the PID for the PMT. + uint32_t videoPid; ///< @brief Specifies the PID for the video. + uint32_t pcrPid; ///< @brief Specifies the PID for the PCR. + uint32_t audio1Pid; ///< @brief Specifies the PID for audio 1. +}; + +class AJAExport j2kDecoderConfig +{ +public: + typedef enum + { + eProgSel_Off, + eProgSel_AutoFirstProg, + eProgSel_LowestProgNum, + eProgSel_SpecificProgNum, + eProgSel_SpecificProgPID, + eProgSel_Default = eProgSel_AutoFirstProg + } eProgSelMode_t; + + j2kDecoderConfig() {init();} + void init(); + + bool operator == ( const j2kDecoderConfig &other ); + bool operator != ( const j2kDecoderConfig &other ); + + eProgSelMode_t selectionMode; + uint32_t programNumber; + uint32_t programPID; + uint32_t audioNumber; +}; + +class AJAExport j2kDecoderStatus +{ +public: + j2kDecoderStatus() {init();} + void init(); + + uint32_t numAvailablePrograms; + uint32_t numAvailableAudios; + std::vector availableProgramNumbers; + std::vector availableProgramPIDs; + std::vector availableAudioPIDs; +}; + +struct s2022RxChannelStatus +{ + uint32_t sfp1RxPackets; + uint32_t sfp1ValidRxPackets; + uint32_t sfp2RxPackets; + uint32_t sfp2ValidRxPackets; +}; + +/** + @brief The CNTV2Config2022 class is the interface to Kona-IP network I/O using SMPTE 2022 +**/ +class AJAExport CNTV2Config2022 : public CNTV2MBController +{ +public: + CNTV2Config2022 (CNTV2Card & device); + ~CNTV2Config2022(); + + bool SetNetworkConfiguration(const eSFP sfp, const IPVNetConfig & netConfig); + bool GetNetworkConfiguration(const eSFP sfp, IPVNetConfig & netConfig); + bool SetNetworkConfiguration(const eSFP sfp, const std::string localIPAddress, const std::string subnetMask, const std::string gateway); + bool GetNetworkConfiguration(const eSFP sfp, std::string & localIPAddress, std::string & subnetMask, std::string & gateway); + bool DisableNetworkInterface(const eSFP sfp); + + bool SetRxChannelConfiguration(const NTV2Channel channel, const rx_2022_channel & rxConfig); + bool GetRxChannelConfiguration(const NTV2Channel channel, rx_2022_channel & rxConfig); + + bool SetRxChannelEnable(const NTV2Channel channel, bool enable); + bool GetRxChannelEnable(const NTV2Channel channel, bool & enabled); + + bool SetTxChannelConfiguration(const NTV2Channel channel, const tx_2022_channel & txConfig); + bool GetTxChannelConfiguration(const NTV2Channel channel, tx_2022_channel & txConfig); + + bool SetTxChannelEnable(const NTV2Channel channel, bool enable); + bool GetTxChannelEnable(const NTV2Channel channel, bool & enabled); + + bool SetJ2KEncoderConfiguration(const NTV2Channel channel, const j2kEncoderConfig & j2kConfig); + bool GetJ2KEncoderConfiguration(const NTV2Channel channel, j2kEncoderConfig &j2kConfig); + + bool SetJ2KDecoderConfiguration(const j2kDecoderConfig & j2kConfig); + bool GetJ2KDecoderConfiguration(j2kDecoderConfig &j2kConfig); + bool GetJ2KDecoderStatus(j2kDecoderStatus & j2kStatus); + + bool Set2022_7_Mode(bool enable, uint32_t rx_networkPathDifferential); + bool Get2022_7_Mode(bool & enable, uint32_t & rx_networkPathDifferential); + + /** + @brief Disables the automatic (default) joining of multicast groups using IGMP, based on remote IP address for Rx Channels + @param[in] sfp Specifies SFP connector used. + @param[in] disable If true, IGMP messages will not be sent to join multicast groups + @note When Rx channels are enabled for multicast IP addresses, by default the multicast group is joined. When Rx Channels + are disabled, if the channel is the last user of the group, then the subscription to the multicast group will be ended. + When IGMP is disabled, the above actions are not performed, + **/ + bool SetIGMPDisable(eSFP sfp, bool disable); + bool GetIGMPDisable(eSFP sfp, bool & disabled); + + bool SetIGMPVersion(eIGMPVersion_t version); + bool GetIGMPVersion(eIGMPVersion_t & version); + + void SetBiDirectionalChannels(bool bidirectional) { _biDirectionalChannels = bidirectional;} + bool GetBiDirectionalChannels() {return _biDirectionalChannels;} + + bool GetMACAddress(eSFP sfp, NTV2Stream stream, std::string remoteIP, uint32_t & hi, uint32_t & lo); + + bool GetSFPMSAData(eSFP sfp, SFPMSAData & data); + bool GetLinkStatus(eSFP sfp, SFPStatus & sfpStatus); + bool Get2022ChannelRxStatus(NTV2Channel channel, s2022RxChannelStatus & status); + + bool SetIPServicesControl(const bool enable, const bool forceReconfig); + bool GetIPServicesControl(bool & enable, bool & forceReconfig); + + + // If method returns false call this to get details + std::string getLastError(); + NTV2IpError getLastErrorCode(); + +private: + void ChannelSemaphoreSet(uint32_t controlReg, uint32_t baseaddr); + void ChannelSemaphoreClear(uint32_t controlReg, uint32_t baseaddr); + + bool SelectRxChannel(NTV2Channel channel, eSFP sfp, uint32_t & baseAddr); + bool SelectTxChannel(NTV2Channel channel, eSFP sfp, uint32_t & baseAddr); + + NTV2Stream VideoChannelToStream(const NTV2Channel channel); + NTV2Channel VideoStreamToChannel(const NTV2Stream stream); + + class CNTV2ConfigTs2022 * _tstreamConfig; + + eSFP GetTxLink(NTV2Channel chan); + + uint32_t _numRx0Chans; + uint32_t _numRx1Chans; + uint32_t _numTx0Chans; + uint32_t _numTx1Chans; + uint32_t _numRxChans; + uint32_t _numTxChans; + bool _is2022_6; + bool _is2022_2; + bool _is2022_7; + bool _biDirectionalChannels; // logically bi-directional channels + bool _is_txTop34; + bool _isIoIp; +}; // CNTV2Config2022 + +#endif // NTV2_2022CONFIG_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2config2110.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2config2110.h new file mode 100644 index 0000000..42d6e15 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2config2110.h @@ -0,0 +1,490 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2config2110.h + @brief Declares the CNTV2Config2110 class. + @copyright (C) 2014-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2_2110CONFIG_H +#define NTV2_2110CONFIG_H + +#include "ntv2card.h" +#include "ntv2enums.h" +#include "ntv2registers2110.h" +#include "ntv2mbcontroller.h" +#include +#include +#include +#include + +/** + @brief Structs and enums that hold the virtual config data used by services the ControlPanel application and JSON parsers +**/ + +#define RX_USE_SFP_IP BIT(31) +#define IP_STRSIZE 32 + + +typedef enum +{ + kNetworkData2110 = NTV2_FOURCC('n','t','1','3'), // 4CC of network config data + kTransmitVideoData2110 = NTV2_FOURCC('t','v','1','3'), // 4CC of video transmit config data + kTransmitAudioData2110 = NTV2_FOURCC('t','a','1','3'), // 4CC of audio transmit config data + kTransmitAncData2110 = NTV2_FOURCC('t','n','1','3'), // 4CC of anc transmit config data + kReceiveVideoData2110 = NTV2_FOURCC('r','v','1','3'), // 4CC of video receive config data + kReceiveAudioData2110 = NTV2_FOURCC('r','a','1','3'), // 4CC of audio receive config data + kReceiveAncData2110 = NTV2_FOURCC('r','n','1','3'), // 4CC of anc receive config data + kChStatusData2110 = NTV2_FOURCC('s','t','1','3') // 4CC of channel status config data +} VirtualDataTag2110; + +typedef enum +{ + kIpStatusFail = 0, + kIpStatusStopped = 1, + kIpStatusRunning = 2 +} IpChStatusState; + +// force 1 byte alignment so can work across 32/64 bit apps +#pragma pack(push,1) + +typedef struct +{ + NTV2Stream stream; + char remoteIP[2][IP_STRSIZE]; + uint32_t remotePort[2]; + uint32_t localPort[2]; + uint32_t sfpEnable[2]; + uint32_t ttl; + uint32_t ssrc; + uint32_t payloadType; + NTV2VideoFormat videoFormat; + VPIDSampling sampling; + uint32_t enable; + uint8_t unused[12]; +} TxVideoChData2110; + +typedef struct +{ + NTV2Stream stream; + NTV2Channel channel; + char remoteIP[2][IP_STRSIZE]; + uint32_t localPort[2]; + uint32_t remotePort[2]; + uint32_t sfpEnable[2]; + uint32_t ttl; + uint32_t ssrc; + uint32_t payloadType; + uint32_t numAudioChannels; + uint32_t firstAudioChannel; + eNTV2PacketInterval audioPktInterval; + uint32_t enable; + uint8_t unused[16]; +} TxAudioChData2110; + +typedef struct +{ + NTV2Stream stream; + char remoteIP[2][IP_STRSIZE]; + uint32_t localPort[2]; + uint32_t remotePort[2]; + uint32_t sfpEnable[2]; + uint32_t ttl; + uint32_t ssrc; + uint32_t payloadType; + uint32_t enable; + uint8_t unused[16]; +} TxAncChData2110; + +typedef struct +{ + NTV2Stream stream; + char sourceIP[2][IP_STRSIZE]; + char destIP[2][IP_STRSIZE]; + uint32_t sourcePort[2]; + uint32_t destPort[2]; + uint32_t sfpEnable[2]; + uint32_t vlan; + uint32_t ssrc; + uint32_t payloadType; + NTV2VideoFormat videoFormat; + uint32_t enable; + uint8_t unused[16]; +} RxVideoChData2110; + +typedef struct +{ + NTV2Stream stream; + NTV2Channel channel; + char sourceIP[2][IP_STRSIZE]; + char destIP[2][IP_STRSIZE]; + uint32_t sourcePort[2]; + uint32_t destPort[2]; + uint32_t sfpEnable[2]; + uint32_t vlan; + uint32_t ssrc; + uint32_t payloadType; + uint32_t numAudioChannels; + eNTV2PacketInterval audioPktInterval; + uint32_t enable; + uint8_t unused[16]; +} RxAudioChData2110; + +typedef struct +{ + NTV2Stream stream; + char sourceIP[2][IP_STRSIZE]; + char destIP[2][IP_STRSIZE]; + uint32_t sourcePort[2]; + uint32_t destPort[2]; + uint32_t sfpEnable[2]; + uint32_t vlan; + uint32_t ssrc; + uint32_t payloadType; + uint32_t enable; + uint8_t unused[16]; +} RxAncChData2110; + +typedef struct +{ + eSFP sfp; + char ipAddress[IP_STRSIZE]; + char subnetMask[IP_STRSIZE]; + char gateWay[IP_STRSIZE]; + uint32_t enable; + uint8_t unused[16]; +} SFPData2110; + +typedef struct +{ + uint32_t txChStatus[4]; + uint32_t rxChStatus[4]; + uint8_t unused[16]; +} IpStatus2110; + +typedef struct +{ + bool setup4k; + uint32_t ptpDomain; + uint8_t ptpPreferredGMID[8]; + uint32_t numSFPs; + SFPData2110 sfp[2]; + bool multiSDP; + bool audioCombine; + uint32_t rxMatchOverride; + uint8_t unused[10]; +} NetworkData2110; + +typedef struct +{ + uint32_t numTxVideoChannels; + TxVideoChData2110 txVideoCh[4]; +} TransmitVideoData2110; + +typedef struct +{ + uint32_t numTxAudioChannels; + TxAudioChData2110 txAudioCh[4]; +} TransmitAudioData2110; + +typedef struct +{ + uint32_t numTxAncChannels; + TxAncChData2110 txAncCh[4]; +} TransmitAncData2110; + +typedef struct +{ + uint32_t numRxVideoChannels; + RxVideoChData2110 rxVideoCh[4]; +} ReceiveVideoData2110; + +typedef struct +{ + uint32_t numRxAudioChannels; + RxAudioChData2110 rxAudioCh[4]; +} ReceiveAudioData2110; + +typedef struct +{ + uint32_t numRxAncChannels; + RxAncChData2110 rxAncCh[4]; +} ReceiveAncData2110; + +#pragma pack(pop) + +inline NTV2Stream ChToVideoStream(int ch) + { return (NTV2Stream)(NTV2_VIDEO1_STREAM+ch); } +inline int VideoStreamToCh(NTV2Stream s) + { return (int)(s); } + +inline NTV2Stream ChToAudioStream(int ch) + { return (NTV2Stream)(NTV2_AUDIO1_STREAM+ch); } +inline int AudioStreamToCh(NTV2Stream s) + { return (int)(s >= NTV2_AUDIO1_STREAM ? s-NTV2_AUDIO1_STREAM : 0); } + +inline NTV2Stream ChToAncStream(int ch) + { return (NTV2Stream)(NTV2_ANC1_STREAM+ch); } +inline int AncStreamToCh(NTV2Stream s) + { return (int)(s >= NTV2_ANC1_STREAM ? s-NTV2_ANC1_STREAM : 0); } + +/** + @brief Configures a SMPTE 2110 Transmit Channel. +**/ + +class AJAExport tx_2110Config +{ + public: + tx_2110Config() { init(); } + + void init(); + + bool operator != ( const tx_2110Config &other ); + bool operator == ( const tx_2110Config &other ); + + public: + std::string remoteIP[2]; ///< @brief Specifies remote (destination) IP address. + uint32_t localPort[2]; ///< @brief Specifies the local (source) port number. + uint32_t remotePort[2]; ///< @brief Specifies the remote (destination) port number. + uint16_t payloadType; + uint8_t tos; // type of service + uint8_t ttl; // time to live + uint32_t ssrc; + NTV2Channel channel; + NTV2VideoFormat videoFormat; + VPIDSampling videoSamples; + uint8_t numAudioChannels; + uint8_t firstAudioChannel; + eNTV2PacketInterval audioPktInterval; +}; + +/** + @brief Configures a SMPTE 2110 Receive Channel. +**/ + +class AJAExport rx_2110Config +{ + public: + rx_2110Config() { init(); } + + void init(); + + bool operator != ( const rx_2110Config &other ); + bool operator == ( const rx_2110Config &other ); + + public: + uint32_t rxMatch; ///< @brief Bitmap of rxMatch criteria used + std::string sourceIP; ///< @brief Specifies the source (sender) IP address (if RX_MATCH_2110_SOURCE_IP set). If it's in the multiclass range, then + /// by default, the IGMP multicast group will be joined (see CNTV2Config2110::SetIGMPDisable). + std::string destIP; ///< @brief Specifies the destination (target) IP address (if RX_MATCH_2110_DEST_IP set) + uint32_t sourcePort; ///< @brief Specifies the source (sender) port number (if RX_MATCH_2110_SOURCE_PORT set) + uint32_t destPort; ///< @brief Specifies the destination (target) port number (if RX_MATCH_2110_DEST_PORT set) + uint32_t ssrc; ///< @brief Specifies the SSRC identifier (if RX_MATCH_2110_SSRC set) + uint16_t vlan; ///< @brief Specifies the VLAN TCI (if RX_MATCH_2110_VLAN set) + uint16_t payloadType; + NTV2VideoFormat videoFormat; + VPIDSampling videoSamples; + uint32_t numAudioChannels; + eNTV2PacketInterval audioPktInterval; +}; + +typedef struct +{ + rx_2110Config rx2110Config[4]; +} multiRx_2110Config; + + +/** + @brief The CNTV2Config2110 class inquires and configures SMPTE 2110 network I/O for \ref konaip and \ref ioip. +**/ + +class AJAExport CNTV2Config2110 : public CNTV2MBController +{ + friend class CKonaIpJsonSetup; +public: + CNTV2Config2110 (CNTV2Card & device); + ~CNTV2Config2110(); + + bool SetNetworkConfiguration (const eSFP sfp, const IPVNetConfig & netConfig); + bool GetNetworkConfiguration (const eSFP sfp, IPVNetConfig & netConfig); + bool SetNetworkConfiguration (const eSFP sfp, const std::string localIPAddress, const std::string subnetMask, const std::string gateway); + bool GetNetworkConfiguration (const eSFP sfp, std::string & localIPAddress, std::string & subnetMask, std::string & gateway); + bool DisableNetworkInterface (const eSFP sfp); + bool SetRxStreamConfiguration (const eSFP sfp, const NTV2Stream stream, const rx_2110Config & rxConfig); + bool GetRxStreamConfiguration (const eSFP sfp, const NTV2Stream stream, rx_2110Config & rxConfig); + bool SetRxStreamEnable (const eSFP sfp, const NTV2Stream stream, bool enable); + bool GetRxStreamEnable (const eSFP sfp, const NTV2Stream stream, bool & enabled); + bool GetRxPacketCount (const NTV2Stream stream, uint32_t &packets); + bool GetRxByteCount (const NTV2Stream stream, uint32_t &bytes); + bool GetRxByteCount (const eSFP sfp, uint64_t &bytes); + + bool SetTxStreamConfiguration (const NTV2Stream stream, const tx_2110Config & txConfig); + bool GetTxStreamConfiguration (const NTV2Stream stream, tx_2110Config & txConfig); + bool SetTxStreamEnable (const NTV2Stream stream, bool enableSfp1, bool enableSfp2 = false); + bool GetTxStreamEnable (const NTV2Stream stream, bool & sfp1Enabled, bool & sfp2Enabled); + bool GetTxPacketCount (NTV2Stream stream, uint32_t &packets); + bool GetTxByteCount (const eSFP sfp, uint64_t &bytes); + + bool SetPTPDomain (const uint8_t domain); + bool GetPTPDomain (uint8_t &domain); + bool SetPTPPreferredGrandMasterId (const uint8_t id[8]); + bool GetPTPPreferredGrandMasterId (uint8_t (&id)[8]); + bool GetPTPStatus (PTPStatus & ptpStatus); + + bool Set4KModeEnable (const bool enable); + bool Get4KModeEnable (bool & enable); + + /** + @brief Enables or disables the audio combiner. + @param[in] enable Specify true to enable the audio combiner; specify false to disable it. + @return True if successful; otherwise false. + @note This only affects 4K RX mode. + @note This parameter can be set in the \ref ntv2konaipjsonsetup. Both JSON examples specify it in the "network2110" area. + @detail Normally the audio combiner is disabled when transmitting 16 audio channels over a single flow. + However, it is possible to divide the audio into multiple flows of 4 channels each, so in this case, on the RX side, + you would enable the audio combiner, so that it combines all the separate flows into a single 16-channel audio buffer. + @see CNTV2Config2110::GetAudioCombineEnable + **/ + bool SetAudioCombineEnable (const bool enable); + + /** + @brief Answers with the enable/disable state of the audio combiner. + @param[in] enable Receives true if the audio combiner is enabled; otherwise false if it's disabled. + @return True if successful; otherwise false. + @note This only affects 4K RX mode. + @detail Normally the audio combiner is off when transmitting 16 audio channels over a single flow. + However, it is possible to divide the audio into multiple flows of 4 channels each, so in this case, on the RX side, + you would enable the audio combiner so, that it combines all the separate flows into a single 16-channel audio buffer. + @see CNTV2Config2110::SetAudioCombineEnable + **/ + bool GetAudioCombineEnable (bool & enable); + + bool SetIPServicesControl (const bool enable, const bool forceReconfig); + bool GetIPServicesControl (bool & enable, bool & forceReconfig); + + std::string GetSDPUrl (const eSFP sfp, const NTV2Stream stream); + std::string GetGeneratedSDP (bool enabledSfp1, bool enabledSfp2, const NTV2Stream stream); + bool GetActualSDP (std::string url, std::string & sdp); + bool ExtractRxVideoConfigFromSDP (std::string sdp, rx_2110Config & rxConfig); + bool ExtractRxVideoConfigFromSDP (std::string sdp, multiRx_2110Config & rxConfig); + bool ExtractRxAudioConfigFromSDP (std::string sdp, rx_2110Config & rxConfig); + bool ExtractRxAncConfigFromSDP (std::string sdp, rx_2110Config & rxConfig); + + /** + @brief Disables the automatic (default) joining of multicast groups using IGMP, based on remote IP address for Rx Channels + @param[in] sfp Specifies SFP connector used. + @param[in] disable If true, IGMP messages will not be sent to join multicast groups + @note When Rx channels are enabled for multicast IP addresses, by default the multicast group is joined. When Rx Channels + are disabled, if the channel is the last user of the group, then the subscription to the multicast group will be ended. + When IGMP is disabled, the above actions are not performed, + **/ + bool SetIGMPDisable (const eSFP sfp, const bool disable); + bool GetIGMPDisable (const eSFP sfp, bool & disabled); + + bool SetIGMPVersion (const eIGMPVersion_t version); + bool GetIGMPVersion (eIGMPVersion_t & version); + + void SetBiDirectionalChannels (const bool bidirectional) { _biDirectionalChannels = bidirectional;} + bool GetBiDirectionalChannels (void) {return _biDirectionalChannels;} + + bool GetMACAddress (const eSFP port, const NTV2Stream stream, std::string remoteIP, uint32_t & hi, uint32_t & lo); + + bool GetSFPMSAData (eSFP port, SFPMSAData & data); + bool GetLinkStatus (eSFP port, SFPStatus & sfpStatus); + + bool GenSDP (bool enableSfp1, bool enableSfp2, const NTV2Stream stream, bool pushit=true); + + static uint32_t Get2110TxStreamIndex (NTV2Stream stream ); + static uint32_t GetDecapsulatorAddress (eSFP sfp, NTV2Stream stream); + + bool SetLLDPInfo (std::string sysname); + bool GetLLDPInfo (std::string &chassisId0, std::string &portId0, + std::string &chassisId1, std::string &portId1); + uint64_t GetNTPTimestamp (void); + + // If method returns false call this to get details + std::string getLastError (void); + NTV2IpError getLastErrorCode (void); + + static uint32_t videoPacketizers[4]; + static uint32_t videoRGB12Packetizers[4]; + static uint32_t audioPacketizers[4]; + + static uint32_t videoDepacketizers[4]; + static uint32_t audioDepacketizers[4]; + +protected: + uint32_t GetDepacketizerAddress (const NTV2Stream stream); + uint32_t GetPacketizerAddress (const NTV2Stream stream, const VPIDSampling sampling); + uint32_t GetFramerAddress (const eSFP sfp, const NTV2Stream stream); + void SelectTxFramerChannel (const NTV2Stream stream, const uint32_t baseAddr); + void AcquireFramerControlAccess (const uint32_t baseAddr); + void ReleaseFramerControlAccess (const uint32_t baseAddr); + + void EnableFramerStream (const eSFP sfp, const NTV2Stream stream, bool enable); + bool SetFramerStream (const eSFP sfp, const NTV2Stream stream, const tx_2110Config & txConfig); + void GetFramerStream (const eSFP sfp, const NTV2Stream stream, tx_2110Config & txConfig); + void SetArbiter (const eSFP sfp, const NTV2Stream stream, bool enable); + void GetArbiter (const eSFP sfp, const NTV2Stream stream, bool & enable); + + void SetSampling(const eSFP sfp, const NTV2Stream stream, const VPIDSampling sampling); + VPIDSampling GetSampling(const eSFP sfp, const NTV2Stream stream); + + void DisableDepacketizerStream (const NTV2Stream stream); + void EnableDepacketizerStream (const NTV2Stream stream); + void DisableDecapsulatorStream (const eSFP sfp, const NTV2Stream stream); + void EnableDecapsulatorStream (const eSFP sfp, const NTV2Stream stream); + + void SetupDecapsulatorStream (const eSFP sfp, const NTV2Stream stream, const rx_2110Config &rxConfig); + + void ResetPacketizerStream (const NTV2Stream stream); + + void SetupDepacketizerStream (const NTV2Stream stream, const rx_2110Config & rxConfig); + void ResetDepacketizerStream (const NTV2Stream stream); + + void SetVideoFormatForRxTx (const NTV2Stream stream, const NTV2VideoFormat format, const bool rx); + void GetVideoFormatForRxTx (const NTV2Stream stream, NTV2VideoFormat & format, uint32_t & hwFormat, const bool rx); + + bool ConfigurePTP (const eSFP sfp, const std::string localIPAddress); + + bool GenVideoStreamSDP (std::stringstream &sdp, const bool enableSfp1, + const bool enableSfp2, const NTV2Stream stream, char *gmInfo); + bool GenVideoStreamSDPInfo (std::stringstream & sdp, const eSFP sfp, const NTV2Stream stream, char* gmInfo); + bool GenVideoStreamMultiSDPInfo (std::stringstream & sdp, char* gmInfo); + bool GenAudioStreamSDP (std::stringstream &sdp, const bool enableSfp1, + const bool enableSfp2, const NTV2Stream stream, char *gmInfo); + bool GenAudioStreamSDPInfo (std::stringstream & sdp, const eSFP sfp, const NTV2Stream stream, char* gmInfo); + bool GenAncStreamSDP (std::stringstream &sdp, const bool enableSfp1, + const bool enableSfp2, const NTV2Stream stream, char *gmInfo); + bool GenAncStreamSDPInfo (std::stringstream & sdp, const eSFP sfp, const NTV2Stream stream, char* gmInfo); + + NTV2StreamType StreamType (const NTV2Stream stream); + NTV2Channel VideoStreamToChannel (const NTV2Stream stream); + +private: + std::string To_String (int val); + + std::vector split (const char *str, char delim); + + std::string rateToString (NTV2FrameRate rate); + NTV2FrameRate stringToRate (std::string str); + + int LeastCommonMultiple (int a,int b); + int getDescriptionValue (int startLine, std::string type, std::string & value); + std::string getVideoDescriptionValue (std::string type); + + std::stringstream txsdp; + + uint32_t _numRx0Chans; + uint32_t _numRx1Chans; + uint32_t _numTx0Chans; + uint32_t _numTx1Chans; + uint32_t _numRxChans; + uint32_t _numTxChans; + bool _biDirectionalChannels; // logically bi-directional channels + + std::vector sdpLines; + std::vector tokens; + +}; // CNTV2Config2110 + +#endif // NTV2_2110CONFIG_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2configts2022.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2configts2022.h new file mode 100644 index 0000000..a3fc2c1 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2configts2022.h @@ -0,0 +1,123 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2configts2022.h + @brief Declares the CNTV2ConfigTs2022 class. + @copyright (C) 2014-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2_2022CONFIGTS_H +#define NTV2_2022CONFIGTS_H + +#include "ntv2card.h" +#include "ntv2enums.h" +#include "ntv2registers2022.h" +#include "ntv2mbcontroller.h" +#include "ntv2tshelper.h" +#include "ntv2config2022.h" +#include + +// Encoder part numbers +#define ENCODE_TS_TIMER 0 +#define ENCODE_TS_J2K_ENCODER 1 +#define ENCODE_TS_MPEG_J2K_ENCAP 2 +#define ENCODE_TS_AES_ENCAP 3 +#define ENCODE_TS_MPEG_AES_ENCAP 4 +#define ENCODE_TS_MPEG_ANC_ENCAP 6 +#define ENCODE_TS_MPEG_PCR_ENCAP 7 + +// Decoder part numbers +#define DECODE_TS_MPEG_J2K_DECAP 0 +#define DECODE_TS_J2K_DECODER 1 +#define DECODE_TS_MPEG_AES_DECAP 2 +#define DECODE_TS_AES_DECAP 3 +#define DECODE_TS_MPEG_ANC_DECAP 5 + + +#define PES_HDR_LOOKUP 0x0 +#define PES_HDR_LEN 0xc0 +#define PTS_OFFSET 0xc1 +#define J2K_TS_OFFSET 0xc2 +#define AUF1_OFFSET 0xc3 +#define AUF2_OFFSET 0xc4 +#define PACKET_RATE 0xca +#define HOST_EN 0xe0 +#define INTERLACED_VIDEO 0xe1 +#define PAYLOAD_PARAMS 0xe2 +#define LOOPBACK 0xe3 +#define PAT_TABLE_LOOKUP 0x100 +#define PAT_PMT_PERIOD 0x1f0 +#define PMT_TABLE_LOOKUP 0x200 +#define ADAPTATION_LOOKUP 0x300 +#define ADAPTATION_HDR_LENGTH 0x3f0 + +#define MODE_STOP 0x00 +#define MODE_RECORD 0x10 + +/** + @brief The CNTV2ConfigTs2022 class is the interface to Kona-IP SMPTE 2022 J2K encoder and TS chips +**/ + +class AJAExport CNTV2ConfigTs2022 : public CNTV2MBController +{ +public: + CNTV2ConfigTs2022 (CNTV2Card & device); + + // Setup the J2K encoder + bool SetupJ2KEncoder(const NTV2Channel channel, const j2kEncoderConfig &config); + bool ReadbackJ2KEncoder(const NTV2Channel channel, j2kEncoderConfig &config); + + // Setup the J2K decoder + bool SetupJ2KDecoder(const j2kDecoderConfig & config); + bool ReadbackJ2KDecoder(j2kDecoderConfig &config); + bool GetJ2KDecoderStatus(j2kDecoderStatus &status); + + // If method returns false call this to get the error code + NTV2IpError getLastErrorCode(); + + private: + + // Setup the J2K encoder and TS + bool SetupJ2KForEncode(const NTV2Channel channel); + bool SetupTsForEncode(const NTV2Channel channel); + + // Setup individual TS encode parts + bool SetupEncodeTsTimer(const NTV2Channel channel); + bool SetupEncodeTsJ2KEncoder(const NTV2Channel channel); + bool SetupEncodeTsMpegJ2kEncap(const NTV2Channel channel); + bool SetupEncodeTsMpegPcrEncap(const NTV2Channel channel); + bool SetupEncodeTsMpegAesEncap(const NTV2Channel channel); + bool SetupEncodeTsAesEncap(const NTV2Channel channel); + + // Routines to talk to the J2K part + bool J2kCanAcceptCmd(const NTV2Channel channel); + bool J2KGetNextT0Status(const NTV2Channel channel, uint32_t *pStatus); + bool GetT0CmdStatus( const NTV2Channel channel, const uint32_t cmdId, uint32_t *pStatus ); + void J2kSetParam(const NTV2Channel channel, uint32_t config, uint32_t param, uint32_t value); + void J2kSetMode(const NTV2Channel channel, uint32_t tier, uint32_t mode); + uint32_t J2kGetFrameCounter(const NTV2Channel channel, uint32_t tier); + void J2kSetConfig(const NTV2Channel channel, uint32_t config); + + uint32_t GetFeatures(); + + void GenerateTableForMpegJ2kEncap(const NTV2Channel channel); + void GenerateTableForMpegPcrEncap(const NTV2Channel channel); + void GenerateTableForMpegAesEncap(const NTV2Channel channel); + uint32_t GetIpxJ2KAddr(const NTV2Channel channel); + uint32_t GetIpxTsAddr(const NTV2Channel channel); + + bool WriteJ2KConfigReg(const NTV2Channel channel, const uint32_t reg, const uint32_t value); + bool ReadJ2KConfigReg(const NTV2Channel channel, const uint32_t reg, uint32_t * value); + + void SetEncoderInputEnable(const NTV2Channel channel, bool bEnable, bool bMDEnable ); + void SetEncoderReset(const NTV2Channel channel, bool bReset ); + int32_t CalculateTsGen(const NTV2Channel channel); + + bool _is2022_6; + bool _is2022_2; + + int32_t _transactionTable[1024][2]; + int32_t _transactionCount; + +}; // CNTV2ConfigTs2022 + +#endif // NTV2_2022CONFIGTS_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2cscmatrix.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2cscmatrix.h new file mode 100644 index 0000000..c6176bb --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2cscmatrix.h @@ -0,0 +1,288 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2cscmatrix.h + @brief Declares the utility class for abstract color space matrix operations. + @copyright 2004-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef NTV2_CSCMATRIX_H +#define NTV2_CSCMATRIX_H + + +#include "ajatypes.h" +#include "ajaexport.h" +#include "ntv2enums.h" +#include "ntv2card.h" + + +const int16_t NTV2_CSCMatrix_ZeroOffset = 0x0000; +const int16_t NTV2_CSCMatrix_SMPTEYOffset = 0x0800; // 0x10 with added ms sign bit and ls-padded to 16 bits +const int16_t NTV2_CSCMatrix_SMPTECOffset = 0x4000; // 0x80 with added ms sign bit and ls-padded to 16 bits + + +typedef enum NTV2CSCCoeff +{ + NTV2CSCCoeffIndex_A0, ///< @brief Proportion of input component 0 applied to A output + NTV2CSCCoeffIndex_A1, ///< @brief Proportion of input component 1 applied to A output + NTV2CSCCoeffIndex_A2, ///< @brief Proportion of input component 2 applied to A output + + NTV2CSCCoeffIndex_B0, ///< @brief Proportion of input component 0 applied to B output + NTV2CSCCoeffIndex_B1, ///< @brief Proportion of input component 1 applied to B output + NTV2CSCCoeffIndex_B2, ///< @brief Proportion of input component 2 applied to B output + + NTV2CSCCoeffIndex_C0, ///< @brief Proportion of input component 0 applied to C output + NTV2CSCCoeffIndex_C1, ///< @brief Proportion of input component 1 applied to C output + NTV2CSCCoeffIndex_C2 ///< @brief Proportion of input component 2 applied to C output +} NTV2CSCCoeffIndex; + + +typedef enum NTV2CSCOffset +{ + NTV2CSCOffsetIndex_Pre0, + NTV2CSCOffsetIndex_Pre1, + NTV2CSCOffsetIndex_Pre2, + + NTV2CSCOffsetIndex_PostA, + NTV2CSCOffsetIndex_PostB, + NTV2CSCOffsetIndex_PostC +} NTV2CSCOffsetIndex; + + +/** + @brief This is used to compare CSC Matrix coefficients -- the default amount by which + they can differ and still be considered "equal". +**/ +const double NTV2CSCMatrix_MaxCoeffDiff = (1.0 / 4096.0); + + +/** + @brief This class supports the color space conversion matrix described below. + + @details The CSC matrix consists of a pre-subtractor, a 3x3 matrix multiplier, + and a post-adder. It receives up to three components as input (labeled + Input0, Input1, and Input2), cross-processes them, and outputs them as + OutputA, OutputB, OutputC. The standard component assignment for GBR + and YCbCr video is: + YCbCr RGB + Input0 / OutputA = Y G + Input1 / OutputB = Cb B + Input2 / OutputC = Cr R + + The basic purpose of the pre-subtractor is to remove any DC bias(es) that + may be on the input video prior to the matrix multiply. For example, YCbCr + video typically has a "black" offset of 0x10 for luminance (Y) and 0x80 + for chrominance (Cb/Cr - values given for 8-bit video). In general, these + offsets must be subtracted from the video before using the 3x3 matrix. + + Similarly, the post-adder is typically used to re-add "black" biases to + the output video. Note that both pre- and post-offsets are typically "positive" + values, and assume a left-justified representation within a 16-bit integer. + In the above example, Y Black offset would be 0x0800 (i.e. 0x10 with an added + sign bit and ls-padded to 16 bits). Similarly, C Black Offset is 0x4000 + (0x80 with a sign bit and ls-padded to 16 bits). + + The 3x3 matrix coefficients are labeled according to the input (0, 1, or 2) + and output (A, B, or C) they affect. For example, coefficient "A0" determines + the amount of Input0 that is applied to OutputA. The matrix form of the + equation can be represented as: + + [OutA OutB OutC] = [In0 In1 In2] [ A0 B0 C0 + A1 B1 C1 + A2 B2 C2 ] + + This class has methods for presetting known matrix values (for "typical" + RGB <=> YUV conversions), as well as some typical "gain" and "hue rotation" + matrices. It also includes methods for combining matrices for more complex + effects, including matrix multiplication. +**/ +class AJAExport CNTV2CSCMatrix +{ +public: + /** + @brief Instantiates and initializes the instance with a known set of coefficients. + @param[in] inPreset Specifies an initial setting for the matrix coefficients. + **/ + explicit CNTV2CSCMatrix (const NTV2ColorSpaceMatrixType inPreset = NTV2_Unity_Matrix); + + + /** + @brief My destructor. + **/ + virtual inline ~CNTV2CSCMatrix () {}; + + + /** + @brief Replace the current matrix coefficients with a known set of coefficients. + @param[in] inPreset Specifies a new setting for the matrix coefficients. + **/ + virtual void InitMatrix (const NTV2ColorSpaceMatrixType inPreset); + + + /** + @brief Returns the value of a requested matrix coefficient. + @param[in] inCoeffIndex Specifies which matrix coefficient to return. + @return The value of the requested coefficient. + **/ + virtual double GetCoefficient (const NTV2CSCCoeffIndex inCoeffIndex) const; + + + /** + @brief Changes the specified matrix coefficient to the given value. + @param[in] inCoeffIndex Specifies which matrix coefficient to change. + @param[in] inCoefficient Specifies the new matrix coefficient value. + **/ + virtual void SetCoefficient (const NTV2CSCCoeffIndex inCoeffIndex, const double inCoefficient); + + + /** + @brief Returns the value of a requested offset. + @param[in] inOffsetIndex Specifies which offset to return. + @return The value of the requested offset. + **/ + virtual int16_t GetOffset (const NTV2CSCOffsetIndex inOffsetIndex) const; + + + /** + @brief Changes the specified offset to the given value. + @param[in] inOffsetIndex Specifies which offset to change. + @param[in] inOffset Specifies the new offset value. + **/ + virtual void SetOffset (const NTV2CSCOffsetIndex inOffsetIndex, const int16_t inOffset); + + + /** + @brief Pre-multiply the current 3x3 matrix by the matrix of the given instance. + @param[in] inPreInstance Specifies a reference to a CNTV2CSCMatrix instance. + **/ + virtual void PreMultiply (const CNTV2CSCMatrix & inPreInstance); + + + /** + @brief Post-multiply the current 3x3 matrix by the matrix of the given instance. + * @param[in] inPostInstance Specifies a reference to a CNTV2CSCMatrix instance. + */ + virtual void PostMultiply (const CNTV2CSCMatrix & inPostInstance); + + + /** + @brief Set the matrix diagonals (gains). + @param[in] inGain0 Specifies the amount of gain to be applied to the 1st channel (unity = 1.0) + @param[in] inGain1 Specifies the amount of gain to be applied to the 2nd channel + @param[in] inGain2 Specifies the amount of gain to be applied to the 3rd channel + **/ + virtual void SetGain (const double inGain0, const double inGain1, const double inGain2); + + + /** + @brief Set matrix for hue rotation. + @param[in] inDegrees Amount of Cb/Cr "rotation" (in degrees) + @note Assumes chroma channels in In 1/Out B, In 2/Out C. This will not work for RGB. + **/ + virtual void SetHueRotate (const double inDegrees); + + + /** + @brief Set pre-offsets. + @param[in] inOffset0 The zero, or "black" level of the 1st input channel + @param[in] inOffset1 The zero, or "black" level of the 2nd input channel + @param[in] inOffset2 The zero, or "black" level of the 3rd input channel + **/ + virtual void SetPreOffsets (const int16_t inOffset0, const int16_t inOffset1, const int16_t inOffset2); + + + /** + @brief Add pre-offsets. + @param[in] inIncrement0 The amount to be added to the existing preOffset0 + @param[in] inIncrement1 The amount to be added to the existing preOffset1 + @param[in] inIncrement2 The amount to be added to the existing preOffset2 + **/ + virtual void AddPreOffsets (const int16_t inIncrement0, const int16_t inIncrement1, const int16_t inIncrement2); + + + /** + @brief Set post-offsets. + @param[in] inOffsetA The zero, or "black" level of the 1st output channel + @param[in] inOffsetB The zero, or "black" level of the 2nd output channel + @param[in] inOffsetC The zero, or "black" level of the 3rd output channel + **/ + virtual void SetPostOffsets (const int16_t inOffsetA, const int16_t inOffsetB, const int16_t inOffsetC); + + + /** + @brief Add post-offsets. + @param[in] inIncrementA The amount to be added to the existing postOffsetA + @param[in] inIncrementB The amount to be added to the existing postOffsetB + @param[in] inIncrementC The amount to be added to the existing postOffsetC + **/ + virtual void AddPostOffsets (const int16_t inIncrementA, const int16_t inIncrementB, const int16_t inIncrementC); + + + /** + @brief Returns 'true' if this CSC Matrix has unity matrix coefficients. + @return True if the matrix is a unity matrix; otherwise false + @note ONLY compares matrix coefficients, NOT offsets. + **/ + virtual bool IsUnityMatrix (void); + + + /** + @brief Returns true if the matrix coefficients and offsets EXACTLY match those of the specified instance. + @note Compares matrix coefficients and offsets. + **/ + virtual bool operator == (const CNTV2CSCMatrix & rhs) const; + + + /** + @brief Returns true if the matrix coefficients and offsets differ from those of the specified instance. + @note Compares matrix coefficients and offsets. + **/ + virtual inline bool operator != (const CNTV2CSCMatrix & rhs) const {return !(*this == rhs);} + + + /** + @brief Tests if the matrix coefficients can all be considered equal to those of the specified instance, + @param[in] inCSCMatrix Specifies a reference to a CNTV2CSCMatrix instance. + @param[in] inMaxDiff Specifies the amount by which two coefficients can differ and still be considered "equal" + @return True if all the matrix coefficients differ by an amount less than the tolerance; otherwise false + @note ONLY compares matrix coefficients, NOT offsets. + **/ + virtual bool IsEqual (const CNTV2CSCMatrix & inCSCMatrix, const double inMaxDiff = NTV2CSCMatrix_MaxCoeffDiff); + + + /** + @brief Tests if two coefficients differ by less than the fiven tolerance. + @param[in] inCoeff1 Specifies the first coefficient to be compared + @param[in] inCoeff2 Specifies the second coefficient to be compared + @param[in] inMaxDiff Specifies the amount by which two coefficients can differ and still be considered "equal" + @return True if the the two oefficients differ by an amount less than the tolerance; otherwise false + **/ + virtual bool CoeffEqual (const double inCoeff1, const double inCoeff2, const double inMaxDiff); + + + // Instance Data + private: + double mA0; ///< @brief Specifies the amount of Input 0 to be applied to Output A + double mA1; ///< @brief Specifies the amount of Input 1 to be applied to Output A + double mA2; ///< @brief Specifies the amount of Input 2 to be applied to Output A + + double mB0; ///< @brief Specifies the amount of Input 0 to be applied to Output B + double mB1; ///< @brief Specifies the amount of Input 1 to be applied to Output B + double mB2; ///< @brief Specifies the amount of Input 2 to be applied to Output B + + double mC0; ///< @brief Specifies the amount of Input 0 to be applied to Output C + double mC1; ///< @brief Specifies the amount of Input 1 to be applied to Output C + double mC2; ///< @brief Specifies the amount of Input 2 to be applied to Output C + + int16_t mPreOffset0; ///< @brief Specifies Input 0's offset from zero + int16_t mPreOffset1; ///< @brief Specifies Input 1's offset from zero + int16_t mPreOffset2; ///< @brief Specifies Input 2's offset from zero + + int16_t mPostOffsetA; ///< @brief Specifies Output A's offset from zero + int16_t mPostOffsetB; ///< @brief Specifies Output B's offset from zero + int16_t mPostOffsetC; ///< @brief Specifies Output C's offset from zero + + NTV2ColorSpaceMatrixType mPreset; ///< @brief Specifies if the matrix coefficients correspond to preset values + +}; // CNTV2CSCMatrix + +#endif // NTV2_CSCMATRIX_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2debug.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2debug.h new file mode 100644 index 0000000..bb681d3 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2debug.h @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2debug.cpp + @brief Declares the NTV2 debug output functions, including 'odprintf'. + @note This module should remain straight ANSI 'C' -- no C++ or STL. + @copyright 2004-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#include "ajaexport.h" +#include "ajatypes.h" +#include "ntv2enums.h" + +#if !defined(NTV2_DEPRECATE_14_3) +AJAExport const char * NTV2DeviceTypeString (const NTV2DeviceType type); +#endif // !defined(NTV2_DEPRECATE_14_3) +AJAExport const char * NTV2DeviceIDString (const NTV2DeviceID id); +AJAExport const char * NTV2DeviceString (const NTV2DeviceID id); +AJAExport const char * NTV2StandardString (NTV2Standard std); +AJAExport const char * NTV2FrameBufferFormatString (NTV2FrameBufferFormat fmt); +AJAExport const char * NTV2FrameGeometryString (NTV2FrameGeometry geom); +AJAExport const char * NTV2FrameRateString (NTV2FrameRate rate); +AJAExport const char * NTV2VideoFormatString (NTV2VideoFormat fmt); +AJAExport const char * NTV2RegisterNameString (const ULWord inRegNum); +AJAExport const char * NTV2InterruptEnumString (const unsigned inInterruptEnum); +#if !defined (NTV2_DEPRECATE) + AJAExport const char * NTV2BoardTypeString (NTV2BoardType type); + AJAExport const char * NTV2BoardIDString (NTV2BoardID id); +#endif // !defined (NTV2_DEPRECATE) + +// indexed by RegisterNum - 2048 +extern AJAExport const char * ntv2RegStrings_SDI_RX_Status []; + +// indexed by RegisterNum +extern AJAExport const char * ntv2RegStrings []; + +#ifdef MSWindows + AJAExport void __cdecl odprintf(const char *format, ...); + #ifndef vcout + #define vcout_dummy_1(x) #x + #define vcout_dummy_2(x) vcout_dummy_1(x) + #define vcout(desc) message(__FILE__ "(" vcout_dummy_2( __LINE__ ) ") : " desc) + #endif // vcout +#endif + +#if defined(FS1) || defined(AJALinux) || defined(AJAMac) + #ifndef odprintf + #define odprintf printf + #endif +#endif diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2debugmacros.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2debugmacros.h new file mode 100644 index 0000000..3ff574c --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2debugmacros.h @@ -0,0 +1,186 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2debugMacros.h + @brief Declares several macros useful for debugging. + @copyright (C) 2004-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef DEBUGMACROS_H +#define DEBUGMACROS_H + + + +// Macros common to all platforms + + // Decompose a UInt32 (or Mac "OSType") into 4 ASCII characters + // Example: printf ("Type = %c%c%c%c\n", Make4CC(myType) ); +//#define Make4CC(my4CC) ((char*)(&my4CC))[0], ((char*)(&my4CC))[1], ((char*)(&my4CC))[2], ((char*)(&my4CC))[3] + + // Advanced form: if the 'type' is a numeric value (i.e. 0 - 63), print as a decimal number. + // Otherwise print as 4 characters. +#ifndef Make4CC + #if TARGET_OS_WIN32 || TARGET_CPU_X86 + #define Make4CC(my4CC) ((my4CC < 0x40) ? ' ' : ((char*)(&my4CC))[3]), \ + ((my4CC < 0x40) ? ' ' : ((char*)(&my4CC))[2]), \ + ((my4CC < 0x40) ? ('0' + (char)(my4CC / 10)) : ((char*)(&my4CC))[1]), \ + ((my4CC < 0x40) ? ('0' + (char)(my4CC % 10)) : ((char*)(&my4CC))[0]) + #else + #define Make4CC(my4CC) ((my4CC < 0x40) ? ' ' : ((char*)(&my4CC))[0]), \ + ((my4CC < 0x40) ? ' ' : ((char*)(&my4CC))[1]), \ + ((my4CC < 0x40) ? ('0' + (char)(my4CC / 10)) : ((char*)(&my4CC))[2]), \ + ((my4CC < 0x40) ? ('0' + (char)(my4CC % 10)) : ((char*)(&my4CC))[3]) + #endif +#endif + + +// Ping selectors +#define kPingOff 0 + + // Muxer +#define kPingMuxerVBI 1 +#define kPingAcThread 2 +#define kPingDma 3 +#define kPingMuxerAudioVox 4 +#define kPingMuxerVideoVox 5 + + // VideoOut +#define kPingFrameNotification 6 +#define kPingCopyDrpToFrame 7 +#define kPingEchoPortOut 8 +#define kPingQTCallback 9 + +#define kPingAVSync 10 + + // Transfer Codec +#define kPingXfrBandDecomp 11 + + + // VDig +#define kPingVDigFrameNotify 12 +#define kPingVDigCompressOne 13 +#define kPingVDigCompressDone 14 + + // Use these for quickie tests +#define kPingTest1 15 +#define kPingTest2 16 +#define kPingTest3 17 +#define kPingTest4 18 + + + +// Platform-specific macros + +#ifdef AJAMac + + + // For simple cases of measuring durations using the Mac "Microseconds" timer + // + // This assumes a pair of matching calls: "StartUSTimer(foo)" and "EndUSTimer(foo)", both within the + // same scope (which rules out starting in one routine and ending in another - for that you have to + // find global memory to hold the "start time"). Typical use is as follows: + // + // TimerStart(foo) + // (code happens) + // TimerStop(foo) + // + // and you'll get a printf that looks like: + // foo duration = xxx usecs + // + // Note: no terminating ";" Also, the variable passes to matching TimerStart() and TimerStop() calls must match. + // You may, however, use different variables in overlapping calls, such as: + // + // TimerStart(foo) + // (code happens) + // TimerStart(bar) + // (more code happens) + // TimerStop(foo) + // (yet more...) + // TimerStop(bar) + // + // You may use TimerLimit() instead of TimerStop() to specify a "limit" duration: the printf will only happen + // if the measured duration EXCEEDS the specified limit. + + #if (DEBUG) + // normal printf's + #define TimerStart(a) UInt64 _startTime_##a, _endTime_##a; \ + int _delta_##a; \ + Microseconds((UnsignedWide*)&_startTime_##a); + + #define TimerStop(a) Microseconds((UnsignedWide*)&_endTime_##a); \ + _delta_##a = (int)U64Subtract(_endTime_##a, _startTime_##a); \ + printf (#a " duration = %d usecs\n", _delta_##a); + + #define TimerLimit(a,max) Microseconds((UnsignedWide*)&_endTime_##a); \ + _delta_##a = (int)U64Subtract(_endTime_##a, _startTime_##a); \ + if (_delta_##a >= max) \ + printf (#a " duration = %d usecs\n", _delta_##a); + + // uses "dprintf" - which is assumed to be locally #define'd for LogProducer LogMsg + #define LogTimerStart(a) UInt64 _startTime_##a, _endTime_##a; \ + int _delta_##a; \ + Microseconds((UnsignedWide*)&_startTime_##a); + + #define LogTimerStop(a) Microseconds((UnsignedWide*)&_endTime_##a); \ + _delta_##a = (int)U64Subtract(_endTime_##a, _startTime_##a); \ + dprintf (LOG_DEBUG, #a " duration = %d usecs\n", _delta_##a); + + // Mark time between successive function calls + #define MarkTimeDelta(a) static UInt64 _savedTime_##a = 0; UInt64 _currTime_##a; int _delta_##a; \ + Microseconds((UnsignedWide*)&_currTime_##a); \ + _delta_##a = (int)U64Subtract(_currTime_##a, _savedTime_##a); \ + printf (#a " duration = %d usecs\n", _delta_##a); \ + _savedTime_##a = _currTime_##a; + + #else + // disable for deployment builds + #define TimerStart(a) + #define TimerStop(a) + #define TimerLimit(a,b) + + #define LogTimerStart(a) + #define LogTimerStop(a) + + #define MarkTimeDelta(a) + #endif + + + // Sleazy (but quick) ways to tell if a Mac keyboard key is pressed + #if (DEBUG) + #define shiftIsDown ( (GetCurrentKeyModifiers() & shiftKey) != 0 ) + #define capsLockIsDown ( (GetCurrentKeyModifiers() & alphaLock) != 0 ) + #define optionIsDown ( (GetCurrentKeyModifiers() & optionKey) != 0 ) + #define controlIsDown ( (GetCurrentKeyModifiers() & controlKey) != 0 ) + #define commandIsDown ( (GetCurrentKeyModifiers() & cmdKey) != 0 ) + #else // !DEBUG + #define shiftIsDown false + #define capsLockIsDown false + #define optionIsDown false + #define controlIsDown false + #define commandIsDown false + #endif + + +#else // !AJAMac + + + #define TimerStart(a) + #define TimerStop(a) + + #define shiftIsDown false + #define capsLockIsDown false + #define optionIsDown false + #define controlIsDown false + #define commandIsDown false + + #if DEBUG + #define printf debugPrintf + void debugPrintf (char *format, ...); + #else + #define printf dummyPrintf + void dummyPrintf (char *format, ...); // see SoftwareCodec.cpp + #endif + +#endif + + +#endif // DEBUGMACROS_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2devicefeatures.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2devicefeatures.h new file mode 100644 index 0000000..4dc2bd5 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2devicefeatures.h @@ -0,0 +1,329 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2devicefeatures.h + @brief Declares device capability functions. + @note Although this is a .cpp file, it must be compilable for Lin/Mac/Win kernel device drivers. + @copyright (C) 2004-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2DEVICEFEATURES_H +#define NTV2DEVICEFEATURES_H + +#if defined(AJALinux) || defined(AJA_LINUX) + #include // For size_t +#endif + +#include "ajaexport.h" +#include "ajatypes.h" +#include "ntv2enums.h" +#include "ntv2publicinterface.h" + +#if defined(__CPLUSPLUS__) || defined(__cplusplus) +#elif !defined(NTV2_BUILDING_DRIVER) + #define false (0) + #define true (!false) +#endif + +#define NTV2DeviceGetNumAudioEngines NTV2DeviceGetNumAudioSystems + + +// Most of the device features functions are generated from a Python script. +// The script writes the implementations into 'ntv2devicefeatures.hpp', and the declarations into 'ntv2devicefeatures.hh'... +#include "ntv2devicefeatures.hh" + +#if defined(__cplusplus) && defined(NTV2_BUILDING_DRIVER) +extern "C" +{ +#endif +/* + @return True if the device having the given ID can do audio output; otherwise false. + @param[in] inDeviceID Specifies the NTV2DeviceID of the device of interest. +*/ +AJAExport bool NTV2DeviceCanDoAudioOut(const NTV2DeviceID inDeviceID); +/* + @return True if the device having the given ID can do audio input; otherwise false. + @param[in] inDeviceID Specifies the NTV2DeviceID of the device of interest. +*/ +AJAExport bool NTV2DeviceCanDoAudioIn(const NTV2DeviceID inDeviceID); + +AJAExport bool NTV2DeviceCanDo292Out(NTV2DeviceID boardID, UWord index0); +AJAExport bool NTV2DeviceCanDo3GOut (NTV2DeviceID boardID, UWord index0); +AJAExport bool NTV2DeviceCanDo12GOut(NTV2DeviceID boardID, UWord index0); +AJAExport bool NTV2DeviceCanDo292In(NTV2DeviceID boardID, UWord index0); +AJAExport bool NTV2DeviceCanDo3GIn(NTV2DeviceID boardID, UWord index0); +AJAExport bool NTV2DeviceCanDo12GIn(NTV2DeviceID boardID, UWord index0); +AJAExport bool NTV2DeviceCanDoLTCEmbeddedN (NTV2DeviceID boardID, UWord index0); + +/** + @return True if the device having the given ID supports the given output destination connector; otherwise false. + @param[in] inDeviceID Specifies the NTV2DeviceID of the device of interest. + @param[in] inOutputDest Specifies the NTV2OutputDestination of interest. +**/ +AJAExport bool NTV2DeviceCanDoOutputDestination (const NTV2DeviceID inDeviceID, const NTV2OutputDestination inOutputDest); + +/** + @return The minimum number of 8MB chunks that will accommodate a raster having the given frame geometry and pixel format. + @param[in] inFG A valid frame geometry. + @param[in] inFBF A valid frame buffer format. +**/ +AJAExport UWord Get8MBFrameSizeFactor (const NTV2FrameGeometry inFG, const NTV2FrameBufferFormat inFBF); + +/** + @return True if the device having the given ID has at least one programmable LUT. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoColorCorrection (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has at least one color space converter widget - all CSCs are programable. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoProgrammableCSC (const NTV2DeviceID inDeviceID); + + +// Overloading not supported by the ANSI C compiler used for Linux drivers. +// +// TODO: Audit all platforms and switch all the original calls to the _Ex +// versions. +#if (defined(__CPLUSPLUS__) || defined(__cplusplus)) && !defined(NTV2_BUILDING_DRIVER) + AJAExport ULWord NTV2DeviceGetFrameBufferSize(NTV2DeviceID boardID); // Revisit for 2MB granularity + AJAExport ULWord NTV2DeviceGetNumberFrameBuffers(NTV2DeviceID boardID); // Revisit for 2MB granularity + AJAExport ULWord NTV2DeviceGetAudioFrameBuffer(NTV2DeviceID boardID); // Revisit for 2MB granularity + AJAExport ULWord NTV2DeviceGetAudioFrameBuffer2(NTV2DeviceID boardID); // Revisit for 2MB granularity +#else + AJAExport ULWord NTV2DeviceGetFrameBufferSize_Ex(NTV2DeviceID boardID); // Revisit for 2MB granularity + AJAExport ULWord NTV2DeviceGetNumberFrameBuffers_Ex(NTV2DeviceID boardID); // Revisit for 2MB granularity + AJAExport ULWord NTV2DeviceGetAudioFrameBuffer_Ex(NTV2DeviceID boardID); // Revisit for 2MB granularity +#endif + +AJAExport ULWord NTV2DeviceGetFrameBufferSize(NTV2DeviceID boardID, NTV2FrameGeometry frameGeometry, NTV2FrameBufferFormat frameFormat); // Revisit for 2MB granularity +AJAExport ULWord NTV2DeviceGetNumberFrameBuffers(NTV2DeviceID boardID, NTV2FrameGeometry frameGeometry, NTV2FrameBufferFormat frameFormat); // Revisit for 2MB granularity +AJAExport ULWord NTV2DeviceGetAudioFrameBuffer(NTV2DeviceID boardID, NTV2FrameGeometry frameGeometry, NTV2FrameBufferFormat frameFormat); // Revisit for 2MB granularity +AJAExport ULWord NTV2DeviceGetAudioFrameBuffer2(NTV2DeviceID boardID, NTV2FrameGeometry frameGeometry, NTV2FrameBufferFormat frameFormat); // Revisit for 2MB granularity + +#define NTV2GetDACVersion NTV2DeviceGetDACVersion ///< @deprecated Use NTV2DeviceGetDACVersion instead. +#define NTV2GetNumDMAEngines NTV2DeviceGetNumDMAEngines ///< @deprecated Use NTV2DeviceGetNumDMAEngines instead. +#define NTV2DeviceGetNumAnlgVideoInputs NTV2DeviceGetNumAnalogVideoInputs ///< @deprecated Use NTV2DeviceGetNumAnalogVideoInputs instead. +#define NTV2DeviceGetNumAnlgVideoOutputs NTV2DeviceGetNumAnalogVideoOutputs ///< @deprecated Use NTV2DeviceGetNumAnalogVideoOutputs instead. +#define NTV2GetHDMIVersion NTV2DeviceGetHDMIVersion ///< @deprecated Use NTV2DeviceGetHDMIVersion instead. + +AJAExport bool NTV2DeviceGetVideoFormatFromState ( NTV2VideoFormat * pOutValue, + const NTV2FrameRate inFrameRate, + const NTV2FrameGeometry inFrameGeometry, + const NTV2Standard inStandard, + const ULWord inIsSMPTE372Enabled); + +AJAExport bool NTV2DeviceGetVideoFormatFromState_Ex ( NTV2VideoFormat * pOutValue, + const NTV2FrameRate inFrameRate, + const NTV2FrameGeometry inFrameGeometry, + const NTV2Standard inStandard, + const ULWord inIsSMPTE372Enabled, + const bool inIsProgressivePicture); + +AJAExport bool NTV2DeviceGetVideoFormatFromState_Ex2 ( NTV2VideoFormat * pOutValue, + const NTV2FrameRate inFrameRate, + const NTV2FrameGeometry inFrameGeometry, + const NTV2Standard inStandard, + const ULWord inIsSMPTE372Enabled, + const bool inIsProgressivePicture, + const bool inIsSquareDivision); + +#if !defined(NTV2_DEPRECATE_15_6) + AJAExport bool NTV2DeviceCanConnect (const NTV2DeviceID inDeviceID, const NTV2InputCrosspointID inInputXpt, const NTV2OutputCrosspointID inOutputXpt); ///< @deprecated Obsoleted by CNTV2Card::HasCanConnectROM and CNTV2Card::CanConnect +#endif // NTV2_DEPRECATE_15_6 +AJAExport bool NTV2DeviceCanDoTCIndex (const NTV2DeviceID inDeviceID, const NTV2TCIndex inTCIndex); ///< @return True if the device having the given ID supports the specified NTV2TCIndex. +AJAExport bool NTV2DeviceCanDoInputTCIndex (const NTV2DeviceID inDeviceID, const NTV2TCIndex inTCIndex); ///< @return True if the device having the given ID supports the specified NTV2TCIndex for input. +AJAExport NTV2AudioSystem NTV2DeviceGetAudioMixerSystem(const NTV2DeviceID inDeviceID); +AJAExport NTV2AudioSystem NTV2DeviceGetHostAudioSystem(const NTV2DeviceID inDeviceID); +AJAExport bool NTV2DeviceROMHasBankSelect (const NTV2DeviceID inDeviceID); +AJAExport NTV2_DEPRECATED_f(UWord NTV2DeviceGetNumAudioStreams (NTV2DeviceID boardID)); ///< @deprecated Will be deprecated soon. Use NTV2DeviceGetNumAudioSystems instead. +AJAExport NTV2_DEPRECATED_f(bool NTV2DeviceCanDoAudioN (NTV2DeviceID boardID, UWord index0)); ///< @deprecated Will be deprecated soon. Use NTV2DeviceGetNumAudioSystems instead. +AJAExport NTV2_DEPRECATED_f(bool NTV2DeviceCanDoLTCOutN (NTV2DeviceID boardID, UWord index0)); ///< @deprecated Will be deprecated soon. Use NTV2DeviceGetNumLTCOutputs instead. +AJAExport NTV2_DEPRECATED_f(bool NTV2DeviceCanDoLTCInN (NTV2DeviceID boardID, UWord index0)); ///< @deprecated Will be deprecated soon. Use NTV2DeviceGetNumLTCInputs instead. +AJAExport NTV2_DEPRECATED_f(bool NTV2DeviceCanDoRS422N (const NTV2DeviceID inDeviceID, const NTV2Channel inChannel)); ///< @deprecated Will be deprecated soon. Use NTV2DeviceGetNumSerialPorts instead. + +#if !defined (NTV2_DEPRECATE_14_3) + AJAExport NTV2_DEPRECATED_f(bool NTV2DeviceCanDoFreezeOutput (const NTV2DeviceID inDeviceID)); ///< @deprecated This function is obsolete. +#endif // !defined (NTV2_DEPRECATE_14_3) + +#if !defined (NTV2_DEPRECATE) + #define NTV2DeviceCanDoProAudio(_boardID_) false + #define NTV2BoardCanDoProcAmp(_boardID_) false + #define NTV2BoardCanDoBrightnessAdjustment(_boardID_,_videoADCMode_) false + #define NTV2BoardCanDoContrastAdjustment(_boardID_,_videoADCMode_) false + #define NTV2BoardCanDoSaturationAdjustment(_boardID_,_videoADCMode_) false + #define NTV2BoardCanDoHueAdjustment(_boardID_,_videoADCMode_) false + + #define NTV2BoardCanDoAudio(_boardID_) NTV2DeviceCanDoAudioN((_boardID_), 0) + #define NTV2BoardCanDoAudio2(_boardID_) NTV2DeviceCanDoAudioN((_boardID_), 1) + #define NTV2BoardCanDoAudio3(_boardID_) NTV2DeviceCanDoAudioN((_boardID_), 2) + #define NTV2BoardCanDoAudio4(_boardID_) NTV2DeviceCanDoAudioN((_boardID_), 3) + #define NTV2BoardCanDoAudio5(_boardID_) NTV2DeviceCanDoAudioN((_boardID_), 4) + #define NTV2BoardCanDoAudio6(_boardID_) NTV2DeviceCanDoAudioN((_boardID_), 5) + #define NTV2BoardCanDoAudio7(_boardID_) NTV2DeviceCanDoAudioN((_boardID_), 6) + #define NTV2BoardCanDoAudio8(_boardID_) NTV2DeviceCanDoAudioN((_boardID_), 7) + + #define NTV2BoardCanDo3G(_boardID_) NTV2DeviceCanDo3GOut((_boardID_), 0) + #define NTV2BoardCanDo3GOut2(_boardID_) NTV2DeviceCanDo3GOut((_boardID_), 1) + #define NTV2BoardCanDo3GOut3(_boardID_) NTV2DeviceCanDo3GOut((_boardID_), 2) + #define NTV2BoardCanDo3GOut4(_boardID_) NTV2DeviceCanDo3GOut((_boardID_), 3) + #define NTV2BoardCanDo3GOut5(_boardID_) NTV2DeviceCanDo3GOut((_boardID_), 4) + #define NTV2BoardCanDo3GOut6(_boardID_) NTV2DeviceCanDo3GOut((_boardID_), 5) + #define NTV2BoardCanDo3GOut7(_boardID_) NTV2DeviceCanDo3GOut((_boardID_), 6) + #define NTV2BoardCanDo3GOut8(_boardID_) NTV2DeviceCanDo3GOut((_boardID_), 7) + + #define NTV2BoardCanDoMixer2(_boardID_) (NTV2DeviceGetNumMixers(_boardID_) >= 2) + #define NTV2BoardCanDoMixer3(_boardID_) (NTV2DeviceGetNumMixers(_boardID_) >= 3) + #define NTV2BoardCanDoMixer4(_boardID_) (NTV2DeviceGetNumMixers(_boardID_) >= 4) + + #define NTV2BoardCanDoLTCIn(_boardID_) NTV2DeviceCanDoLTCInN((_boardID_), 0) + #define NTV2BoardCanDoLTCIn2(_boardID_) NTV2DeviceCanDoLTCInN((_boardID_), 1) + + #define NTV2BoardCanDoLTCOut(_boardID_) NTV2DeviceCanDoLTCOutN((_boardID_), 0) + #define NTV2BoardCanDoLTCOut2(_boardID_) NTV2DeviceCanDoLTCOutN((_boardID_), 1) + + #define NTV2BoardCanDoLTCEmbedded(_boardID_) NTV2DeviceCanDoLTCEmbeddedN((_boardID_), 0) + #define NTV2BoardCanDoLTCEmbedded2(_boardID_) NTV2DeviceCanDoLTCEmbeddedN((_boardID_), 1) + #define NTV2BoardCanDoLTCEmbedded3(_boardID_) NTV2DeviceCanDoLTCEmbeddedN((_boardID_), 2) + #define NTV2BoardCanDoLTCEmbedded4(_boardID_) NTV2DeviceCanDoLTCEmbeddedN((_boardID_), 3) + #define NTV2BoardCanDoLTCEmbedded5(_boardID_) NTV2DeviceCanDoLTCEmbeddedN((_boardID_), 4) + #define NTV2BoardCanDoLTCEmbedded6(_boardID_) NTV2DeviceCanDoLTCEmbeddedN((_boardID_), 5) + #define NTV2BoardCanDoLTCEmbedded7(_boardID_) NTV2DeviceCanDoLTCEmbeddedN((_boardID_), 6) + #define NTV2BoardCanDoLTCEmbedded8(_boardID_) NTV2DeviceCanDoLTCEmbeddedN((_boardID_), 7) + + #define NTV2BoardCanDoUART(_boardID_) NTV2DeviceCanDoUARTN((_boardID_), 0) + #define NTV2BoardCanDoUART2(_boardID_) NTV2DeviceCanDoUARTN((_boardID_), 1) + + #define NTV2BoardCanDoUARTN(_boardID_,_ndx0_) NTV2DeviceCanDoRS422N((_boardID_),(_ndx0_)) + #define NTV2DeviceCanDoUARTN(_boardID_,_ndx0_) NTV2DeviceCanDoRS422N((_boardID_),(_ndx0_)) +#endif // !defined (NTV2_DEPRECATE) + +#if !defined (NTV2_DEPRECATE_14_2) // UNDEFINED AS OF SDK 14.2 + #define NTV2BoardCanChangeEmbeddedAudioClock NTV2DeviceCanChangeEmbeddedAudioClock ///< @deprecated Use NTV2DeviceCanChangeEmbeddedAudioClock instead. + #define NTV2BoardCanChangeFrameBufferSize NTV2DeviceCanChangeFrameBufferSize ///< @deprecated Use NTV2DeviceCanChangeFrameBufferSize instead. + #define NTV2BoardCanDisableUFC NTV2DeviceCanDisableUFC ///< @deprecated Use NTV2DeviceCanDisableUFC instead. + #define NTV2BoardCanDo2KVideo NTV2DeviceCanDo2KVideo ///< @deprecated Use NTV2DeviceCanDo2KVideo instead. + #define NTV2BoardCanDo3GLevelConversion NTV2DeviceCanDo3GLevelConversion ///< @deprecated Use NTV2DeviceCanDo3GLevelConversion instead. + #define NTV2BoardCanDo3GOut NTV2DeviceCanDo3GOut ///< @deprecated Use NTV2DeviceCanDo3GOut instead. + #define NTV2BoardCanDo4KVideo NTV2DeviceCanDo4KVideo ///< @deprecated Use NTV2DeviceCanDo4KVideo instead. + #define NTV2BoardCanDoAESAudioIn NTV2DeviceCanDoAESAudioIn ///< @deprecated Use NTV2DeviceCanDoAESAudioIn instead. + #define NTV2BoardCanDoAnalogAudio NTV2DeviceCanDoAnalogAudio ///< @deprecated Use NTV2DeviceCanDoAnalogAudio instead. + #define NTV2BoardCanDoAnalogVideoIn NTV2DeviceCanDoAnalogVideoIn ///< @deprecated Use NTV2DeviceCanDoAnalogVideoIn instead. + #define NTV2BoardCanDoAnalogVideoOut NTV2DeviceCanDoAnalogVideoOut ///< @deprecated Use NTV2DeviceCanDoAnalogVideoOut instead. + #define NTV2BoardCanDoAudio2Channels NTV2DeviceCanDoAudio2Channels ///< @deprecated Use NTV2DeviceCanDoAudio2Channels instead. + #define NTV2BoardCanDoAudio6Channels NTV2DeviceCanDoAudio6Channels ///< @deprecated Use NTV2DeviceCanDoAudio6Channels instead. + #define NTV2BoardCanDoAudio8Channels NTV2DeviceCanDoAudio8Channels ///< @deprecated Use NTV2DeviceCanDoAudio8Channels instead. + #define NTV2BoardCanDoAudio96K NTV2DeviceCanDoAudio96K ///< @deprecated Use NTV2DeviceCanDoAudio96K instead. + #define NTV2BoardCanDoAudioDelay NTV2DeviceCanDoAudioDelay ///< @deprecated Use NTV2DeviceCanDoAudioDelay instead. + #define NTV2BoardCanDoAudioN NTV2DeviceCanDoAudioN ///< @deprecated Use NTV2DeviceCanDoAudioN instead. + #define NTV2BoardCanDoBreakoutBox NTV2DeviceCanDoBreakoutBox ///< @deprecated Use NTV2DeviceCanDoBreakoutBox instead. + #define NTV2BoardCanDoCapture NTV2DeviceCanDoCapture ///< @deprecated Use NTV2DeviceCanDoCapture instead. + #define NTV2BoardCanDoColorCorrection NTV2DeviceCanDoColorCorrection ///< @deprecated Use NTV2DeviceCanDoColorCorrection instead. + #define NTV2BoardCanDoConversionMode NTV2DeviceCanDoConversionMode ///< @deprecated Use NTV2DeviceCanDoConversionMode instead. + #define NTV2BoardCanDoDSKMode NTV2DeviceCanDoDSKMode ///< @deprecated Use NTV2DeviceCanDoDSKMode instead. + #define NTV2BoardCanDoDSKOpacity NTV2DeviceCanDoDSKOpacity ///< @deprecated Use NTV2DeviceCanDoDSKOpacity instead. + #define NTV2BoardCanDoDualLink NTV2DeviceCanDoDualLink ///< @deprecated Use NTV2DeviceCanDoDualLink instead. + #define NTV2BoardCanDoDVCProHD NTV2DeviceCanDoDVCProHD ///< @deprecated Use NTV2DeviceCanDoDVCProHD instead. + #define NTV2BoardCanDoFormat NTV2DeviceCanDoFormat ///< @deprecated Use NTV2DeviceCanDoVideoFormat instead. + #define NTV2BoardCanDoFrameBufferFormat NTV2DeviceCanDoFrameBufferFormat ///< @deprecated Use NTV2DeviceCanDoFrameBufferFormat instead. + #define NTV2BoardCanDoFreezeOutput NTV2DeviceCanDoFreezeOutput ///< @deprecated Use NTV2DeviceCanDoFreezeOutput instead. + #define NTV2BoardCanDoHDMIOutStereo NTV2DeviceCanDoHDMIOutStereo ///< @deprecated Use NTV2DeviceCanDoHDMIOutStereo instead. + #define NTV2BoardCanDoHDV NTV2DeviceCanDoHDV ///< @deprecated Use NTV2DeviceCanDoHDV instead. + #define NTV2BoardCanDoHDVideo NTV2DeviceCanDoHDVideo ///< @deprecated Use NTV2DeviceCanDoHDVideo instead. + #define NTV2BoardCanDoInputSource NTV2DeviceCanDoInputSource ///< @deprecated Use NTV2DeviceCanDoInputSource instead. + #define NTV2BoardCanDoIsoConvert NTV2DeviceCanDoIsoConvert ///< @deprecated Use NTV2DeviceCanDoIsoConvert instead. + #define NTV2BoardCanDoLTC NTV2DeviceCanDoLTC ///< @deprecated Use NTV2DeviceCanDoLTC instead. + #define NTV2BoardCanDoLTCEmbeddedN NTV2DeviceCanDoLTCEmbeddedN ///< @deprecated Use NTV2DeviceCanDoLTCEmbeddedN instead. + #define NTV2BoardCanDoLTCInN NTV2DeviceCanDoLTCInN ///< @deprecated Use NTV2DeviceCanDoLTCInN instead. + #define NTV2BoardCanDoLTCInOnRefPort NTV2DeviceCanDoLTCInOnRefPort ///< @deprecated Use NTV2DeviceCanDoLTCInOnRefPort instead. + #define NTV2BoardCanDoLTCOutN NTV2DeviceCanDoLTCOutN ///< @deprecated Use NTV2DeviceCanDoLTCOutN instead. + #define NTV2BoardCanDoMSI NTV2DeviceCanDoMSI ///< @deprecated Use NTV2DeviceCanDoMSI instead. + #define NTV2BoardCanDoMultiFormat NTV2DeviceCanDoMultiFormat ///< @deprecated Use NTV2DeviceCanDoMultiFormat instead. + #define NTV2BoardCanDoPCMControl NTV2DeviceCanDoPCMControl ///< @deprecated Use NTV2DeviceCanDoPCMControl instead. + #define NTV2BoardCanDoPIO NTV2DeviceCanDoPIO ///< @deprecated Use NTV2DeviceCanDoPIO instead. + #define NTV2BoardCanDoPlayback NTV2DeviceCanDoPlayback ///< @deprecated Use NTV2DeviceCanDoPlayback instead. + #define NTV2BoardCanDoProAudio NTV2DeviceCanDoProAudio ///< @deprecated Use NTV2DeviceCanDoProAudio instead. + #define NTV2BoardCanDoProgrammableCSC NTV2DeviceCanDoProgrammableCSC ///< @deprecated Use NTV2DeviceCanDoProgrammableCSC instead. + #define NTV2BoardCanDoProgrammableRS422 NTV2DeviceCanDoProgrammableRS422 ///< @deprecated Use NTV2DeviceCanDoProgrammableRS422 instead. + #define NTV2BoardCanDoProRes NTV2DeviceCanDoProRes ///< @deprecated Use NTV2DeviceCanDoProRes instead. + #define NTV2BoardCanDoQREZ NTV2DeviceCanDoQREZ ///< @deprecated Use NTV2DeviceCanDoQREZ instead. + #define NTV2BoardCanDoQuarterExpand NTV2DeviceCanDoQuarterExpand ///< @deprecated Use NTV2DeviceCanDoQuarterExpand instead. + #define NTV2BoardCanDoRateConvert NTV2DeviceCanDoRateConvert ///< @deprecated Use NTV2DeviceCanDoRateConvert instead. + #define NTV2BoardCanDoRGBPlusAlphaOut NTV2DeviceCanDoRGBPlusAlphaOut ///< @deprecated Use NTV2DeviceCanDoRGBPlusAlphaOut instead. + #define NTV2BoardCanDoRP188 NTV2DeviceCanDoRP188 ///< @deprecated Use NTV2DeviceCanDoRP188 instead. + #define NTV2BoardCanDoRS422N NTV2DeviceCanDoRS422N ///< @deprecated Use NTV2DeviceCanDoRS422N instead. + #define NTV2BoardCanDoSDVideo NTV2DeviceCanDoSDVideo ///< @deprecated Use NTV2DeviceCanDoSDVideo instead. + #define NTV2BoardCanDoStackedAudio NTV2DeviceCanDoStackedAudio ///< @deprecated Use NTV2DeviceCanDoStackedAudio instead. + #define NTV2BoardCanDoStereoIn NTV2DeviceCanDoStereoIn ///< @deprecated Use NTV2DeviceCanDoStereoIn instead. + #define NTV2BoardCanDoStereoOut NTV2DeviceCanDoStereoOut ///< @deprecated Use NTV2DeviceCanDoStereoOut instead. + #define NTV2BoardCanDoThunderbolt NTV2DeviceCanDoThunderbolt ///< @deprecated Use NTV2DeviceCanDoThunderbolt instead. + #define NTV2BoardCanDoVideoFormat NTV2DeviceCanDoVideoFormat ///< @deprecated Use NTV2DeviceCanDoVideoFormat instead. + #define NTV2BoardCanDoVideoProcessing NTV2DeviceCanDoVideoProcessing ///< @deprecated Use NTV2DeviceCanDoVideoProcessing instead. + #define NTV2BoardCanDoWidget NTV2DeviceCanDoWidget ///< @deprecated Use NTV2DeviceCanDoWidget instead. + #define NTV2BoardGetActiveMemorySize NTV2DeviceGetActiveMemorySize ///< @deprecated Use NTV2DeviceGetActiveMemorySize instead. + #define NTV2BoardGetAudioFrameBuffer NTV2DeviceGetAudioFrameBuffer ///< @deprecated Use NTV2DeviceGetAudioFrameBuffer instead. + #define NTV2BoardGetAudioFrameBuffer2 NTV2DeviceGetAudioFrameBuffer2 ///< @deprecated Use NTV2DeviceGetAudioFrameBuffer2 instead. + #define NTV2BoardGetDownConverterDelay NTV2DeviceGetDownConverterDelay ///< @deprecated Use NTV2DeviceGetDownConverterDelay instead. + #define NTV2BoardGetFrameBufferSize NTV2DeviceGetFrameBufferSize ///< @deprecated Use NTV2DeviceGetFrameBufferSize instead. + #define NTV2BoardGetFrameBufferSize_Ex NTV2DeviceGetFrameBufferSize_Ex ///< @deprecated Use NTV2DeviceGetFrameBufferSize_Ex instead. + #define NTV2BoardGetHDMIVersion NTV2DeviceGetHDMIVersion ///< @deprecated Use NTV2DeviceGetHDMIVersion instead. + #define NTV2BoardGetLUTVersion NTV2DeviceGetLUTVersion ///< @deprecated Use NTV2DeviceGetLUTVersion instead. + #define NTV2BoardGetMaxAudioChannels NTV2DeviceGetMaxAudioChannels ///< @deprecated Use NTV2DeviceGetMaxAudioChannels instead. + #define NTV2BoardGetMaxTransferCount NTV2DeviceGetMaxTransferCount ///< @deprecated Use NTV2DeviceGetMaxTransferCount instead. + #define NTV2BoardGetNum4kQuarterSizeConverters NTV2DeviceGetNum4kQuarterSizeConverters ///< @deprecated Use NTV2DeviceGetNum4kQuarterSizeConverters instead. + #define NTV2BoardGetNumAESAudioInputChannels NTV2DeviceGetNumAESAudioInputChannels ///< @deprecated Use NTV2DeviceGetNumAESAudioInputChannels instead. + #define NTV2BoardGetNumAESAudioOutputChannels NTV2DeviceGetNumAESAudioOutputChannels ///< @deprecated Use NTV2DeviceGetNumAESAudioOutputChannels instead. + #define NTV2BoardGetNumAnalogAudioInputChannels NTV2DeviceGetNumAnalogAudioInputChannels ///< @deprecated Use NTV2DeviceGetNumAnalogAudioInputChannels instead. + #define NTV2BoardGetNumAnalogAudioOutputChannels NTV2DeviceGetNumAnalogAudioOutputChannels ///< @deprecated Use NTV2DeviceGetNumAnalogAudioOutputChannels instead. + #define NTV2BoardGetNumAnlgVideoInputs NTV2DeviceGetNumAnalogVideoInputs ///< @deprecated Use NTV2DeviceGetNumAnalogVideoInputs instead. + #define NTV2BoardGetNumAnlgVideoOutputs NTV2DeviceGetNumAnalogVideoOutputs ///< @deprecated Use NTV2DeviceGetNumAnalogVideoOutputs instead. + #define NTV2BoardGetNumAudioStreams NTV2DeviceGetNumAudioStreams ///< @deprecated Use NTV2DeviceGetNumAudioStreams instead. + #define NTV2BoardGetNumberFrameBuffers NTV2DeviceGetNumberFrameBuffers ///< @deprecated Use NTV2DeviceGetNumberFrameBuffers instead. + #define NTV2DeviceGetNumberRegisters NTV2DeviceGetMaxRegisterNumber ///< @deprecated Use NTV2DeviceGetMaxRegisterNumber instead. + #define NTV2BoardGetNumberRegisters NTV2DeviceGetMaxRegisterNumber ///< @deprecated Use NTV2DeviceGetMaxRegisterNumber instead. + #define NTV2BoardGetNumCrossConverters NTV2DeviceGetNumCrossConverters ///< @deprecated Use NTV2DeviceGetNumCrossConverters instead. + #define NTV2BoardGetNumCSCs NTV2DeviceGetNumCSCs ///< @deprecated Use NTV2DeviceGetNumCSCs instead. + #define NTV2BoardGetNumDownConverters NTV2DeviceGetNumDownConverters ///< @deprecated Use NTV2DeviceGetNumDownConverters instead. + #define NTV2BoardGetNumEmbeddedAudioInputChannels NTV2DeviceGetNumEmbeddedAudioInputChannels ///< @deprecated Use NTV2DeviceGetNumEmbeddedAudioInputChannels instead. + #define NTV2BoardGetNumEmbeddedAudioOutputChannels NTV2DeviceGetNumEmbeddedAudioOutputChannels ///< @deprecated Use NTV2DeviceGetNumEmbeddedAudioOutputChannels instead. + #define NTV2BoardGetNumFrameStores NTV2DeviceGetNumFrameStores ///< @deprecated Use NTV2DeviceGetNumFrameStores instead. + #define NTV2BoardGetNumFrameSyncs NTV2DeviceGetNumFrameSyncs ///< @deprecated Use NTV2DeviceGetNumFrameSyncs instead. + #define NTV2BoardGetNumHDMIAudioInputChannels NTV2DeviceGetNumHDMIAudioInputChannels ///< @deprecated Use NTV2DeviceGetNumHDMIAudioInputChannels instead. + #define NTV2BoardGetNumHDMIAudioOutputChannels NTV2DeviceGetNumHDMIAudioOutputChannels ///< @deprecated Use NTV2DeviceGetNumHDMIAudioOutputChannels instead. + #define NTV2BoardGetNumHDMIVideoInputs NTV2DeviceGetNumHDMIVideoInputs ///< @deprecated Use NTV2DeviceGetNumHDMIVideoInputs instead. + #define NTV2BoardGetNumHDMIVideoOutputs NTV2DeviceGetNumHDMIVideoOutputs ///< @deprecated Use NTV2DeviceGetNumHDMIVideoOutputs instead. + #define NTV2BoardGetNumInputConverters NTV2DeviceGetNumInputConverters ///< @deprecated Use NTV2DeviceGetNumInputConverters instead. + #define NTV2BoardGetNumLUTs NTV2DeviceGetNumLUTs ///< @deprecated Use NTV2DeviceGetNumLUTs instead. + #define NTV2BoardGetNumMixers NTV2DeviceGetNumMixers ///< @deprecated Use NTV2DeviceGetNumMixers instead. + #define NTV2BoardGetNumOutputConverters NTV2DeviceGetNumOutputConverters ///< @deprecated Use NTV2DeviceGetNumOutputConverters instead. + #define NTV2BoardGetNumReferenceVideoInputs NTV2DeviceGetNumReferenceVideoInputs ///< @deprecated Use NTV2DeviceGetNumReferenceVideoInputs instead. + #define NTV2BoardGetNumSerialPorts NTV2DeviceGetNumSerialPorts ///< @deprecated Use NTV2DeviceGetNumSerialPorts instead. + #define NTV2BoardGetNumUpConverters NTV2DeviceGetNumUpConverters ///< @deprecated Use NTV2DeviceGetNumUpConverters instead. + #define NTV2BoardGetNumVideoChannels NTV2DeviceGetNumVideoChannels ///< @deprecated Use NTV2DeviceGetNumVideoChannels instead. + #define NTV2BoardGetNumVideoInputs NTV2DeviceGetNumVideoInputs ///< @deprecated Use NTV2DeviceGetNumVideoInputs instead. + #define NTV2BoardGetNumVideoOutputs NTV2DeviceGetNumVideoOutputs ///< @deprecated Use NTV2DeviceGetNumVideoOutputs instead. + #define NTV2BoardGetPingLED NTV2DeviceGetPingLED ///< @deprecated Use NTV2DeviceGetPingLED instead. + #define NTV2BoardGetUFCVersion NTV2DeviceGetUFCVersion ///< @deprecated Use NTV2DeviceGetUFCVersion instead. + #define NTV2BoardGetVideoFormatFromState NTV2DeviceGetVideoFormatFromState ///< @deprecated Use NTV2DeviceGetVideoFormatFromState instead. + #define NTV2BoardGetVideoFormatFromState_Ex NTV2DeviceGetVideoFormatFromState_Ex ///< @deprecated Use NTV2DeviceGetVideoFormatFromState_Ex instead. + #define NTV2BoardHasBiDirectionalSDI NTV2DeviceHasBiDirectionalSDI ///< @deprecated Use NTV2DeviceHasBiDirectionalSDI instead. + #define NTV2BoardHasColorSpaceConverterOnChannel2 NTV2DeviceHasColorSpaceConverterOnChannel2 ///< @deprecated Use NTV2DeviceHasColorSpaceConverterOnChannel2 instead. + #define NTV2BoardHasNWL NTV2DeviceHasNWL ///< @deprecated Use NTV2DeviceHasNWL instead. + #define NTV2BoardHasPCIeGen2 NTV2DeviceHasPCIeGen2 ///< @deprecated Use NTV2DeviceHasPCIeGen2 instead. + #define NTV2BoardHasSDIRelays NTV2DeviceHasSDIRelays ///< @deprecated Use NTV2DeviceHasSDIRelays instead. + #define NTV2BoardHasSPIFlash NTV2DeviceHasSPIFlash ///< @deprecated Use NTV2DeviceHasSPIFlash instead. + #define NTV2BoardHasSPIFlashSerial NTV2DeviceHasSPIFlashSerial ///< @deprecated Use NTV2DeviceHasSPIFlashSerial instead. + #define NTV2BoardHasSPIv2 NTV2DeviceHasSPIv2 ///< @deprecated Use NTV2DeviceHasSPIv2 instead. + #define NTV2BoardHasSPIv3 NTV2DeviceHasSPIv3 ///< @deprecated Use NTV2DeviceHasSPIv3 instead. + #define NTV2BoardIs64Bit NTV2DeviceIs64Bit ///< @deprecated Use NTV2DeviceIs64Bit instead. + #define NTV2BoardIsDirectAddressable NTV2DeviceIsDirectAddressable ///< @deprecated Use NTV2DeviceIsDirectAddressable instead. + #define NTV2BoardIsExternalToHost NTV2DeviceIsExternalToHost ///< @deprecated Use NTV2DeviceIsExternalToHost instead. + #define NTV2BoardNeedsRoutingSetup NTV2DeviceNeedsRoutingSetup ///< @deprecated Use NTV2DeviceNeedsRoutingSetup instead. + #define NTV2BoardSoftwareCanChangeFrameBufferSize NTV2DeviceSoftwareCanChangeFrameBufferSize ///< @deprecated Use NTV2DeviceSoftwareCanChangeFrameBufferSize instead. +#endif // !defined (NTV2_DEPRECATE) + +#if defined(__cplusplus) && defined(NTV2_BUILDING_DRIVER) +} +#endif + +#endif // NTV2DEVICEFEATURES_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2devicefeatures.hh b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2devicefeatures.hh new file mode 100644 index 0000000..6b8e7b0 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2devicefeatures.hh @@ -0,0 +1,920 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2devicefeatures.hh + @brief Declares NTV2DeviceCanDo... and NTV2DeviceGetNum... functions. + This module is included at compile time from 'ntv2devicefeatures.h'. + @copyright (C) 2004-2021 AJA Video Systems, Inc. + @note Generated by './ajalibraries/ajantv2/sdkgen/ntv2sdkgen.py' on Tue Dec 21 15:45:39 2021. +**/ +#ifndef NTV2DEVICEFEATURES_HH +#define NTV2DEVICEFEATURES_HH + +#include "ajaexport.h" +#include "ntv2enums.h" + +#if defined(__cplusplus) && defined(NTV2_BUILDING_DRIVER) +extern "C" +{ +#endif + + +/** + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanChangeEmbeddedAudioClock (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID does not have fixed frame buffer sizes. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanChangeFrameBufferSize (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has at least one UFC, and it can be disabled. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDisableUFC (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID supports 12g routing crosspoints. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDo12gRouting (const NTV2DeviceID inDeviceID); + +/** + @return True if the device supports 12G SDI + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDo12GSDI (const NTV2DeviceID inDeviceID); + +/** + @return True if the device supports SMPTE 2110 + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDo2110 (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID is capable of handling 2Kx1556 video. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDo2KVideo (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can perform 3G level B to 3G level A conversion. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDo3GLevelConversion (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID supports SMPTE 425 mux control. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDo425Mux (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can handle 4K/UHD video. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDo4KVideo (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can handle 8K/UHD2 video. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDo8KVideo (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has at least one AES/EBU audio input. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoAESAudioIn (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has at least one analog audio input or output. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoAnalogAudio (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has at least one analog video input. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoAnalogVideoIn (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has at least one analog video output. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoAnalogVideoOut (const NTV2DeviceID inDeviceID); + +/** + @return True if audio system(s) on the device having the given ID can be set to a 192kHz sample rate. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoAudio192K (const NTV2DeviceID inDeviceID); + +/** + @return True if the audio system(s) on the device having the given ID can be configured to embed/de-embed only 2 audio channels. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoAudio2Channels (const NTV2DeviceID inDeviceID); + +/** + @return True if the audio system(s) on the device having the given ID can be configured to embed/de-embed only 6 audio channels. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoAudio6Channels (const NTV2DeviceID inDeviceID); + +/** + @return True if the audio system(s) on the device having the given ID can be configured to embed/de-embed only 8 audio channels. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoAudio8Channels (const NTV2DeviceID inDeviceID); + +/** + @return True if audio system(s) on the device having the given ID can be set to a 96kHz sample rate. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoAudio96K (const NTV2DeviceID inDeviceID); + +/** + @return True if audio system(s) on the device having the given ID have an adjustable delay. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoAudioDelay (const NTV2DeviceID inDeviceID); + +/** + @return True if the device supports an audio mixer (firmware dependent). + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoAudioMixer (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can be connected to an AJA breakout box. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoBreakoutBox (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can capture (ingest) video. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoCapture (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID supports ANC insertion/extraction. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoCustomAnc (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has a mixer/keyer whose opacity is adjustable. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoDSKOpacity (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can input/output 10-bit RGB over 2-wire SDI. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoDualLink (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can squeeze/stretch between 1920x1080/1280x1080 and 1280x720/960x720. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoDVCProHD (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has enhanced color space converter capability. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoEnhancedCSC (const NTV2DeviceID inDeviceID); + +/** + @return True if the device supports frame pulse source independent of reference source + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoFramePulseSelect (const NTV2DeviceID inDeviceID); + +/** + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoFrameStore1Display (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID supports HDMI HDR output. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoHDMIHDROut (const NTV2DeviceID inDeviceID); + +/** + @return True if the device can rasterize 4 HD signals into a single HDMI output + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoHDMIMultiView (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can handle 3D-stereo video output over HDMI. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoHDMIOutStereo (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can squeeze/stretch between 1920x1080 and 1440x1080. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoHDV (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can handle HD (High Definition) video. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoHDVideo (const NTV2DeviceID inDeviceID); + +/** + @return True if the device supports 1080p > 50 RGB rates + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoHFRRGB (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID ingests and/or plays video via TCP/IP (instead of SDI/HDMI/etc). + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoIP (const NTV2DeviceID inDeviceID); + +/** + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoIsoConvert (const NTV2DeviceID inDeviceID); + +/** + @return True if the device supports the JPEG 2000 codec + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoJ2K (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can take in LTC (Linear TimeCode) from one of its inputs. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoLTC (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can read LTC (Linear TimeCode) from its reference input. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoLTCInOnRefPort (const NTV2DeviceID inDeviceID); + +/** + @return True if the DMA hardware on the device having the given ID supports MSI (Message Signaled Interrupts). + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoMSI (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can simultaneously handle different video formats on more than one SDI input or output. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoMultiFormat (const NTV2DeviceID inDeviceID); + +/** + @return True if the device supports grouped audio system control + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoMultiLinkAudio (const NTV2DeviceID inDeviceID); + +/** + @return True if the audio system(s) on the device having the given ID can set the per-audio-channel-pair non-PCM (Pulse Code Modulation) bits in outgoing embedded audio. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoPCMControl (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has per-audio-channel-pair PCM detection capabilities. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoPCMDetection (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID supports Programmed I/O. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoPIO (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can output (play) video. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoPlayback (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has at least one RS-422 serial port, and it (they) can be programmed (for baud rate, parity, etc.). + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoProgrammableRS422 (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can can accommodate Apple ProRes-compressed video in its frame buffers. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoProRes (const NTV2DeviceID inDeviceID); + +/** + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoQREZ (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can handle quarter-sized frames (pixel-halving and line-halving during input, pixel-double and line-double during output). + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoQuarterExpand (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can do frame rate conversion. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoRateConvert (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can do RGB over 3G Level A. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoRGBLevelAConversion (const NTV2DeviceID inDeviceID); + +/** + @return True if the device with the given ID has CSCs capable of splitting the key (alpha) and YCbCr (fill) from RGB frame buffers that include alpha. Has nothing to do with RGB wire formats. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoRGBPlusAlphaOut (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can insert and/or extract RP-188/VITC. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoRP188 (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can perform SDI error checking. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoSDIErrorChecks (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can handle SD (Standard Definition) video. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoSDVideo (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID uses a 'stacked' arrangement of its audio buffers. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoStackedAudio (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID supports 3D video input over dual-stream SDI. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoStereoIn (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID supports 3D video output over dual-stream SDI. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoStereoOut (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID connects to the host using a Thunderbolt cable. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoThunderbolt (const NTV2DeviceID inDeviceID); + +/** + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoVideoProcessing (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can insert and/or extract RP-188/VITC2. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoVITC2 (const NTV2DeviceID inDeviceID); + +/** + @return True if the device is capable of doing a warm boot rather than power cycling after firmware update. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanDoWarmBootFPGA (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can measure its temperature. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanMeasureTemperature (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can report if its "fail-safe" firmware is loaded and running. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanReportFailSafeLoaded (const NTV2DeviceID inDeviceID); + +/** + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanReportFrameSize (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID can report its running (and not necessarily installed) firmware date. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanReportRunningFirmwareDate (const NTV2DeviceID inDeviceID); + +/** + @return True if the fan on the device having the given ID can be thermostatically controlled. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceCanThermostat (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has a pair of unbalanced RCA audio monitor output jacks. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasAudioMonitorRCAJacks (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has a bi-directional analog audio connector. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasBiDirectionalAnalogAudio (const NTV2DeviceID inDeviceID); + +/** + @return True if the SDI connectors on the device having the given ID are bi-directional. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasBiDirectionalSDI (const NTV2DeviceID inDeviceID); + +/** + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasColorSpaceConverterOnChannel2 (const NTV2DeviceID inDeviceID); + +/** + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasGenlockv2 (const NTV2DeviceID inDeviceID); + +/** + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasGenlockv3 (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has a headphone jack. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasHeadphoneJack (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has an HEVC M30 encoder/decoder. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasHEVCM30 (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has an HEVC M31 encoder. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasHEVCM31 (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has LED audio meters. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasLEDAudioMeters (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has NorthWest Logic DMA hardware. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasNWL (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID supports 2nd-generation PCIe. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasPCIeGen2 (const NTV2DeviceID inDeviceID); + +/** + @return True if the device can be configured and controlled by the retail services and AJA Control Panel. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasRetailSupport (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID supports rotary encoder volume control + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasRotaryEncoder (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID has bypass relays on its SDI connectors. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasSDIRelays (const NTV2DeviceID inDeviceID); + +/** + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasSPIFlash (const NTV2DeviceID inDeviceID); + +/** + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasSPIFlashSerial (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID uses version 2 SPI hardware. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasSPIv2 (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID uses version 3 SPI hardware. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasSPIv3 (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID uses version 4 SPI hardware. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasSPIv4 (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID uses version 5 SPI hardware. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasSPIv5 (const NTV2DeviceID inDeviceID); + +/** + @return True if the device has Xilinx DMA engine + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceHasXilinxDMA (const NTV2DeviceID inDeviceID); + +/** + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceIs64Bit (const NTV2DeviceID inDeviceID); + +/** + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceIsDirectAddressable (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID connects to the host with a cable. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceIsExternalToHost (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID is supported by this SDK. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceIsSupported (const NTV2DeviceID inDeviceID); + +/** + @return True if the routing for the device having the given ID can be queried and/or changed. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceNeedsRoutingSetup (const NTV2DeviceID inDeviceID); + +/** + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport bool NTV2DeviceSoftwareCanChangeFrameBufferSize (const NTV2DeviceID inDeviceID); + +/** + @return Returns the size, in bytes, of the device's active RAM available for video and audio. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport ULWord NTV2DeviceGetActiveMemorySize (const NTV2DeviceID inDeviceID); + +/** + @return Returns the version number of the DAC on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetDACVersion (const NTV2DeviceID inDeviceID); + +/** + @return Returns the down-converter delay on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetDownConverterDelay (const NTV2DeviceID inDeviceID); + +/** + @return Returns the version number of the HDMI input or output hardware on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport ULWord NTV2DeviceGetHDMIVersion (const NTV2DeviceID inDeviceID); + +/** + @return Returns the version number of the LUT(s) on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport ULWord NTV2DeviceGetLUTVersion (const NTV2DeviceID inDeviceID); + +/** + @return Returns the maximum number of audio channels that a single audio system can support on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetMaxAudioChannels (const NTV2DeviceID inDeviceID); + +/** + @return Returns the highest register number for the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport ULWord NTV2DeviceGetMaxRegisterNumber (const NTV2DeviceID inDeviceID); + +/** + @return Returns the maximum number of 32-bit words that the DMA engine can move at a time on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport ULWord NTV2DeviceGetMaxTransferCount (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of 2022 channels configured on SFP 1 on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNum2022ChannelsSFP1 (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of 2022 channels configured on SFP 2 on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNum2022ChannelsSFP2 (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of quarter-size 4K/UHD down-converters on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNum4kQuarterSizeConverters (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of AES/EBU audio input channels on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumAESAudioInputChannels (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of AES/EBU audio output channels on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumAESAudioOutputChannels (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of analog audio input channels on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumAnalogAudioInputChannels (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of analog audio output channels on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumAnalogAudioOutputChannels (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of analog video inputs on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumAnalogVideoInputs (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of analog video outputs on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumAnalogVideoOutputs (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of independent audio systems on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumAudioSystems (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of cross-converters on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumCrossConverters (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of colorspace converter widgets on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumCSCs (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of DMA engines on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport ULWord NTV2DeviceGetNumDMAEngines (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of down-converters on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumDownConverters (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of SDI-embedded input audio channels supported by the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumEmbeddedAudioInputChannels (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of SDI-embedded output audio channels supported by the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumEmbeddedAudioOutputChannels (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of frame stores on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumFrameStores (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of frame sync widgets on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumFrameSyncs (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of HDMI audio input channels on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumHDMIAudioInputChannels (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of HDMI audio output channels on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumHDMIAudioOutputChannels (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of HDMI video inputs on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumHDMIVideoInputs (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of HDMI video outputs on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumHDMIVideoOutputs (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of input converter widgets on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumInputConverters (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of analog LTC inputs on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumLTCInputs (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of analog LTC outputs on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumLTCOutputs (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of LUT banks on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumLUTBanks (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of LUT widgets on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumLUTs (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of mixer/keyer widgets on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumMixers (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of output converter widgets on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumOutputConverters (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of reference video inputs on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumReferenceVideoInputs (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of RS-422 serial ports on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumSerialPorts (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of up-converters on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumUpConverters (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of video channels supported on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport ULWord NTV2DeviceGetNumVideoChannels (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of SDI video inputs on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumVideoInputs (const NTV2DeviceID inDeviceID); + +/** + @return Returns the number of SDI video outputs on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport UWord NTV2DeviceGetNumVideoOutputs (const NTV2DeviceID inDeviceID); + +/** + @return Returns the highest bit number of the LED bits in the Global Control Register on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport ULWord NTV2DeviceGetPingLED (const NTV2DeviceID inDeviceID); + +/** + @return Returns the version number of the UFC on the device having the given ID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. +**/ +AJAExport ULWord NTV2DeviceGetUFCVersion (const NTV2DeviceID inDeviceID); + +/** + @return True if the device having the given ID supports the given NTV2ConversionMode. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. + @param[in] inConversionMode Specifies the NTV2ConversionMode. +**/ +AJAExport bool NTV2DeviceCanDoConversionMode (const NTV2DeviceID inDeviceID, const NTV2ConversionMode inConversionMode); + +/** + @return True if the device having the given ID supports the given NTV2DSKMode. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. + @param[in] inDSKMode Specifies the NTV2DSKMode. +**/ +AJAExport bool NTV2DeviceCanDoDSKMode (const NTV2DeviceID inDeviceID, const NTV2DSKMode inDSKMode); + +/** + @return True if the device having the given ID supports the given NTV2FrameBufferFormat. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. + @param[in] inFBFormat Specifies the NTV2FrameBufferFormat. +**/ +AJAExport bool NTV2DeviceCanDoFrameBufferFormat (const NTV2DeviceID inDeviceID, const NTV2FrameBufferFormat inFBFormat); + +/** + @return True if the device having the given ID supports the given NTV2InputSource. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. + @param[in] inInputSource Specifies the NTV2InputSource. +**/ +AJAExport bool NTV2DeviceCanDoInputSource (const NTV2DeviceID inDeviceID, const NTV2InputSource inInputSource); + +/** + @return True if the device having the given ID supports the given NTV2VideoFormat. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. + @param[in] inVideoFormat Specifies the NTV2VideoFormat. +**/ +AJAExport bool NTV2DeviceCanDoVideoFormat (const NTV2DeviceID inDeviceID, const NTV2VideoFormat inVideoFormat); + +/** + @return True if the device having the given ID supports the given NTV2WidgetID. + @param[in] inDeviceID Specifies the NTV2DeviceID of interest. + @param[in] inWidgetID Specifies the NTV2WidgetID. +**/ +AJAExport bool NTV2DeviceCanDoWidget (const NTV2DeviceID inDeviceID, const NTV2WidgetID inWidgetID); +#define NTV2DEVICEFEATURES_HH + +#if defined(__cplusplus) && defined(NTV2_BUILDING_DRIVER) +} +#endif + + + +#endif // NTV2DEVICEFEATURES_HH diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2devicescanner.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2devicescanner.h new file mode 100644 index 0000000..73462bf --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2devicescanner.h @@ -0,0 +1,444 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2devicescanner.h + @brief Declares the CNTV2DeviceScanner class. + @copyright (C) 2004-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2DEVICESCANNER_H +#define NTV2DEVICESCANNER_H + +#include "ajaexport.h" +#include "ntv2card.h" +#include "string.h" +#include +#include + + +typedef std::vector NTV2AudioSampleRateList; +typedef NTV2AudioSampleRateList::const_iterator NTV2AudioSampleRateListConstIter; +typedef NTV2AudioSampleRateList::iterator NTV2AudioSampleRateListIter; + +typedef std::vector NTV2AudioChannelsPerFrameList; +typedef NTV2AudioChannelsPerFrameList::const_iterator NTV2AudioChannelsPerFrameListConstIter; +typedef NTV2AudioChannelsPerFrameList::iterator NTV2AudioChannelsPerFrameListIter; + +typedef std::vector NTV2AudioSourceList; +typedef NTV2AudioSourceList::const_iterator NTV2AudioSourceListConstIter; +typedef NTV2AudioSourceList::iterator NTV2AudioSourceListIter; + +typedef std::vector NTV2AudioBitsPerSampleList; +typedef NTV2AudioBitsPerSampleList::const_iterator NTV2AudioBitsPerSampleListConstIter; +typedef NTV2AudioBitsPerSampleList::iterator NTV2AudioBitsPerSampleListIter; + + +/** + @deprecated Please use the functions provided in 'ntv2devicefeatures.h' and 'ntv2devicefeatures.hh' instead. +**/ +typedef struct NTV2DeviceInfo +{ + NTV2DeviceID deviceID; ///< @brief Device ID/species (e.g., DEVICE_ID_KONA3G, DEVICE_ID_IOXT, etc.) + ULWord deviceIndex; ///< @brief Device index number -- this will be phased out someday + ULWord pciSlot; ///< @brief PCI slot (if applicable and/or known) + uint64_t deviceSerialNumber; ///< @brief Unique device serial number + std::string deviceIdentifier; ///< @brief Device name as seen in Control Panel, Watcher, Cables, etc. + UWord numVidInputs; ///< @brief Total number of video inputs -- analog, digital, whatever + UWord numVidOutputs; ///< @brief Total number of video outputs -- analog, digital, whatever + UWord numAnlgVidInputs; ///< @brief Total number of analog video inputs + UWord numAnlgVidOutputs; ///< @brief Total number of analog video outputs + UWord numHDMIVidInputs; ///< @brief Total number of HDMI inputs + UWord numHDMIVidOutputs; ///< @brief Total number of HDMI outputs + UWord numInputConverters; ///< @brief Total number of input converters + UWord numOutputConverters; ///< @brief Total number of output converters + UWord numUpConverters; ///< @brief Total number of up-converters + UWord numDownConverters; ///< @brief Total number of down-converters + UWord downConverterDelay; + bool isoConvertSupport; + bool rateConvertSupport; + bool dvcproHDSupport; + bool qrezSupport; + bool hdvSupport; + bool quarterExpandSupport; + bool vidProcSupport; + bool dualLinkSupport; ///< @brief Supports dual-link? + bool colorCorrectionSupport; ///< @brief Supports color correction? + bool programmableCSCSupport; ///< @brief Programmable color space converter? + bool rgbAlphaOutputSupport; ///< @brief Supports RGB alpha channel? + bool breakoutBoxSupport; ///< @brief Can support a breakout box? + bool procAmpSupport; + bool has2KSupport; ///< @brief Supports 2K formats? + bool has4KSupport; ///< @brief Supports 4K formats? + bool has8KSupport; ///< @brief Supports 8K formats? + bool has3GLevelConversion; ///< @brief Supports 3G Level Conversion? + bool proResSupport; ///< @brief Supports ProRes? + bool sdi3GSupport; ///< @brief Supports 3G? + bool sdi12GSupport; ///< @brief Supports 12G? + bool ipSupport; ///< @brief Supports IP IO? + bool biDirectionalSDI; ///< @brief Supports Bi-directional SDI + bool ltcInSupport; ///< @brief Accepts LTC input? + bool ltcOutSupport; ///< @brief Supports LTC output? + bool ltcInOnRefPort; ///< @brief Supports LTC on reference input? + bool stereoOutSupport; ///< @brief Supports stereo output? + bool stereoInSupport; ///< @brief Supports stereo input? + bool multiFormat; ///< @brief Supports multiple video formats? + NTV2AudioSampleRateList audioSampleRateList; ///< @brief My supported audio sample rates + NTV2AudioChannelsPerFrameList audioNumChannelsList; ///< @brief My supported number of audio channels per frame + NTV2AudioBitsPerSampleList audioBitsPerSampleList; ///< @brief My supported audio bits-per-sample + NTV2AudioSourceList audioInSourceList; ///< @brief My supported audio input sources (AES, ADAT, etc.) + NTV2AudioSourceList audioOutSourceList; ///< @brief My supported audio output destinations (AES, etc.) + UWord numAudioStreams; ///< @brief Maximum number of independent audio streams + UWord numAnalogAudioInputChannels; ///< @brief Total number of analog audio input channels + UWord numAESAudioInputChannels; ///< @brief Total number of AES audio input channels + UWord numEmbeddedAudioInputChannels; ///< @brief Total number of embedded (SDI) audio input channels + UWord numHDMIAudioInputChannels; ///< @brief Total number of HDMI audio input channels + UWord numAnalogAudioOutputChannels; ///< @brief Total number of analog audio output channels + UWord numAESAudioOutputChannels; ///< @brief Total number of AES audio output channels + UWord numEmbeddedAudioOutputChannels; ///< @brief Total number of embedded (SDI) audio output channels + UWord numHDMIAudioOutputChannels; ///< @brief Total number of HDMI audio output channels + UWord numDMAEngines; ///< @brief Total number of DMA engines + UWord numSerialPorts; ///< @brief Total number of serial ports + ULWord pingLED; + #if !defined (NTV2_DEPRECATE) + uint64_t boardSerialNumber; ///< @deprecated Use deviceSerialNumber instead + char boardIdentifier[32]; ///< @deprecated Use deviceIdentifier instead + NTV2BoardType boardType; ///< @deprecated No longer used. Remove deviceType from the source code instead + NTV2BoardID boardID; ///< @deprecated Use deviceID instead + ULWord boardNumber; ///< @deprecated Use deviceIndex instead + #endif // !defined (NTV2_DEPRECATE) + + AJAExport bool operator == (const NTV2DeviceInfo & rhs) const; ///< @return True if I'm equivalent to another ::NTV2DeviceInfo struct. + AJAExport inline bool operator != (const NTV2DeviceInfo & rhs) const { return !(*this == rhs); } ///< @return True if I'm different from another ::NTV2DeviceInfo struct. + +} NTV2DeviceInfo; + + + +// ostream operators + +/** + @brief Streams the NTV2AudioSampleRateList to the given output stream in a human-readable format. + @param inOutStr The output stream into which the NTV2AudioSampleRateList is to be streamed. + @param[in] inList Specifies the NTV2AudioSampleRateList to be streamed. + @return The output stream. +**/ +AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioSampleRateList & inList); + +/** + @brief Streams the NTV2AudioChannelsPerFrameList to the given output stream in a human-readable format. + @param inOutStr The output stream into which the NTV2AudioChannelsPerFrameList is to be streamed. + @param[in] inList Specifies the NTV2AudioChannelsPerFrameList to be streamed. + @return The output stream. +**/ +AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioChannelsPerFrameList & inList); + +/** + @brief Streams the NTV2AudioSourceList to the given output stream in a human-readable format. + @param inOutStr The output stream into which the NTV2AudioSourceList is to be streamed. + @param[in] inList Specifies the NTV2AudioSourceList to be streamed. + @return The output stream. +**/ +AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioSourceList & inList); + +/** + @brief Streams the NTV2AudioBitsPerSampleList to the given output stream in a human-readable format. + @param inOutStr The output stream into which the NTV2AudioBitsPerSampleList is to be streamed. + @param[in] inList Specifies the NTV2AudioBitsPerSampleList to be streamed. + @return The output stream. +**/ +AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioBitsPerSampleList & inList); + +/** + @brief Streams the NTV2DeviceInfo to the given output stream in a human-readable format. + @param inOutStr The output stream into which the NTV2DeviceInfo is to be streamed. + @param[in] inInfo Specifies the NTV2DeviceInfo to be streamed. + @return The output stream. +**/ +AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2DeviceInfo & inInfo); + + +/** + @brief I am an ordered list of NTV2DeviceInfo structs. +**/ +typedef std::vector NTV2DeviceInfoList; +typedef NTV2DeviceInfoList::const_iterator NTV2DeviceInfoListConstIter; // Const iterator shorthand +typedef NTV2DeviceInfoList::iterator NTV2DeviceInfoListIter; // Iterator shorthand + + +/** + @brief Streams the NTV2DeviceInfoList to an output stream in a human-readable format. + @param inOutStr The output stream into which the NTV2DeviceInfoList is to be streamed. + @param[in] inList Specifies the NTV2DeviceInfoList to be streamed. + @return The output stream. +**/ +AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2DeviceInfoList & inList); + + +typedef struct { + ULWord boardNumber; + AudioSampleRateEnum sampleRate; + AudioChannelsPerFrameEnum numChannels; + AudioBitsPerSampleEnum bitsPerSample; + AudioSourceEnum sourceIn; + AudioSourceEnum sourceOut; +} NTV2AudioPhysicalFormat; + + +/** + @brief Streams the AudioPhysicalFormat to an output stream in a human-readable format. + @param inOutStr The output stream into which the AudioPhysicalFormat is to be streamed. + @param[in] inFormat Specifies the AudioPhysicalFormat to be streamed. + @return The output stream. +**/ +AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioPhysicalFormat & inFormat); + + +/** + @brief I am an ordered list of NTV2AudioPhysicalFormat structs. +**/ +typedef std::vector NTV2AudioPhysicalFormatList; +typedef NTV2AudioPhysicalFormatList::const_iterator NTV2AudioPhysicalFormatListConstIter; // Shorthand for const_iterator +typedef NTV2AudioPhysicalFormatList::iterator NTV2AudioPhysicalFormatListIter; // Shorthand for iterator + + +/** + @brief Streams the AudioPhysicalFormatList to an output stream in a human-readable format. + @param inOutStr The output stream into which the AudioPhysicalFormatList is to be streamed. + @param[in] inList Specifies the AudioPhysicalFormatList to be streamed. + @return The output stream. +**/ +AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioPhysicalFormatList & inList); + + + +/** + @brief This class is used to enumerate AJA devices that are attached and known to the local host computer. +**/ +class AJAExport CNTV2DeviceScanner +{ +// Class Methods +public: + /** + @brief Rescans the host, and returns an open CNTV2Card instance for the AJA device having the given zero-based index number. + @return True if successful; otherwise false. + @param[in] inDeviceIndexNumber Specifies the AJA device using a zero-based index number. + @param[out] outDevice Receives the open, ready-to-use CNTV2Card instance. + **/ + static bool GetDeviceAtIndex (const ULWord inDeviceIndexNumber, CNTV2Card & outDevice); + + /** + @brief Rescans the host, and returns an open CNTV2Card instance for the first AJA device found on the host that has the given NTV2DeviceID. + @return True if successful; otherwise false. + @param[in] inDeviceID Specifies the device identifier of interest. + @param[out] outDevice Receives the open, ready-to-use CNTV2Card instance. + **/ + static bool GetFirstDeviceWithID (const NTV2DeviceID inDeviceID, CNTV2Card & outDevice); + + /** + @brief Rescans the host, and returns an open CNTV2Card instance for the first AJA device whose device identifier name contains the given substring. + @note The name is compared case-insensitively (e.g., "iO4K" == "Io4k"). + @return True if successful; otherwise false. + @param[in] inNameSubString Specifies a portion of the device name to search for. + @param[out] outDevice Receives the open, ready-to-use CNTV2Card instance. + **/ + static bool GetFirstDeviceWithName (const std::string & inNameSubString, CNTV2Card & outDevice); + + /** + @brief Rescans the host, and returns an open CNTV2Card instance for the first AJA device whose serial number contains the given value. + @note The serial value is compared case-sensitively. + @return True if successful; otherwise false. + @param[in] inSerialStr Specifies the device serial value to search for. + @param[out] outDevice Receives the open, ready-to-use CNTV2Card instance of the first matching device. + **/ + static bool GetFirstDeviceWithSerial (const std::string & inSerialStr, CNTV2Card & outDevice); // New in SDK 16.0 + + /** + @brief Rescans the host, and returns an open CNTV2Card instance for the first AJA device whose serial number matches the given value. + @return True if successful; otherwise false. + @param[in] inSerialNumber Specifies the device serial value to search for. + @param[out] outDevice Receives the open, ready-to-use CNTV2Card instance. + **/ + static bool GetDeviceWithSerial (const uint64_t inSerialNumber, CNTV2Card & outDevice); // New in SDK 16.0 + + /** + @brief Rescans the host, and returns an open CNTV2Card instance for the AJA device that matches a command line argument + according to the following evaluation sequence: + -# 1 or 2 digit unsigned decimal integer: a zero-based device index number; + -# 8 or 9 character alphanumeric string: device with a matching serial number string (case-insensitive comparison); + -# 3-16 character hexadecimal integer, optionally preceded by '0x': device having a matching 64-bit serial number; + -# All other cases: first device (lowest index number) whose name contains the argument string (compared case-insensitively). + @return True if successful; otherwise false. + @param[in] inArgument The argument string. If 'list' or '?', the std::cout stream is sent some + "help text" showing a list of all available devices. + @param[out] outDevice Receives the open, ready-to-use CNTV2Card instance. + **/ + static bool GetFirstDeviceFromArgument (const std::string & inArgument, CNTV2Card & outDevice); + + /** + @brief Compares two NTV2DeviceInfoLists and returns a list of additions and a list of removals. + @param[in] inOldList Specifies the "old" list to be compared with a "newer" list. + @param[in] inNewList Specifies the "new" list to be compared with the "older" list. + @param[out] outDevicesAdded Receives a list of devices that exist in the "new" list that don't exist in the "old" list. + @param[out] outDevicesRemoved Receives a list of devices that exist in the "old" list that don't exist in the "new" list. + @return True if the two lists differ in any way; otherwise false if they match. + **/ + static bool CompareDeviceInfoLists (const NTV2DeviceInfoList & inOldList, + const NTV2DeviceInfoList & inNewList, + NTV2DeviceInfoList & outDevicesAdded, + NTV2DeviceInfoList & outDevicesRemoved); + + /** + @param[in] inDevice The CNTV2Card instance that's open for the device of interest. + @return A string containing the device name that will find the same given device using CNTV2DeviceScanner::GetFirstDeviceFromArgument. + **/ + static std::string GetDeviceRefName (CNTV2Card & inDevice); // New in SDK 16.0 + + /** + @return True if the string contains a legal decimal number. + @param[in] inStr The string to be tested. + **/ + static bool IsLegalDecimalNumber (const std::string & inStr, const size_t inMaxLength = 2); // New in SDK 16.0 + static uint64_t IsLegalHexSerialNumber (const std::string & inStr); // New in SDK 16.0 // e.g. "0x3236333331375458" + static bool IsHexDigit (const char inChr); // New in SDK 16.0 + static bool IsDecimalDigit (const char inChr); // New in SDK 16.0 + static bool IsAlphaNumeric (const char inStr); // New in SDK 16.0 + + /** + @return True if the string contains letters and/or decimal digits. + @param[in] inStr The string to be tested. + **/ + static bool IsAlphaNumeric (const std::string & inStr); // New in SDK 16.0 + + /** + @return True if the string contains a legal serial number. + @param[in] inStr The string to be tested. + **/ + static bool IsLegalSerialNumber (const std::string & inStr); // New in SDK 16.0 + +// Instance Methods +public: + // Construction, Copying, Assigning + /** + @brief Constructs me. + @param[in] inScanNow Specifies if a scan should be made right away. Defaults to true. + If false is specified, the client must explicitly call ScanHardware to enumerate NTV2 devices. + **/ + explicit CNTV2DeviceScanner (const bool inScanNow = true); + explicit CNTV2DeviceScanner (bool inScanNow, UWord inDeviceMask); + + /** + @brief Constructs me from an existing CNTV2DeviceScanner instance. + @param[in] inDeviceScanner Specifies the CNTV2DeviceScanner instance to be copied. + **/ + explicit CNTV2DeviceScanner (const CNTV2DeviceScanner & inDeviceScanner); + + /** + @brief Assigns an existing CNTV2DeviceScanner instance to me. + @param[in] inDeviceScanner Specifies the CNTV2DeviceScanner instance to be copied. + **/ + virtual CNTV2DeviceScanner & operator = (const CNTV2DeviceScanner & inDeviceScanner); + + + // Scanning + /** + @brief Re-scans the local host for connected AJA devices. + **/ + virtual void ScanHardware (void); + virtual void ScanHardware (UWord inDeviceMask); + + + // Inquiry + /** + @brief Returns the number of AJA devices found on the local host. + @return Number of AJA devices found on the local host. + **/ + virtual inline size_t GetNumDevices (void) const { return GetDeviceInfoList ().size (); } + + /** + @brief Returns true if one or more AJA devices having the specified device identifier are attached and known to the host. + @return True if at least one AJA device having the specified device identifier is present on the host system; otherwise false. + @param[in] inDeviceID Specifies the device identifier of interest. + @param[in] inRescan Specifies if the host should be rescanned or not. Defaults to false. + **/ + virtual bool DeviceIDPresent (const NTV2DeviceID inDeviceID, const bool inRescan = false); + + /** + @brief Returns detailed information about the AJA device having the given zero-based index number. + @return True if successful; otherwise false. + @param[in] inDeviceIndexNumber Specifies the AJA device to retrieve information about using a zero-based index number. + @param[out] outDeviceInfo Specifies the NTV2DeviceInfo structure that will receive the device information. + @param[in] inRescan Specifies if the host should be rescanned or not. + **/ + virtual bool GetDeviceInfo (const ULWord inDeviceIndexNumber, NTV2DeviceInfo & outDeviceInfo, const bool inRescan = false); + + /** + @brief Returns an NTV2DeviceInfoList that can be "walked" using standard C++ vector iteration techniques. + @return A non-constant reference to my NTV2DeviceInfoList. + **/ + virtual inline NTV2DeviceInfoList & GetDeviceInfoList (void) { return _deviceInfoList; } + + /** + @brief Returns an NTV2DeviceInfoList that can be "walked" using standard C++ vector iteration techniques. + @return A constant reference to my NTV2DeviceInfoList. + **/ + virtual inline const NTV2DeviceInfoList & GetDeviceInfoList (void) const { return _deviceInfoList; } + + + // Sorting + /** + @brief Sorts my device list by ascending PCI slot number. + **/ + virtual void SortDeviceInfoList (void); + + #if !defined (NTV2_DEPRECATE) + public: + static NTV2_DEPRECATED_f(void DumpBoardInfo (const NTV2DeviceInfo & info)); ///< @deprecated Use the ostream operators instead. + static NTV2_DEPRECATED_f(void DumpAudioFormatInfo (const NTV2AudioPhysicalFormat & audioPhysicalFormat)); ///< @deprecated Use the ostream operators instead. + virtual NTV2_DEPRECATED_f(bool BoardTypePresent (NTV2BoardType boardType, bool rescan = false)); ///< @deprecated NTV2BoardType is obsolete. + virtual inline NTV2_DEPRECATED_f(bool BoardIDPresent (NTV2BoardID boardID, bool rescan = false)) {return DeviceIDPresent (boardID, rescan);} ///< @deprecated Use DeviceIDPresent instead. + virtual inline NTV2_DEPRECATED_f(bool GetBoardInfo (ULWord inDeviceIndexNumber, NTV2DeviceInfo & outDeviceInfo, bool inRescan)) {return GetDeviceInfo (inDeviceIndexNumber, outDeviceInfo, inRescan);} ///< @deprecated Use GetDeviceInfo instead. + virtual inline NTV2_DEPRECATED_f(void SortBoardInfoList (void)) { SortDeviceInfoList (); } ///< @deprecated Use SortDeviceInfoList instead. + virtual inline NTV2_DEPRECATED_f(size_t GetNumBoards (void) const) { return GetNumDevices (); } ///< @deprecated Use GetNumDevices instead. + virtual inline NTV2_DEPRECATED_f(NTV2DeviceInfoList & GetBoardList (void)) { return _deviceInfoList; } ///< @deprecated Use GetDeviceInfoList instead. + virtual inline NTV2_DEPRECATED_f(const NTV2DeviceInfoList & GetBoardList (void) const) { return _deviceInfoList; } ///< @deprecated Use GetDeviceInfoList instead. + #endif // NTV2_DEPRECATE + + virtual inline ~CNTV2DeviceScanner () { } + + +private: + virtual void SetAudioAttributes(NTV2DeviceInfo & inDeviceInfo, CNTV2Card & inDevice) const; + virtual void SetVideoAttributes (NTV2DeviceInfo & inDevicInfo); + virtual void DeepCopy (const CNTV2DeviceScanner & inDeviceScanner); + + +// Instance Data +private: + NTV2DeviceInfoList _deviceInfoList; /// My device list + +}; // CNTV2DeviceScanner + + +#if !defined (NTV2_DEPRECATE) + typedef NTV2_DEPRECATED_TYPEDEF NTV2DeviceInfo NTV2BoardInfo; /// @deprecated Use NTV2DeviceInfo instead. Type names containing "board" are being phased out. + typedef NTV2_DEPRECATED_TYPEDEF NTV2DeviceInfo OurBoardInfo; /// @deprecated Use NTV2DeviceInfo instead. Type names containing "board" are being phased out. + typedef NTV2_DEPRECATED_TYPEDEF NTV2DeviceInfoList NTV2BoardInfoList; /// @deprecated Use NTV2DeviceInfoList instead. Type names containing "board" are being phased out. + typedef NTV2_DEPRECATED_TYPEDEF NTV2DeviceInfoList BoardInfoList; /// @deprecated Use NTV2DeviceInfoList instead. Type names containing "board" are being phased out. + typedef NTV2_DEPRECATED_TYPEDEF NTV2AudioPhysicalFormat AudioPhysicalFormat; /// @deprecated Use NTV2AudioPhysicalFormat instead. Type names without "NTV2" are being phased out. + typedef NTV2_DEPRECATED_TYPEDEF NTV2AudioPhysicalFormatList AudioPhysicalFormatList; /// @deprecated Use NTV2AudioPhysicalFormatList instead. Type names without "NTV2" are being phased out. + typedef NTV2_DEPRECATED_TYPEDEF CNTV2DeviceScanner CNTV2BoardScan; /// @deprecated Use CNTV2DeviceScanner instead. Type names containing "board" are being phased out. +#endif // NTV2_DEPRECATE + + +#if !defined (AJADLL_BUILD) && !defined (AJASTATIC) + // This code forces link/load errors if the SDK client was built with NTV2_DEPRECATE defined, + // but the SDK lib/dylib/DLL was built without NTV2_DEPRECATE defined, ... or vice-versa... + #if defined (NTV2_DEPRECATE) + extern int gNTV2_DEPRECATE(); + static int __AJA_trigger_link_error_if_incompatible__ = gNTV2_DEPRECATE(); + #else + extern int gNTV2_NON_DEPRECATE(); + static int __AJA_trigger_link_error_if_incompatible__ = gNTV2_NON_DEPRECATE(); + #endif +#endif // neither AJADLL_BUILD nor AJASTATIC + +#endif // NTV2DEVICESCANNER_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2discover.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2discover.h new file mode 100644 index 0000000..58b137f --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2discover.h @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2discover.h + @brief Declares the NTV nub discovery functions. + @copyright (C) 2006-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef NTV2DISCOVER_H +#define NTV2DISCOVER_H +#if defined (AJALinux ) || defined (AJAMac) + #include + #include + #include +#endif +#include "ajaexport.h" +#include "ntv2nubtypes.h" + +#if defined (NTV2_NUB_CLIENT_SUPPORT) + +#define DISCOVER_SUCCESS (0) +#define DISCOVER_RECVERR (-1) +#define DISCOVER_FULL (-2) +#define DISCOVER_FOUND_NOBODY (-3) + +// Discover nubs on all network interfaces +AJAExport int ntv2DiscoverNubs ( int inMaxNubs, // Maximum number of nubs (size of sockaddr_in and boardInventory arrays) + struct sockaddr_in their_addr [], // Array of responders + NTV2DiscoverRespPayload boardInventory [], // Available boards for each responder + int & outFoundNubCount, // How many nubs were found (no more than inMaxNubs) + int inWaitTimeoutSecs, // How long to wait for discover responses In seconds + int sendto_count = 5); // default + +AJAExport int ntv2DiscoverNubs ( const char * hostname, + int inMaxNubs, // Maximum number of nubs (size of sockaddr_in and boardInventory arrays) + struct sockaddr_in their_addr [], // Array of responders + NTV2DiscoverRespPayload boardInventory [], // Available boards for each responder + int & outFoundNubCount, // How many nubs were found (no more than maxNubs above) + int inWaitTimeoutSecs, // How long to wait for discover responses In seconds + int sendto_count = 5, // How many UDP queries to send (can be lost) + bool appendNubs = false); // If true, leave existing nubs in boardInventory and add new ones +#endif // defined (NTV2_NUB_CLIENT_SUPPORT) + +#endif // NTV2DISCOVER_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2driverinterface.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2driverinterface.h new file mode 100644 index 0000000..c1296c6 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2driverinterface.h @@ -0,0 +1,678 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2driverinterface.h + @brief Declares the CNTV2DriverInterface base class. + @copyright (C) 2004-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2DRIVERINTERFACE_H +#define NTV2DRIVERINTERFACE_H + +#include "ajaexport.h" +#include "ajatypes.h" +#include "ntv2enums.h" +#include "ntv2videodefines.h" +#include "ntv2audiodefines.h" +#include "ntv2nubaccess.h" +#include "ntv2publicinterface.h" +#include "ntv2utils.h" +#include "ntv2devicefeatures.h" +#if defined(NTV2_WRITEREG_PROFILING) // Register Write Profiling + #include "ajabase/system/lock.h" +#endif // NTV2_WRITEREG_PROFILING Register Write Profiling +#include + +// Check consistent use of AJA_USE_CPLUSPLUS11 and NTV2_USE_CPLUSPLUS11 +#ifdef AJA_USE_CPLUSPLUS11 + #ifndef NTV2_USE_CPLUSPLUS11 + #error "AJA_USE_CPLUSPLUS11 && !NTV2_USE_CPLUSPLUS11" + #else + //#warning "AJA_USE_CPLUSPLUS11 && NTV2_USE_CPLUSPLUS11" + #endif +#else + #ifdef NTV2_USE_CPLUSPLUS11 + #error "!AJA_USE_CPLUSPLUS11 && NTV2_USE_CPLUSPLUS11" + #else + //#warning "!AJA_USE_CPLUSPLUS11 && !NTV2_USE_CPLUSPLUS11" + #endif +#endif + +#if defined(AJALinux ) || defined(AJAMac) + #include + #include + #include +#endif + +#ifdef MSWindows + #include + #include +#endif + + +#define AsNTV2DriverInterfaceRef(_x_) reinterpret_cast(_x_) +#define AsNTV2DriverInterfacePtr(_x_) reinterpret_cast(_x_) + + +typedef struct +{ + std::string buildNumber; + std::string packageNumber; + std::string date; + std::string time; +} PACKAGE_INFO_STRUCT, *PPACKAGE_INFO_STRUCT; + + +/** + @brief I'm the base class that undergirds the platform-specific derived classes (from which ::CNTV2Card is ultimately derived). +**/ +class AJAExport CNTV2DriverInterface +{ + // STATIC (CLASS) METHODS + public: + static NTV2StringList GetLegalSchemeNames (void); ///< @return A list of legal scheme names that can be used to open remote or non-physical devices. (New in SDK 16.0) + static inline UWord MaxNumDevices (void) {return 32;} ///< @return Maximum number of local/physical device connections. (New in SDK 16.0) + + /** + @brief Specifies if subsequent Open calls should open the device in shared mode or not. + @note On some platforms, this function may have no effect. + @param[in] inSharedMode Specify true for shared mode; otherwise use false. + **/ + static void SetShareMode (const bool inSharedMode); + static bool GetShareMode (void); ///< @return True if local devices will be opened in shared mode; otherwise false. (New in SDK 16.0) + + /** + @brief Specifies if the next Open call should try to open the device in shared mode or not. + @note On some platforms, this function may have no effect. + @param[in] inOverlapMode Specify true for overlapped mode; otherwise use false. + **/ + static void SetOverlappedMode (const bool inOverlapMode); + static bool GetOverlappedMode (void); ///< @return True if local devices will be opened in overlapped mode; otherwise false. (New in SDK 16.0) + + /** + @name Construction, destruction, assignment + **/ + ///@{ + public: + CNTV2DriverInterface(); ///< @brief My default constructor. + virtual ~CNTV2DriverInterface(); ///< @brief My destructor. + + private: + /** + @brief My assignment operator. + @note We have intentionally disabled this capability because historically it was never implemented properly. + @param[in] inRHS The rvalue to be assigned to the lvalue. + @return A non-constant reference to the lvalue. + **/ + AJA_VIRTUAL CNTV2DriverInterface & operator = (const CNTV2DriverInterface & inRHS); + + /** + @brief My copy constructor. + @note We have intentionally disabled this capability because historically it was never implemented properly. + @param[in] inObjToCopy The object to be copied. + **/ + CNTV2DriverInterface (const CNTV2DriverInterface & inObjToCopy); + ///@} + + public: + /** + @name Inquiry + **/ + ///@{ + AJA_VIRTUAL NTV2DeviceID GetDeviceID (void); ///< @return The 4-byte value that identifies the kind of AJA device this is. + AJA_VIRTUAL inline UWord GetIndexNumber (void) const {return _boardNumber;} ///< @return My zero-based index number (relative to other devices attached to the host). + AJA_VIRTUAL inline bool IsOpen (void) const {return _boardOpened;} ///< @return True if I'm able to communicate with the device I represent; otherwise false. + + /** + @return True if the device is ready to be fully operable; otherwise false. + @param[in] inCheckValid If true, additionally checks CNTV2Card::IsMBSystemValid. Defaults to false. + @note Some devices have processors that require a lot of time (~30 to ~90 seconds) to start up after a PCIe bus reset, + power-up or wake from sleep. Calls to CNTV2Card::IsOpen, CNTV2Card::ReadRegister and CNTV2Card::WriteRegister + will all succeed, but the device won't be capable of either ingesting or playing video or performing DMA operations. + **/ + AJA_VIRTUAL bool IsDeviceReady (const bool inCheckValid = false); + AJA_VIRTUAL bool IsMBSystemValid (void); ///< @return True if microblaze system exists (is valid); otherwise false. + AJA_VIRTUAL bool IsMBSystemReady (void); ///< @return True if microblaze system is in ready state; otherwise false. + AJA_VIRTUAL inline bool IsIPDevice (void) {return ::NTV2DeviceCanDoIP(GetDeviceID());} ///< @return True if I am an IP device; otherwise false. + ///@} + + /** + @name Open/Close, Connect/Disconnect + **/ + ///@{ + /** + @brief Opens a local/physical AJA device so it can be monitored/controlled. + @param[in] inDeviceIndex Specifies a zero-based index number of the AJA device to open. + @result True if successful; otherwise false. + @note Before attempting the Open, if I'm currently open, Close will be called first. + **/ + AJA_VIRTUAL bool Open (const UWord inDeviceIndex); + + /** + @brief Opens the specified local, remote or software device. + @param[in] inURLSpec Specifies the local, remote or software device to be opened. + @result True if successful; otherwise false. + @note Before attempting the Open, if I'm currently open, Close will be called first. + **/ + AJA_VIRTUAL bool Open (const std::string & inURLSpec); + + /** + @brief Closes me, releasing host resources that may have been allocated in a previous Open call. + @result True if successful; otherwise false. + @details This function closes any onnection to an AJA device. + Once closed, the device can no longer be queried or controlled by this instance. + **/ + AJA_VIRTUAL bool Close (void); + ///@} + + /** + @name Register Read/Write + **/ + ///@{ + + /** + @brief Updates or replaces all or part of the 32-bit contents of a specific register (real or virtual) + on the AJA device. Using the optional mask and shift parameters, it's possible to set or clear + any number of specific bits in a real register without altering any of the register's other bits. + @result True if successful; otherwise false. + @param[in] inRegNum Specifies the register number of interest. + @param[in] inValue Specifies the desired new register value. If the "inShift" parameter is non-zero, + this value is shifted left by the designated number of bit positions before being + masked and applied to the real register contents. + @param[in] inMask Optionally specifies a bit mask to be applied to the new (shifted) value before + updating the register. Defaults to 0xFFFFFFFF, which does not perform any masking. + On Windows and MacOS, a zero mask is treated the same as 0xFFFFFFFF. + @param[in] inShift Optionally specifies the number of bits to left-shift the specified value before applying + it to the register. Defaults to zero, which does not perform any shifting. + On MacOS, this parameter is ignored. + On Windows, a shift value of 0xFFFFFFFF is treated the same as a zero shift value. + @note This function should be used only when there is no higher-level function available to accomplish the desired task. + @note The mask and shift parameters are ignored when setting a virtual register. + @bug On MacOS, "holes" in the mask (i.e., one or more runs of 0-bits lying between more-significant and + less-significant 1-bits) were not handled correctly. + **/ + AJA_VIRTUAL bool WriteRegister (const ULWord inRegNum, const ULWord inValue, const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0); + + /** + @brief Reads all or part of the 32-bit contents of a specific register (real or virtual) on the AJA device. + Using the optional mask and shift parameters, it's possible to read any number of specific bits in a register + while ignoring the register's other bits. + @result True if successful; otherwise false. + @param[in] inRegNum Specifies the register number of interest. + @param[out] outValue Receives the register value obtained from the device. + @param[in] inMask Optionally specifies a bit mask to be applied after reading the device register. + Zero and 0xFFFFFFFF masks are ignored. Defaults to 0xFFFFFFFF (no masking). + @param[in] inShift Optionally specifies the number of bits to right-shift the value obtained + from the device register after the mask has been applied. Defaults to zero (no shift). + @note This function should be used only when there is no higher-level function available to accomplish the desired task. + @note The mask and shift parameters are ignored when reading a virtual register. + **/ + AJA_VIRTUAL bool ReadRegister (const ULWord inRegNum, ULWord & outValue, const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0); + + /** + @brief This template function reads all or part of the 32-bit contents of a specific register (real or virtual) + from the AJA device, and if successful, returns its value automatically casted to the scalar type of the + "outValue" parameter. + @result True if successful; otherwise false. + @param[in] inRegNum Specifies the register number of interest. + @param[out] outValue Receives the register value obtained from the device, automatically casted to the parameter's type. + Its type must be statically castable from ULWord (i.e. it must be a scalar). + @param[in] inMask Optionally specifies a bit mask to be applied after reading the device register. + Zero and 0xFFFFFFFF masks are ignored. Defaults to 0xFFFFFFFF (no masking). + @param[in] inShift Optionally specifies the number of bits to right-shift the value obtained + from the device register after the mask has been applied. Defaults to zero (no shift). + @note This function should be used only when there is no higher-level function available to accomplish the desired task. + @note The mask and shift parameters are ignored when reading a virtual register. + **/ + template bool ReadRegister(const ULWord inRegNum, T & outValue, const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0) + { + ULWord regValue(0); + bool result (ReadRegister(inRegNum, regValue, inMask, inShift)); + if (result) + outValue = T(regValue); + return result; + } + +#if !defined(READREGMULTICHANGE) + /** + @brief Reads the register(s) specified by the given ::NTV2RegInfo sequence. + @param[in] inOutValues Specifies the register(s) to be read, and upon return, contains their values. + @return True only if all registers were read successfully; otherwise false. + @note This operation is not guaranteed to be performed atomically. + **/ + AJA_VIRTUAL bool ReadRegisters (NTV2RegisterReads & inOutValues); +#endif // !defined(READREGMULTICHANGE) + AJA_VIRTUAL bool RestoreHardwareProcampRegisters() = 0; + ///@} + + /** + @name DMA Transfer + **/ + ///@{ + /** + @brief Transfers data between the AJA device and the host. This function will block and not return to the caller until + the transfer has finished or failed. + @param[in] inDMAEngine Specifies the device DMA engine to use. Use NTV2_DMA_FIRST_AVAILABLE for most applications. + (Use the ::NTV2DeviceGetNumDMAEngines function to determine how many are available.) + @param[in] inIsRead Specifies the transfer direction. Use 'true' for reading (device-to-host). + Use 'false' for writing (host-to-device). + @param[in] inFrameNumber Specifies the zero-based frame number of the starting frame to be transferred to/from the device. + @param pFrameBuffer Specifies a valid, non-NULL address of the host buffer. If reading (device-to-host), this memory + will be written into. If writing (host-to-device), this memory will be read from. + @param[in] inOffsetBytes Specifies the byte offset into the device frame buffer where the data transfer will start. + @param[in] inTotalByteCount Specifies the total number of bytes to be transferred. + @param[in] inSynchronous This parameter is obsolete, and ignored. + @return True if successful; otherwise false. + @note The host buffer must be at least inByteCount + inOffsetBytes in size; otherwise, host memory will be corrupted, + or a bus error or other runtime exception may occur. + **/ + AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine, + const bool inIsRead, + const ULWord inFrameNumber, + ULWord * pFrameBuffer, + const ULWord inOffsetBytes, + const ULWord inTotalByteCount, + const bool inSynchronous = true); + + /** + @brief Transfers data in segments between the AJA device and the host. This function will block + and not return to the caller until the transfer has finished or failed. + @param[in] inDMAEngine Specifies the device DMA engine to use. Use ::NTV2_DMA_FIRST_AVAILABLE + for most applications. (Use the ::NTV2DeviceGetNumDMAEngines function + to determine how many are available.) + @param[in] inIsRead Specifies the transfer direction. Use 'true' for reading (device-to-host). + Use 'false' for writing (host-to-device). + @param[in] inFrameNumber Specifies the zero-based frame number of the starting frame to be + transferred to/from the device. + @param pFrameBuffer Specifies a valid, non-NULL address of the host buffer. If reading + (device-to-host), this memory will be written into. If writing + (host-to-device), this memory will be read from. + @param[in] inCardOffsetBytes Specifies the byte offset into the device frame buffer where the data + transfer will start. + @param[in] inTotalByteCount Specifies the total number of bytes to be transferred. + @param[in] inNumSegments Specifies the number of segments to transfer. Note that this determines + the number of bytes per segment (by dividing into inTotalByteCount). + @param[in] inHostPitchPerSeg Specifies the number of bytes to increment the host memory pointer + after each segment is transferred. + @param[in] inCardPitchPerSeg Specifies the number of bytes to increment the on-device memory pointer + after each segment is transferred. + @param[in] inSynchronous This parameter is obsolete, and ignored. + @return True if successful; otherwise false. + @note The host buffer must be at least inByteCount + inOffsetBytes in size; otherwise, host memory will be corrupted, + or a bus error or other runtime exception may occur. + **/ + AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine, + const bool inIsRead, + const ULWord inFrameNumber, + ULWord * pFrameBuffer, + const ULWord inCardOffsetBytes, + const ULWord inTotalByteCount, + const ULWord inNumSegments, + const ULWord inHostPitchPerSeg, + const ULWord inCardPitchPerSeg, + const bool inSynchronous = true) = 0; + + AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine, + const NTV2Channel inDMAChannel, + const bool inTarget, + const ULWord inFrameNumber, + const ULWord inCardOffsetBytes, + const ULWord inByteCount, + const ULWord inNumSegments, + const ULWord inSegmentHostPitch, + const ULWord inSegmentCardPitch, + const PCHANNEL_P2P_STRUCT & inP2PData) = 0; + ///@} + + /** + @name Interrupts + **/ + ///@{ + AJA_VIRTUAL bool ConfigureSubscription (const bool bSubscribe, const INTERRUPT_ENUMS inInterruptType, PULWord & outSubcriptionHdl); + AJA_VIRTUAL bool ConfigureInterrupt (const bool bEnable, const INTERRUPT_ENUMS eInterruptType) = 0; + /** + @brief Answers with the number of interrupts of the given type processed by the driver. + @param[in] eInterrupt The interrupt type of interest. + @param[out] outCount Receives the count value. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetInterruptCount (const INTERRUPT_ENUMS eInterrupt, ULWord & outCount) = 0; + + AJA_VIRTUAL bool WaitForInterrupt (const INTERRUPT_ENUMS eInterrupt, const ULWord timeOutMs = 68); + + AJA_VIRTUAL HANDLE GetInterruptEvent (const INTERRUPT_ENUMS eInterruptType); + /** + @brief Answers with the number of interrupt events that I successfully waited for. + @param[in] inEventCode Specifies the interrupt of interest. + @param[out] outCount Receives the number of interrupt events that I successfully waited for. + @return True if successful; otherwise false. + @see CNTV2DriverInterface::SetInterruptEventCount, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool GetInterruptEventCount (const INTERRUPT_ENUMS inEventCode, ULWord & outCount); + + /** + @brief Resets my interrupt event tally for the given interrupt type. (This is my count of the number of successful event waits.) + @param[in] inEventCode Specifies the interrupt type. + @param[in] inCount Specifies the new count value. Use zero to reset the tally. + @return True if successful; otherwise false. + @see CNTV2DriverInterface::GetInterruptEventCount, \ref fieldframeinterrupts + **/ + AJA_VIRTUAL bool SetInterruptEventCount (const INTERRUPT_ENUMS inEventCode, const ULWord inCount); + ///@} + + /** + @name Control/Messaging + **/ + ///@{ + /** + @brief Sends an AutoCirculate command to the NTV2 driver. + @param pAutoCircData Points to the AUTOCIRCULATE_DATA that contains the AutoCirculate API command and parameters. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool AutoCirculate (AUTOCIRCULATE_DATA & pAutoCircData); + + /** + @brief Sends a message to the NTV2 driver (the new, improved, preferred way). + @param pInMessage Points to the message to pass to the driver. + Valid messages start with an NTV2_HEADER and end with an NTV2_TRAILER. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool NTV2Message (NTV2_HEADER * pInMessage); + + /** + @brief Sends an HEVC message to the NTV2 driver. + @param pMessage Points to the HevcMessageHeader that contains the HEVC message. + @return False. This must be implemented by the platform-specific subclass. + **/ + AJA_VIRTUAL inline bool HevcSendMessage (HevcMessageHeader * pMessage) {(void) pMessage; return false;} + + AJA_VIRTUAL bool ControlDriverDebugMessages (NTV2_DriverDebugMessageSet msgSet, bool enable) = 0; + ///@} + + AJA_VIRTUAL inline ULWord GetNumFrameBuffers (void) const {return _ulNumFrameBuffers;} + AJA_VIRTUAL inline ULWord GetFrameBufferSize (void) const {return _ulFrameBufferSize;} + + /** + @brief Answers with the currently-installed bitfile information. + @param[out] outBitFileInfo Receives the bitfile info. + @param[in] inBitFileType Optionally specifies the bitfile type of interest. Defaults to NTV2_VideoProcBitFile. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool DriverGetBitFileInformation (BITFILE_INFO_STRUCT & outBitFileInfo, const NTV2BitFileType inBitFileType = NTV2_VideoProcBitFile); + + /** + @brief Answers with the driver's build information. + @param[out] outBuildInfo Receives the build information. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool DriverGetBuildInformation (BUILD_INFO_STRUCT & outBuildInfo); + + /** + @brief Answers with the IP device's package information. + @param[out] outPkgInfo Receives the package information. + @return True if successful; otherwise false. + **/ + AJA_VIRTUAL bool GetPackageInformation (PACKAGE_INFO_STRUCT & outPkgInfo); + + AJA_VIRTUAL bool BitstreamWrite (const NTV2_POINTER & inBuffer, const bool inFragment, const bool inSwap); + AJA_VIRTUAL bool BitstreamReset (const bool inConfiguration, const bool inInterface); + AJA_VIRTUAL bool BitstreamStatus (NTV2ULWordVector & outRegValues); + + /** + @name Device Ownership + **/ + ///@{ + /** + @brief A reference-counted version of CNTV2DriverInterface::AcquireStreamForApplication useful for + process groups. + @result True if successful; otherwise false. + @param[in] inAppType A 32-bit value that uniquely and globally identifies the calling application + or process that is requesting exclusive use of the device. + @param[in] inProcessID Specifies the OS-specific process identifier that uniquely identifies the running + process on the host machine that is requesting exclusive use of the device. + @details This method reserves exclusive use of the AJA device by the given running host process, + recording both the "process ID" and 4-byte "application type" specified by the caller, and if + already reserved for the given application, increments a reference counter. If a different host + process has already reserved the device, the function will fail. + @note AJA recommends saving the device's ::NTV2EveryFrameTaskMode when this function is called, and + restoring the task mode after releasing the device (when CNTV2DriverInterface::ReleaseStreamForApplicationWithReference + is called). + @note Each call to CNTV2DriverInterface::AcquireStreamForApplicationWithReference should be balanced by + the same number of calls to CNTV2DriverInterface::ReleaseStreamForApplicationWithReference. + **/ + AJA_VIRTUAL bool AcquireStreamForApplicationWithReference (const ULWord inAppType, const int32_t inProcessID); + + /** + @brief A reference-counted version of CNTV2DriverInterface::ReleaseStreamForApplication useful for + process groups. + @result True if successful; otherwise false. + @param[in] inAppType A 32-bit value that uniquely and globally identifies the calling application + or process that is releasing exclusive use of the device. + @param[in] inProcessID Specifies the OS-specific process identifier that uniquely identifies the running + process on the host machine that is releasing exclusive use of the device. + @details This method releases exclusive use of the AJA device by the given host process once the reference + count goes to zero. This method will fail if the specified application type or process ID values + don't match those used in the prior call to CNTV2DriverInterface::AcquireStreamForApplication. + @note AJA recommends restoring the device's original ::NTV2EveryFrameTaskMode as it was when + CNTV2DriverInterface::AcquireStreamForApplicationWithReference was first called, and restoring it + after the final call to this function (when the device has truly been released). + @note Each call to CNTV2DriverInterface::AcquireStreamForApplicationWithReference should be balanced by + the same number of calls to CNTV2DriverInterface::ReleaseStreamForApplicationWithReference. + **/ + AJA_VIRTUAL bool ReleaseStreamForApplicationWithReference (const ULWord inAppType, const int32_t inProcessID); + + /** + @brief Reserves exclusive use of the AJA device for a given process, preventing other processes on the host + from acquiring it until subsequently released. + @result True if successful; otherwise false. + @param[in] inAppType A 32-bit value that uniquely and globally identifies the calling application + or process that is requesting exclusive use of the device. + @param[in] inProcessID Specifies the OS-specific process identifier that uniquely identifies the running + process on the host machine that is requesting exclusive use of the device. + @details This method reserves exclusive use of the AJA device by the given running host process. + The AJA device records both the "process ID" and 4-byte "application type". If another host process + has already reserved the device, this function will fail. + @note AJA recommends saving the device's ::NTV2EveryFrameTaskMode when this function is called, and + restoring it after CNTV2DriverInterface::ReleaseStreamForApplication is called to release the device. + @note A call to CNTV2DriverInterface::AcquireStreamForApplication should be balanced by a call to + CNTV2DriverInterface::ReleaseStreamForApplication. + **/ + AJA_VIRTUAL bool AcquireStreamForApplication (const ULWord inAppType, const int32_t inProcessID); + + /** + @brief Releases exclusive use of the AJA device for a given process, permitting other processes to acquire it. + @result True if successful; otherwise false. + @param[in] inAppType A 32-bit value that uniquely and globally identifies the calling application + or process that is requesting exclusive use of the device. + @param[in] inProcessID Specifies the OS-specific process identifier that uniquely identifies the running + process on the host machine that is requesting exclusive use of the device. + @details This method releases exclusive use of the AJA device by the given host process. This method will + fail if the specified application type or process ID values don't match those used in the prior + call to CNTV2DriverInterface::AcquireStreamForApplication. + @note AJA recommends saving the device's ::NTV2EveryFrameTaskMode at the time + CNTV2DriverInterface::AcquireStreamForApplication is called, and restoring it after releasing + the device. + @note A call to CNTV2DriverInterface::AcquireStreamForApplication should be balanced by a call to + CNTV2DriverInterface::ReleaseStreamForApplication. + **/ + AJA_VIRTUAL bool ReleaseStreamForApplication (const ULWord inAppType, const int32_t inProcessID); + + AJA_VIRTUAL bool SetStreamingApplication (const ULWord inAppType, const int32_t inProcessID); + AJA_VIRTUAL bool GetStreamingApplication (ULWord & outAppType, int32_t & outProcessID); + + /** + @brief Associates this device as the default or "native" device to use with the given host process. + @result True if successful; otherwise false. + @param[in] inProcessID Specifies the OS-specific process identifier that uniquely identifies a running + process on the host machine. + @note Not implemented on Windows or Linux. + @see CNTV2DriverInterface::IsDefaultDeviceForPID + **/ + AJA_VIRTUAL bool SetDefaultDeviceForPID (const int32_t inProcessID) {(void)inProcessID; return false;} + + /** + @return True if the given host process is associated with this device; otherwise false. + @param[in] inProcessID Specifies the OS-specific process identifier that uniquely identifies a running + process on the host machine. + @note Not implemented on Windows or Linux. + @see CNTV2DriverInterface::SetDefaultDeviceForPID + **/ + AJA_VIRTUAL bool IsDefaultDeviceForPID (const int32_t inProcessID) {(void)inProcessID; return false;} + ///@} + + AJA_VIRTUAL bool ReadRP188Registers (const NTV2Channel inChannel, RP188_STRUCT * pRP188Data); + AJA_VIRTUAL std::string GetHostName (void) const; ///< @return String containing the name of the host (if connected to a remote device) or the name of the non-physical device; otherwise an empty string. + AJA_VIRTUAL bool IsRemote (void) const; ///< @return True if I'm connected to a non-local or non-physical device; otherwise false. +#if defined (NTV2_NUB_CLIENT_SUPPORT) + AJA_VIRTUAL inline NTV2NubProtocolVersion GetNubProtocolVersion (void) const {return _pRPCAPI ? _pRPCAPI->NubProtocolVersion() : ntv2NubProtocolVersionNone;} ///< @return My nub protocol version. +#endif + + // DEPRECATED FUNCTIONS +#if !defined (NTV2_DEPRECATE) + AJA_VIRTUAL NTV2_DEPRECATED_f(NTV2BoardType GetCompileFlag (void)); + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool BoardOpened (void) const) {return IsOpen();} +#endif // !NTV2_DEPRECATE +#if !defined(NTV2_DEPRECATE_12_7) + // For devices that support more than one bitfile + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SwitchBitfile (NTV2DeviceID boardID, NTV2BitfileType bitfile)) { (void) boardID; (void) bitfile; return false; } ///< @deprecated This function is obsolete. +#endif +#if !defined(NTV2_DEPRECATE_14_3) + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadRegister (const ULWord inRegNum, ULWord * pOutValue, const ULWord inRegMask = 0xFFFFFFFF, const ULWord inRegShift = 0x0)) + { + return pOutValue ? ReadRegister(inRegNum, *pOutValue, inRegMask, inRegShift) : false; + } + AJA_VIRTUAL bool Open (const UWord inDeviceIndex, const bool inDisplayError, const NTV2DeviceType eDeviceType, const char * pInHostName); +#endif // !defined(NTV2_DEPRECATE_14_3) +#if !defined(NTV2_DEPRECATE_15_0) + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool IsKonaIPDevice(void)) {return IsIPDevice();} ///< @deprecated Call CNTV2Card::IsIPDevice instead. +#endif // !defined(NTV2_DEPRECATE_15_0) +#if !defined(NTV2_DEPRECATE_15_1) + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetOutputTimecodeOffset(ULWord frames)) {return WriteRegister(kVRegOutputTimecodeOffset, frames);} ///< @deprecated Obsolete starting after SDK 15.0. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetOutputTimecodeOffset(ULWord* pFrames)) {return pFrames ? ReadRegister(kVRegOutputTimecodeOffset, *pFrames) : false;} ///< @deprecated Obsolete starting after SDK 15.0. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetOutputTimecodeType(ULWord type)) {return WriteRegister(kVRegOutputTimecodeType, type);} ///< @deprecated Obsolete starting after SDK 15.0. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetOutputTimecodeType(ULWord* pType)) {return pType ? ReadRegister(kVRegOutputTimecodeType, *pType) : false;} ///< @deprecated Obsolete starting after SDK 15.0. +#endif // !defined(NTV2_DEPRECATE_15_1) +#if !defined(NTV2_DEPRECATE_15_6) + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool LockFormat(void)) {return false;} ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool StartDriver(DriverStartPhase phase)) {(void)phase; return false;} ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetUserModeDebugLevel(ULWord level)) {(void)level; return false;} ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetUserModeDebugLevel(ULWord*level)) {(void)level; return false;} ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetKernelModeDebugLevel(ULWord level)) {(void)level; return false;} ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetKernelModeDebugLevel(ULWord* level)) {(void)level; return false;} ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetUserModePingLevel(ULWord level)) {(void)level; return false;} ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetUserModePingLevel(ULWord* level)) {(void)level; return false;} ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetKernelModePingLevel(ULWord level)) {(void)level; return false;} ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetKernelModePingLevel(ULWord* level)) {(void)level; return false;} ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetLatencyTimerValue (ULWord value)) {(void)value; return false;} ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetLatencyTimerValue (ULWord* value)) {(void)value; return false;} ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool SetDebugFilterStrings(const char* inclStr, const char* exclStr)) {(void)inclStr; (void)exclStr; return false;} ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool GetDebugFilterStrings(char* inclStr, char* exclStr)) {(void)inclStr; (void)exclStr; return false;} ///< @deprecated Obsolete starting after SDK 15.5. +#endif // !defined(NTV2_DEPRECATE_15_6) +#if !defined(NTV2_DEPRECATE_16_0) + // SuspendAudio/ResumeAudio were only implemented on MacOS + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool SuspendAudio(void)) {return true;} + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool ResumeAudio(const ULWord inFBSize)) {(void) inFBSize; return true;} + // Memory Mapping/Unmapping + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapFrameBuffers(void)) {return false;} ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool UnmapFrameBuffers(void)) {return true;} ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapRegisters(void)) {return false;} ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool UnmapRegisters(void)) {return true;} ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapXena2Flash(void)) {return false;} ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool UnmapXena2Flash(void)) {return true;} ///< @deprecated Obsolete starting in SDK 16.0. + // Others + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool DmaUnlock(void)) {return false;} ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool CompleteMemoryForDMA(ULWord * pHostBuffer)) {(void)pHostBuffer; return false;} ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool PrepareMemoryForDMA(ULWord * pHostBuffer, const ULWord inNumBytes)) {(void)pHostBuffer; (void)inNumBytes; return false;} ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool GetInterruptCount(const INTERRUPT_ENUMS eInt, ULWord *pCnt)) {return pCnt ? GetInterruptCount(eInt, *pCnt) : false;} ///< @deprecated Use version of this function that accepts a non-const reference. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool ReadRegisterMulti(const ULWord numRegs, ULWord * pOutWhichRegFailed, NTV2RegInfo aRegs[])); ///< @deprecated Use CNTV2DriverInterface::ReadRegisters instead. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(ULWord GetPCISlotNumber(void) const) {return _pciSlot;} ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(Word SleepMs(const LWord msec)); ///< @deprecated Obsolete starting in SDK 16.0. Use AJATime::Sleep instead. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(ULWord GetAudioFrameBufferNumber(void) const) {return GetNumFrameBuffers() - 1;} ///< @deprecated Obsolete starting in SDK 16.0. +#endif // !defined(NTV2_DEPRECATE_16_0) + +#if defined(NTV2_WRITEREG_PROFILING) // Register Write Profiling + /** + @name WriteRegister Profiling + **/ + ///@{ + AJA_VIRTUAL bool GetRecordedRegisterWrites (NTV2RegisterWrites & outRegWrites) const; ///< @brief Answers with the recorded register writes. + AJA_VIRTUAL bool StartRecordRegisterWrites (const bool inSkipActualWrites = false); ///< @brief Starts recording all WriteRegister calls. + AJA_VIRTUAL bool IsRecordingRegisterWrites (void) const; ///< @return True if WriteRegister calls are currently being recorded (and not paused); otherwise false. + AJA_VIRTUAL bool StopRecordRegisterWrites (void); ///< @brief Stops recording all WriteRegister calls. + AJA_VIRTUAL bool PauseRecordRegisterWrites (void); ///< @brief Pauses recording WriteRegister calls. + AJA_VIRTUAL bool ResumeRecordRegisterWrites (void); ///< @brief Resumes recording WriteRegister calls (after a prior call to PauseRecordRegisterWrites). + AJA_VIRTUAL ULWord GetNumRecordedRegisterWrites (void) const; ///< @return The number of recorded WriteRegister calls. + ///@} +#endif // NTV2_WRITEREG_PROFILING // Register Write Profiling + + + // PROTECTED METHODS + protected: +#if !defined(NTV2_DEPRECATE_12_7) + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool DisplayNTV2Error(const char* pInStr)) {(void)pInStr; return false;} ///< @deprecated This function is obsolete. +#endif +#if defined (NTV2_NUB_CLIENT_SUPPORT) + /** + @brief Peforms the housekeeping details of opening the specified local, remote or software device. + @param[in] inURLSpec Specifies the local, remote or software device to be opened. + @result True if successful; otherwise false. + **/ + AJA_VIRTUAL bool OpenRemote (const std::string & inURLSpec); + AJA_VIRTUAL bool CloseRemote (void); ///< @brief Releases host resources associated with the remote/special device connection. +#endif // defined (NTV2_NUB_CLIENT_SUPPORT) + AJA_VIRTUAL bool OpenLocalPhysical (const UWord inDeviceIndex) = 0; ///< @brief Opens the local/physical device connection. + AJA_VIRTUAL bool CloseLocalPhysical (void) = 0; ///< @brief Releases host resources associated with the local/physical device connection. + AJA_VIRTUAL bool ParseFlashHeader (BITFILE_INFO_STRUCT & outBitfileInfo); + + /** + @brief Atomically increments the event count tally for the given interrupt type. + @param[in] eInterruptType Specifies the interrupt type of interest. + **/ + AJA_VIRTUAL void BumpEventCount (const INTERRUPT_ENUMS eInterruptType); + + /** + @brief Initializes my member variables after a successful Open. + **/ + AJA_VIRTUAL void FinishOpen (void); + AJA_VIRTUAL bool ReadFlashULWord (const ULWord inAddress, ULWord & outValue, const ULWord inRetryCount = 1000); + + + // PRIVATE TYPES + protected: + typedef std::vector _EventCounts; + typedef std::vector _EventHandles; + + + // MEMBER DATA + protected: + UWord _boardNumber; ///< @brief My device index number. + NTV2DeviceID _boardID; ///< @brief My cached device ID. + bool _boardOpened; ///< @brief True if I'm open and connected to the device. +#if defined(NTV2_WRITEREG_PROFILING) + bool mRecordRegWrites; ///< @brief True if recording; otherwise false when not recording + bool mSkipRegWrites; ///< @brief True if actual register writes are skipped while recording +#endif // NTV2_WRITEREG_PROFILING + ULWord _programStatus; +#if defined (NTV2_NUB_CLIENT_SUPPORT) + NTV2RPCAPI * _pRPCAPI; ///< @brief Points to remote or software device interface; otherwise NULL for local physical device. +#endif // defined (NTV2_NUB_CLIENT_SUPPORT) + _EventHandles mInterruptEventHandles; ///< @brief For subscribing to each possible event, one for each interrupt type + _EventCounts mEventCounts; ///< @brief My event tallies, one for each interrupt type. Note that these +#if defined(NTV2_WRITEREG_PROFILING) + NTV2RegisterWrites mRegWrites; ///< @brief Stores WriteRegister data + mutable AJALock mRegWritesLock; ///< @brief Guard mutex for mRegWrites +#endif // NTV2_WRITEREG_PROFILING +#if !defined(NTV2_DEPRECATE_16_0) + ULWord * _pFrameBaseAddress; ///< @deprecated Obsolete starting in SDK 16.0. + ULWord * _pRegisterBaseAddress; ///< @deprecated Obsolete starting in SDK 16.0. + ULWord _pRegisterBaseAddressLength;///< @deprecated Obsolete starting in SDK 16.0. + ULWord * _pXena2FlashBaseAddress; ///< @deprecated Obsolete starting in SDK 16.0. + ULWord * _pCh1FrameBaseAddress; ///< @deprecated Obsolete starting in SDK 16.0. + ULWord * _pCh2FrameBaseAddress; ///< @deprecated Obsolete starting in SDK 16.0. +#endif // !defined(NTV2_DEPRECATE_16_0) + ULWord _ulNumFrameBuffers; + ULWord _ulFrameBufferSize; + ULWord _pciSlot; // DEPRECATE! + +}; // CNTV2DriverInterface + +#endif // NTV2DRIVERINTERFACE_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2driverprocamp.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2driverprocamp.h new file mode 100644 index 0000000..f657351 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2driverprocamp.h @@ -0,0 +1,65 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2driverprocamp.h + @brief Declares functions used in the NTV2 device driver. + @copyright (C) 2004-2021 AJA Video Systems, Inc. All rights reserved. +**/ +// ntv2driverprocamp.h +#ifndef NTV2DRIVERPROCAMP_H +#define NTV2DRIVERPROCAMP_H + +#include "ajatypes.h" +#include "ntv2enums.h" +#include "ntv2publicinterface.h" + +// This file is used by the Linux driver which is C, not C++. +#if defined(__CPLUSPLUS__) || defined(__cplusplus) +#else +#define false (0) +#define true (!false) +#endif + +#ifdef AJALinux +#include "ntv2linuxpublicinterface.h" +#endif + +#ifdef AJAMac + #include + #include "ntv2macpublicinterface.h" +#endif + +#ifdef MSWindows +#include "ntv2winpublicinterface.h" +#endif + + +bool SetVirtualProcampRegister( VirtualRegisterNum virtualRegisterNum, + ULWord value, + VirtualProcAmpRegisters *regs); + +bool GetVirtualProcampRegister( VirtualRegisterNum virtualRegisterNum, + ULWord *value, + VirtualProcAmpRegisters *regs); + +#ifndef AJAMac // note: in Mac-land these are methods in MacDriver.h + +bool WriteHardwareProcampRegister( ULWord inDeviceIndex, + NTV2DeviceID deviceID, + VirtualRegisterNum virtualRegisterNum, + ULWord value, + HardwareProcAmpRegisterImage *hwRegImage); + +bool RestoreHardwareProcampRegisters( ULWord inDeviceIndex, + NTV2DeviceID deviceID, + VirtualProcAmpRegisters *regs, + HardwareProcAmpRegisterImage *hwRegImage); + +bool I2CWriteDataSingle(ULWord inDeviceIndex, UByte I2CAddress, UByte I2CData); + +bool I2CWriteDataDoublet( ULWord inDeviceIndex, + UByte I2CAddress1, UByte I2CData1, + UByte I2CAddress2, UByte I2CData2); + +#endif // !AJAMac + +#endif // NTV2DRIVERPROCAMP_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2endian.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2endian.h new file mode 100644 index 0000000..7cc46f6 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2endian.h @@ -0,0 +1,74 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2endian.h + @brief Defines a number of handy byte-swapping macros. + @copyright (C) 2008-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef NTV2ENDIAN_H +#define NTV2ENDIAN_H + +#include "ajatypes.h" + +// unconditional endian byte swap + +#define NTV2EndianSwap16(__val__) \ + ( ((UWord(__val__)<<8) & 0xFF00) | \ + ((UWord(__val__)>>8) & 0x00FF) ) + +#define NTV2EndianSwap32(__val__) \ + ( ((ULWord(__val__)<<24) & 0xFF000000) | \ + ((ULWord(__val__)<< 8) & 0x00FF0000) | \ + ((ULWord(__val__)>> 8) & 0x0000FF00) | \ + ((ULWord(__val__)>>24) & 0x000000FF) ) + +#define NTV2EndianSwap64(__val__) \ + ( ((ULWord64(__val__)<<56) & 0xFF00000000000000ULL) | \ + ((ULWord64(__val__)<<40) & 0x00FF000000000000ULL) | \ + ((ULWord64(__val__)<<24) & 0x0000FF0000000000ULL) | \ + ((ULWord64(__val__)<< 8) & 0x000000FF00000000ULL) | \ + ((ULWord64(__val__)>> 8) & 0x00000000FF000000ULL) | \ + ((ULWord64(__val__)>>24) & 0x0000000000FF0000ULL) | \ + ((ULWord64(__val__)>>40) & 0x000000000000FF00ULL) | \ + ((ULWord64(__val__)>>56) & 0x00000000000000FFULL) ) + + +#if AJATargetBigEndian // BigEndian (BE) target host + + // BigEndian-to-host (NetworkByteOrder-to-host) (native) + #define NTV2EndianSwap16BtoH(__val__) (__val__) + #define NTV2EndianSwap16HtoB(__val__) (__val__) + #define NTV2EndianSwap32BtoH(__val__) (__val__) + #define NTV2EndianSwap32HtoB(__val__) (__val__) + #define NTV2EndianSwap64BtoH(__val__) (__val__) + #define NTV2EndianSwap64HtoB(__val__) (__val__) + + // LittleEndian-to-host (translate) + #define NTV2EndianSwap16LtoH(__val__) NTV2EndianSwap16(__val__) + #define NTV2EndianSwap16HtoL(__val__) NTV2EndianSwap16(__val__) + #define NTV2EndianSwap32LtoH(__val__) NTV2EndianSwap32(__val__) + #define NTV2EndianSwap32HtoL(__val__) NTV2EndianSwap32(__val__) + #define NTV2EndianSwap64LtoH(__val__) NTV2EndianSwap64(__val__) + #define NTV2EndianSwap64HtoL(__val__) NTV2EndianSwap64(__val__) + +#else // LittleEndian (LE) target host + + // BigEndian-to-host (NetworkByteOrder-to-host) (translate) + #define NTV2EndianSwap16BtoH(__val__) NTV2EndianSwap16(__val__) + #define NTV2EndianSwap16HtoB(__val__) NTV2EndianSwap16(__val__) + #define NTV2EndianSwap32BtoH(__val__) NTV2EndianSwap32(__val__) + #define NTV2EndianSwap32HtoB(__val__) NTV2EndianSwap32(__val__) + #define NTV2EndianSwap64BtoH(__val__) NTV2EndianSwap64(__val__) + #define NTV2EndianSwap64HtoB(__val__) NTV2EndianSwap64(__val__) + + // LittleEndian-to-host (native) + #define NTV2EndianSwap16LtoH(__val__) (__val__) + #define NTV2EndianSwap16HtoL(__val__) (__val__) + #define NTV2EndianSwap32LtoH(__val__) (__val__) + #define NTV2EndianSwap32HtoL(__val__) (__val__) + #define NTV2EndianSwap64LtoH(__val__) (__val__) + #define NTV2EndianSwap64HtoL(__val__) (__val__) + +#endif + +#endif // NTV2ENDIAN_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2enhancedcsc.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2enhancedcsc.h new file mode 100644 index 0000000..49ee170 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2enhancedcsc.h @@ -0,0 +1,139 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2enhancedcsc.h + @brief Declares the CNTV2EnhancedCSC class. + @copyright (C) 2015-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2_ENHANCED_CSC_H +#define NTV2_ENHANCED_CSC_H + +#include "ajaexport.h" +#include "ntv2card.h" +#include "ntv2cscmatrix.h" + +typedef enum +{ + NTV2_Enhanced_CSC_Pixel_Format_RGB444, + NTV2_Enhanced_CSC_Pixel_Format_YCbCr444, + NTV2_Enhanced_CSC_Pixel_Format_YCbCr422, + + NTV2_Enhanced_CSC_Num_Pixel_Formats +} NTV2EnhancedCSCPixelFormat; + + +typedef enum +{ + NTV2_Enhanced_CSC_Chroma_Filter_Select_Full, + NTV2_Enhanced_CSC_Chroma_Filter_Select_Simple, + NTV2_Enhanced_CSC_Chroma_Filter_Select_None, + + NTV2_Enhanced_CSC_Num_Chroma_Filter_Selects +} NTV2EnhancedCSCChromaFilterSelect; + + +typedef enum +{ + NTV2_Enhanced_CSC_Chroma_Edge_Control_Black, + NTV2_Enhanced_CSC_Chroma_Edge_Control_Extended, + + NTV2_Enhanced_CSC_Num_Chroma_Edge_Controls +} NTV2EnhancedCSCChromaEdgeControl; + + +typedef enum +{ + NTV2_Enhanced_CSC_Key_Source_Key_Input, + NTV2_Enhanced_CSC_Key_Spurce_A0_Input, + + NTV2_Enhanced_CSC_Num_Key_Sources +} NTV2EnhancedCSCKeySource; + + +typedef enum +{ + NTV2_Enhanced_CSC_Key_Output_Range_Full, + NTV2_Enhanced_CSC_Key_Output_Range_SMPTE, + + NTV2_Enhanced_CSC_Num_Key_Output_Ranges +} NTV2EnhancedCSCKeyOutputRange; + + +/** + @brief This class controls the enhanced color space converter. +**/ +class AJAExport CNTV2EnhancedCSC +{ +// Class Methods +public: + // Construction, Copying, Assigning + #if defined (NTV2_DEPRECATE) + explicit CNTV2EnhancedCSC () { }; + #else + explicit CNTV2EnhancedCSC (CNTV2Card & inCard) + : mDevice (inCard) { }; + #endif + + virtual inline ~CNTV2EnhancedCSC () { } + + +// Instance Methods +public: + inline CNTV2CSCMatrix & Matrix (void) {return mMatrix;} + inline const CNTV2CSCMatrix & Matrix (void) const {return mMatrix;} + + bool SetInputPixelFormat (const NTV2EnhancedCSCPixelFormat inPixelFormat); + inline NTV2EnhancedCSCPixelFormat GetInputPixelFormat (void) const {return mInputPixelFormat;} + + bool SetOutputPixelFormat (const NTV2EnhancedCSCPixelFormat inPixelFormat); + inline NTV2EnhancedCSCPixelFormat GetOutputPixelFormat (void) const {return mOutputPixelFormat;} + + bool SetChromaFilterSelect (const NTV2EnhancedCSCChromaFilterSelect inChromaFilterSelect); + inline NTV2EnhancedCSCChromaFilterSelect GetChromaFilterSelect (void) const {return mChromaFilterSelect;} + + bool SetChromaEdgeControl (const NTV2EnhancedCSCChromaEdgeControl inChromaEdgeControl); + inline NTV2EnhancedCSCChromaEdgeControl GetChromaEdgeControl (void) const {return mChromaEdgeControl;} + + bool SetKeySource (const NTV2EnhancedCSCKeySource inKeySource); + inline NTV2EnhancedCSCKeySource GetKeySource (void) const {return mKeySource;} + + bool SetKeyOutputRange (const NTV2EnhancedCSCKeyOutputRange inKeyOutputRange); + inline NTV2EnhancedCSCKeyOutputRange GetKeyOutputRange (void) const {return mKeyOutputRange;} + + bool SetKeyInputOffset (const int16_t inKeyInputOffset); + inline int16_t GetKeyInputOffset (void) const {return mKeyInputOffset;} + + bool SetKeyOutputOffset (const uint16_t inKeyOutputOffset); + inline uint16_t GetKeyOutputOffset (void) const {return mKeyOutputOffset;} + + bool SetKeyGain (const double inKeyGain); + inline double GetKeyGain (void) const {return mKeyGain;} + + bool SendToHardware (CNTV2Card & inDevice, const NTV2Channel inChannel) const; + bool GetFromHardware (CNTV2Card & inDevice, const NTV2Channel inChannel); + #if !defined (NTV2_DEPRECATE) + inline bool SendToHardware (const NTV2Channel inChannel) {return SendToHardware (mDevice, inChannel);} + inline bool GetFromHardware (const NTV2Channel inChannel) {return GetFromHardware (mDevice, inChannel);} + #endif // !defined (NTV2_DEPRECATE) + +// Instance Data +private: + NTV2EnhancedCSCPixelFormat mInputPixelFormat; + NTV2EnhancedCSCPixelFormat mOutputPixelFormat; + NTV2EnhancedCSCChromaFilterSelect mChromaFilterSelect; + NTV2EnhancedCSCChromaEdgeControl mChromaEdgeControl; + NTV2EnhancedCSCKeySource mKeySource; + NTV2EnhancedCSCKeyOutputRange mKeyOutputRange; + int16_t mKeyInputOffset; + uint16_t mKeyOutputOffset; + double mKeyGain; + CNTV2CSCMatrix mMatrix; + #if !defined (NTV2_DEPRECATE) + CNTV2Card & mDevice; + #endif // !defined (NTV2_DEPRECATE) + +}; // CNTV2EnhancedCSC + + +#endif // NTV2_ENHANCED_CSC_H + diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2enums.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2enums.h new file mode 100644 index 0000000..52dfd0f --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2enums.h @@ -0,0 +1,5148 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2enums.h + @brief Enumerations for controlling NTV2 devices. + @copyright (C) 2013-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef NTV2ENUMS_H +#define NTV2ENUMS_H + +#include "ajatypes.h" // Defines NTV2_DEPRECATE (or not) + + + +/** + SDK VERSION + The next several macro values are patched when the SDK is built by AJA. +**/ +#if defined (AJA_BUILDING_CMAKE) +// NOTE: Enabling the CMake variable "AJA_BUILDING_CMAKE" will generate an +// include file "includes/version.h" in the CMake build directory for ajantv2. +// The contents of this file are populated by CMake, using the ajantv2/includes/version.h.in +// file as a template. CMake will enable the preprocessor define "BUILDING_CMAKE" so that +// version.h is included here at build time. +#include "includes/version.h" +#else +#define AJA_NTV2_SDK_VERSION_MAJOR 16 ///< @brief The SDK major version number, an unsigned decimal integer. +#define AJA_NTV2_SDK_VERSION_MINOR 2 ///< @brief The SDK minor version number, an unsigned decimal integer. +#define AJA_NTV2_SDK_VERSION_POINT 0 ///< @brief The SDK "point" release version, an unsigned decimal integer. +#define AJA_NTV2_SDK_BUILD_NUMBER 3 ///< @brief The SDK build number, an unsigned decimal integer. +#define AJA_NTV2_SDK_BUILD_DATETIME "Wed Feb 02 21:58:01 UTC 2022" ///< @brief The date and time the SDK was built, in this format: "MM/DD/YYYY +8:hh:mm:ss" +#define AJA_NTV2_SDK_BUILD_TYPE "" ///< @brief The SDK build type, where "a"=alpha, "b"=beta, "d"=development, ""=release. +#endif + +#define AJA_NTV2_SDK_VERSION ((AJA_NTV2_SDK_VERSION_MAJOR << 24) | (AJA_NTV2_SDK_VERSION_MINOR << 16) | (AJA_NTV2_SDK_VERSION_POINT << 8) | (AJA_NTV2_SDK_BUILD_NUMBER)) +#define AJA_NTV2_SDK_VERSION_AT_LEAST(__a__,__b__) (AJA_NTV2_SDK_VERSION >= (((__a__) << 24) | ((__b__) << 16))) +#define AJA_NTV2_SDK_VERSION_BEFORE(__a__,__b__) (AJA_NTV2_SDK_VERSION < (((__a__) << 24) | ((__b__) << 16))) + + +#if !defined(NTV2_DEPRECATE_14_3) +typedef enum +{ + DEVICETYPE_UNKNOWN=0, + DEVICETYPE_NTV2=256, + DEVICETYPE_MAX=256 + #if !defined (NTV2_DEPRECATE) + ,BOARDTYPE_UNKNOWN = DEVICETYPE_UNKNOWN, + BOARDTYPE_NTV2 = DEVICETYPE_NTV2, + BOARDTYPE_MAX = DEVICETYPE_MAX + #endif // !defined (NTV2_DEPRECATE) +} NTV2DeviceType; ///< @deprecated Obsolete. +#endif // !defined(NTV2_DEPRECATE_14_3) + + +#if !defined (NTV2_DEPRECATE) + typedef NTV2DeviceType NTV2BoardType; + #define BOARDTYPE_SCANNABLE (BOARDTYPE_NTV2) + #define BOARDTYPE_AS_COMPILED (DEVICETYPE_NTV2) +#endif + + +/** + @brief Identifies a specific AJA NTV2 device model number. + The NTV2DeviceID is actually the PROM part number for a given device. + They are used to determine the feature set of the device, and which firmware to flash. +**/ +typedef enum +{ + DEVICE_ID_CORVID1 = 0x10244800, ///< @brief See \ref corvid1corvid3g + DEVICE_ID_CORVID22 = 0x10293000, ///< @brief See \ref corvid22 + DEVICE_ID_CORVID24 = 0x10402100, ///< @brief See \ref corvid24 + DEVICE_ID_CORVID3G = 0x10294900, ///< @brief See \ref corvid1corvid3g + DEVICE_ID_CORVID44 = 0x10565400, ///< @brief See \ref corvid44 + DEVICE_ID_CORVID44_8KMK = 0x10832400, ///< @brief See \ref corvid4412g + DEVICE_ID_CORVID44_8K = 0X10832401, ///< @brief See \ref corvid4412g + DEVICE_ID_CORVID44_2X4K = 0X10832402, ///< @brief See \ref corvid4412g + DEVICE_ID_CORVID44_PLNR = 0X10832403, ///< @brief See \ref corvid4412g + DEVICE_ID_CORVID88 = 0x10538200, ///< @brief See \ref corvid88 + DEVICE_ID_CORVIDHBR = 0x10668200, ///< @brief See \ref corvidhbr + DEVICE_ID_CORVIDHEVC = 0x10634500, ///< @brief See \ref corvidhevc + DEVICE_ID_IO4K = 0x10478300, ///< @brief See \ref io4kquad + DEVICE_ID_IO4KPLUS = 0x10710800, ///< @brief See \ref io4kplus + DEVICE_ID_IO4KUFC = 0x10478350, ///< @brief See \ref io4kufc + DEVICE_ID_IOEXPRESS = 0x10280300, ///< @brief See \ref ioexpress + DEVICE_ID_IOIP_2022 = 0x10710850, ///< @brief See \ref ioip + DEVICE_ID_IOIP_2110 = 0x10710851, ///< @brief See \ref ioip + DEVICE_ID_IOIP_2110_RGB12 = 0x10710852, ///< @brief See \ref ioip + DEVICE_ID_IOX3 = 0x10920600, ///< @brief See \ref iox3 + DEVICE_ID_IOXT = 0x10378800, ///< @brief See \ref ioxt + DEVICE_ID_KONA1 = 0x10756600, ///< @brief See \ref kona1 + DEVICE_ID_KONA3G = 0x10294700, ///< @brief See \ref kona3gufc + DEVICE_ID_KONA3GQUAD = 0x10322950, ///< @brief See \ref kona3gquad + DEVICE_ID_KONA4 = 0x10518400, ///< @brief See \ref kona4quad + DEVICE_ID_KONA4UFC = 0x10518450, ///< @brief See \ref kona4ufc + DEVICE_ID_KONA5 = 0x10798400, ///< @brief See \ref kona5 + DEVICE_ID_KONA5_8KMK = 0x10798401, ///< @brief See \ref kona5 + DEVICE_ID_KONA5_8K = 0x10798402, ///< @brief See \ref kona5 + DEVICE_ID_KONA5_2X4K = 0x10798403, ///< @brief See \ref kona5 + DEVICE_ID_KONA5_3DLUT = 0x10798404, ///< @brief See \ref kona5 + DEVICE_ID_KONA5_OE1 = 0x10798405, ///< @brief See \ref kona5 + DEVICE_ID_KONA5_OE2 = 0x10798406, ///< @brief See \ref kona5 + DEVICE_ID_KONA5_OE3 = 0x10798407, ///< @brief See \ref kona5 + DEVICE_ID_KONA5_OE4 = 0x10798408, ///< @brief See \ref kona5 + DEVICE_ID_KONA5_OE5 = 0x10798409, ///< @brief See \ref kona5 + DEVICE_ID_KONA5_OE6 = 0x1079840A, ///< @brief See \ref kona5 + DEVICE_ID_KONA5_OE7 = 0x1079840B, ///< @brief See \ref kona5 + DEVICE_ID_KONA5_OE8 = 0x1079840C, ///< @brief See \ref kona5 + DEVICE_ID_KONA5_OE9 = 0x1079840D, ///< @brief See \ref kona5 + DEVICE_ID_KONA5_OE10 = 0x1079840E, ///< @brief See \ref kona5 + DEVICE_ID_KONA5_OE11 = 0x1079840F, ///< @brief See \ref kona5 + DEVICE_ID_KONA5_OE12 = 0x10798410, ///< @brief See \ref kona5 + DEVICE_ID_KONA5_8K_MV_TX = 0x10798420, ///< @brief See \ref kona5 + DEVICE_ID_SOJI_3DLUT = 0x10922400, + DEVICE_ID_SOJI_OE1 = 0x10922401, + DEVICE_ID_SOJI_OE2 = 0x10922402, + DEVICE_ID_SOJI_OE3 = 0x10922403, + DEVICE_ID_SOJI_OE4 = 0x10922404, + DEVICE_ID_SOJI_OE5 = 0x10922405, + DEVICE_ID_SOJI_OE6 = 0x10922406, + DEVICE_ID_SOJI_OE7 = 0x10922407, + DEVICE_ID_KONAHDMI = 0x10767400, ///< @brief See \ref konahdmi + DEVICE_ID_KONAIP_1RX_1TX_1SFP_J2K = 0x10646702, ///< @brief See \ref konaip + DEVICE_ID_KONAIP_1RX_1TX_2110 = 0x10646705, ///< @brief See \ref konaip + DEVICE_ID_KONAIP_2022 = 0x10646700, ///< @brief See \ref konaip + DEVICE_ID_KONAIP_2110 = 0x10646706, ///< @brief See \ref konaip + DEVICE_ID_KONAIP_2110_RGB12 = 0x10646707, ///< @brief See \ref konaip + DEVICE_ID_KONAIP_2TX_1SFP_J2K = 0x10646703, ///< @brief See \ref konaip + DEVICE_ID_KONAIP_4CH_2SFP = 0x10646701, ///< @brief See \ref konaip + DEVICE_ID_KONALHEPLUS = 0x10352300, ///< @brief See \ref konalheplus + DEVICE_ID_KONALHI = 0x10266400, ///< @brief See \ref konalhi + DEVICE_ID_KONALHIDVI = 0x10266401, ///< @brief See \ref konalhi + DEVICE_ID_TTAP = 0x10416000, ///< @brief See \ref ttap + DEVICE_ID_TTAP_PRO = 0x10879000, ///< @brief See \ref ttappro +#if !defined (NTV2_DEPRECATE_12_6) + DEVICE_ID_CORVIDHDBT = DEVICE_ID_CORVIDHBR, ///< @deprecated Use ::DEVICE_ID_CORVIDHBR instead. +#endif // NTV2_DEPRECATE_12_6 +#if !defined (NTV2_DEPRECATE_14_0) + DEVICE_ID_LHE_PLUS = DEVICE_ID_KONALHEPLUS, ///< @deprecated Use ::DEVICE_ID_KONALHEPLUS instead. + DEVICE_ID_LHI = DEVICE_ID_KONALHI, ///< @deprecated Use ::DEVICE_ID_KONALHI instead. + DEVICE_ID_LHI_DVI = DEVICE_ID_KONALHIDVI, ///< @deprecated Use ::DEVICE_ID_KONALHIDVI instead. + DEVICE_ID_KONAIP22 = DEVICE_ID_KONAIP_2022, ///< @deprecated Use ::DEVICE_ID_KONAIP_2022 instead. + DEVICE_ID_KONAIP4I = DEVICE_ID_KONAIP_4CH_2SFP, ///< @deprecated Use ::DEVICE_ID_KONAIP_4CH_2SFP instead. + DEVICE_ID_KONAIP_2IN_2OUT = DEVICE_ID_KONAIP_2022, ///< @deprecated Use ::DEVICE_ID_KONAIP_2022 instead. + DEVICE_ID_KONAIP_4I = DEVICE_ID_KONAIP_4CH_2SFP, ///< @deprecated Use ::DEVICE_ID_KONAIP_4CH_2SFP instead. +#endif // NTV2_DEPRECATE_14_0 + DEVICE_ID_NOTFOUND = 0xFFFFFFFF, ///< @brief Invalid or "not found" + DEVICE_ID_INVALID = DEVICE_ID_NOTFOUND + +} NTV2DeviceID; + +#define DEVICE_ID_CORVID44_12G DEVICE_ID_CORVID44_8KMK +#define DEVICE_ID_KONA5_4X12G DEVICE_ID_KONA5_8K + +#define DEVICE_IS_KONA5_OE(__d__) \ + ( (__d__) == DEVICE_ID_KONA5_OE1 || \ + (__d__) == DEVICE_ID_KONA5_OE2 || \ + (__d__) == DEVICE_ID_KONA5_OE3 || \ + (__d__) == DEVICE_ID_KONA5_OE4 || \ + (__d__) == DEVICE_ID_KONA5_OE5 || \ + (__d__) == DEVICE_ID_KONA5_OE6 || \ + (__d__) == DEVICE_ID_KONA5_OE7 || \ + (__d__) == DEVICE_ID_KONA5_OE8 || \ + (__d__) == DEVICE_ID_KONA5_OE9 || \ + (__d__) == DEVICE_ID_KONA5_OE10 || \ + (__d__) == DEVICE_ID_KONA5_OE11 || \ + (__d__) == DEVICE_ID_KONA5_OE12) + +#define DEVICE_IS_SOJI(__d__) \ + ( (__d__) == DEVICE_ID_SOJI_3DLUT|| \ + (__d__) == DEVICE_ID_SOJI_OE1 || \ + (__d__) == DEVICE_ID_SOJI_OE2 || \ + (__d__) == DEVICE_ID_SOJI_OE3 || \ + (__d__) == DEVICE_ID_SOJI_OE4 || \ + (__d__) == DEVICE_ID_SOJI_OE5 || \ + (__d__) == DEVICE_ID_SOJI_OE6 || \ + (__d__) == DEVICE_ID_SOJI_OE7) + +#if !defined (NTV2_DEPRECATE) + typedef NTV2DeviceID NTV2BoardID; ///< @deprecated Use NTV2DeviceID instead. Identifiers with "board" in them are being phased out. + + typedef enum + { + BOARDSUBTYPE_AES, ///< @deprecated Obsolete. + BOARDSUBTYPE_22, ///< @deprecated Obsolete. + BOARDSUBTYPE_NONE ///< @deprecated Obsolete. + } NTV2BoardSubType; ///< @deprecated This is obsolete. +#endif // !defined (NTV2_DEPRECATE) + +#define NTV2_DEVICE_SUPPORTS_SMPTE2110(__d__) ( (__d__) == DEVICE_ID_KONAIP_2110 \ + || (__d__) == DEVICE_ID_KONAIP_2110_RGB12 \ + || (__d__) == DEVICE_ID_KONAIP_1RX_1TX_2110 \ + || (__d__) == DEVICE_ID_IOIP_2110 \ + || (__d__) == DEVICE_ID_IOIP_2110_RGB12 ) + +#define NTV2_DEVICE_SUPPORTS_SMPTE2022(__d__) ( (__d__) == DEVICE_ID_KONAIP_2022 \ + || (__d__) == DEVICE_ID_IOIP_2022 ) + + +/** + @brief Identifies a particular video standard. +**/ +typedef enum +{ + NTV2_STANDARD_1080, ///< @brief Identifies SMPTE HD 1080i or 1080psf + NTV2_STANDARD_720, ///< @brief Identifies SMPTE HD 720p + NTV2_STANDARD_525, ///< @brief Identifies SMPTE SD 525i + NTV2_STANDARD_625, ///< @brief Identifies SMPTE SD 625i + NTV2_STANDARD_1080p, ///< @brief Identifies SMPTE HD 1080p + NTV2_STANDARD_2K, ///< @deprecated Identifies SMPTE HD 2048x1556psf (1.35 full-aperture film, obsolete in SDK 15.0 and later) + NTV2_STANDARD_2Kx1080p, ///< @brief Identifies SMPTE HD 2K1080p + NTV2_STANDARD_2Kx1080i, ///< @brief Identifies SMPTE HD 2K1080psf + NTV2_STANDARD_3840x2160p, ///< @brief Identifies Ultra-High-Definition (UHD) + NTV2_STANDARD_4096x2160p, ///< @brief Identifies 4K + NTV2_STANDARD_3840HFR, ///< @brief Identifies high frame-rate UHD + NTV2_STANDARD_4096HFR, ///< @brief Identifies high frame-rate 4K + NTV2_STANDARD_7680, ///< @brief Identifies UHD2 + NTV2_STANDARD_8192, ///< @brief Identifies 8K + NTV2_STANDARD_3840i, ///< @brief Identifies Ultra-High-Definition (UHD) psf + NTV2_STANDARD_4096i, ///< @brief Identifies 4K psf + NTV2_NUM_STANDARDS, + NTV2_STANDARD_UNDEFINED = NTV2_NUM_STANDARDS, + NTV2_STANDARD_INVALID = NTV2_NUM_STANDARDS +#if !defined (NTV2_DEPRECATE) + , + NTV2_V2_STANDARD_1080 = NTV2_STANDARD_1080, ///< @deprecated Use NTV2_STANDARD_1080 instead. + NTV2_V2_STANDARD_720 = NTV2_STANDARD_720, ///< @deprecated Use NTV2_STANDARD_720 instead. + NTV2_V2_STANDARD_525 = NTV2_STANDARD_525, ///< @deprecated Use NTV2_STANDARD_525 instead. + NTV2_V2_STANDARD_625 = NTV2_STANDARD_625, ///< @deprecated Use NTV2_STANDARD_625 instead. + NTV2_V2_STANDARD_1080p = NTV2_STANDARD_1080p, ///< @deprecated Use NTV2_STANDARD_1080p instead. + NTV2_V2_STANDARD_2K = NTV2_STANDARD_2K, ///< @deprecated Use NTV2_STANDARD_2K instead. + NTV2_V2_STANDARD_2Kx1080p = NTV2_STANDARD_2Kx1080p, ///< @deprecated Use NTV2_STANDARD_2Kx1080p instead. + NTV2_V2_STANDARD_2Kx1080i = NTV2_STANDARD_2Kx1080i, ///< @deprecated Use NTV2_STANDARD_2Kx1080i instead. + NTV2_V2_STANDARD_3840x2160p = NTV2_STANDARD_3840x2160p, ///< @deprecated Use NTV2_STANDARD_3840x2160p instead. + NTV2_V2_STANDARD_4096x2160p = NTV2_STANDARD_4096x2160p, ///< @deprecated Use NTV2_STANDARD_4096x2160p instead. + NTV2_V2_STANDARD_3840HFR = NTV2_STANDARD_3840HFR, ///< @deprecated Use NTV2_STANDARD_3840HFR instead. + NTV2_V2_STANDARD_4096HFR = NTV2_STANDARD_4096HFR, ///< @deprecated Use NTV2_STANDARD_4096HFR instead. + NTV2_V2_NUM_STANDARDS = NTV2_NUM_STANDARDS, ///< @deprecated Use NTV2_NUM_STANDARDS instead. + NTV2_V2_STANDARD_UNDEFINED = NTV2_STANDARD_UNDEFINED, ///< @deprecated Use NTV2_STANDARD_UNDEFINED instead. + NTV2_V2_STANDARD_INVALID = NTV2_STANDARD_INVALID ///< @deprecated Use NTV2_STANDARD_INVALID instead. +#endif // !defined (NTV2_DEPRECATE) +} NTV2Standard; + +#define NTV2_IS_VALID_STANDARD(__s__) ((__s__) >= NTV2_STANDARD_1080 && (__s__) < NTV2_STANDARD_UNDEFINED) +#define NTV2_IS_PROGRESSIVE_STANDARD(__s__) ( (__s__) == NTV2_STANDARD_1080p \ + || (__s__) == NTV2_STANDARD_720 \ + || (__s__) == NTV2_STANDARD_2Kx1080p \ + || (__s__) == NTV2_STANDARD_3840x2160p \ + || (__s__) == NTV2_STANDARD_4096x2160p \ + || (__s__) == NTV2_STANDARD_3840HFR \ + || (__s__) == NTV2_STANDARD_4096HFR \ + || (__s__) == NTV2_STANDARD_7680 \ + || (__s__) == NTV2_STANDARD_8192 ) +#define NTV2_IS_SD_STANDARD(__s__) ((__s__) == NTV2_STANDARD_525 || (__s__) == NTV2_STANDARD_625) +#define NTV2_IS_UHD_STANDARD(__s__) ((__s__) == NTV2_STANDARD_3840x2160p \ + || (__s__) == NTV2_STANDARD_3840HFR \ + || (__s__) == NTV2_STANDARD_3840i) +#define NTV2_IS_4K_STANDARD(__s__) ((__s__) == NTV2_STANDARD_4096x2160p \ + || (__s__) == NTV2_STANDARD_4096HFR \ + || (__s__) == NTV2_STANDARD_4096i) +#define NTV2_IS_QUAD_STANDARD(__s__) (NTV2_IS_UHD_STANDARD(__s__) || NTV2_IS_4K_STANDARD(__s__)) +#define NTV2_IS_2K1080_STANDARD(__s__) ((__s__) == NTV2_STANDARD_2Kx1080p || (__s__) == NTV2_STANDARD_2Kx1080i) +#define NTV2_IS_UHD2_STANDARD(__s__) ((__s__) == NTV2_STANDARD_7680) +#define NTV2_IS_8K_STANDARD(__s__) ((__s__) == NTV2_STANDARD_8192) +#define NTV2_IS_QUAD_QUAD_STANDARD(__s__) (NTV2_IS_UHD2_STANDARD(__s__) || NTV2_IS_8K_STANDARD(__s__)) +#define NTV2_IS_HFR_STANDARD(__s__) (NTV2_STANDARD_3840HFR == (__s__) || NTV2_STANDARD_4096HFR == (__s__)) + +#if !defined (NTV2_DEPRECATE) + typedef NTV2Standard NTV2V2Standard; ///< @deprecated Use NTV2Standard instead. + #define IS_PROGRESSIVE_NTV2Standard NTV2_IS_PROGRESSIVE_STANDARD + #define IS_PROGRESSIVE_STANDARD NTV2_IS_PROGRESSIVE_STANDARD + #define NTV2_IS_VALID_NTV2Standard NTV2_IS_VALID_STANDARD + #define NTV2_IS_VALID_NTV2V2Standard NTV2_IS_VALID_STANDARD +#endif // !defined (NTV2_DEPRECATE) + + +/** + @brief Identifies a particular video frame buffer format. See \ref devicefbformats for details. +**/ +typedef enum +{ + NTV2_FBF_FIRST = 0 + ,NTV2_FBF_10BIT_YCBCR = NTV2_FBF_FIRST ///< @brief See \ref fbformat10bitycbcr + ,NTV2_FBF_8BIT_YCBCR ///< @brief See \ref fbformat8bitycbcr + ,NTV2_FBF_ARGB ///< @brief See \ref fbformats8bitrgb + ,NTV2_FBF_RGBA ///< @brief See \ref fbformats8bitrgb + ,NTV2_FBF_10BIT_RGB ///< @brief See \ref fbformats10bitrgb + ,NTV2_FBF_8BIT_YCBCR_YUY2 ///< @brief See \ref fbformatsyuy2 + ,NTV2_FBF_ABGR ///< @brief See \ref fbformats8bitrgb + ,NTV2_FBF_LAST_SD_FBF = NTV2_FBF_ABGR + ,NTV2_FBF_10BIT_DPX ///< @brief See \ref fbformats10bitrgbdpx + ,NTV2_FBF_10BIT_YCBCR_DPX ///< @brief See \ref fbformats10bitycbcrdpx + ,NTV2_FBF_8BIT_DVCPRO ///< @brief See \ref fbformats8bitdvcpro + ,NTV2_FBF_8BIT_YCBCR_420PL3 ///< @brief See \ref fbformats8bitycbcrplanar3 + ,NTV2_FBF_8BIT_HDV ///< @brief See \ref fbformats8bithdv + ,NTV2_FBF_24BIT_RGB ///< @brief See \ref fbformats24bitrgb + ,NTV2_FBF_24BIT_BGR ///< @brief See \ref fbformats24bitbgr + ,NTV2_FBF_10BIT_YCBCRA ///< @brief 10-Bit YCbCrA + ,NTV2_FBF_10BIT_DPX_LE ///< @brief 10-Bit DPX Little-Endian + ,NTV2_FBF_48BIT_RGB ///< @brief See \ref fbformats48bitrgb + ,NTV2_FBF_12BIT_RGB_PACKED ///< @brief See \ref fbformats12bitpackedrgb + ,NTV2_FBF_PRORES_DVCPRO ///< @brief Apple ProRes DVC Pro + ,NTV2_FBF_PRORES_HDV ///< @brief Apple ProRes HDV + ,NTV2_FBF_10BIT_RGB_PACKED ///< @brief 10-Bit Packed RGB + ,NTV2_FBF_10BIT_ARGB ///< @brief 10-Bit ARGB + ,NTV2_FBF_16BIT_ARGB ///< @brief 16-Bit ARGB + ,NTV2_FBF_8BIT_YCBCR_422PL3 ///< @brief See \ref fbformats8bitycbcr422pl3 + ,NTV2_FBF_10BIT_RAW_RGB ///< @brief 10-Bit Raw RGB + ,NTV2_FBF_10BIT_RAW_YCBCR ///< @brief See \ref fbformats10bitcion + ,NTV2_FBF_10BIT_YCBCR_420PL3_LE ///< @brief See \ref fbformats10bitycbcr420pl3 + ,NTV2_FBF_10BIT_YCBCR_422PL3_LE ///< @brief See \ref fbformats10bitycbcr422pl3 + ,NTV2_FBF_10BIT_YCBCR_420PL2 ///< @brief 10-Bit 4:2:0 2-Plane YCbCr + ,NTV2_FBF_10BIT_YCBCR_422PL2 ///< @brief 10-Bit 4:2:2 2-Plane YCbCr + ,NTV2_FBF_8BIT_YCBCR_420PL2 ///< @brief 8-Bit 4:2:0 2-Plane YCbCr + ,NTV2_FBF_8BIT_YCBCR_422PL2 ///< @brief 8-Bit 4:2:2 2-Plane YCbCr + ,NTV2_FBF_LAST + ,NTV2_FBF_NUMFRAMEBUFFERFORMATS = NTV2_FBF_LAST + ,NTV2_FBF_INVALID = NTV2_FBF_NUMFRAMEBUFFERFORMATS +} NTV2FrameBufferFormat; + +#if !defined(NTV2_DEPRECATE_14_0) + NTV2_DEPRECATED_vi(const NTV2FrameBufferFormat NTV2_FBF_8BIT_QREZ, NTV2_FBF_8BIT_YCBCR_420PL3); ///< @deprecated Use NTV2_FBF_8BIT_YCBCR_420PL3 instead. + NTV2_DEPRECATED_vi(const NTV2FrameBufferFormat NTV2_FBF_10BIT_DPX_LITTLEENDIAN, NTV2_FBF_10BIT_DPX_LE); ///< @deprecated Use NTV2_FBF_10BIT_DPX_LE instead. + NTV2_DEPRECATED_vi(const NTV2FrameBufferFormat NTV2_FBF_UNUSED_23, NTV2_FBF_8BIT_YCBCR_422PL3); ///< @deprecated Use NTV2_FBF_8BIT_YCBCR_422PL3 instead. + NTV2_DEPRECATED_vi(const NTV2FrameBufferFormat NTV2_FBF_UNUSED_26, NTV2_FBF_10BIT_YCBCR_420PL3_LE); ///< @deprecated Use NTV2_FBF_10BIT_YCBCR_420PL3_LE instead. + NTV2_DEPRECATED_vi(const NTV2FrameBufferFormat NTV2_FBF_UNUSED_27, NTV2_FBF_10BIT_YCBCR_422PL3_LE); ///< @deprecated Use NTV2_FBF_10BIT_YCBCR_422PL3_LE instead. + NTV2_DEPRECATED_vi(const NTV2FrameBufferFormat NTV2_FBF_10BIT_YCBCR_420PL, NTV2_FBF_10BIT_YCBCR_420PL2); ///< @deprecated Use NTV2_FBF_10BIT_YCBCR_420PL2 instead. + NTV2_DEPRECATED_vi(const NTV2FrameBufferFormat NTV2_FBF_10BIT_YCBCR_422PL, NTV2_FBF_10BIT_YCBCR_422PL2); ///< @deprecated Use NTV2_FBF_10BIT_YCBCR_422PL2 instead. + NTV2_DEPRECATED_vi(const NTV2FrameBufferFormat NTV2_FBF_8BIT_YCBCR_420PL, NTV2_FBF_8BIT_YCBCR_420PL2); ///< @deprecated Use NTV2_FBF_8BIT_YCBCR_420PL2 instead. + NTV2_DEPRECATED_vi(const NTV2FrameBufferFormat NTV2_FBF_8BIT_YCBCR_422PL, NTV2_FBF_8BIT_YCBCR_422PL2); ///< @deprecated Use NTV2_FBF_8BIT_YCBCR_422PL2 instead. +#endif // NTV2_DEPRECATE_14_0 + + +typedef NTV2FrameBufferFormat NTV2PixelFormat; ///< @brief An alias for NTV2FrameBufferFormat. + + +#define NTV2_IS_VALID_FRAME_BUFFER_FORMAT(__s__) ((__s__) >= NTV2_FBF_10BIT_YCBCR && (__s__) < NTV2_FBF_NUMFRAMEBUFFERFORMATS) + +#define NTV2_IS_VALID_FBF(__s__) ((__s__) >= NTV2_FBF_10BIT_YCBCR && (__s__) < NTV2_FBF_NUMFRAMEBUFFERFORMATS) + +#define NTV2_IS_FBF_PLANAR(__s__) ( (__s__) == NTV2_FBF_8BIT_YCBCR_420PL3 \ + || (__s__) == NTV2_FBF_8BIT_YCBCR_422PL3 \ + || (__s__) == NTV2_FBF_10BIT_YCBCR_420PL3_LE \ + || (__s__) == NTV2_FBF_10BIT_YCBCR_422PL3_LE \ + || (__s__) == NTV2_FBF_10BIT_YCBCR_420PL2 \ + || (__s__) == NTV2_FBF_10BIT_YCBCR_422PL2 \ + || (__s__) == NTV2_FBF_8BIT_YCBCR_420PL2 \ + || (__s__) == NTV2_FBF_8BIT_YCBCR_422PL2 \ + ) + +#define NTV2_IS_VALID_PLANAR_FRAME_BUFFER_FORMAT(__s__) (NTV2_IS_FBF_PLANAR(__s__)) + +#define NTV2_IS_FBF_PRORES(__fbf__) ( (__fbf__) == NTV2_FBF_PRORES_DVCPRO \ + || (__fbf__) == NTV2_FBF_PRORES_HDV \ + ) + +#define NTV2_IS_FBF_RGB(__fbf__) ( (__fbf__) == NTV2_FBF_ARGB \ + || (__fbf__) == NTV2_FBF_RGBA \ + || (__fbf__) == NTV2_FBF_10BIT_RGB \ + || (__fbf__) == NTV2_FBF_ABGR \ + || (__fbf__) == NTV2_FBF_10BIT_DPX \ + || (__fbf__) == NTV2_FBF_24BIT_RGB \ + || (__fbf__) == NTV2_FBF_24BIT_BGR \ + || (__fbf__) == NTV2_FBF_10BIT_DPX_LE \ + || (__fbf__) == NTV2_FBF_48BIT_RGB \ + || (__fbf__) == NTV2_FBF_12BIT_RGB_PACKED \ + || (__fbf__) == NTV2_FBF_10BIT_RGB_PACKED \ + || (__fbf__) == NTV2_FBF_10BIT_ARGB \ + || (__fbf__) == NTV2_FBF_16BIT_ARGB \ + || (__fbf__) == NTV2_FBF_10BIT_RAW_RGB \ + ) + +#define NTV2_IS_FBF_8BIT(__fbf__) ( (__fbf__) == NTV2_FBF_8BIT_YCBCR \ + || (__fbf__) == NTV2_FBF_ARGB \ + || (__fbf__) == NTV2_FBF_RGBA \ + || (__fbf__) == NTV2_FBF_8BIT_YCBCR_YUY2 \ + || (__fbf__) == NTV2_FBF_ABGR \ + || (__fbf__) == NTV2_FBF_8BIT_DVCPRO \ + ) + +#define NTV2_IS_FBF_10BIT(__fbf__) ( (__fbf__) == NTV2_FBF_10BIT_YCBCR \ + || (__fbf__) == NTV2_FBF_10BIT_RGB \ + || (__fbf__) == NTV2_FBF_10BIT_DPX \ + || (__fbf__) == NTV2_FBF_10BIT_YCBCR_DPX \ + || (__fbf__) == NTV2_FBF_10BIT_YCBCRA \ + || (__fbf__) == NTV2_FBF_10BIT_DPX_LE \ + || (__fbf__) == NTV2_FBF_10BIT_RGB_PACKED \ + || (__fbf__) == NTV2_FBF_10BIT_ARGB \ + || (__fbf__) == NTV2_FBF_10BIT_RAW_RGB \ + || (__fbf__) == NTV2_FBF_10BIT_RAW_YCBCR \ + || (__fbf__) == NTV2_FBF_10BIT_YCBCR_420PL3_LE \ + || (__fbf__) == NTV2_FBF_10BIT_YCBCR_422PL3_LE \ + || (__fbf__) == NTV2_FBF_10BIT_YCBCR_420PL2 \ + || (__fbf__) == NTV2_FBF_10BIT_YCBCR_422PL2 \ + ) + +#define NTV2_FBF_HAS_ALPHA(__fbf__) ( (__fbf__) == NTV2_FBF_ARGB \ + || (__fbf__) == NTV2_FBF_RGBA \ + || (__fbf__) == NTV2_FBF_ABGR \ + || (__fbf__) == NTV2_FBF_10BIT_ARGB \ + || (__fbf__) == NTV2_FBF_16BIT_ARGB \ + || (__fbf__) == NTV2_FBF_10BIT_YCBCRA \ + ) + +#define NTV2_FBF_IS_RAW(__fbf__) ( (__fbf__) == NTV2_FBF_10BIT_RAW_RGB \ + || (__fbf__) == NTV2_FBF_10BIT_RAW_YCBCR \ + ) + +#define NTV2_FBF_IS_YCBCR(__fbf__) ( !NTV2_IS_FBF_RGB(__fbf__) \ + && !NTV2_FBF_IS_RAW(__fbf__) \ + && !NTV2_IS_FBF_PRORES(__fbf__) \ + ) + +#define NTV2_IS_FBF_12BIT_RGB(__fbf__) ( (__fbf__) == NTV2_FBF_48BIT_RGB \ + || (__fbf__) == NTV2_FBF_12BIT_RGB_PACKED \ + ) + + +/** + @brief Identifies a particular video frame geometry. +**/ +typedef enum +{ + NTV2_FG_1920x1080 = 0, ///< @brief 1920x1080, for 1080i and 1080p, ::NTV2_VANCMODE_OFF + NTV2_FG_FIRST = NTV2_FG_1920x1080, ///< @brief The ordinally first geometry (New in SDK 16.0) + NTV2_FG_1280x720 = 1, ///< @brief 1280x720, for 720p, ::NTV2_VANCMODE_OFF + NTV2_FG_720x486 = 2, ///< @brief 720x486, for NTSC 525i and 525p60, ::NTV2_VANCMODE_OFF + NTV2_FG_720x576 = 3, ///< @brief 720x576, for PAL 625i, ::NTV2_VANCMODE_OFF + NTV2_FG_1920x1114 = 4, ///< @brief 1920x1080, ::NTV2_VANCMODE_TALLER + NTV2_FG_2048x1114 = 5, ///< @brief 2048x1080, ::NTV2_VANCMODE_TALLER + NTV2_FG_720x508 = 6, ///< @brief 720x486, for NTSC 525i, ::NTV2_VANCMODE_TALL + NTV2_FG_720x598 = 7, ///< @brief 720x576, for PAL 625i, ::NTV2_VANCMODE_TALL + NTV2_FG_1920x1112 = 8, ///< @brief 1920x1080, for 1080i and 1080p, ::NTV2_VANCMODE_TALL + NTV2_FG_1280x740 = 9, ///< @brief 1280x720, for 720p, ::NTV2_VANCMODE_TALL + NTV2_FG_2048x1080 = 10, ///< @brief 2048x1080, for 2Kx1080p, ::NTV2_VANCMODE_OFF + NTV2_FG_2048x1556 = 11, ///< @brief 2048x1556, for 2Kx1556psf film format, ::NTV2_VANCMODE_OFF + NTV2_FG_2048x1588 = 12, ///< @brief 2048x1556, for 2Kx1556psf film format, ::NTV2_VANCMODE_TALL + NTV2_FG_2048x1112 = 13, ///< @brief 2048x1080, for 2Kx1080p, ::NTV2_VANCMODE_TALL + NTV2_FG_720x514 = 14, ///< @brief 720x486, for NTSC 525i and 525p60, ::NTV2_VANCMODE_TALLER + NTV2_FG_720x612 = 15, ///< @brief 720x576, for PAL 625i, ::NTV2_VANCMODE_TALLER + NTV2_FG_4x1920x1080 = 16, ///< @brief 3840x2160, for UHD, ::NTV2_VANCMODE_OFF + NTV2_FG_4x2048x1080 = 17, ///< @brief 4096x2160, for 4K, ::NTV2_VANCMODE_OFF + NTV2_FG_4x3840x2160 = 18, ///< @brief 7680x4320, for UHD2, ::NTV2_VANCMODE_OFF + NTV2_FG_4x4096x2160 = 19, ///< @brief 8192x4320, for 8K, ::NTV2_VANCMODE_OFF + NTV2_FG_LAST = NTV2_FG_4x4096x2160, ///< @brief The ordinally last geometry (New in SDK 16.0) + NTV2_FG_NUMFRAMEGEOMETRIES, + NTV2_FG_INVALID = NTV2_FG_NUMFRAMEGEOMETRIES +} NTV2FrameGeometry; + +#define NTV2_IS_VALID_NTV2FrameGeometry(__s__) ((__s__) >= NTV2_FG_FIRST && (__s__) < NTV2_FG_NUMFRAMEGEOMETRIES) + +#define NTV2_IS_QUAD_QUAD_FRAME_GEOMETRY(geom) \ + (geom == NTV2_FG_4x3840x2160 || geom == NTV2_FG_4x4096x2160) + +#define NTV2_IS_QUAD_FRAME_GEOMETRY(geom) \ + ( geom >= NTV2_FG_4x1920x1080 && geom <= NTV2_FG_4x2048x1080 ) + +#define NTV2_IS_2K_1080_FRAME_GEOMETRY(geom) \ + ( geom == NTV2_FG_2048x1114 || \ + geom == NTV2_FG_2048x1080 || \ + geom == NTV2_FG_2048x1112 ) + +#define NTV2_IS_TALL_VANC_GEOMETRY(__g__) ( (__g__) == NTV2_FG_720x508 \ + || (__g__) == NTV2_FG_720x598 \ + || (__g__) == NTV2_FG_1920x1112 \ + || (__g__) == NTV2_FG_1280x740 \ + || (__g__) == NTV2_FG_2048x1588 \ + || (__g__) == NTV2_FG_2048x1112 ) + +#define NTV2_IS_TALLER_VANC_GEOMETRY(__g__) ( (__g__) == NTV2_FG_1920x1114 \ + || (__g__) == NTV2_FG_2048x1114 \ + || (__g__) == NTV2_FG_720x514 \ + || (__g__) == NTV2_FG_720x612 ) + +#define NTV2_IS_VANC_GEOMETRY(__g__) (NTV2_IS_TALL_VANC_GEOMETRY(__g__) || NTV2_IS_TALLER_VANC_GEOMETRY(__g__)) + + +/** + @brief Identifies a particular video frame rate. + @note These match the hardware register values. +**/ +typedef enum +{ + NTV2_FRAMERATE_UNKNOWN = 0, ///< @brief Represents an unknown or invalid frame rate + NTV2_FRAMERATE_6000 = 1, ///< @brief 60 frames per second + NTV2_FRAMERATE_FIRST = NTV2_FRAMERATE_6000, ///< @brief First ordinal value (new in SDK 16.0) + NTV2_FRAMERATE_5994 = 2, ///< @brief Fractional rate of 60,000 frames per 1,001 seconds + NTV2_FRAMERATE_3000 = 3, ///< @brief 30 frames per second + NTV2_FRAMERATE_2997 = 4, ///< @brief Fractional rate of 30,000 frames per 1,001 seconds + NTV2_FRAMERATE_2500 = 5, ///< @brief 25 frames per second + NTV2_FRAMERATE_2400 = 6, ///< @brief 24 frames per second + NTV2_FRAMERATE_2398 = 7, ///< @brief Fractional rate of 24,000 frames per 1,001 seconds + NTV2_FRAMERATE_5000 = 8, ///< @brief 50 frames per second + NTV2_FRAMERATE_4800 = 9, ///< @brief 48 frames per second + NTV2_FRAMERATE_4795 = 10, ///< @brief Fractional rate of 48,000 frames per 1,001 seconds + NTV2_FRAMERATE_12000 = 11, ///< @brief 120 frames per second + NTV2_FRAMERATE_11988 = 12, ///< @brief Fractional rate of 120,000 frames per 1,001 seconds + NTV2_FRAMERATE_1500 = 13, ///< @brief 15 frames per second + NTV2_FRAMERATE_1498 = 14, ///< @brief Fractional rate of 15,000 frames per 1,001 seconds +#if !defined(NTV2_DEPRECATE_16_0) + // These were never implemented, and are here so old code will still compile + NTV2_FRAMERATE_1900 = 15, ///< @deprecated 19 fps -- obsolete, was ordinal value 9 in old SDKs + NTV2_FRAMERATE_1898 = 16, ///< @deprecated 19,000 frames per 1,001 seconds -- obsolete, was ordinal value 10 in old SDKs + NTV2_FRAMERATE_1800 = 17, ///< @deprecated 18 fps -- obsolete, was ordinal value 11 in old SDKs + NTV2_FRAMERATE_1798 = 18, ///< @deprecated 18,000 frames per 1,001 seconds -- obsolete, was ordinal value 12 in old SDKs + NTV2_FRAMERATE_LAST = NTV2_FRAMERATE_1798, ///< @brief Last ordinal value (new in SDK 16.0) +#else // !defined(NTV2_DEPRECATE_16_0) + NTV2_FRAMERATE_LAST = NTV2_FRAMERATE_1498, ///< @brief Last ordinal value (new in SDK 16.0) +#endif // !defined(NTV2_DEPRECATE_16_0) + NTV2_NUM_FRAMERATES, + NTV2_FRAMERATE_INVALID = NTV2_FRAMERATE_UNKNOWN +} NTV2FrameRate; + +#define NTV2_IS_VALID_NTV2FrameRate(__r__) ((__r__) >= NTV2_FRAMERATE_6000 && (__r__) < NTV2_NUM_FRAMERATES) +#define NTV2_IS_SUPPORTED_NTV2FrameRate(__r__) ((__r__) >= NTV2_FRAMERATE_6000 && (__r__) <= NTV2_FRAMERATE_1498) + +#if !defined(NTV2_DEPRECATE_16_0) + #define NTV2_IS_FRACTIONAL_NTV2FrameRate(__r__) \ + ( (__r__) == NTV2_FRAMERATE_1498 || \ + (__r__) == NTV2_FRAMERATE_1798 || \ + (__r__) == NTV2_FRAMERATE_1898 || \ + (__r__) == NTV2_FRAMERATE_2398 || \ + (__r__) == NTV2_FRAMERATE_2997 || \ + (__r__) == NTV2_FRAMERATE_4795 || \ + (__r__) == NTV2_FRAMERATE_5994 || \ + (__r__) == NTV2_FRAMERATE_11988 ) +#else // !defined(NTV2_DEPRECATE_16_0) + #define NTV2_IS_FRACTIONAL_NTV2FrameRate(__r__) \ + ( (__r__) == NTV2_FRAMERATE_1498 || \ + (__r__) == NTV2_FRAMERATE_2398 || \ + (__r__) == NTV2_FRAMERATE_2997 || \ + (__r__) == NTV2_FRAMERATE_4795 || \ + (__r__) == NTV2_FRAMERATE_5994 || \ + (__r__) == NTV2_FRAMERATE_11988 ) +#endif // !defined(NTV2_DEPRECATE_16_0) + +#define NTV2_IS_HIGH_NTV2FrameRate(__r__) \ + ( (__r__) == NTV2_FRAMERATE_4795 || \ + (__r__) == NTV2_FRAMERATE_4800 || \ + (__r__) == NTV2_FRAMERATE_5000 || \ + (__r__) == NTV2_FRAMERATE_5994 || \ + (__r__) == NTV2_FRAMERATE_6000 || \ + (__r__) == NTV2_FRAMERATE_11988 || \ + (__r__) == NTV2_FRAMERATE_12000 ) + + +typedef enum +{ + NTV2_SG_UNKNOWN = 0, + NTV2_SG_525 = 1, + NTV2_SG_625 = 2, + NTV2_SG_750 = 3, + NTV2_SG_1125 = 4, + NTV2_SG_1250 = 5, + NTV2_SG_2Kx1080 = 8, + NTV2_SG_2Kx1556 = 9 +} NTV2ScanGeometry; + + +// IMPORTANT When adding to the NTV2VideoFormat enum, don't forget to: +// Add a corresponding case to GetNTV2FrameGeometryFromVideoFormat in r2deviceservices.cpp +// Add a corresponding case to GetNTV2QuarterSizedVideoFormat in ntv2utils.cpp +// Add a corresponding case to GetNTV2StandardFromVideoFormat in ntv2utils.cpp +// Add a corresponding case to GetActiveVideoSize in ntv2utils.cpp +// Add a corresponding case to GetNTV2FrameRateFromVideoFormat in ntv2utils.cpp +// Add a corresponding case to GetDisplayWidth in ntv2utils.cpp +// Add a corresponding case to GetDisplayHeight in ntv2utils.cpp +// Add a corresponding string to NTV2VideoFormatStrings in ntv2utils.cpp +// Add a corresponding timing to NTV2KonaHDTiming in ntv2register.cpp +// Add a corresponding timing to NTV2KonaLHTiming in ntv2register.cpp +// Add a corresponding case to SetVPIDData in ntv2vpid.cpp +// Add a corresponding case to NTV2VideoFromatString in ntv2debug.cpp +// Add a corresponding case to NTV2DeviceGetVideoFormatFromState_Ex in sdkgen/*.csv for ntv2devicefeatures.cpp +// Consider adding a new test case to commonapps/hi5_4k_diag/main.cpp +// Add a corresponding case to AJAVideoFormatNTV2Table in commonclasses/ntv2videoformataja.cpp +// (If the format is really new, videotypes.h in ajabase/common may need updating) +// Update the #defines following this enum + +/** + @brief Identifies a particular video format. +**/ +typedef enum _NTV2VideoFormat +{ + NTV2_FORMAT_UNKNOWN + + ,NTV2_FORMAT_FIRST_HIGH_DEF_FORMAT = 1 + ,NTV2_FORMAT_FIRST_STANDARD_DEF_FORMAT = 32 + ,NTV2_FORMAT_FIRST_2K_DEF_FORMAT = 64 + ,NTV2_FORMAT_FIRST_4K_DEF_FORMAT = 80 + ,NTV2_FORMAT_FIRST_HIGH_DEF_FORMAT2 = 110 + ,NTV2_FORMAT_FIRST_UHD_TSI_DEF_FORMAT = 200 + ,NTV2_FORMAT_FIRST_4K_TSI_DEF_FORMAT = 250 + ,NTV2_FORMAT_FIRST_4K_DEF_FORMAT2 = 300 + ,NTV2_FORMAT_FIRST_UHD2_DEF_FORMAT = 350 + ,NTV2_FORMAT_FIRST_UHD2_FULL_DEF_FORMAT = 400 + + ,NTV2_FORMAT_1080i_5000 = NTV2_FORMAT_FIRST_HIGH_DEF_FORMAT + ,NTV2_FORMAT_1080i_5994 + ,NTV2_FORMAT_1080i_6000 + ,NTV2_FORMAT_720p_5994 + ,NTV2_FORMAT_720p_6000 + ,NTV2_FORMAT_1080psf_2398 + ,NTV2_FORMAT_1080psf_2400 + ,NTV2_FORMAT_1080p_2997 + ,NTV2_FORMAT_1080p_3000 + ,NTV2_FORMAT_1080p_2500 + ,NTV2_FORMAT_1080p_2398 + ,NTV2_FORMAT_1080p_2400 + ,NTV2_FORMAT_1080p_2K_2398 + ,NTV2_FORMAT_1080p_2K_2400 + ,NTV2_FORMAT_1080psf_2K_2398 + ,NTV2_FORMAT_1080psf_2K_2400 + ,NTV2_FORMAT_720p_5000 + ,NTV2_FORMAT_1080p_5000_B + ,NTV2_FORMAT_1080p_5994_B + ,NTV2_FORMAT_1080p_6000_B + ,NTV2_FORMAT_720p_2398 + ,NTV2_FORMAT_720p_2500 + ,NTV2_FORMAT_1080p_5000_A + ,NTV2_FORMAT_1080p_5994_A + ,NTV2_FORMAT_1080p_6000_A + ,NTV2_FORMAT_1080p_2K_2500 + ,NTV2_FORMAT_1080psf_2K_2500 + ,NTV2_FORMAT_1080psf_2500_2 + ,NTV2_FORMAT_1080psf_2997_2 + ,NTV2_FORMAT_1080psf_3000_2 + ,NTV2_FORMAT_END_HIGH_DEF_FORMATS + + ,NTV2_FORMAT_525_5994 = NTV2_FORMAT_FIRST_STANDARD_DEF_FORMAT + ,NTV2_FORMAT_625_5000 + ,NTV2_FORMAT_525_2398 + ,NTV2_FORMAT_525_2400 + ,NTV2_FORMAT_525psf_2997 + ,NTV2_FORMAT_625psf_2500 + ,NTV2_FORMAT_END_STANDARD_DEF_FORMATS + + ,NTV2_FORMAT_2K_1498 = NTV2_FORMAT_FIRST_2K_DEF_FORMAT + ,NTV2_FORMAT_2K_1500 + ,NTV2_FORMAT_2K_2398 + ,NTV2_FORMAT_2K_2400 + ,NTV2_FORMAT_2K_2500 + ,NTV2_FORMAT_END_2K_DEF_FORMATS + + ,NTV2_FORMAT_4x1920x1080psf_2398 = NTV2_FORMAT_FIRST_4K_DEF_FORMAT + ,NTV2_FORMAT_4x1920x1080psf_2400 + ,NTV2_FORMAT_4x1920x1080psf_2500 + ,NTV2_FORMAT_4x1920x1080p_2398 + ,NTV2_FORMAT_4x1920x1080p_2400 + ,NTV2_FORMAT_4x1920x1080p_2500 + ,NTV2_FORMAT_4x2048x1080psf_2398 + ,NTV2_FORMAT_4x2048x1080psf_2400 + ,NTV2_FORMAT_4x2048x1080psf_2500 + ,NTV2_FORMAT_4x2048x1080p_2398 + ,NTV2_FORMAT_4x2048x1080p_2400 + ,NTV2_FORMAT_4x2048x1080p_2500 + ,NTV2_FORMAT_4x1920x1080p_2997 + ,NTV2_FORMAT_4x1920x1080p_3000 + ,NTV2_FORMAT_4x1920x1080psf_2997 + ,NTV2_FORMAT_4x1920x1080psf_3000 + ,NTV2_FORMAT_4x2048x1080p_2997 + ,NTV2_FORMAT_4x2048x1080p_3000 + ,NTV2_FORMAT_4x2048x1080psf_2997 + ,NTV2_FORMAT_4x2048x1080psf_3000 + ,NTV2_FORMAT_4x1920x1080p_5000 + ,NTV2_FORMAT_4x1920x1080p_5994 + ,NTV2_FORMAT_4x1920x1080p_6000 + ,NTV2_FORMAT_4x2048x1080p_5000 + ,NTV2_FORMAT_4x2048x1080p_5994 + ,NTV2_FORMAT_4x2048x1080p_6000 + ,NTV2_FORMAT_4x2048x1080p_4795 + ,NTV2_FORMAT_4x2048x1080p_4800 + ,NTV2_FORMAT_4x2048x1080p_11988 + ,NTV2_FORMAT_4x2048x1080p_12000 + ,NTV2_FORMAT_END_4K_DEF_FORMATS + + ,NTV2_FORMAT_1080p_2K_6000_A = NTV2_FORMAT_FIRST_HIGH_DEF_FORMAT2 + ,NTV2_FORMAT_1080p_2K_5994_A + ,NTV2_FORMAT_1080p_2K_2997 + ,NTV2_FORMAT_1080p_2K_3000 + ,NTV2_FORMAT_1080p_2K_5000_A + ,NTV2_FORMAT_1080p_2K_4795_A + ,NTV2_FORMAT_1080p_2K_4800_A + ,NTV2_FORMAT_1080p_2K_4795_B + ,NTV2_FORMAT_1080p_2K_4800_B + ,NTV2_FORMAT_1080p_2K_5000_B + ,NTV2_FORMAT_1080p_2K_5994_B + ,NTV2_FORMAT_1080p_2K_6000_B + ,NTV2_FORMAT_END_HIGH_DEF_FORMATS2 + + ,NTV2_FORMAT_3840x2160psf_2398 = NTV2_FORMAT_FIRST_UHD_TSI_DEF_FORMAT + ,NTV2_FORMAT_3840x2160psf_2400 + ,NTV2_FORMAT_3840x2160psf_2500 + ,NTV2_FORMAT_3840x2160p_2398 + ,NTV2_FORMAT_3840x2160p_2400 + ,NTV2_FORMAT_3840x2160p_2500 + ,NTV2_FORMAT_3840x2160p_2997 + ,NTV2_FORMAT_3840x2160p_3000 + ,NTV2_FORMAT_3840x2160psf_2997 + ,NTV2_FORMAT_3840x2160psf_3000 + ,NTV2_FORMAT_3840x2160p_5000 + ,NTV2_FORMAT_3840x2160p_5994 + ,NTV2_FORMAT_3840x2160p_6000 + ,NTV2_FORMAT_3840x2160p_5000_B + ,NTV2_FORMAT_3840x2160p_5994_B + ,NTV2_FORMAT_3840x2160p_6000_B + + ,NTV2_FORMAT_4096x2160psf_2398 = NTV2_FORMAT_FIRST_4K_TSI_DEF_FORMAT + ,NTV2_FORMAT_4096x2160psf_2400 + ,NTV2_FORMAT_4096x2160psf_2500 + ,NTV2_FORMAT_4096x2160p_2398 + ,NTV2_FORMAT_4096x2160p_2400 + ,NTV2_FORMAT_4096x2160p_2500 + ,NTV2_FORMAT_4096x2160p_2997 + ,NTV2_FORMAT_4096x2160p_3000 + ,NTV2_FORMAT_4096x2160psf_2997 + ,NTV2_FORMAT_4096x2160psf_3000 + ,NTV2_FORMAT_4096x2160p_4795 + ,NTV2_FORMAT_4096x2160p_4800 + ,NTV2_FORMAT_4096x2160p_5000 + ,NTV2_FORMAT_4096x2160p_5994 + ,NTV2_FORMAT_4096x2160p_6000 + ,NTV2_FORMAT_4096x2160p_11988 + ,NTV2_FORMAT_4096x2160p_12000 + ,NTV2_FORMAT_4096x2160p_4795_B + ,NTV2_FORMAT_4096x2160p_4800_B + ,NTV2_FORMAT_4096x2160p_5000_B + ,NTV2_FORMAT_4096x2160p_5994_B + ,NTV2_FORMAT_4096x2160p_6000_B + ,NTV2_FORMAT_END_4K_TSI_DEF_FORMATS + + ,NTV2_FORMAT_4x1920x1080p_5000_B = NTV2_FORMAT_FIRST_4K_DEF_FORMAT2 + ,NTV2_FORMAT_4x1920x1080p_5994_B + ,NTV2_FORMAT_4x1920x1080p_6000_B + ,NTV2_FORMAT_4x2048x1080p_5000_B + ,NTV2_FORMAT_4x2048x1080p_5994_B + ,NTV2_FORMAT_4x2048x1080p_6000_B + ,NTV2_FORMAT_4x2048x1080p_4795_B + ,NTV2_FORMAT_4x2048x1080p_4800_B + ,NTV2_FORMAT_END_4K_DEF_FORMATS2 + + ,NTV2_FORMAT_4x3840x2160p_2398 = NTV2_FORMAT_FIRST_UHD2_DEF_FORMAT + ,NTV2_FORMAT_4x3840x2160p_2400 + ,NTV2_FORMAT_4x3840x2160p_2500 + ,NTV2_FORMAT_4x3840x2160p_2997 + ,NTV2_FORMAT_4x3840x2160p_3000 + ,NTV2_FORMAT_4x3840x2160p_5000 + ,NTV2_FORMAT_4x3840x2160p_5994 + ,NTV2_FORMAT_4x3840x2160p_6000 + ,NTV2_FORMAT_4x3840x2160p_5000_B + ,NTV2_FORMAT_4x3840x2160p_5994_B + ,NTV2_FORMAT_4x3840x2160p_6000_B + ,NTV2_FORMAT_END_UHD2_DEF_FORMATS + + ,NTV2_FORMAT_4x4096x2160p_2398 = NTV2_FORMAT_FIRST_UHD2_FULL_DEF_FORMAT + ,NTV2_FORMAT_4x4096x2160p_2400 + ,NTV2_FORMAT_4x4096x2160p_2500 + ,NTV2_FORMAT_4x4096x2160p_2997 + ,NTV2_FORMAT_4x4096x2160p_3000 + ,NTV2_FORMAT_4x4096x2160p_4795 + ,NTV2_FORMAT_4x4096x2160p_4800 + ,NTV2_FORMAT_4x4096x2160p_5000 + ,NTV2_FORMAT_4x4096x2160p_5994 + ,NTV2_FORMAT_4x4096x2160p_6000 + ,NTV2_FORMAT_4x4096x2160p_4795_B + ,NTV2_FORMAT_4x4096x2160p_4800_B + ,NTV2_FORMAT_4x4096x2160p_5000_B + ,NTV2_FORMAT_4x4096x2160p_5994_B + ,NTV2_FORMAT_4x4096x2160p_6000_B + ,NTV2_FORMAT_END_UHD2_FULL_DEF_FORMATS + + ,NTV2_MAX_NUM_VIDEO_FORMATS = NTV2_FORMAT_END_UHD2_FULL_DEF_FORMATS +} NTV2VideoFormat; + + +#if !defined(NTV2_DEPRECATE_14_2) + NTV2_DEPRECATED_vi(const NTV2VideoFormat NTV2_FORMAT_1080psf_2500, NTV2_FORMAT_1080i_5000); ///< @deprecated Use NTV2_FORMAT_1080i_5000 instead. + NTV2_DEPRECATED_vi(const NTV2VideoFormat NTV2_FORMAT_1080psf_2997, NTV2_FORMAT_1080i_5994); ///< @deprecated Use NTV2_FORMAT_1080i_5994 instead. + NTV2_DEPRECATED_vi(const NTV2VideoFormat NTV2_FORMAT_1080psf_3000, NTV2_FORMAT_1080i_6000); ///< @deprecated Use NTV2_FORMAT_1080i_6000 instead. + NTV2_DEPRECATED_vi(const NTV2VideoFormat NTV2_FORMAT_DEPRECATED_525_5994, NTV2_FORMAT_1080p_2K_2398); ///< @deprecated Use NTV2_FORMAT_1080p_2K_2398 instead. + NTV2_DEPRECATED_vi(const NTV2VideoFormat NTV2_FORMAT_DEPRECATED_625_5000, NTV2_FORMAT_1080p_2K_2400); ///< @deprecated Use NTV2_FORMAT_1080p_2K_2400 instead. + NTV2_DEPRECATED_vi(const NTV2VideoFormat NTV2_FORMAT_1080p_5000, NTV2_FORMAT_1080p_5000_B); ///< @deprecated Use NTV2_FORMAT_1080p_5000_B instead. + NTV2_DEPRECATED_vi(const NTV2VideoFormat NTV2_FORMAT_1080p_5994, NTV2_FORMAT_1080p_5994_B); ///< @deprecated Use NTV2_FORMAT_1080p_5994_B instead. + NTV2_DEPRECATED_vi(const NTV2VideoFormat NTV2_FORMAT_1080p_6000, NTV2_FORMAT_1080p_6000_B); ///< @deprecated Use NTV2_FORMAT_1080p_6000_B instead. + + NTV2_DEPRECATED_vi(const NTV2VideoFormat NTV2_FORMAT_1080p_2K_6000, NTV2_FORMAT_1080p_2K_6000_A); ///< @deprecated Use NTV2_FORMAT_1080p_2K_6000_A instead. + NTV2_DEPRECATED_vi(const NTV2VideoFormat NTV2_FORMAT_1080p_2K_5994, NTV2_FORMAT_1080p_2K_5994_A); ///< @deprecated Use NTV2_FORMAT_1080p_2K_5994_A instead. + NTV2_DEPRECATED_vi(const NTV2VideoFormat NTV2_FORMAT_1080p_2K_5000, NTV2_FORMAT_1080p_2K_5000_A); ///< @deprecated Use NTV2_FORMAT_1080p_2K_5000_A instead. + NTV2_DEPRECATED_vi(const NTV2VideoFormat NTV2_FORMAT_1080p_2K_4795, NTV2_FORMAT_1080p_2K_4795_A); ///< @deprecated Use NTV2_FORMAT_1080p_2K_4795_A instead. + NTV2_DEPRECATED_vi(const NTV2VideoFormat NTV2_FORMAT_1080p_2K_4800, NTV2_FORMAT_1080p_2K_4800_A); ///< @deprecated Use NTV2_FORMAT_1080p_2K_4800_A instead. +#endif // NTV2_DEPRECATE_14_2 + +#define NTV2_IS_VALID_VIDEO_FORMAT(__f__) \ + ( NTV2_IS_HD_VIDEO_FORMAT (__f__) || \ + NTV2_IS_SD_VIDEO_FORMAT(__f__) || \ + NTV2_IS_2K_VIDEO_FORMAT(__f__) || \ + NTV2_IS_2K_1080_VIDEO_FORMAT(__f__) || \ + NTV2_IS_4K_VIDEO_FORMAT(__f__) || \ + NTV2_IS_QUAD_QUAD_FORMAT(__f__) ) + +#define NTV2_IS_PAL_VIDEO_FORMAT(__f__) \ + ( (__f__) == NTV2_FORMAT_1080i_5000 || \ + (__f__) == NTV2_FORMAT_625_5000) + +#define NTV2_IS_HD_VIDEO_FORMAT(__f__) \ + ( (__f__) != NTV2_FORMAT_UNKNOWN && \ + (((__f__) >= NTV2_FORMAT_FIRST_HIGH_DEF_FORMAT && \ + (__f__) < NTV2_FORMAT_END_HIGH_DEF_FORMATS) || \ + ((__f__) >= NTV2_FORMAT_FIRST_HIGH_DEF_FORMAT2 && \ + (__f__) < NTV2_FORMAT_END_HIGH_DEF_FORMATS2 )) ) + +#define NTV2_IS_SD_VIDEO_FORMAT(__f__) \ + ( (__f__) != NTV2_FORMAT_UNKNOWN && \ + (__f__) >= NTV2_FORMAT_FIRST_STANDARD_DEF_FORMAT && \ + (__f__) < NTV2_FORMAT_END_STANDARD_DEF_FORMATS ) + +#define NTV2_IS_720P_VIDEO_FORMAT(__f__) \ + ( (__f__) == NTV2_FORMAT_720p_2398 || \ + (__f__) == NTV2_FORMAT_720p_2500 || \ + (__f__) == NTV2_FORMAT_720p_5000 || \ + (__f__) == NTV2_FORMAT_720p_5994 || \ + (__f__) == NTV2_FORMAT_720p_6000 ) + +#define NTV2_IS_2K_VIDEO_FORMAT(__f__) \ + ( (__f__) == NTV2_FORMAT_2K_1498 || \ + (__f__) == NTV2_FORMAT_2K_1500 || \ + (__f__) == NTV2_FORMAT_2K_2398 || \ + (__f__) == NTV2_FORMAT_2K_2400 || \ + (__f__) == NTV2_FORMAT_2K_2500 ) + +#define NTV2_IS_2K_1080_VIDEO_FORMAT(__f__) \ + ( (__f__) == NTV2_FORMAT_1080p_2K_2398 || \ + (__f__) == NTV2_FORMAT_1080psf_2K_2398 || \ + (__f__) == NTV2_FORMAT_1080p_2K_2400 || \ + (__f__) == NTV2_FORMAT_1080psf_2K_2400 || \ + (__f__) == NTV2_FORMAT_1080p_2K_2500 || \ + (__f__) == NTV2_FORMAT_1080psf_2K_2500 || \ + (__f__) == NTV2_FORMAT_1080p_2K_2997 || \ + (__f__) == NTV2_FORMAT_1080p_2K_3000 || \ + (__f__) == NTV2_FORMAT_1080p_2K_4795_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_4800_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_5000_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_5994_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_6000_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_6000_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_5994_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_5000_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_4800_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_4795_B ) + +#define NTV2_IS_4K_VIDEO_FORMAT(__f__) \ + ( ((__f__) >= NTV2_FORMAT_FIRST_4K_DEF_FORMAT && \ + (__f__) < NTV2_FORMAT_END_4K_DEF_FORMATS ) || \ + ((__f__) >= NTV2_FORMAT_FIRST_UHD_TSI_DEF_FORMAT && \ + (__f__) < NTV2_FORMAT_END_4K_DEF_FORMATS2) \ + ) + +#define NTV2_IS_4K_HFR_VIDEO_FORMAT(__f__) \ + ( ((__f__) >= NTV2_FORMAT_4x1920x1080p_5000 && \ + (__f__) <= NTV2_FORMAT_4x2048x1080p_12000 ) || \ + ((__f__) >= NTV2_FORMAT_3840x2160p_5000 && \ + (__f__) <= NTV2_FORMAT_3840x2160p_6000 ) || \ + ((__f__) >= NTV2_FORMAT_4096x2160p_5000 && \ + (__f__) <= NTV2_FORMAT_4096x2160p_12000) \ + ) + +#define NTV2_IS_QUAD_HFR_VIDEO_FORMAT(__f__) \ + ( ((__f__) >= NTV2_FORMAT_4x1920x1080p_5000 && \ + (__f__) <= NTV2_FORMAT_4x2048x1080p_12000 ) || \ + ((__f__) >= NTV2_FORMAT_3840x2160p_5000 && \ + (__f__) <= NTV2_FORMAT_3840x2160p_6000 ) || \ + ((__f__) >= NTV2_FORMAT_4096x2160p_5000 && \ + (__f__) <= NTV2_FORMAT_4096x2160p_12000) \ + ) + +#define NTV2_IS_QUAD_FRAME_FORMAT(__f__) \ + ( ((__f__) >= NTV2_FORMAT_FIRST_4K_DEF_FORMAT && \ + (__f__) < NTV2_FORMAT_END_4K_DEF_FORMATS ) || \ + ((__f__) >= NTV2_FORMAT_FIRST_UHD_TSI_DEF_FORMAT && \ + (__f__) < NTV2_FORMAT_END_4K_DEF_FORMATS2 ) \ + ) + +#define NTV2_IS_QUAD_QUAD_FORMAT(__f__) \ + ( ((__f__) >= NTV2_FORMAT_FIRST_UHD2_DEF_FORMAT && \ + (__f__) < NTV2_FORMAT_END_UHD2_DEF_FORMATS ) || \ + ((__f__) >= NTV2_FORMAT_FIRST_UHD2_FULL_DEF_FORMAT && \ + (__f__) < NTV2_FORMAT_END_UHD2_FULL_DEF_FORMATS ) \ + ) + +#define NTV2_IS_QUAD_QUAD_HFR_VIDEO_FORMAT(__f__) \ + ( ((__f__) >= NTV2_FORMAT_4x3840x2160p_5000 && \ + (__f__) <= NTV2_FORMAT_4x3840x2160p_6000_B ) || \ + ((__f__) >= NTV2_FORMAT_4x4096x2160p_4795 && \ + (__f__) <= NTV2_FORMAT_4x4096x2160p_6000_B ) \ + ) + +#define NTV2_IS_4K_4096_VIDEO_FORMAT(__f__) \ + ( (__f__) == NTV2_FORMAT_4x2048x1080p_2398 || \ + (__f__) == NTV2_FORMAT_4x2048x1080psf_2398 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_2400 || \ + (__f__) == NTV2_FORMAT_4x2048x1080psf_2400 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_2500 || \ + (__f__) == NTV2_FORMAT_4x2048x1080psf_2500 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_2997 || \ + (__f__) == NTV2_FORMAT_4x2048x1080psf_2997 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_3000 || \ + (__f__) == NTV2_FORMAT_4x2048x1080psf_3000 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_4795 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_4800 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_5000 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_5994 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_6000 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_11988 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_12000 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_4795_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_4800_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_5000_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_5994_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_6000_B || \ + ((__f__) >= NTV2_FORMAT_FIRST_4K_TSI_DEF_FORMAT && \ + (__f__) < NTV2_FORMAT_END_4K_TSI_DEF_FORMATS ) \ + ) + +#define NTV2_IS_4K_QUADHD_VIDEO_FORMAT(__f__) \ + ( (__f__) == NTV2_FORMAT_4x1920x1080p_2398 || \ + (__f__) == NTV2_FORMAT_4x1920x1080psf_2398 || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_2400 || \ + (__f__) == NTV2_FORMAT_4x1920x1080psf_2400 || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_2500 || \ + (__f__) == NTV2_FORMAT_4x1920x1080psf_2500 || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_2997 || \ + (__f__) == NTV2_FORMAT_4x1920x1080psf_2997 || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_3000 || \ + (__f__) == NTV2_FORMAT_4x1920x1080psf_3000 || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_5000 || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_5994 || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_6000 || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_5000_B || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_5994_B || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_6000_B || \ + ((__f__) >= NTV2_FORMAT_FIRST_UHD_TSI_DEF_FORMAT && \ + (__f__) < NTV2_FORMAT_FIRST_4K_TSI_DEF_FORMAT ) \ + ) + +#define NTV2_IS_UHD2_VIDEO_FORMAT(__f__) \ + ( ((__f__) >= NTV2_FORMAT_FIRST_UHD2_DEF_FORMAT && \ + (__f__) < NTV2_FORMAT_END_UHD2_DEF_FORMATS) \ + ) + +#define NTV2_IS_UHD2_FULL_VIDEO_FORMAT(__f__) \ + ( ((__f__) >= NTV2_FORMAT_FIRST_UHD2_FULL_DEF_FORMAT && \ + (__f__) < NTV2_FORMAT_END_UHD2_FULL_DEF_FORMATS) \ + ) + +#define NTV2_IS_8K_VIDEO_FORMAT(__f__) \ + ( ((__f__) >= NTV2_FORMAT_FIRST_UHD2_DEF_FORMAT && \ + (__f__) < NTV2_FORMAT_END_UHD2_FULL_DEF_FORMATS) \ + ) + +#define NTV2_IS_372_DUALLINK_FORMAT(__f__) \ + ( (__f__) == NTV2_FORMAT_1080p_5000_B || \ + (__f__) == NTV2_FORMAT_1080p_5994_B || \ + (__f__) == NTV2_FORMAT_1080p_6000_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_6000_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_5994_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_5000_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_4800_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_4795_B ) + +#define NTV2_IS_525_FORMAT(__f__) \ + ( (__f__) == NTV2_FORMAT_525_5994 || \ + (__f__) == NTV2_FORMAT_525_2398 || \ + (__f__) == NTV2_FORMAT_525_2400 || \ + (__f__) == NTV2_FORMAT_525psf_2997 ) + +#define NTV2_IS_625_FORMAT(__f__) \ + ( (__f__) == NTV2_FORMAT_625_5000 || \ + (__f__) == NTV2_FORMAT_625psf_2500 ) + +#define NTV2_IS_INTERMEDIATE_FORMAT(__f__) \ + ( (__f__) == NTV2_FORMAT_2K_2398 || \ + (__f__) == NTV2_FORMAT_2K_2400 || \ + (__f__) == NTV2_FORMAT_720p_2398 || \ + (__f__) == NTV2_FORMAT_525_2398 ) + +#define NTV2_IS_3G_FORMAT(__f__) \ + ( (__f__) == NTV2_FORMAT_1080p_5000_A || \ + (__f__) == NTV2_FORMAT_1080p_5000_B || \ + (__f__) == NTV2_FORMAT_1080p_5994_A || \ + (__f__) == NTV2_FORMAT_1080p_5994_B || \ + (__f__) == NTV2_FORMAT_1080p_6000_A || \ + (__f__) == NTV2_FORMAT_1080p_6000_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_4795_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_4800_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_5000_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_5994_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_6000_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_6000_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_5994_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_5000_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_4800_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_4795_B || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_5000 || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_5994 || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_6000 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_4795 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_4800 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_5000 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_5994 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_6000 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_11988 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_12000 || \ + ((__f__) >= NTV2_FORMAT_3840x2160p_5000 && \ + (__f__) <= NTV2_FORMAT_3840x2160p_6000) || \ + ((__f__) >= NTV2_FORMAT_4096x2160p_4795 && \ + (__f__) <= NTV2_FORMAT_4096x2160p_12000) || \ + ((__f__) >= NTV2_FORMAT_4x3840x2160p_5000 && \ + (__f__) <= NTV2_FORMAT_4x3840x2160p_6000) || \ + ((__f__) >= NTV2_FORMAT_4x4096x2160p_4795 && \ + (__f__) <= NTV2_FORMAT_4x4096x2160p_6000) \ + ) + +#define NTV2_IS_6G_FORMAT(__f__) \ + ( ((__f__) >= NTV2_FORMAT_3840x2160psf_2398 && \ + (__f__) <= NTV2_FORMAT_3840x2160psf_3000) || \ + ((__f__) >= NTV2_FORMAT_4096x2160psf_2398 && \ + (__f__) <= NTV2_FORMAT_4096x2160psf_3000 ) \ + ) + +#define NTV2_IS_12G_FORMAT(__f__) \ + ( ((__f__) >= NTV2_FORMAT_3840x2160p_5000 && \ + (__f__) <= NTV2_FORMAT_3840x2160p_6000_B) || \ + ((__f__) >= NTV2_FORMAT_4096x2160p_5000 && \ + (__f__) <= NTV2_FORMAT_4096x2160p_6000_B ) \ + ) + +#define NTV2_IS_3Gb_FORMAT(__f__) \ + ( (__f__) == NTV2_FORMAT_1080p_5000_B || \ + (__f__) == NTV2_FORMAT_1080p_5994_B || \ + (__f__) == NTV2_FORMAT_1080p_6000_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_6000_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_5994_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_5000_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_4800_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_4795_B || \ + (__f__) == NTV2_FORMAT_3840x2160p_5000_B || \ + (__f__) == NTV2_FORMAT_3840x2160p_5994_B || \ + (__f__) == NTV2_FORMAT_3840x2160p_6000_B || \ + (__f__) == NTV2_FORMAT_4096x2160p_4795_B || \ + (__f__) == NTV2_FORMAT_4096x2160p_4800_B || \ + (__f__) == NTV2_FORMAT_4096x2160p_5000_B || \ + (__f__) == NTV2_FORMAT_4096x2160p_5994_B || \ + (__f__) == NTV2_FORMAT_4096x2160p_6000_B || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_5000_B || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_5994_B || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_6000_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_5000_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_5994_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_6000_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_4795_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_4800_B || \ + (__f__) == NTV2_FORMAT_4x3840x2160p_5000_B || \ + (__f__) == NTV2_FORMAT_4x3840x2160p_5994_B || \ + (__f__) == NTV2_FORMAT_4x3840x2160p_6000_B || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_4795_B || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_4800_B || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_5000_B || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_5994_B || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_6000_B \ + ) + +#define NTV2_IS_WIRE_FORMAT(__f__) \ + ( (__f__) != NTV2_FORMAT_525_2398 && \ + (__f__) != NTV2_FORMAT_525_2400 && \ + (__f__) != NTV2_FORMAT_720p_2398 && \ + (__f__) != NTV2_FORMAT_720p_2500 ) + +#define NTV2_IS_PSF_VIDEO_FORMAT(__f__) \ + ( (__f__) == NTV2_FORMAT_1080psf_2398 || \ + (__f__) == NTV2_FORMAT_1080psf_2400 || \ + (__f__) == NTV2_FORMAT_1080psf_2K_2398 || \ + (__f__) == NTV2_FORMAT_1080psf_2K_2400 || \ + (__f__) == NTV2_FORMAT_1080psf_2K_2500 || \ + (__f__) == NTV2_FORMAT_1080psf_2500_2 || \ + (__f__) == NTV2_FORMAT_1080psf_2997_2 || \ + (__f__) == NTV2_FORMAT_1080psf_3000_2 || \ + (__f__) == NTV2_FORMAT_525psf_2997 || \ + (__f__) == NTV2_FORMAT_625psf_2500 || \ + (__f__) == NTV2_FORMAT_4x1920x1080psf_2398 || \ + (__f__) == NTV2_FORMAT_4x1920x1080psf_2400 || \ + (__f__) == NTV2_FORMAT_4x1920x1080psf_2500 || \ + (__f__) == NTV2_FORMAT_4x1920x1080psf_2997 || \ + (__f__) == NTV2_FORMAT_4x1920x1080psf_3000 || \ + (__f__) == NTV2_FORMAT_4x2048x1080psf_2398 || \ + (__f__) == NTV2_FORMAT_4x2048x1080psf_2400 || \ + (__f__) == NTV2_FORMAT_4x2048x1080psf_2500 || \ + (__f__) == NTV2_FORMAT_4x2048x1080psf_2997 || \ + (__f__) == NTV2_FORMAT_4x2048x1080psf_3000 || \ + (__f__) == NTV2_FORMAT_3840x2160psf_2398 || \ + (__f__) == NTV2_FORMAT_3840x2160psf_2400 || \ + (__f__) == NTV2_FORMAT_3840x2160psf_2500 || \ + (__f__) == NTV2_FORMAT_3840x2160psf_2997 || \ + (__f__) == NTV2_FORMAT_3840x2160psf_3000 || \ + (__f__) == NTV2_FORMAT_4096x2160psf_2398 || \ + (__f__) == NTV2_FORMAT_4096x2160psf_2400 || \ + (__f__) == NTV2_FORMAT_4096x2160psf_2500 || \ + (__f__) == NTV2_FORMAT_4096x2160psf_2997 || \ + (__f__) == NTV2_FORMAT_4096x2160psf_3000 \ + ) + +#define NTV2_VIDEO_FORMAT_HAS_PROGRESSIVE_PICTURE(__f__) \ + ( (__f__) != NTV2_FORMAT_1080i_5000 && \ + (__f__) != NTV2_FORMAT_1080i_5994 && \ + (__f__) != NTV2_FORMAT_1080i_6000 && \ + (__f__) != NTV2_FORMAT_525_5994 && \ + (__f__) != NTV2_FORMAT_625_5000 ) + +#define NTV2_VIDEO_FORMAT_IS_A(__f__) \ + ( (__f__) == NTV2_FORMAT_1080p_5000_A || \ + (__f__) == NTV2_FORMAT_1080p_5994_A || \ + (__f__) == NTV2_FORMAT_1080p_6000_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_4795_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_4800_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_5000_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_5994_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_6000_A || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_5000 || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_5994 || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_6000 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_4795 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_4800 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_5000 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_5994 || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_6000 || \ + (__f__) == NTV2_FORMAT_3840x2160p_5000 || \ + (__f__) == NTV2_FORMAT_3840x2160p_5994 || \ + (__f__) == NTV2_FORMAT_3840x2160p_6000 || \ + (__f__) == NTV2_FORMAT_4096x2160p_4795 || \ + (__f__) == NTV2_FORMAT_4096x2160p_4800 || \ + (__f__) == NTV2_FORMAT_4096x2160p_5000 || \ + (__f__) == NTV2_FORMAT_4096x2160p_5994 || \ + (__f__) == NTV2_FORMAT_4096x2160p_6000 || \ + (__f__) == NTV2_FORMAT_4x3840x2160p_5000 || \ + (__f__) == NTV2_FORMAT_4x3840x2160p_5994 || \ + (__f__) == NTV2_FORMAT_4x3840x2160p_6000 || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_4795 || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_4800 || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_5000 || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_5994 || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_6000 \ + ) + +#define NTV2_VIDEO_FORMAT_IS_B(__f__) \ + ( (__f__) == NTV2_FORMAT_1080p_5000_B || \ + (__f__) == NTV2_FORMAT_1080p_5994_B || \ + (__f__) == NTV2_FORMAT_1080p_6000_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_4795_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_4800_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_5000_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_5994_B || \ + (__f__) == NTV2_FORMAT_1080p_2K_6000_B || \ + (__f__) == NTV2_FORMAT_3840x2160p_5000_B || \ + (__f__) == NTV2_FORMAT_3840x2160p_5994_B || \ + (__f__) == NTV2_FORMAT_3840x2160p_6000_B || \ + (__f__) == NTV2_FORMAT_4096x2160p_4795_B || \ + (__f__) == NTV2_FORMAT_4096x2160p_4800_B || \ + (__f__) == NTV2_FORMAT_4096x2160p_5000_B || \ + (__f__) == NTV2_FORMAT_4096x2160p_5994_B || \ + (__f__) == NTV2_FORMAT_4096x2160p_6000_B || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_5000_B || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_5994_B || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_6000_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_5000_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_5994_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_6000_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_4795_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_4800_B || \ + (__f__) == NTV2_FORMAT_4x3840x2160p_5000_B || \ + (__f__) == NTV2_FORMAT_4x3840x2160p_5994_B || \ + (__f__) == NTV2_FORMAT_4x3840x2160p_6000_B || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_4795_B || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_4800_B || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_5000_B || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_5994_B || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_6000_B \ + ) + +#define NTV2_VIDEO_FORMAT_IS_J2K_SUPPORTED(__f__) \ + ( (__f__) == NTV2_FORMAT_525_5994 || \ + (__f__) == NTV2_FORMAT_625_5000 || \ + (__f__) == NTV2_FORMAT_720p_2398 || \ + (__f__) == NTV2_FORMAT_720p_2500 || \ + (__f__) == NTV2_FORMAT_720p_5000 || \ + (__f__) == NTV2_FORMAT_720p_5994 || \ + (__f__) == NTV2_FORMAT_720p_6000 || \ + (__f__) == NTV2_FORMAT_1080i_5000 || \ + (__f__) == NTV2_FORMAT_1080i_5994 || \ + (__f__) == NTV2_FORMAT_1080i_6000 || \ + (__f__) == NTV2_FORMAT_1080p_2398 || \ + (__f__) == NTV2_FORMAT_1080p_2400 || \ + (__f__) == NTV2_FORMAT_1080p_2500 || \ + (__f__) == NTV2_FORMAT_1080p_2997 || \ + (__f__) == NTV2_FORMAT_1080p_3000 || \ + (__f__) == NTV2_FORMAT_1080p_5000_A || \ + (__f__) == NTV2_FORMAT_1080p_5994_A || \ + (__f__) == NTV2_FORMAT_1080p_6000_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_2398 || \ + (__f__) == NTV2_FORMAT_1080p_2K_2400 || \ + (__f__) == NTV2_FORMAT_1080p_2K_2500 || \ + (__f__) == NTV2_FORMAT_1080p_2K_2997 || \ + (__f__) == NTV2_FORMAT_1080p_2K_3000 || \ + (__f__) == NTV2_FORMAT_1080p_2K_5000_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_5994_A || \ + (__f__) == NTV2_FORMAT_1080p_2K_6000_A ) + +#define NTV2_IS_TSI_FORMAT(__f__) \ + ( ((__f__) >= NTV2_FORMAT_FIRST_UHD_TSI_DEF_FORMAT && \ + (__f__) < NTV2_FORMAT_END_4K_TSI_DEF_FORMATS ) ) + + +#define NTV2_IS_SQUARE_DIVISION_FORMAT(__f__) \ + ( ((__f__) >= NTV2_FORMAT_FIRST_4K_DEF_FORMAT && \ + (__f__) < NTV2_FORMAT_END_4K_DEF_FORMATS ) || \ + ((__f__) >= NTV2_FORMAT_FIRST_4K_DEF_FORMAT2 && \ + (__f__) < NTV2_FORMAT_END_4K_DEF_FORMATS2 ) || \ + ((__f__) >= NTV2_FORMAT_FIRST_UHD2_DEF_FORMAT && \ + (__f__) < NTV2_FORMAT_END_UHD2_DEF_FORMATS ) || \ + ((__f__) >= NTV2_FORMAT_FIRST_UHD2_FULL_DEF_FORMAT && \ + (__f__) < NTV2_FORMAT_END_UHD2_FULL_DEF_FORMATS ) ) + +#define NTV2_VIDEO_FORMAT_NEEDS_CONVERSION(__f__) \ + ( (__f__) == NTV2_FORMAT_3840x2160p_5000_B || \ + (__f__) == NTV2_FORMAT_3840x2160p_5994_B || \ + (__f__) == NTV2_FORMAT_3840x2160p_6000_B || \ + (__f__) == NTV2_FORMAT_4096x2160p_4795_B || \ + (__f__) == NTV2_FORMAT_4096x2160p_4800_B || \ + (__f__) == NTV2_FORMAT_4096x2160p_5000_B || \ + (__f__) == NTV2_FORMAT_4096x2160p_5994_B || \ + (__f__) == NTV2_FORMAT_4096x2160p_6000_B || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_5000_B || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_5994_B || \ + (__f__) == NTV2_FORMAT_4x1920x1080p_6000_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_5000_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_5994_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_6000_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_4795_B || \ + (__f__) == NTV2_FORMAT_4x2048x1080p_4800_B || \ + (__f__) == NTV2_FORMAT_4x3840x2160p_5000_B || \ + (__f__) == NTV2_FORMAT_4x3840x2160p_5994_B || \ + (__f__) == NTV2_FORMAT_4x3840x2160p_6000_B || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_4795_B || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_4800_B || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_5000_B || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_5994_B || \ + (__f__) == NTV2_FORMAT_4x4096x2160p_6000_B \ + ) + +/** + @brief Used to identify the mode of a \ref widget_framestore, or the direction of an \ref aboutautocirculate stream: + either Capture (Input) or Display (Output). + @see CNTV2Card::SetMode, CNTV2Card::GetMode, \ref vidop-fs +**/ +typedef enum +{ + NTV2_MODE_DISPLAY, ///< @brief Playout (output) mode, which reads from device SDRAM + NTV2_MODE_OUTPUT = NTV2_MODE_DISPLAY, ///< @brief Output (playout, display) mode, which reads from device SDRAM + NTV2_MODE_CAPTURE, ///< @brief Capture (input) mode, which writes into device SDRAM + NTV2_MODE_INPUT = NTV2_MODE_CAPTURE, ///< @brief Input (capture) mode, which writes into device SDRAM + NTV2_MODE_INVALID ///< @brief The invalid mode +} NTV2Mode; + +#define NTV2_IS_VALID_MODE(__mode__) (((__mode__) >= NTV2_MODE_DISPLAY) && ((__mode__) < NTV2_MODE_INVALID)) +#define NTV2_IS_INPUT_MODE(__mode__) ((__mode__) == NTV2_MODE_INPUT) +#define NTV2_IS_OUTPUT_MODE(__mode__) ((__mode__) == NTV2_MODE_OUTPUT) + + +#if !defined (NTV2_DEPRECATE) + typedef enum + { + NTV2_FRAMBUFFERMODE_FRAME, + NTV2_FRAMBUFFERMODE_FIELD + } NTV2FrameBufferMode; ///< @deprecated Obsolete. +#endif // !defined (NTV2_DEPRECATE) + + +/** + @brief Identifies a specific video input source. + @details Always call ::NTV2DeviceCanDoInputSource to determine if a device has one of these input sources. + Call CNTV2Card::GetInputVideoFormat to determine what video signal is present on the input (if any). + Call ::GetInputSourceOutputXpt to get an NTV2OutputCrosspointID for one of these inputs to pass to + CNTV2Card::Connect. See \ref devicesignalinputsoutputs. + @warning Do not rely on the ordinal values of these constants between successive SDKs, since new devices + can be introduced that require additional inputs. +**/ +typedef enum +{ + NTV2_INPUTSOURCE_ANALOG1 ///< @brief Identifies the first analog video input + ,NTV2_INPUTSOURCE_HDMI1 ///< @brief Identifies the 1st HDMI video input + ,NTV2_INPUTSOURCE_HDMI2 ///< @brief Identifies the 2nd HDMI video input + ,NTV2_INPUTSOURCE_HDMI3 ///< @brief Identifies the 3rd HDMI video input + ,NTV2_INPUTSOURCE_HDMI4 ///< @brief Identifies the 4th HDMI video input + ,NTV2_INPUTSOURCE_SDI1 ///< @brief Identifies the 1st SDI video input + ,NTV2_INPUTSOURCE_SDI2 ///< @brief Identifies the 2nd SDI video input + ,NTV2_INPUTSOURCE_SDI3 ///< @brief Identifies the 3rd SDI video input + ,NTV2_INPUTSOURCE_SDI4 ///< @brief Identifies the 4th SDI video input + ,NTV2_INPUTSOURCE_SDI5 ///< @brief Identifies the 5th SDI video input + ,NTV2_INPUTSOURCE_SDI6 ///< @brief Identifies the 6th SDI video input + ,NTV2_INPUTSOURCE_SDI7 ///< @brief Identifies the 7th SDI video input + ,NTV2_INPUTSOURCE_SDI8 ///< @brief Identifies the 8th SDI video input + ,NTV2_INPUTSOURCE_INVALID ///< @brief The invalid video input + ,NTV2_NUM_INPUTSOURCES = NTV2_INPUTSOURCE_INVALID +} NTV2InputSource; + +#if !defined (NTV2_DEPRECATE_14_2) + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_ANALOG, NTV2_INPUTSOURCE_ANALOG1); ///< @deprecated Use NTV2_INPUTSOURCE_ANALOG1 instead. + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_HDMI, NTV2_INPUTSOURCE_HDMI1); ///< @deprecated Use NTV2_INPUTSOURCE_HDMI1 instead. +#endif +#if !defined (NTV2_DEPRECATE) + #if defined(NTV2_BUILDING_DRIVER) + #define NTV2_INPUTSOURCE_DUALLINK NTV2_INPUTSOURCE_SDI1 + #define NTV2_INPUTSOURCE_DUALLINK1 NTV2_INPUTSOURCE_SDI1 + #define NTV2_INPUTSOURCE_DUALLINK2 NTV2_INPUTSOURCE_SDI2 + #define NTV2_INPUTSOURCE_DUALLINK3 NTV2_INPUTSOURCE_SDI3 + #define NTV2_INPUTSOURCE_DUALLINK4 NTV2_INPUTSOURCE_SDI4 + #define NTV2_INPUTSOURCE_DUALLINK5 NTV2_INPUTSOURCE_SDI5 + #define NTV2_INPUTSOURCE_DUALLINK6 NTV2_INPUTSOURCE_SDI6 + #define NTV2_INPUTSOURCE_DUALLINK7 NTV2_INPUTSOURCE_SDI7 + #define NTV2_INPUTSOURCE_DUALLINK8 NTV2_INPUTSOURCE_SDI8 + #define NTV2_INPUTSOURCE_SDI1_DS2 NTV2_INPUTSOURCE_SDI1 + #define NTV2_INPUTSOURCE_SDI2_DS2 NTV2_INPUTSOURCE_SDI2 + #define NTV2_INPUTSOURCE_SDI3_DS2 NTV2_INPUTSOURCE_SDI3 + #define NTV2_INPUTSOURCE_SDI4_DS2 NTV2_INPUTSOURCE_SDI4 + #define NTV2_INPUTSOURCE_SDI5_DS2 NTV2_INPUTSOURCE_SDI5 + #define NTV2_INPUTSOURCE_SDI6_DS2 NTV2_INPUTSOURCE_SDI6 + #define NTV2_INPUTSOURCE_SDI7_DS2 NTV2_INPUTSOURCE_SDI7 + #define NTV2_INPUTSOURCE_SDI8_DS2 NTV2_INPUTSOURCE_SDI8 + #else + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_DUALLINK, NTV2_INPUTSOURCE_SDI1); ///< @deprecated Use NTV2_INPUTSOURCE_SDI1 instead. + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_DUALLINK1, NTV2_INPUTSOURCE_SDI1); ///< @deprecated Use NTV2_INPUTSOURCE_SDI1 instead. + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_DUALLINK2, NTV2_INPUTSOURCE_SDI2); ///< @deprecated Use NTV2_INPUTSOURCE_SDI2 instead. + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_DUALLINK3, NTV2_INPUTSOURCE_SDI3); ///< @deprecated Use NTV2_INPUTSOURCE_SDI3 instead. + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_DUALLINK4, NTV2_INPUTSOURCE_SDI4); ///< @deprecated Use NTV2_INPUTSOURCE_SDI4 instead. + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_DUALLINK5, NTV2_INPUTSOURCE_SDI5); ///< @deprecated Use NTV2_INPUTSOURCE_SDI5 instead. + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_DUALLINK6, NTV2_INPUTSOURCE_SDI6); ///< @deprecated Use NTV2_INPUTSOURCE_SDI6 instead. + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_DUALLINK7, NTV2_INPUTSOURCE_SDI7); ///< @deprecated Use NTV2_INPUTSOURCE_SDI7 instead. + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_DUALLINK8, NTV2_INPUTSOURCE_SDI8); ///< @deprecated Use NTV2_INPUTSOURCE_SDI8 instead. + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_SDI1_DS2, NTV2_INPUTSOURCE_SDI1); ///< @deprecated Use NTV2_INPUTSOURCE_SDI1 instead. + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_SDI2_DS2, NTV2_INPUTSOURCE_SDI2); ///< @deprecated Use NTV2_INPUTSOURCE_SDI2 instead. + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_SDI3_DS2, NTV2_INPUTSOURCE_SDI3); ///< @deprecated Use NTV2_INPUTSOURCE_SDI3 instead. + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_SDI4_DS2, NTV2_INPUTSOURCE_SDI4); ///< @deprecated Use NTV2_INPUTSOURCE_SDI4 instead. + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_SDI5_DS2, NTV2_INPUTSOURCE_SDI5); ///< @deprecated Use NTV2_INPUTSOURCE_SDI5 instead. + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_SDI6_DS2, NTV2_INPUTSOURCE_SDI6); ///< @deprecated Use NTV2_INPUTSOURCE_SDI6 instead. + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_SDI7_DS2, NTV2_INPUTSOURCE_SDI7); ///< @deprecated Use NTV2_INPUTSOURCE_SDI7 instead. + NTV2_DEPRECATED_vi(const NTV2InputSource NTV2_INPUTSOURCE_SDI8_DS2, NTV2_INPUTSOURCE_SDI8); ///< @deprecated Use NTV2_INPUTSOURCE_SDI8 instead. + #endif +#endif + +#define NTV2_INPUT_SOURCE_IS_HDMI(_inpSrc_) ((_inpSrc_) >= NTV2_INPUTSOURCE_HDMI1 && (_inpSrc_) <= NTV2_INPUTSOURCE_HDMI4) +#define NTV2_INPUT_SOURCE_IS_ANALOG(_inpSrc_) ((_inpSrc_) == NTV2_INPUTSOURCE_ANALOG1) +#define NTV2_INPUT_SOURCE_IS_SDI(_inpSrc_) ((_inpSrc_) >= NTV2_INPUTSOURCE_SDI1 && (_inpSrc_) <= NTV2_INPUTSOURCE_SDI8) +#define NTV2_IS_VALID_INPUT_SOURCE(_inpSrc_) (((_inpSrc_) >= 0) && ((_inpSrc_) < NTV2_INPUTSOURCE_INVALID)) + +/** + @brief Used to specify one or more ::NTV2InputSource types. +**/ +typedef enum _NTV2InputSourceKinds +{ + NTV2_INPUTSOURCES_ALL = 0xFF, ///< @brief Specifies any/all input source kinds. + NTV2_INPUTSOURCES_SDI = 1, ///< @brief Specifies SDI input source kinds. + NTV2_INPUTSOURCES_HDMI = 2, ///< @brief Specifies HDMI input source kinds. + NTV2_INPUTSOURCES_ANALOG = 4, ///< @brief Specifies analog input source kinds. + NTV2_INPUTSOURCES_NONE = 0 ///< @brief Doesn't specify any kind of input source. +} NTV2InputSourceKinds; + + +typedef enum +{ + #if defined (NTV2_DEPRECATE) + NTV2_OUTPUTDESTINATION_ANALOG, + NTV2_OUTPUTDESTINATION_HDMI, + NTV2_OUTPUTDESTINATION_SDI1, + NTV2_OUTPUTDESTINATION_SDI2, + NTV2_OUTPUTDESTINATION_SDI3, + NTV2_OUTPUTDESTINATION_SDI4, + NTV2_OUTPUTDESTINATION_SDI5, + NTV2_OUTPUTDESTINATION_SDI6, + NTV2_OUTPUTDESTINATION_SDI7, + NTV2_OUTPUTDESTINATION_SDI8, + #else + NTV2_OUTPUTDESTINATION_SDI1, + NTV2_OUTPUTDESTINATION_ANALOG, + NTV2_OUTPUTDESTINATION_SDI2, + NTV2_OUTPUTDESTINATION_HDMI, + NTV2_OUTPUTDESTINATION_DUALLINK, + NTV2_OUTPUTDESTINATION_DUALLINK1 = NTV2_OUTPUTDESTINATION_DUALLINK, + NTV2_OUTPUTDESTINATION_HDMI_14, + NTV2_OUTPUTDESTINATION_DUALLINK2, + NTV2_OUTPUTDESTINATION_SDI3, + NTV2_OUTPUTDESTINATION_SDI4, + NTV2_OUTPUTDESTINATION_SDI5, + NTV2_OUTPUTDESTINATION_SDI6, + NTV2_OUTPUTDESTINATION_SDI7, + NTV2_OUTPUTDESTINATION_SDI8, + NTV2_OUTPUTDESTINATION_DUALLINK3, + NTV2_OUTPUTDESTINATION_DUALLINK4, + NTV2_OUTPUTDESTINATION_DUALLINK5, + NTV2_OUTPUTDESTINATION_DUALLINK6, + NTV2_OUTPUTDESTINATION_DUALLINK7, + NTV2_OUTPUTDESTINATION_DUALLINK8, + #endif // !defined (NTV2_DEPRECATE) + NTV2_OUTPUTDESTINATION_INVALID, + NTV2_NUM_OUTPUTDESTINATIONS = NTV2_OUTPUTDESTINATION_INVALID // Always last! +} NTV2OutputDestination; + +#if !defined (NTV2_DEPRECATE) + #define NTV2_OUTPUT_DEST_IS_HDMI(_dest_) ((_dest_) == NTV2_OUTPUTDESTINATION_HDMI || (_dest_) == NTV2_OUTPUTDESTINATION_HDMI_14) + #define NTV2_OUTPUT_DEST_IS_ANALOG(_dest_) ((_dest_) == NTV2_OUTPUTDESTINATION_ANALOG) + #define NTV2_OUTPUT_DEST_IS_SDI(_dest_) (!NTV2_OUTPUT_DEST_IS_HDMI(_dest_) && !NTV2_OUTPUT_DEST_IS_ANALOG(_dest_) && (_dest_) < NTV2_NUM_OUTPUTDESTINATIONS) + #define NTV2_OUTPUT_DEST_IS_DUAL_LINK(_dest_) ( (_dest_) == NTV2_OUTPUTDESTINATION_DUALLINK1 || \ + (_dest_) == NTV2_OUTPUTDESTINATION_DUALLINK2 || \ + (_dest_) == NTV2_OUTPUTDESTINATION_DUALLINK3 || \ + (_dest_) == NTV2_OUTPUTDESTINATION_DUALLINK4 || \ + (_dest_) == NTV2_OUTPUTDESTINATION_DUALLINK5 || \ + (_dest_) == NTV2_OUTPUTDESTINATION_DUALLINK6 || \ + (_dest_) == NTV2_OUTPUTDESTINATION_DUALLINK7 || \ + (_dest_) == NTV2_OUTPUTDESTINATION_DUALLINK8 ) +#else + #define NTV2_OUTPUT_DEST_IS_HDMI(_dest_) ((_dest_) == NTV2_OUTPUTDESTINATION_HDMI) + #define NTV2_OUTPUT_DEST_IS_ANALOG(_dest_) ((_dest_) == NTV2_OUTPUTDESTINATION_ANALOG) + #define NTV2_OUTPUT_DEST_IS_SDI(_dest_) ((_dest_) >= NTV2_OUTPUTDESTINATION_SDI1 && (_dest_) <= NTV2_OUTPUTDESTINATION_SDI8) +#endif // !defined (NTV2_DEPRECATE) +#define NTV2_IS_VALID_OUTPUT_DEST(_dest_) (((_dest_) >= 0) && ((_dest_) < NTV2_NUM_OUTPUTDESTINATIONS)) + + +/** + @brief These enum values are mostly used to identify a specific \ref widget_framestore. + They're also commonly used to identify an \ref autocirculatechannels for video streaming. + Finally, they can also be used anywhere a zero-based index value is expected. + @note In NTV2 parlance, the terms Channel and Frame Store are used interchangeably. + @see ::NTV2DeviceGetNumFrameStores, \ref vidop-fs +**/ +typedef enum +{ + NTV2_CHANNEL1, ///< @brief Specifies channel or Frame Store 1 (or the first item). + NTV2_CHANNEL2, ///< @brief Specifies channel or Frame Store 2 (or the 2nd item). + NTV2_CHANNEL3, ///< @brief Specifies channel or Frame Store 3 (or the 3rd item). + NTV2_CHANNEL4, ///< @brief Specifies channel or Frame Store 4 (or the 4th item). + NTV2_CHANNEL5, ///< @brief Specifies channel or Frame Store 5 (or the 5th item). + NTV2_CHANNEL6, ///< @brief Specifies channel or Frame Store 6 (or the 6th item). + NTV2_CHANNEL7, ///< @brief Specifies channel or Frame Store 7 (or the 7th item). + NTV2_CHANNEL8, ///< @brief Specifies channel or Frame Store 8 (or the 8th item). + NTV2_MAX_NUM_CHANNELS, // Always last! + NTV2_CHANNEL_INVALID = NTV2_MAX_NUM_CHANNELS +} NTV2Channel; + +#define NTV2_IS_VALID_CHANNEL(__x__) ((__x__) >= NTV2_CHANNEL1 && (__x__) < NTV2_MAX_NUM_CHANNELS) + + +/** + @brief These enum values are used for device selection/filtering. + @see ::NTV2GetSupportedDevices +**/ +typedef enum _NTV2DeviceKinds +{ + NTV2_DEVICEKIND_ALL = 0xFFFF, ///< @brief Specifies any/all devices. + NTV2_DEVICEKIND_INPUT = 0x0001, ///< @brief Specifies devices that input (capture). + NTV2_DEVICEKIND_OUTPUT = 0x0002, ///< @brief Specifies devices that output (playout). + NTV2_DEVICEKIND_SDI = 0x0004, ///< @brief Specifies devices with SDI connectors. + NTV2_DEVICEKIND_HDMI = 0x0008, ///< @brief Specifies devices with HDMI connectors. + NTV2_DEVICEKIND_ANALOG = 0x0010, ///< @brief Specifies devices with analog video connectors. + NTV2_DEVICEKIND_SFP = 0x0020, ///< @brief Specifies devices with SFP connectors. + NTV2_DEVICEKIND_IP = NTV2_DEVICEKIND_SFP, + NTV2_DEVICEKIND_EXTERNAL = 0x0040, ///< @brief Specifies external devices (e.g. Thunderbolt). + NTV2_DEVICEKIND_4K = 0x0080, ///< @brief Specifies devices that can do 4K video. + NTV2_DEVICEKIND_8K = 0x0100, ///< @brief Specifies devices that can do 8K video. +// NTV2_DEVICEKIND_HFR = 0x0200, ///< @brief Specifies devices that can handle HFR video. + NTV2_DEVICEKIND_6G = 0x0400, ///< @brief Specifies devices that have 6G SDI connectors. + NTV2_DEVICEKIND_12G = 0x0800, ///< @brief Specifies devices that have 12G SDI connectors. + NTV2_DEVICEKIND_CUSTOM_ANC = 0x1000, ///< @brief Specifies devices that have custom Anc inserter/extractor firmware. + NTV2_DEVICEKIND_RELAYS = 0x2000, ///< @brief Specifies devices that have bypass relays. + NTV2_DEVICEKIND_NONE = 0 ///< @brief Doesn't specify any kind of device. +} NTV2DeviceKinds; + + +/** + @brief Identifies a specific IP-based data stream. + @warning The ordinal values of the enum names may change in successive SDKs. +**/ +typedef enum +{ + NTV2_VIDEO1_STREAM = 0, + NTV2_VIDEO2_STREAM = 1, + NTV2_VIDEO3_STREAM = 2, + NTV2_VIDEO4_STREAM = 3, + NTV2_AUDIO1_STREAM = 4, + NTV2_AUDIO2_STREAM = 5, + NTV2_AUDIO3_STREAM = 6, + NTV2_AUDIO4_STREAM = 7, + NTV2_ANC1_STREAM = 8, + NTV2_ANC2_STREAM = 9, + NTV2_ANC3_STREAM = 10, + NTV2_ANC4_STREAM = 11, + NTV2_VIDEO4K_STREAM = 12, + NTV2_MAX_NUM_SINGLE_STREAMS = NTV2_VIDEO4K_STREAM, + NTV2_MAX_NUM_STREAMS = 13, + NTV2_STREAM_INVALID = NTV2_MAX_NUM_STREAMS +} NTV2Stream; + +#define NTV2_STREAM_MASK_ALL ((1 << NTV2_MAX_NUM_STREAMS) - 1) + + +/** + @brief Identifies the kind of data that can be carried by an IP-based data stream. +**/ +typedef enum +{ + VIDEO_STREAM, ///< @brief Video data + AUDIO_STREAM, ///< @brief Audio data + ANC_STREAM, ///< @brief Anc data + VIDEO_4K_STREAM, ///< @brief 4K Video stream using 4 streams + INVALID_STREAM +} NTV2StreamType; + + +#define NTV2_IS_VALID_RX_STREAM(__x__) ((__x__) >= NTV2_VIDEO1_STREAM && (__x__) < NTV2_MAX_NUM_STREAMS) +#define NTV2_IS_VALID_TX_STREAM(__x__) ((__x__) >= NTV2_VIDEO1_STREAM && (__x__) < NTV2_MAX_NUM_STREAMS) +#define NTV2_IS_VALID_RX_SINGLE_STREAM(__x__) ((__x__) >= NTV2_VIDEO1_STREAM && (__x__) < NTV2_MAX_NUM_SINGLE_STREAMS) +#define NTV2_IS_VALID_TX_SINGLE_STREAM(__x__) ((__x__) >= NTV2_VIDEO1_STREAM && (__x__) < NTV2_MAX_NUM_SINGLE_STREAMS) + +/** + @brief These enum values identify a specific source for the device's (output) reference clock. + @see CNTV2Card::GetReference, CNTV2Card::SetReference, \ref deviceclockingandsync + @warning Do not rely on the ordinal values of these constants between successive SDKs, since new devices + can be introduced that require additional inputs. +**/ +typedef enum +{ + NTV2_REFERENCE_EXTERNAL = 0, ///< @brief Specifies the External Reference connector. + NTV2_REFERENCE_INPUT1 = 1, ///< @brief Specifies the SDI In 1 connector. + NTV2_REFERENCE_INPUT2 = 2, ///< @brief Specifies the SDI In 2 connector. + NTV2_REFERENCE_FREERUN = 3, ///< @brief Specifies the device's internal clock. + NTV2_REFERENCE_ANALOG_INPUT1 = 4, ///< @brief Specifies the Analog In 1 connector. + NTV2_REFERENCE_HDMI_INPUT1 = 5, ///< @brief Specifies the HDMI In 1 connector. + NTV2_REFERENCE_INPUT3 = 6, ///< @brief Specifies the SDI In 3 connector. + NTV2_REFERENCE_INPUT4 = 7, ///< @brief Specifies the SDI In 4 connector. + NTV2_REFERENCE_INPUT5 = 8, ///< @brief Specifies the SDI In 5 connector. + NTV2_REFERENCE_INPUT6 = 9, ///< @brief Specifies the SDI In 6 connector. + NTV2_REFERENCE_INPUT7 = 10, ///< @brief Specifies the SDI In 7 connector. + NTV2_REFERENCE_INPUT8 = 11, ///< @brief Specifies the SDI In 8 connector. + NTV2_REFERENCE_SFP1_PTP = 12, ///< @brief Specifies the PTP source on SFP 1. + NTV2_REFERENCE_SFP1_PCR = 13, ///< @brief Specifies the PCR source on SFP 1. + NTV2_REFERENCE_SFP2_PTP = 14, ///< @brief Specifies the PTP source on SFP 2. + NTV2_REFERENCE_SFP2_PCR = 15, ///< @brief Specifies the PCR source on SFP 2. + NTV2_REFERENCE_HDMI_INPUT2 = 16, ///< @brief Specifies the HDMI In 2 connector. + NTV2_REFERENCE_HDMI_INPUT3 = 17, ///< @brief Specifies the HDMI In 3 connector. + NTV2_REFERENCE_HDMI_INPUT4 = 18, ///< @brief Specifies the HDMI In 4 connector. + NTV2_NUM_REFERENCE_INPUTS, // Always last! + NTV2_REFERENCE_HDMI_INPUT = NTV2_REFERENCE_HDMI_INPUT1, ///< @deprecated Use NTV2_REFERENCE_HDMI_INPUT1 instead. + NTV2_REFERENCE_ANALOG_INPUT = NTV2_REFERENCE_ANALOG_INPUT1, ///< @deprecated Use NTV2_REFERENCE_ANALOG_INPUT1 instead. + NTV2_REFERENCE_INVALID = NTV2_NUM_REFERENCE_INPUTS +} NTV2ReferenceSource; + +#define NTV2_IS_VALID_NTV2ReferenceSource(__x__) ((__x__) >= NTV2_REFERENCE_EXTERNAL && (__x__) < NTV2_NUM_REFERENCE_INPUTS) + +typedef enum +{ + NTV2_REFVOLTAGE_1 , + NTV2_REFVOLTAGE_4 +} NTV2RefVoltage; + + +typedef enum // used in FS1 +{ + NTV2FS1_RefSelect_None = 0, + NTV2FS1_RefSelect_RefBNC = 1, + NTV2FS1_RefSelect_ComponentY = 2, + NTV2FS1_RefSelect_SVideo = 4, + NTV2FS1_RefSelect_Composite = 8 +} NTV2FS1ReferenceSelect; + +typedef enum // used in FS1 +{ + NTV2FS1_FreezeOutput_Disable = 0, + NTV2FS1_FreezeOutput_Enable = 1 +} NTV2FS1FreezeOutput; + +typedef enum // used in FS1 +{ + NTV2FS1_OUTPUTTONE_DISABLE = 0, + NTV2FS1_OUTPUTTONE_ENABLE = 1 +} NTV2FS1OutputTone; + +typedef enum // used in FS1 +{ + NTV2FS1_AUDIOTONE_400Hz = 0, + NTV2FS1_AUDIOTONE_1000Hz = 1 +} NTV2FS1AudioTone; + +typedef enum // used in FS1 +{ + NTV2FS1_AUDIOLEVEL_24dBu = 0, + NTV2FS1_AUDIOLEVEL_18dBu = 1, + NTV2FS1_AUDIOLEVEL_12dBu = 2, + NTV2FS1_AUDIOLEVEL_15dBu = 3 +} NTV2FS1AudioLevel; + +typedef enum +{ + NTV2_DISABLEINTERRUPTS = 0x0, + NTV2_OUTPUTVERTICAL = 0x1, + NTV2_INPUT1VERTICAL = 0x2, + NTV2_INPUT2VERTICAL = 0x4, + NTV2_AUDIOINTERRUPT = 0x8, + NTV2_AUDIOOUTWRAPINTERRUPT = 0x10, + NTV2_AUDIOINWRAPINTERRUPT = 0x20, + NTV2_AUDIOWRAPRATEINTERRUPT = 0x40, + NTV2_UART_TX_INTERRUPT = 0x80, + NTV2_UART_RX_INTERRUPT = 0x100, + NTV2_FS1_I2C_INTERRUPT1 = 0x200, + NTV2_FS1_I2C_INTERRUPT2 = 0x400, + NTV2_AUX_VERTICAL_INTERRUPT = 0x800, + NTV2_AUX_VERTICAL_INTERRUPT_CLEAR= 0x1000, + NTV2_FS1_I2C_INTERRUPT2_CLEAR = 0x2000, + NTV2_FS1_I2C_INTERRUPT1_CLEAR = 0x4000, + NTV2_UART_RX_INTERRUPT_CLEAR = 0x8000, + NTV2_AUDIOCHUNKRATE_CLEAR = 0x10000, + NTV2_UART_TX_INTERRUPT2 = 0x20000, + NTV2_OUTPUT2VERTICAL = 0x40000, + NTV2_OUTPUT3VERTICAL = 0x80000, + NTV2_OUTPUT4VERTICAL = 0x100000, + NTV2_OUTPUT4VERTICAL_CLEAR = 0x200000, + NTV2_OUTPUT3VERTICAL_CLEAR = 0x400000, + NTV2_OUTPUT2VERTICAL_CLEAR = 0x800000, + NTV2_UART_TX_INTERRUPT_CLEAR = 0x1000000, + NTV2_WRAPRATEINTERRUPT_CLEAR = 0x2000000, + NTV2_UART_TX_INTERRUPT2_CLEAR = 0x4000000, + NTV2_AUDIOOUTWRAPINTERRUPT_CLEAR= 0x8000000, + NTV2_AUDIOINTERRUPT_CLEAR = 0x10000000, + NTV2_INPUT2VERTICAL_CLEAR = 0x20000000, + NTV2_INPUT1VERTICAL_CLEAR = 0x40000000, + NTV2_OUTPUTVERTICAL_CLEAR = 0x80000000 +} NTV2InterruptMask; + +typedef enum +{ + NTV2_OUTPUTVERTICAL_SHIFT = 0x0, + NTV2_INPUT1VERTICAL_SHIFT = 0x1, + NTV2_INPUT2VERTICAL_SHIFT = 0x2, + NTV2_AUDIOINTERRUPT_SHIFT = 0x3, + NTV2_AUDIOOUTWRAPINTERRUPT_SHIFT = 0x4, + NTV2_AUDIOINWRAPINTERRUPT_SHIFT = 0x5, + NTV2_AUDIOWRAPRATEINTERRUPT_SHIFT = 0x6, + NTV2_UART_TX_INTERRUPT_SHIFT = 0x7, + NTV2_UART_RX_INTERRUPT_SHIFT = 0x8, + NTV2_FS1_I2C_INTERRUPT1_SHIFT = 0x9, + NTV2_FS1_I2C_INTERRUPT2_SHIFT = 0xA, + NTV2_AUX_VERTICAL_INTERRUPT_SHIFT = 0xB, + NTV2_AUX_VERTICAL_INTERRUPT_CLEAR_SHIFT = 0xC, + NTV2_FS1_I2C_INTERRUPT2_CLEAR_SHIFT = 0xD, + NTV2_FS1_I2C_INTERRUPT1_CLEAR_SHIFT = 0xE, + NTV2_UART_RX_INTERRUPT_CLEAR_SHIFT = 0xF, + NTV2_AUDIOCHUNKRATE_CLEAR_SHIFT = 0x10, + NTV2_UART_TX_INTERRUPT2_SHIFT = 0x11, + NTV2_OUTPUT2VERTICAL_SHIFT = 0x12, + NTV2_OUTPUT3VERTICAL_SHIFT = 0x13, + NTV2_OUTPUT4VERTICAL_SHIFT = 0x14, + NTV2_OUTPUT4VERTICAL_CLEAR_SHIFT = 0x15, + NTV2_OUTPUT3VERTICAL_CLEAR_SHIFT = 0x16, + NTV2_OUTPUT2VERTICAL_CLEAR_SHIFT = 0x17, + NTV2_UART_TX_INTERRUPT_CLEAR_SHIFT = 0x18, + NTV2_WRAPRATEINTERRUPT_CLEAR_SHIFT = 0x19, + NTV2_UART_TX_INTERRUPT2_CLEAR_SHIFT = 0x1A, + NTV2_AUDIOOUTWRAPINTERRUPT_CLEAR_SHIFT = 0x1B, + NTV2_AUDIOINTERRUPT_CLEAR_SHIFT = 0x1C, + NTV2_INPUT2VERTICAL_CLEAR_SHIFT = 0x1D, + NTV2_INPUT1VERTICAL_CLEAR_SHIFT = 0x1E, + NTV2_OUTPUTVERTICAL_CLEAR_SHIFT = 0x1F +} NTV2InterruptShift; + +typedef enum +{ + NTV2_INPUT3VERTICAL = 0x2, + NTV2_INPUT4VERTICAL = 0x4, + NTV2_HDMIRXV2HOTPLUGDETECT = 0x10, + NTV2_HDMIRXV2HOTPLUGDETECT_CLEAR= 0x20, + NTV2_HDMIRXV2AVICHANGE = 0x40, + NTV2_HDMIRXV2AVICHANGE_CLEAR = 0x80, + NTV2_INPUT5VERTICAL = 0x100, + NTV2_INPUT6VERTICAL = 0x200, + NTV2_INPUT7VERTICAL = 0x400, + NTV2_INPUT8VERTICAL = 0x800, + NTV2_OUTPUT5VERTICAL = 0x1000, + NTV2_OUTPUT6VERTICAL = 0x2000, + NTV2_OUTPUT7VERTICAL = 0x4000, + NTV2_OUTPUT8VERTICAL = 0x8000, + NTV2_OUTPUT8VERTICAL_CLEAR = 0x10000, + NTV2_OUTPUT7VERTICAL_CLEAR = 0x20000, + NTV2_OUTPUT6VERTICAL_CLEAR = 0x40000, + NTV2_OUTPUT5VERTICAL_CLEAR = 0x80000, + NTV2_INPUT8VERTICAL_CLEAR = 0x2000000, + NTV2_INPUT7VERTICAL_CLEAR = 0x4000000, + NTV2_INPUT6VERTICAL_CLEAR = 0x8000000, + NTV2_INPUT5VERTICAL_CLEAR = 0x10000000, + NTV2_INPUT4VERTICAL_CLEAR = 0x20000000, + NTV2_INPUT3VERTICAL_CLEAR = 0x40000000 +} NTV2Interrupt2Mask; + +typedef enum +{ + NTV2_INPUT3VERTICAL_SHIFT = 0x1, + NTV2_INPUT4VERTICAL_SHIFT = 0x2, + NTV2_HDMIRXV2HOTPLUGDETECT_SHIFT = 0x4, + NTV2_HDMIRXV2HOTPLUGDETECT_CLEAR_SHIFT= 0x5, + NTV2_HDMIRXV2AVICHANGE_SHIFT = 0x6, + NTV2_HDMIRXV2AVICHANGE_CLEAR_SHIFT = 0x7, + NTV2_INPUT5VERTICAL_SHIFT = 0x8, + NTV2_INPUT6VERTICAL_SHIFT = 0x9, + NTV2_INPUT7VERTICAL_SHIFT = 0xA, + NTV2_INPUT8VERTICAL_SHIFT = 0xB, + NTV2_OUTPUT5VERTICAL_SHIFT = 0xC, + NTV2_OUTPUT6VERTICAL_SHIFT = 0xD, + NTV2_OUTPUT7VERTICAL_SHIFT = 0xE, + NTV2_OUTPUT8VERTICAL_SHIFT = 0xF, + NTV2_OUTPUT8VERTICAL_CLEAR_SHIFT = 0x10, + NTV2_OUTPUT7VERTICAL_CLEAR_SHIFT = 0x11, + NTV2_OUTPUT6VERTICAL_CLEAR_SHIFT = 0x12, + NTV2_OUTPUT5VERTICAL_CLEAR_SHIFT = 0x13, + NTV2_INPUT8VERTICAL_CLEAR_SHIFT = 0x19, + NTV2_INPUT7VERTICAL_CLEAR_SHIFT = 0x1A, + NTV2_INPUT6VERTICAL_CLEAR_SHIFT = 0x1B, + NTV2_INPUT5VERTICAL_CLEAR_SHIFT = 0x1C, + NTV2_INPUT4VERTICAL_CLEAR_SHIFT = 0x1D, + NTV2_INPUT3VERTICAL_CLEAR_SHIFT = 0x1E +} NTV2Interrupt2Shift; + +typedef enum +{ + NTV2_DISABLE_DMAINTERRUPTS = 0, + NTV2_DMA1_ENABLE = 1, + NTV2_DMA2_ENABLE = 2, + NTV2_DMA3_ENABLE = 4, + NTV2_DMA4_ENABLE = 8, + NTV2_DMA_BUS_ERROR = 16 +} NTV2DMAInterruptMask; + +typedef enum +{ + NTV2_DMA1_CLEAR = 0x08000000, + NTV2_DMA2_CLEAR = 0x10000000, + NTV2_DMA3_CLEAR = 0x20000000, + NTV2_DMA4_CLEAR = 0x40000000, + NTV2_BUSERROR_CLEAR= 0x80000000 +} NTV2DMAStatusBits; + +/** + @brief These values are used to determine when certain register writes actually take effect. + See CNTV2Card::SetRegisterWriteMode or \ref fieldframeinterrupts +**/ +typedef enum +{ + NTV2_REGWRITE_SYNCTOFIELD, ///< @brief Field Mode: Register changes take effect at the next field VBI. + NTV2_REGWRITE_SYNCTOFRAME, ///< @brief Frame Mode: Register changes take effect at the next frame VBI (power-up default). + NTV2_REGWRITE_IMMEDIATE, ///< @brief Register changes take effect immediately, without waiting for a field or frame VBI. + NTV2_REGWRITE_SYNCTOFIELD_AFTER10LINES ///< @brief Register changes take effect after 10 lines after the next field VBI (not commonly used). +} NTV2RegisterWriteMode; + +typedef enum +{ + NTV2_SIGNALMASK_NONE = 0, ///< Output Black. + NTV2_SIGNALMASK_Y = 1, ///< Output Y if set, else Output Y=0x40 + NTV2_SIGNALMASK_Cb = 2, ///< Output Cb if set, elso Output Cb to 0x200 + NTV2_SIGNALMASK_Cr = 4, ///< Output Cr if set, elso Output Cr to 0x200 + NTV2_SIGNALMASK_ALL = 1+2+4 ///< Output Cr if set, elso Output Cr to 0x200 +} NTV2SignalMask; + +/** + @brief Logically, these are an ::NTV2Channel combined with an ::NTV2Mode. + @note Do not use these, as they will be removed at some point in the future. +**/ +typedef enum +{ + NTV2CROSSPOINT_CHANNEL1, + NTV2CROSSPOINT_CHANNEL2, + NTV2CROSSPOINT_INPUT1, + NTV2CROSSPOINT_INPUT2, + NTV2CROSSPOINT_MATTE, ///< @deprecated This is obsolete + NTV2CROSSPOINT_FGKEY, ///< @deprecated This is obsolete + NTV2CROSSPOINT_CHANNEL3, + NTV2CROSSPOINT_CHANNEL4, + NTV2CROSSPOINT_INPUT3, + NTV2CROSSPOINT_INPUT4, + NTV2CROSSPOINT_CHANNEL5, + NTV2CROSSPOINT_CHANNEL6, + NTV2CROSSPOINT_CHANNEL7, + NTV2CROSSPOINT_CHANNEL8, + NTV2CROSSPOINT_INPUT5, + NTV2CROSSPOINT_INPUT6, + NTV2CROSSPOINT_INPUT7, + NTV2CROSSPOINT_INPUT8, + NTV2_NUM_CROSSPOINTS, + NTV2CROSSPOINT_INVALID = NTV2_NUM_CROSSPOINTS +} NTV2Crosspoint; + +#define NTV2_IS_INPUT_CROSSPOINT(__x__) ( (__x__) == NTV2CROSSPOINT_INPUT1 || \ + (__x__) == NTV2CROSSPOINT_INPUT2 || \ + (__x__) == NTV2CROSSPOINT_INPUT3 || \ + (__x__) == NTV2CROSSPOINT_INPUT4 || \ + (__x__) == NTV2CROSSPOINT_INPUT5 || \ + (__x__) == NTV2CROSSPOINT_INPUT6 || \ + (__x__) == NTV2CROSSPOINT_INPUT7 || \ + (__x__) == NTV2CROSSPOINT_INPUT8 ) + +#define NTV2_IS_OUTPUT_CROSSPOINT(__x__) ( (__x__) == NTV2CROSSPOINT_CHANNEL1 || \ + (__x__) == NTV2CROSSPOINT_CHANNEL2 || \ + (__x__) == NTV2CROSSPOINT_CHANNEL3 || \ + (__x__) == NTV2CROSSPOINT_CHANNEL4 || \ + (__x__) == NTV2CROSSPOINT_CHANNEL5 || \ + (__x__) == NTV2CROSSPOINT_CHANNEL6 || \ + (__x__) == NTV2CROSSPOINT_CHANNEL7 || \ + (__x__) == NTV2CROSSPOINT_CHANNEL8 ) + +#define NTV2_IS_VALID_NTV2CROSSPOINT(__x__) (NTV2_IS_INPUT_CROSSPOINT (__x__) || NTV2_IS_OUTPUT_CROSSPOINT (__x__)) + + +typedef enum +{ + NTV2VIDPROCMODE_MIX, + NTV2VIDPROCMODE_SPLIT, + NTV2VIDPROCMODE_KEY, + NTV2VIDPROCMODE_INVALID +} NTV2Ch1VidProcMode; + +typedef enum +{ + NTV2Ch2OUTPUTMODE_BGV, + NTV2Ch2OUTPUTMODE_FGV, + NTV2Ch2OUTPUTMODE_MIXEDKEY, + NTV2Ch2OUTPUTMODE_INVALID +} NTV2Ch2OutputMode; + + +typedef enum +{ + NTV2SPLITMODE_HORZSPLIT, + NTV2SPLITMODE_VERTSPLIT, + NTV2SPLITMODE_HORZSLIT, + NTV2SPLITMODE_VERTSLIT, + NTV2SPLITMODE_INVALID +} NTV2SplitMode; + + +/** + @brief These enum values identify the Mixer/Keyer foreground and background input control values. + @see CNTV2Card::GetMixerFGInputControl, CNTV2Card::SetMixerFGInputControl, CNTV2Card::GetMixerBGInputControl, CNTV2Card::SetMixerBGInputControl, \ref widget_mixkey +**/ +typedef enum +{ + NTV2MIXERINPUTCONTROL_FULLRASTER, + NTV2MIXERINPUTCONTROL_SHAPED, + NTV2MIXERINPUTCONTROL_UNSHAPED, + NTV2MIXERINPUTCONTROL_INVALID +} NTV2MixerKeyerInputControl; + +#define NTV2_IS_VALID_MIXERINPUTCONTROL(__x__) ((__x__) >= NTV2MIXERINPUTCONTROL_FULLRASTER && (__x__) < NTV2MIXERINPUTCONTROL_INVALID) + +#if !defined (NTV2_DEPRECATE) + typedef NTV2MixerKeyerInputControl Xena2VidProcInputControl; + #define XENA2VIDPROCINPUTCONTROL_FULLRASTER NTV2MIXERINPUTCONTROL_FULLRASTER + #define XENA2VIDPROCINPUTCONTROL_SHAPED NTV2MIXERINPUTCONTROL_SHAPED + #define XENA2VIDPROCINPUTCONTROL_UNSHAPED NTV2MIXERINPUTCONTROL_UNSHAPED +#endif // !defined (NTV2_DEPRECATE) + + +/** + @brief These enum values identify the mixer mode. + @see CNTV2Card::GetMixerMode, CNTV2Card::SetMixerMode, \ref widget_mixkey +**/ +typedef enum +{ + NTV2MIXERMODE_FOREGROUND_ON, ///< @brief Passes only foreground video + key to the Mixer output. + NTV2MIXERMODE_MIX, ///< @brief Overlays foreground video on top of background video. + NTV2MIXERMODE_SPLIT, ///< @deprecated Obsolete -- split-view is no longer supported. + NTV2MIXERMODE_FOREGROUND_OFF, ///< @brief Passes only background video + key to the Mixer output. + NTV2MIXERMODE_INVALID ///< @brief Invalid/uninitialized. +} NTV2MixerKeyerMode; + +#define NTV2_IS_VALID_MIXERMODE(__x__) ((__x__) >= NTV2MIXERMODE_FOREGROUND_ON && (__x__) < NTV2MIXERMODE_INVALID) + +#if !defined (NTV2_DEPRECATE) + typedef NTV2MixerKeyerMode Xena2VidProcMode; + #define XENAVIDPROCMODE_FOREGROUND_ON NTV2MIXERMODE_FOREGROUND_ON + #define XENAVIDPROCMODE_MIX NTV2MIXERMODE_MIX + #define XENAVIDPROCMODE_SPLIT NTV2MIXERMODE_SPLIT + #define XENAVIDPROCMODE_FOREGROUND_OFF NTV2MIXERMODE_FOREGROUND_OFF +#endif // !defined (NTV2_DEPRECATE) + +typedef enum +{ + NTV2OUTPUTFILTER_NONE, + NTV2OUTPUTFILTER_VERTICAL, + NTV2OUTPUTFILTER_FIELD1, + NTV2OUTPUTFILTER_FIELD2 +} NTV2OutputFilter; + +typedef enum +{ + NTV2PROCAMPSTANDARDDEFBRIGHTNESS, /* SD Luma Offset */ + NTV2PROCAMPSTANDARDDEFCONTRAST, /* SD Luma Gain */ + NTV2PROCAMPSTANDARDDEFSATURATION, /* SD Cb and Cr Gain */ + NTV2PROCAMPSTANDARDDEFHUE, /* SD Composite and S-Video only */ + NTV2PROCAMPHIGHDEFBRIGHTNESS, /* HD Luma Offset */ + NTV2PROCAMPHIGHDEFCONTRAST, /* HD Luma Gain */ + NTV2PROCAMPHIGHDEFSATURATION, /* HD Cb and Cr Gain */ + NTV2PROCAMPHIGHDEFHUE /* HD Hue, not implemented */ +} NTV2ProcAmpControl; + + +#define NTV2_MAXBOARDS 8 + + +typedef enum +{ + PROP_SETTINGS, + PROP_TESTPATTERN, + PROP_EXPORT, + PROP_CAPTURE, + PROP_VIDEOPROC, + PROP_NONE +} NTV2Prop ; + +/** + @brief These values are used to identify fields for interlaced video. + See \ref fieldframeinterrupts and CNTV2Card::WaitForInputFieldID. +**/ +typedef enum +{ + NTV2_FIELD0, ///< @brief Identifies the first field in time for an interlaced video frame, or the first and only field in a progressive video frame. + NTV2_FIELD1, ///< @brief Identifies the last (second) field in time for an interlaced video frame. + NTV2_FIELD_INVALID +} NTV2FieldID; + +#define NTV2_IS_VALID_FIELD(__x__) ((__x__) >= NTV2_FIELD0 && (__x__) < NTV2_FIELD_INVALID) + + +typedef enum +{ + DMA_READ, + DMA_WRITE +} DMADirection; + +typedef enum +{ + NTV2_PIO, // don't change these equates 0-4 + NTV2_DMA1, + NTV2_DMA2, + NTV2_DMA3, + NTV2_DMA4, + NTV2_AUTODMA2, + NTV2_AUTODMA3, + NTV2_DMA_FIRST_AVAILABLE +} NTV2DMAEngine; + +#define NTV2_NUM_DMA_ENGINES (NTV2_DMA4 - NTV2_DMA1 + 1) + +typedef enum +{ + QUICKEXPORT_DESKTOP, + QUICKEXPORT_WINDOW, + QUICKEXPORT_CLIPBOARD, + QUICKEXPORT_FILE +} QuickExportMode; + +typedef enum +{ + NTV2CAPTURESOURCE_INPUT1, + NTV2CAPTURESOURCE_INPUT2, + NTV2CAPTURESOURCE_INPUT1_PLUS_INPUT2, + NTV2CAPTURESOURCE_FRAMEBUFFER +} NTV2CaptureSource; + +typedef enum +{ + NTV2CAPTUREDESTINATION_CLIPBOARD, + NTV2CAPTUREDESTINATION_BMPFILE, + NTV2CAPTUREDESTINATION_JPEGFILE, + NTV2CAPTUREDESTINATION_YUVFILE, + NTV2CAPTUREDESTINATION_TIFFFILE, + NTV2CAPTUREDESTINATION_WINDOW, + NTV2CAPTUREDESTINATION_PNGFILE, + NTV2CAPTUREDESTINATION_FRAMEBUFFERONLY, // Just leave in FrameBuffer + NTV2_MAX_NUM_CaptureDestinations +} NTV2CaptureDestination; + +typedef enum +{ + NTV2CAPTUREMODE_FIELD, + NTV2CAPTUREMODE_FRAME, + NTV2_MAX_NUM_CaptureModes +} NTV2CaptureMode; + +/** + @brief Represents the size of the audio buffer used by a device audio system for storing captured + samples or samples awaiting playout. For example, NTV2_AUDIO_BUFFER_SIZE_4MB means that a + 4MB chunk of device memory is used to store captured audio samples, while another 4MB block + of device memory is used to store audio samples for playout. + @note All NTV2 devices have standardized on 4MB audio buffers. Using a different value may result + in unexpected behavior. +**/ +typedef enum +{ + NTV2_AUDIO_BUFFER_SIZE_1MB = 0, // 0b00 + NTV2_AUDIO_BUFFER_SIZE_4MB = 1, // 0b01 + NTV2_AUDIO_BUFFER_STANDARD = NTV2_AUDIO_BUFFER_SIZE_1MB, + NTV2_AUDIO_BUFFER_BIG = NTV2_AUDIO_BUFFER_SIZE_4MB, +#if !defined (NTV2_DEPRECATE) + NTV2_AUDIO_BUFFER_SIZE_2MB = 2, // 0b10 + NTV2_AUDIO_BUFFER_SIZE_8MB = 3, // 0b11 + NTV2_AUDIO_BUFFER_MEDIUM = NTV2_AUDIO_BUFFER_SIZE_2MB, + NTV2_AUDIO_BUFFER_BIGGER = NTV2_AUDIO_BUFFER_SIZE_8MB, +#endif // !defined (NTV2_DEPRECATE) + NTV2_AUDIO_BUFFER_INVALID, + NTV2_MAX_NUM_AudioBufferSizes = NTV2_AUDIO_BUFFER_INVALID + +} NTV2AudioBufferSize; + +#define NTV2_IS_VALID_AUDIO_BUFFER_SIZE(_x_) ((_x_) >= NTV2_AUDIO_BUFFER_STANDARD && (_x_) < NTV2_MAX_NUM_AudioBufferSizes) + + +typedef enum +{ + NTV2_AUDIO_48K, + NTV2_AUDIO_96K, + NTV2_AUDIO_192K, + NTV2_MAX_NUM_AudioRates, + NTV2_AUDIO_RATE_INVALID = NTV2_MAX_NUM_AudioRates +} NTV2AudioRate; + +#define NTV2_IS_VALID_AUDIO_RATE(_x_) ((_x_) < NTV2_MAX_NUM_AudioRates) + + +typedef enum +{ + NTV2_ENCODED_AUDIO_NORMAL, // Normal, Sample Rate Converter enabled + NTV2_ENCODED_AUDIO_SRC_DISABLED // AES ch. 1/2 encoded audio mode (SRC disabled) +} NTV2EncodedAudioMode; + + +typedef enum +{ + NTV2_AUDIO_FORMAT_LPCM, + NTV2_AUDIO_FORMAT_DOLBY, + NTV2_MAX_NUM_AudioFormats, + NTV2_AUDIO_FORMAT_INVALID = NTV2_MAX_NUM_AudioFormats +} NTV2AudioFormat; + +#define NTV2_IS_VALID_AUDIO_FORMAT(_x_) ((_x_) < NTV2_MAX_NUM_AudioFormats) + +/** + @brief This enum value determines/states which SDI video input will be used to supply + audio samples to an audio system. + It assumes that the audio systems' audio source is set to NTV2_AUDIO_EMBEDDED. + @see CNTV2Card::SetEmbeddedAudioInput, CNTV2Card::GetEmbeddedAudioInput +**/ +typedef enum +{ + NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_1, + NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_2, + NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_3, + NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_4, + NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_5, + NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_6, + NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_7, + NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_8, + NTV2_MAX_NUM_EmbeddedAudioInputs, + NTV2_EMBEDDED_AUDIO_INPUT_INVALID = NTV2_MAX_NUM_EmbeddedAudioInputs +} NTV2EmbeddedAudioInput; + +#define NTV2_IS_VALID_EMBEDDED_AUDIO_INPUT(_x_) ((_x_) >= NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_1 && (_x_) < NTV2_EMBEDDED_AUDIO_INPUT_INVALID) + + +/** + @brief This enum value determines/states the device audio clock reference source. + It was important to set this to ::NTV2_EMBEDDED_AUDIO_CLOCK_VIDEO_INPUT on older devices. + Newer devices always use ::NTV2_EMBEDDED_AUDIO_CLOCK_VIDEO_INPUT and cannot be changed. + @see CNTV2Card::GetEmbeddedAudioClock, CNTV2Card::SetEmbeddedAudioClock, \ref audiooperation +**/ +typedef enum +{ + NTV2_EMBEDDED_AUDIO_CLOCK_REFERENCE, ///< @brief Audio clock derived from the device reference + NTV2_EMBEDDED_AUDIO_CLOCK_VIDEO_INPUT, ///< @brief Audio clock derived from the video input + NTV2_MAX_NUM_EmbeddedAudioClocks, + NTV2_EMBEDDED_AUDIO_CLOCK_INVALID = NTV2_MAX_NUM_EmbeddedAudioClocks +} NTV2EmbeddedAudioClock; + +#define NTV2_IS_VALID_EMBEDDED_AUDIO_CLOCK(_x_) ((_x_) < NTV2_MAX_NUM_EmbeddedAudioClocks) + + +/** + @brief This enum value determines/states where an audio system will obtain its audio samples. + @see CNTV2Card::SetAudioSystemInputSource, CNTV2Card::GetAudioSystemInputSource, \ref audiocapture +**/ +typedef enum +{ + NTV2_AUDIO_EMBEDDED, ///< @brief Obtain audio samples from the audio that's embedded in the video HANC + NTV2_AUDIO_AES, ///< @brief Obtain audio samples from the device AES inputs, if available. + NTV2_AUDIO_ANALOG, ///< @brief Obtain audio samples from the device analog input(s), if available. + NTV2_AUDIO_HDMI, ///< @brief Obtain audio samples from the device HDMI input, if available + NTV2_AUDIO_MIC, + NTV2_MAX_NUM_AudioSources, + NTV2_AUDIO_SOURCE_INVALID = NTV2_MAX_NUM_AudioSources +} NTV2AudioSource; + +#define NTV2_AUDIO_SOURCE_IS_EMBEDDED(_x_) ((_x_) == NTV2_AUDIO_EMBEDDED) +#define NTV2_AUDIO_SOURCE_IS_AES(_x_) ((_x_) == NTV2_AUDIO_AES) +#define NTV2_AUDIO_SOURCE_IS_ANALOG(_x_) ((_x_) == NTV2_AUDIO_ANALOG) +#define NTV2_AUDIO_SOURCE_IS_HDMI(_x_) ((_x_) == NTV2_AUDIO_HDMI) +#define NTV2_IS_VALID_AUDIO_SOURCE(_x_) ((_x_) >= NTV2_AUDIO_EMBEDDED && (_x_) < NTV2_AUDIO_SOURCE_INVALID) + + +/** + @brief This enum value determines/states if an audio output embedder will embed silence (zeroes) + or de-embedded audio from an SDI input. + @see CNTV2Card::SetAudioLoopBack, CNTV2Card::GetAudioLoopBack, CNTV2Card::SetAudioSystemInputSource, CNTV2Card::GetAudioSystemInputSource, \ref audioplayout +**/ +typedef enum +{ + NTV2_AUDIO_LOOPBACK_OFF, ///< @brief Embeds silence (zeroes) into the data stream. + NTV2_AUDIO_LOOPBACK_ON, ///< @brief Embeds SDI input source audio into the data stream. + NTV2_AUDIO_LOOPBACK_INVALID +} NTV2AudioLoopBack; + +#define NTV2_IS_VALID_AUDIO_LOOPBACK(_x_) ((_x_) >= NTV2_AUDIO_LOOPBACK_OFF && (_x_) < NTV2_AUDIO_LOOPBACK_INVALID) + +/** + @brief Determines the order that raster lines are written into, or read out of, frame buffer memory on the device. +**/ +typedef enum +{ + NTV2_FRAMEBUFFER_ORIENTATION_TOPDOWN, ///< @brief Raster lines are read/written top-to-bottom from/to frame buffer memory. + NTV2_FRAMEBUFFER_ORIENTATION_NORMAL = NTV2_FRAMEBUFFER_ORIENTATION_TOPDOWN, + NTV2_FRAMEBUFFER_ORIENTATION_BOTTOMUP, ///< @brief Raster lines are read/written bottom-to-top from/to frame buffer memory. + NTV2_FRAMEBUFFER_ORIENTATION_INVALID, + NTV2_MAX_NUM_VideoFrameBufferOrientations = NTV2_FRAMEBUFFER_ORIENTATION_INVALID +} NTV2VideoFrameBufferOrientation, NTV2FrameBufferOrientation, NTV2FBOrientation; + +#define NTV2_IS_VALID_FRAMEBUFFER_ORIENTATION(_x_) ((_x_) >= NTV2_FRAMEBUFFER_ORIENTATION_TOPDOWN && (_x_) < NTV2_MAX_NUM_VideoFrameBufferOrientations) +#define NTV2_IS_FRAMEBUFFER_ORIENTATION_FLIPPED(_x_) ((_x_) == NTV2_FRAMEBUFFER_ORIENTATION_BOTTOMUP) + + +typedef enum +{ + NTV2_CCHOSTACCESS_CH1BANK0, + NTV2_CCHOSTACCESS_CH1BANK1, + NTV2_CCHOSTACCESS_CH2BANK0, + NTV2_CCHOSTACCESS_CH2BANK1, + NTV2_CCHOSTACCESS_CH3BANK0, + NTV2_CCHOSTACCESS_CH3BANK1, + NTV2_CCHOSTACCESS_CH4BANK0, + NTV2_CCHOSTACCESS_CH4BANK1, + NTV2_CCHOSTACCESS_CH5BANK0, + NTV2_CCHOSTACCESS_CH5BANK1, + NTV2_CCHOSTACCESS_CH6BANK0, + NTV2_CCHOSTACCESS_CH6BANK1, + NTV2_CCHOSTACCESS_CH7BANK0, + NTV2_CCHOSTACCESS_CH7BANK1, + NTV2_CCHOSTACCESS_CH8BANK0, + NTV2_CCHOSTACCESS_CH8BANK1, + NTV2_MAX_NUM_ColorCorrectionHostAccessBanks +}NTV2ColorCorrectionHostAccessBank; + +typedef enum +{ + NTV2_CCMODE_OFF, + NTV2_CCMODE_RGB, + NTV2_CCMODE_YCbCr, + NTV2_CCMODE_3WAY, + NTV2_MAX_NUM_ColorCorrectionModes, + NTV2_CCMODE_INVALID = NTV2_MAX_NUM_ColorCorrectionModes +} NTV2ColorCorrectionMode; + +#define NTV2_IS_VALID_COLOR_CORRECTION_MODE(__x__) ((__x__) >= NTV2_CCMODE_OFF && (__x__) < NTV2_MAX_NUM_ColorCorrectionModes) +#define NTV2_IS_ACTIVE_COLOR_CORRECTION_MODE(__x__) (NTV2_IS_VALID_COLOR_CORRECTION_MODE (__x__) && (__x__) != NTV2_CCMODE_OFF) + + +///////////////////////////////////////////////////////////////////////////////////// +// RP188 (timecode) enum and structs - added for oem driver +typedef enum +{ + NTV2_RP188_INPUT, + NTV2_RP188_OUTPUT, + NTV2_MAX_NUM_RP188Modes, + NTV2_RP188_INVALID = NTV2_MAX_NUM_RP188Modes +} NTV2_RP188Mode; // matches sense of hardware register bit + +#define NTV2_IS_VALID_RP188_MODE(__x__) ((__x__) >= NTV2_RP188_INPUT && (__x__) < NTV2_MAX_NUM_RP188Modes) + + +typedef enum +{ + NTV2_AUDIOPLAYBACK_NOW, + NTV2_AUDIOPLAYBACK_NEXTFRAME, + NTV2_AUDIOPLAYBACK_NORMALAUTOCIRCULATE, // default + NTV2_AUDIOPLAYBACK_1STAUTOCIRCULATEFRAME // only works for channelspec = NTV2CROSSPOINT_CHANNEL1 +} NTV2_GlobalAudioPlaybackMode; + +////////////////////////////////////////////////////////////////////////////////////// +/// Kona2/Xena2 specific enums +typedef enum +{ + NTV2_FRAMESIZE_2MB, + NTV2_FRAMESIZE_4MB, + NTV2_FRAMESIZE_8MB, + NTV2_FRAMESIZE_16MB, + NTV2_FRAMESIZE_6MB, + NTV2_FRAMESIZE_10MB, + NTV2_FRAMESIZE_12MB, + NTV2_FRAMESIZE_14MB, + NTV2_FRAMESIZE_18MB, + NTV2_FRAMESIZE_20MB, + NTV2_FRAMESIZE_22MB, + NTV2_FRAMESIZE_24MB, + NTV2_FRAMESIZE_26MB, + NTV2_FRAMESIZE_28MB, + NTV2_FRAMESIZE_30MB, + NTV2_FRAMESIZE_32MB, + NTV2_MAX_NUM_Framesizes, + NTV2_FRAMESIZE_INVALID = NTV2_MAX_NUM_Framesizes +} NTV2Framesize; + +#define NTV2_IS_VALID_FRAMESIZE(__x__) ((__x__) >= NTV2_FRAMESIZE_2MB && (__x__) < NTV2_MAX_NUM_Framesizes) +#define NTV2_IS_VALID_8MB_FRAMESIZE(__x__) ((__x__) == NTV2_FRAMESIZE_8MB || (__x__) == NTV2_FRAMESIZE_16MB || (__x__) == NTV2_FRAMESIZE_32MB) + + +typedef enum +{ + NTV2_480iRGB, + NTV2_480iYPbPrSMPTE, + NTV2_480iYPbPrBetacam525, + NTV2_480iYPbPrBetacamJapan, + NTV2_480iNTSC_US_Composite, + NTV2_480iNTSC_Japan_Composite, + NTV2_576iRGB, + NTV2_576iYPbPrSMPTE, + NTV2_576iPAL_Composite, + NTV2_1080iRGB, + NTV2_1080psfRGB, + NTV2_720pRGB, + NTV2_1080iSMPTE, + NTV2_1080psfSMPTE, + NTV2_720pSMPTE, + NTV2_1080iXVGA, + NTV2_1080psfXVGA, + NTV2_720pXVGA, + NTV2_2Kx1080RGB, + NTV2_2Kx1080SMPTE, + NTV2_2Kx1080XVGA, + NTV2_END_DACMODES, + NTV2_MAX_NUM_VideoDACModes, + NTV2_VIDEO_DAC_MODE_INVALID = NTV2_END_DACMODES +} NTV2VideoDACMode; + +#define NTV2_IS_VALID_VIDEO_DAC_MODE(__x__) ((__x__) >= NTV2_480iRGB && (__x__) < NTV2_END_DACMODES) + + +typedef enum +{ + NTV2LHI_480iRGB = 0xC, + NTV2LHI_480iYPbPrSMPTE = 0x8, + NTV2LHI_480iYPbPrBetacam525 = 0x9, + NTV2LHI_480iYPbPrBetacamJapan = 0xA, + NTV2LHI_480iNTSC_US_Composite = 0x1, + NTV2LHI_480iNTSC_Japan_Composite = 0x2, + NTV2LHI_576iRGB = 0xC, + NTV2LHI_576iYPbPrSMPTE = 0x8, + NTV2LHI_576iPAL_Composite = 0x0, + NTV2LHI_1080iRGB = 0xC, + NTV2LHI_1080psfRGB = 0xC, + NTV2LHI_1080iSMPTE = 0x8, + NTV2LHI_1080psfSMPTE = 0x8, + NTV2LHI_720pRGB = 0xC, + NTV2LHI_720pSMPTE = 0x8, + NTV2_MAX_NUM_LHIVideoDACModes +} NTV2LHIVideoDACMode; + + +// GetAnalogInputADCMode +typedef enum +{ + NTV2_480iADCComponentBeta, // 0 + NTV2_480iADCComponentSMPTE, // 1 + NTV2_480iADCSVideoUS, // 2 + NTV2_480iADCCompositeUS, // 3 + NTV2_480iADCComponentBetaJapan, // 4 + NTV2_480iADCComponentSMPTEJapan, // 5 + NTV2_480iADCSVideoJapan, // 6 + NTV2_480iADCCompositeJapan, // 7 + NTV2_576iADCComponentBeta, // 8 + NTV2_576iADCComponentSMPTE, // 9 + NTV2_576iADCSVideo, // 10 + NTV2_576iADCComposite, // 11 + NTV2_720p_60, // 60 + 59.94 // 12 + NTV2_1080i_30, // 30 + 29.97 // 13 + NTV2_720p_50, // 14 + NTV2_1080i_25, // 15 + NTV2_1080pSF24, // 24 + 23.98 // 16 + NTV2_MAX_NUM_LSVideoADCModes // 17 +} NTV2LSVideoADCMode; + + +// Up/Down/Cross Converter modes +typedef enum +{ + NTV2_UpConvertAnamorphic, + NTV2_UpConvertPillarbox4x3, + NTV2_UpConvertZoom14x9, + NTV2_UpConvertZoomLetterbox, + NTV2_UpConvertZoomWide, + NTV2_MAX_NUM_UpConvertModes, + NTV2_UpConvertMode_Invalid = NTV2_MAX_NUM_UpConvertModes +} NTV2UpConvertMode; + + +#if !defined(NTV2_DEPRECATE_16_1) + typedef enum + { + NTV2_AnalogAudioIO_8Out, + NTV2_AnalogAudioIO_4In_4Out, + NTV2_AnalogAudioIO_4Out_4In, + NTV2_AnalogAudioIO_8In + } NTV2AnalogAudioIO; +#endif // !defined(NTV2_DEPRECATE_16_1) + + +typedef enum +{ + NTV2_DownConvertLetterbox, + NTV2_DownConvertCrop, + NTV2_DownConvertAnamorphic, + NTV2_DownConvert14x9, + NTV2_MAX_NUM_DownConvertModes, + NTV2_DownConvertMode_Invalid = NTV2_MAX_NUM_DownConvertModes +} NTV2DownConvertMode; + + +typedef enum +{ + NTV2_IsoLetterBox, + NTV2_IsoHCrop, + NTV2_IsoPillarBox, + NTV2_IsoVCrop, + NTV2_Iso14x9, + NTV2_IsoPassThrough, + NTV2_MAX_NUM_IsoConvertModes, + NTV2_IsoConvertMode_Invalid = NTV2_MAX_NUM_IsoConvertModes +} NTV2IsoConvertMode; + + +// This specifies the range of levels for 10-bit RGB (aka DualLink) +typedef enum +{ + NTV2_RGB10RangeFull, // Levels are 0 - 1023 (Full) + NTV2_RGB10RangeSMPTE, // Levels are 64 - 940 (SMPTE) + NTV2_MAX_NUM_RGB10Ranges +} NTV2RGB10Range; + +typedef enum +{ + NTV2_MixerRGBRangeFull, + NTV2_MixerRGBRangeSMPTE +} NTV2MixerRGBRange; + + +typedef enum +{ + NTV2_AudioMap12_12, + NTV2_AudioMap34_12, + NTV2_AudioMap56_12, + NTV2_AudioMap78_12, + NTV2_AudioMap910_12, + NTV2_AudioMap1112_12, + NTV2_AudioMap1314_12, + NTV2_AudioMap1516_12, + NTV2_MAX_NUM_AudioMapSelectEnums +} NTV2AudioMapSelect; + + +typedef enum // Virtual Register: kVRegInputSelect - set in services +{ + NTV2_Input1Select, + NTV2_Input2Select, + NTV2_Input3Select, + NTV2_Input4Select, + NTV2_Input5Select, + NTV2_Input2xDLHDSelect, + NTV2_Input2x4kSelect, + NTV2_Input4x4kSelect, + NTV2_Input2x8kSelect, + NTV2_Input4x8kSelect, + NTV2_InputAutoSelect, + NTV2_MAX_NUM_InputVideoSelectEnums +} NTV2InputVideoSelect; + + +typedef enum +{ + NTV2_AUDIOLEVEL_24dBu, + NTV2_AUDIOLEVEL_18dBu, + NTV2_AUDIOLEVEL_12dBu, + NTV2_AUDIOLEVEL_15dBu, + NTV2_MAX_NUM_AudioLevels +} NTV2AudioLevel; + + +#if !defined(R2_DEPRECATE) + +typedef enum // Deprecated +{ + NTV2_GammaNone, // don't change LUTs for gamma (aka "Custom") + NTV2_GammaAuto, // switch between Rec 601 for SD and Rec 709 for HD + NTV2_GammaMac, // 1.8 "Macintosh" Power-function gamma + NTV2_GammaRec601, // 2.2 Rec 601 Power-function gamma + NTV2_GammaRec709, // 2.22.. Rec 709 gamma + NTV2_GammaPC, // 2.5 "PC" Power-function gamma + NTV2_MAX_NUM_GammaTypes +} NTV2GammaType; + + +typedef enum // Deprecated +{ + NTV2_ColorSpaceModeAuto, // Auto Select + NTV2_ColorSpaceModeYCbCr, // YCbCr (TBD, add 420, 444 options) + NTV2_ColorSpaceModeRgb, // RGB + NTV2_MAX_NUM_ColorSpaceModes +} NTV2ColorSpaceMode; + + +typedef enum // Deprecated +{ + NTV2_RGBRangeAuto, // don't change LUTs for gamma (aka "Custom") + NTV2_RGBRangeFull, // Levels are 0 - 1023 (Full) + NTV2_RGBRangeSMPTE, // Levels are 64 - 940 (SMPTE) + NTV2_MAX_NUM_RGBRangeModes +} NTV2RGBRangeMode; + + +typedef enum +{ + NTV2_AnlgComposite, // Composite or Composite + NTV2_AnlgComponentSMPTE, // Component (SMPTE/N10 levels) + NTV2_AnlgComponentBetacam, // Component (Betacam levels) + NTV2_AnlgComponentRGB, // Component (RGB) + NTV2_AnlgXVGA, // xVGA + NTV2_AnlgSVideo, // S-Video + NTV2_MAX_NUM_AnalogTypes +} NTV2AnalogType; + + +typedef enum +{ + NTV2_Black75IRE, // 7.5 IRE (NTSC-US) + NTV2_Black0IRE, // 0 IRE (NTSC-J) + NTV2_MAX_NUM_AnalogBlackLevels +} NTV2AnalogBlackLevel; + + +#if !defined(NTV2_DEPRECATE_15_1) + typedef enum + { + NTV2_YUVSelect, + NTV2_RGBSelect, + NTV2_Stereo3DSelect, + NTV2_NUM_SDIInputFormats + } NTV2SDIInputFormatSelect; +#endif // !defined(NTV2_DEPRECATE_15_1) + + +typedef enum // Deprecated +{ + NTV2_DeviceUnavailable = -1, + NTV2_DeviceNotInitialized = 0, + NTV2_DeviceInitialized = 1 +} NTV2DeviceInitialized; + + +typedef enum // Deprecated +{ + NTV2_AES_EBU_XLRSelect, + NTV2_AES_EBU_BNCSelect, + NTV2_Input1Embedded1_8Select, + NTV2_Input1Embedded9_16Select, + NTV2_Input2Embedded1_8Select, + NTV2_Input2Embedded9_16Select, + NTV2_AnalogSelect, + NTV2_HDMISelect, + NTV2_AudioInputOther, + NTV2_MicInSelect, + NTV2_HDMI2Select, + NTV2_HDMI3Select, + NTV2_HDMI4Select, + NTV2_AutoAudioSelect, + NTV2_MAX_NUM_InputAudioSelectEnums +} NTV2InputAudioSelect; + +typedef enum +{ + NTV2_PrimaryOutputSelect, + NTV2_SecondaryOutputSelect, + NTV2_RgbOutputSelect, // Deprecated + NTV2_VideoPlusKeySelect, + NTV2_StereoOutputSelect, + NTV2_Quadrant1Select, + NTV2_Quadrant2Select, + NTV2_Quadrant3Select, + NTV2_Quadrant4Select, + NTV2_Quarter4k, + NTV2_4kHalfFrameRate, // deprecated + NTV2_MultiView, + NTV2_AutoOutputSelect, + NTV2_MAX_NUM_OutputVideoSelectEnums +} NTV2OutputVideoSelect; + + +typedef enum // Deprecated +{ + NTV2_SDITransport_Off, // transport disabled, disconnected + NTV2_SDITransport_1_5, // Single Link, 1 wire 1.5G + NTV2_SDITransport_3Ga, // Single Link, 1 wire 3Ga + NTV2_SDITransport_DualLink_1_5, // Dual Link, 2 wire 1.5G + NTV2_SDITransport_DualLink_3Gb, // Dual Link, 1 wire 3Gb + NTV2_SDITransport_QuadLink_1_5, // Quad Link, 4 wire 1.5G (4K YUV) + NTV2_SDITransport_QuadLink_3Gb, // Quad Link, 2 wire 3Gb (4K YUV or Stereo RGB) + NTV2_SDITransport_QuadLink_3Ga, // Quad Link, 4 wire 3Ga (4K HFR) + NTV2_SDITransport_OctLink_3Gb, // Oct Link, 4 wire 3Gb (4K RGB, HFR) + NTV2_SDITransport_6G, // 6G see Quad Link + NTV2_SDITransport_12G, // 12G see Oct Link + NTV2_MAX_NUM_SDITransportTypes, // last + NTV2_SDITransport_Auto // auto mode + =NTV2_MAX_NUM_SDITransportTypes +} NTV2SDITransportType; + + +typedef enum // Deprecated +{ + NTV2_4kTransport_Auto, // auto + NTV2_4kTransport_Quadrants_2wire, // quads 2x wire + NTV2_4kTransport_Quadrants_4wire, // quads 4x wire + NTV2_4kTransport_PixelInterleave, // SMPTE 425-5 & 425-3 + NTV2_4kTransport_Quarter_1wire, // quarter size + NTV2_4kTransport_12g_6g_1wire, // 12G / 6G 1wire + NTV2_MAX_NUM_4kTransportTypes +} NTV24kTransportType; + + +typedef enum // Deprecated +{ + NTV2_PanModeOff, + NTV2_PanModeReserved, + NTV2_PanMode2Kx1080, + NTV2_PanMode1920x1080, + NTV2_MAX_NUM_PanModes +} NTV2PanMode; + + +#if !defined(NTV2_DEPRECATE_15_1) + // note: Pause Mode is a "software" feature - not performed in hardware + typedef enum + { + NTV2_PauseOnFrame, + NTV2_PauseOnField + } NTV2PauseModeType; + + // note: 24 fps <-> 30 fps Pulldown is a "software" feature - not performed in hardware + typedef enum + { + NTV2_Pulldown2323, + NTV2_Pulldown2332, + NTV2_Pulldown2224 + } NTV2PulldownPatternType; +#endif // !defined(NTV2_DEPRECATE_15_1) + + +// NOTE: Timecode Burn-In Mode is a "software" feature - not performed in hardware +typedef enum // Deprecated +{ + NTV2_TimecodeBurnInOff, // no burn-in + NTV2_TimecodeBurnInTC, // display current timecode + NTV2_TimecodeBurnInUB, // display current user bits + NTV2_TimecodeBurnInFrameCount, // display current frame count + NTV2_TimecodeBurnInQuickTime, // (like frame count, but shows Mac QuickTime frame time) + NTV2_MAX_NUM_TimecodeBurnInModeTypes +} NTV2TimecodeBurnInModeType; + + +// not in use? +// This specifies the endian 10-bit RGB (aka DualLink) +typedef enum +{ + NTV2_RGB10LittleEndian, // Little Endian + NTV2_RGB10BigEndian, // Big Endian + NTV2_MAX_NUM_RGB10EndianEnums +} NTV2RGB10Endian; + +#endif // R2_DEPRECATE + + + +#if !defined (NTV2_DEPRECATE) + // Audio Channel Mapping and Channel Gain/Phase controls used in FS1 + typedef enum // used in FS1 + { + NTV2_AUDIOCHANNELMAPPING_EMB1CH1 = 0, + NTV2_AUDIOCHANNELMAPPING_EMB1CH2, + NTV2_AUDIOCHANNELMAPPING_EMB1CH3, + NTV2_AUDIOCHANNELMAPPING_EMB1CH4, + NTV2_AUDIOCHANNELMAPPING_EMB1CH5, + NTV2_AUDIOCHANNELMAPPING_EMB1CH6, + NTV2_AUDIOCHANNELMAPPING_EMB1CH7, + NTV2_AUDIOCHANNELMAPPING_EMB1CH8, + NTV2_AUDIOCHANNELMAPPING_EMB2CH1 = 8, + NTV2_AUDIOCHANNELMAPPING_EMB2CH2, + NTV2_AUDIOCHANNELMAPPING_EMB2CH3, + NTV2_AUDIOCHANNELMAPPING_EMB2CH4, + NTV2_AUDIOCHANNELMAPPING_EMB2CH5, + NTV2_AUDIOCHANNELMAPPING_EMB2CH6, + NTV2_AUDIOCHANNELMAPPING_EMB2CH7, + NTV2_AUDIOCHANNELMAPPING_EMB2CH8, + NTV2_AUDIOCHANNELMAPPING_ANALOGCH1 = 16, + NTV2_AUDIOCHANNELMAPPING_ANALOGCH2, + NTV2_AUDIOCHANNELMAPPING_ANALOGCH3, + NTV2_AUDIOCHANNELMAPPING_ANALOGCH4, + NTV2_AUDIOCHANNELMAPPING_ANALOGCH5, + NTV2_AUDIOCHANNELMAPPING_ANALOGCH6, + NTV2_AUDIOCHANNELMAPPING_ANALOGCH7, + NTV2_AUDIOCHANNELMAPPING_ANALOGCH8, + NTV2_AUDIOCHANNELMAPPING_AESCH1 = 24, + NTV2_AUDIOCHANNELMAPPING_AESCH2, + NTV2_AUDIOCHANNELMAPPING_AESCH3, + NTV2_AUDIOCHANNELMAPPING_AESCH4, + NTV2_AUDIOCHANNELMAPPING_AESCH5, + NTV2_AUDIOCHANNELMAPPING_AESCH6, + NTV2_AUDIOCHANNELMAPPING_AESCH7, + NTV2_AUDIOCHANNELMAPPING_AESCH8, + NTV2_AUDIOCHANNELMAPPING_EMB1CH9 = 32, + NTV2_AUDIOCHANNELMAPPING_EMB1CH10, + NTV2_AUDIOCHANNELMAPPING_EMB1CH11, + NTV2_AUDIOCHANNELMAPPING_EMB1CH12, + NTV2_AUDIOCHANNELMAPPING_EMB1CH13, + NTV2_AUDIOCHANNELMAPPING_EMB1CH14, + NTV2_AUDIOCHANNELMAPPING_EMB1CH15, + NTV2_AUDIOCHANNELMAPPING_EMB1CH16, + NTV2_AUDIOCHANNELMAPPING_EMB2CH9 = 40, + NTV2_AUDIOCHANNELMAPPING_EMB2CH10, + NTV2_AUDIOCHANNELMAPPING_EMB2CH11, + NTV2_AUDIOCHANNELMAPPING_EMB2CH12, + NTV2_AUDIOCHANNELMAPPING_EMB2CH13, + NTV2_AUDIOCHANNELMAPPING_EMB2CH14, + NTV2_AUDIOCHANNELMAPPING_EMB2CH15, + NTV2_AUDIOCHANNELMAPPING_EMB2CH16 + } NTV2AudioChannelMapping; +#endif // !defined (NTV2_DEPRECATE) + + +#if !defined (NTV2_DEPRECATE) + typedef enum + { + NTV2FS1AFDInsertMode_Off, + NTV2FS1AFDInsertMode_Delete, + NTV2FS1AFDInsertMode_Pass, + NTV2FS1AFDInsertMode_Replace + } NTV2AFDInsertMode; + + typedef enum + { + NTV2FS1AFD_InsertAR_4x3, + NTV2FS1AFD_InsertAR_16x9 + } NTV2AFDInsertAspectRatio; + + typedef enum + { + NTV2AFDInsert_LetterboxTo16x9 = 0x04, + NTV2AFDInsert_FullFrame = 0x08, + NTV2AFDInsert_Pillarbox4x3 = 0x09, + NTV2AFDInsert_FullFrameProtected = 0x0A, + NTV2AFDInsert_14x9 = 0x0B, + NTV2AFDInsert_4x3Alt14x9 = 0x0D, + NTV2AFDInsert_16x9Alt14x9 = 0x0E, + NTV2AFDInsert_16x9Alt4x3 = 0x0F + } NTV2AFDInsertCode; +#endif // !defined (NTV2_DEPRECATE) + + +typedef enum +{ + NTV2_QuarterSizeExpandOff, // Normal 1:1 playback + NTV2_QuarterSizeExpandOn, // Hardware will pixel-double and line-double to expand quarter-size frame + NTV2_MAX_NUM_QuarterSizeExpandModes, + NTV2_QuarterSizeExpandInvalid = NTV2_MAX_NUM_QuarterSizeExpandModes +} NTV2QuarterSizeExpandMode; + +#define NTV2_IS_VALID_QuarterSizeExpandMode(__q__) ((__q__) == NTV2_QuarterSizeExpandOff || (__q__) == NTV2_QuarterSizeExpandOn) + + +typedef enum +{ + NTV2_StandardQuality = 0x0, + NTV2_HighQuality = 0x1, + NTV2_ProRes = NTV2_StandardQuality, + NTV2_ProResHQ = NTV2_HighQuality, + NTV2_ProResLT = 0x2, + NTV2_ProResProxy = 0x4, + NTV2_MAX_NUM_FrameBufferQuality, + NTV2_FBQualityInvalid = NTV2_MAX_NUM_FrameBufferQuality +} NTV2FrameBufferQuality; + +#define NTV2_IS_VALID_FrameBufferQuality(__q__) ((__q__) == NTV2_StandardQuality || (__q__) == NTV2_HighQuality || (__q__) == NTV2_ProResLT || (__q__) == NTV2_ProResProxy) + + +typedef enum +{ + NTV2_NoPSF, // Currently only used for ProRes encoder + NTV2_IsPSF, + NTV2_INVALID_EncodeAsPSF +} NTV2EncodeAsPSF; + +#define NTV2_IS_VALID_EncodeAsPSF(__x__) ((__x__) == NTV2_NoPSF || (__x__) == NTV2_IsPSF) + + +/** + @brief Identifies a widget output, a signal source, that potentially can drive + another widget's input (identified by ::NTV2InputCrosspointID). + @see CNTV2Card::Connect and also \ref ntv2signalrouting +**/ +typedef enum NTV2OutputCrosspointID +{ + NTV2_FIRST_OUTPUT_CROSSPOINT = 0x00 + ,NTV2_XptBlack = 0x00 + ,NTV2_XptSDIIn1 = 0x01 + ,NTV2_XptSDIIn2 = 0x02 + ,NTV2_XptLUT1YUV = 0x04 + ,NTV2_XptLUT1Out = NTV2_XptLUT1YUV | 0x80 + ,NTV2_XptCSC1VidYUV = 0x05 + ,NTV2_XptCSC1VidRGB = NTV2_XptCSC1VidYUV | 0x80 + ,NTV2_XptConversionModule = 0x06 + ,NTV2_XptCompressionModule = 0x07 + ,NTV2_XptFrameBuffer1YUV = 0x08 + ,NTV2_XptFrameBuffer1RGB = NTV2_XptFrameBuffer1YUV | 0x80 + ,NTV2_XptFrameSync1YUV = 0x09 + ,NTV2_XptFrameSync1RGB = NTV2_XptFrameSync1YUV | 0x80 + ,NTV2_XptFrameSync2YUV = 0x0A + ,NTV2_XptFrameSync2RGB = NTV2_XptFrameSync2YUV | 0x80 + ,NTV2_XptDuallinkOut1 = 0x0B + ,NTV2_XptAlphaOut = 0x0C + ,NTV2_XptCSC1KeyYUV = 0x0E + ,NTV2_XptFrameBuffer2YUV = 0x0F + ,NTV2_XptFrameBuffer2RGB = NTV2_XptFrameBuffer2YUV | 0x80 + ,NTV2_XptCSC2VidYUV = 0x10 + ,NTV2_XptCSC2VidRGB = NTV2_XptCSC2VidYUV | 0x80 + ,NTV2_XptCSC2KeyYUV = 0x11 + ,NTV2_XptMixer1VidYUV = 0x12 + ,NTV2_XptMixer1KeyYUV = 0x13 + ,NTV2_XptMixer1VidRGB = NTV2_XptMixer1VidYUV | 0x80 + ,NTV2_XptMultiLinkOut1DS1 = 0x14 ///< @brief New in SDK 16.0 + ,NTV2_XptMultiLinkOut1DS2 = 0x15 ///< @brief New in SDK 16.0 + ,NTV2_XptAnalogIn = 0x16 + ,NTV2_XptHDMIIn1 = 0x17 + ,NTV2_XptHDMIIn1RGB = NTV2_XptHDMIIn1 | 0x80 + ,NTV2_XptMultiLinkOut1DS3 = 0x18 ///< @brief New in SDK 16.0 + ,NTV2_XptMultiLinkOut1DS4 = 0x19 ///< @brief New in SDK 16.0 + ,NTV2_XptMultiLinkOut2DS1 = 0x1A ///< @brief New in SDK 16.0 + ,NTV2_XptMultiLinkOut2DS2 = 0x1B ///< @brief New in SDK 16.0 + ,NTV2_XptDuallinkOut2 = 0x1C + ,NTV2_XptTestPatternYUV = 0x1D + ,NTV2_XptSDIIn1DS2 = 0x1E + ,NTV2_XptSDIIn2DS2 = 0x1F + ,NTV2_XptMixer2VidYUV = 0x20 + ,NTV2_XptMixer2KeyYUV = 0x21 + ,NTV2_XptMixer2VidRGB = NTV2_XptMixer2VidYUV | 0x80 + ,NTV2_XptOEOutYUV = 0x22 + ,NTV2_XptOEOutRGB = NTV2_XptOEOutYUV | 0x80 + ,NTV2_XptStereoCompressorOut = 0x23 + ,NTV2_XptFrameBuffer3YUV = 0x24 + ,NTV2_XptFrameBuffer3RGB = NTV2_XptFrameBuffer3YUV | 0x80 + ,NTV2_XptFrameBuffer4YUV = 0x25 + ,NTV2_XptFrameBuffer4RGB = NTV2_XptFrameBuffer4YUV | 0x80 + ,NTV2_XptDuallinkOut1DS2 = 0x26 + ,NTV2_XptDuallinkOut2DS2 = 0x27 + ,NTV2_XptCSC5VidYUV = 0x2C + ,NTV2_XptCSC5VidRGB = NTV2_XptCSC5VidYUV | 0x80 + ,NTV2_XptCSC5KeyYUV = 0x2D + ,NTV2_XptMultiLinkOut2DS3 = 0x2E ///< @brief New in SDK 16.0 + ,NTV2_XptMultiLinkOut2DS4 = 0x2F ///< @brief New in SDK 16.0 + ,NTV2_XptSDIIn3 = 0x30 + ,NTV2_XptSDIIn4 = 0x31 + ,NTV2_XptSDIIn3DS2 = 0x32 + ,NTV2_XptSDIIn4DS2 = 0x33 + ,NTV2_XptDuallinkOut3 = 0x36 + ,NTV2_XptDuallinkOut3DS2 = 0x37 + ,NTV2_XptDuallinkOut4 = 0x38 + ,NTV2_XptDuallinkOut4DS2 = 0x39 + ,NTV2_XptCSC3VidYUV = 0x3A + ,NTV2_XptCSC3VidRGB = NTV2_XptCSC3VidYUV | 0x80 + ,NTV2_XptCSC3KeyYUV = 0x3B + ,NTV2_XptCSC4VidYUV = 0x3C + ,NTV2_XptCSC4VidRGB = NTV2_XptCSC4VidYUV | 0x80 + ,NTV2_XptCSC4KeyYUV = 0x3D + ,NTV2_XptDuallinkOut5 = 0x3E + ,NTV2_XptDuallinkOut5DS2 = 0x3F + ,NTV2_Xpt3DLUT1YUV = 0x40 + ,NTV2_Xpt3DLUT1RGB = NTV2_Xpt3DLUT1YUV | 0x80 + ,NTV2_XptHDMIIn1Q2 = 0x41 + ,NTV2_XptHDMIIn1Q2RGB = NTV2_XptHDMIIn1Q2 | 0x80 + ,NTV2_XptHDMIIn1Q3 = 0x42 + ,NTV2_XptHDMIIn1Q3RGB = NTV2_XptHDMIIn1Q3 | 0x80 + ,NTV2_XptHDMIIn1Q4 = 0x43 + ,NTV2_XptHDMIIn1Q4RGB = NTV2_XptHDMIIn1Q4 | 0x80 + ,NTV2_Xpt4KDownConverterOut = 0x44 + ,NTV2_Xpt4KDownConverterOutRGB = NTV2_Xpt4KDownConverterOut | 0x80 + ,NTV2_XptSDIIn5 = 0x45 + ,NTV2_XptSDIIn6 = 0x46 + ,NTV2_XptSDIIn5DS2 = 0x47 + ,NTV2_XptSDIIn6DS2 = 0x48 + ,NTV2_XptSDIIn7 = 0x49 + ,NTV2_XptSDIIn8 = 0x4A + ,NTV2_XptSDIIn7DS2 = 0x4B + ,NTV2_XptSDIIn8DS2 = 0x4C + ,NTV2_XptFrameBuffer5YUV = 0x51 + ,NTV2_XptFrameBuffer5RGB = NTV2_XptFrameBuffer5YUV | 0x80 + ,NTV2_XptFrameBuffer6YUV = 0x52 + ,NTV2_XptFrameBuffer6RGB = NTV2_XptFrameBuffer6YUV | 0x80 + ,NTV2_XptFrameBuffer7YUV = 0x53 + ,NTV2_XptFrameBuffer7RGB = NTV2_XptFrameBuffer7YUV | 0x80 + ,NTV2_XptFrameBuffer8YUV = 0x54 + ,NTV2_XptFrameBuffer8RGB = NTV2_XptFrameBuffer8YUV | 0x80 + ,NTV2_XptMixer3VidYUV = 0x55 + ,NTV2_XptMixer3KeyYUV = 0x56 + ,NTV2_XptMixer3VidRGB = NTV2_XptMixer3VidYUV | 0x80 + ,NTV2_XptMixer4VidYUV = 0x57 + ,NTV2_XptMixer4KeyYUV = 0x58 + ,NTV2_XptMixer4VidRGB = NTV2_XptMixer4VidYUV | 0x80 + ,NTV2_XptCSC6VidYUV = 0x59 + ,NTV2_XptCSC6VidRGB = NTV2_XptCSC6VidYUV | 0x80 + ,NTV2_XptCSC6KeyYUV = 0x5A + ,NTV2_XptCSC7VidYUV = 0x5B + ,NTV2_XptCSC7VidRGB = NTV2_XptCSC7VidYUV | 0x80 + ,NTV2_XptCSC7KeyYUV = 0x5C + ,NTV2_XptCSC8VidYUV = 0x5D + ,NTV2_XptCSC8VidRGB = NTV2_XptCSC8VidYUV | 0x80 + ,NTV2_XptCSC8KeyYUV = 0x5E + ,NTV2_XptDuallinkOut6 = 0x62 + ,NTV2_XptDuallinkOut6DS2 = 0x63 + ,NTV2_XptDuallinkOut7 = 0x64 + ,NTV2_XptDuallinkOut7DS2 = 0x65 + ,NTV2_XptDuallinkOut8 = 0x66 + ,NTV2_XptDuallinkOut8DS2 = 0x67 + ,NTV2_Xpt425Mux1AYUV = 0x68 + ,NTV2_Xpt425Mux1ARGB = NTV2_Xpt425Mux1AYUV | 0x80 + ,NTV2_Xpt425Mux1BYUV = 0x69 + ,NTV2_Xpt425Mux1BRGB = NTV2_Xpt425Mux1BYUV | 0x80 + ,NTV2_Xpt425Mux2AYUV = 0x6A + ,NTV2_Xpt425Mux2ARGB = NTV2_Xpt425Mux2AYUV | 0x80 + ,NTV2_Xpt425Mux2BYUV = 0x6B + ,NTV2_Xpt425Mux2BRGB = NTV2_Xpt425Mux2BYUV | 0x80 + ,NTV2_Xpt425Mux3AYUV = 0x6C + ,NTV2_Xpt425Mux3ARGB = NTV2_Xpt425Mux3AYUV | 0x80 + ,NTV2_Xpt425Mux3BYUV = 0x6D + ,NTV2_Xpt425Mux3BRGB = NTV2_Xpt425Mux3BYUV | 0x80 + ,NTV2_Xpt425Mux4AYUV = 0x6E + ,NTV2_Xpt425Mux4ARGB = NTV2_Xpt425Mux4AYUV | 0x80 + ,NTV2_Xpt425Mux4BYUV = 0x6F + ,NTV2_Xpt425Mux4BRGB = NTV2_Xpt425Mux4BYUV | 0x80 + ,NTV2_XptFrameBuffer1_DS2YUV = 0x70 + ,NTV2_XptFrameBuffer1_DS2RGB = NTV2_XptFrameBuffer1_DS2YUV | 0x80 + ,NTV2_XptFrameBuffer2_DS2YUV = 0x71 + ,NTV2_XptFrameBuffer2_DS2RGB = NTV2_XptFrameBuffer2_DS2YUV | 0x80 + ,NTV2_XptFrameBuffer3_DS2YUV = 0x72 + ,NTV2_XptFrameBuffer3_DS2RGB = NTV2_XptFrameBuffer3_DS2YUV | 0x80 + ,NTV2_XptFrameBuffer4_DS2YUV = 0x73 + ,NTV2_XptFrameBuffer4_DS2RGB = NTV2_XptFrameBuffer4_DS2YUV | 0x80 + ,NTV2_XptFrameBuffer5_DS2YUV = 0x74 + ,NTV2_XptFrameBuffer5_DS2RGB = NTV2_XptFrameBuffer5_DS2YUV | 0x80 + ,NTV2_XptFrameBuffer6_DS2YUV = 0x75 + ,NTV2_XptFrameBuffer6_DS2RGB = NTV2_XptFrameBuffer6_DS2YUV | 0x80 + ,NTV2_XptFrameBuffer7_DS2YUV = 0x76 + ,NTV2_XptFrameBuffer7_DS2RGB = NTV2_XptFrameBuffer7_DS2YUV | 0x80 + ,NTV2_XptFrameBuffer8_DS2YUV = 0x77 + ,NTV2_XptFrameBuffer8_DS2RGB = NTV2_XptFrameBuffer8_DS2YUV | 0x80 + ,NTV2_XptHDMIIn2 = 0x78 + ,NTV2_XptHDMIIn2RGB = NTV2_XptHDMIIn2 | 0x80 + ,NTV2_XptHDMIIn2Q2 = 0x79 + ,NTV2_XptHDMIIn2Q2RGB = NTV2_XptHDMIIn2Q2 | 0x80 + ,NTV2_XptHDMIIn2Q3 = 0x7A + ,NTV2_XptHDMIIn2Q3RGB = NTV2_XptHDMIIn2Q3 | 0x80 + ,NTV2_XptHDMIIn2Q4 = 0x7B + ,NTV2_XptHDMIIn2Q4RGB = NTV2_XptHDMIIn2Q4 | 0x80 + ,NTV2_XptHDMIIn3 = 0x7C + ,NTV2_XptHDMIIn3RGB = NTV2_XptHDMIIn3 | 0x80 + ,NTV2_XptHDMIIn4 = 0x7D + ,NTV2_XptHDMIIn4RGB = NTV2_XptHDMIIn4 | 0x80 + ,NTV2_XptDuallinkIn1 = 0x83 + ,NTV2_XptLUT2Out = 0x8D + ,NTV2_XptIICTRGB = 0x95 + ,NTV2_XptIICT2RGB = 0x9B + ,NTV2_XptDuallinkIn2 = 0xA8 + ,NTV2_XptLUT3Out = 0xA9 + ,NTV2_XptLUT4Out = 0xAA + ,NTV2_XptLUT5Out = 0xAB + ,NTV2_XptDuallinkIn3 = 0xB4 + ,NTV2_XptDuallinkIn4 = 0xB5 + ,NTV2_XptDuallinkIn5 = 0xCD + ,NTV2_XptDuallinkIn6 = 0xCE + ,NTV2_XptDuallinkIn7 = 0xCF + ,NTV2_XptDuallinkIn8 = 0xD0 + ,NTV2_XptLUT6Out = 0xDF + ,NTV2_XptLUT7Out = 0xE0 + ,NTV2_XptLUT8Out = 0xE1 + ,NTV2_XptRuntimeCalc = 0xFF + ,NTV2_LAST_OUTPUT_CROSSPOINT = 0xFF + ,NTV2_OUTPUT_CROSSPOINT_INVALID = 0xFF + #if !defined(NTV2_DEPRECATE_16_0) + ,NTV2_XptDCIMixerVidYUV = NTV2_XptOEOutYUV + ,NTV2_XptDCIMixerVidRGB = NTV2_XptOEOutRGB + ,NTV2_XptLUT1RGB = NTV2_XptLUT1Out ///< @deprecated Removed in SDK 16.0, redeployed as ::NTV2_XptLUT1Out + ,NTV2_XptLUT2RGB = NTV2_XptLUT2Out ///< @deprecated Removed in SDK 16.0, redeployed as ::NTV2_XptLUT2Out + ,NTV2_XptWaterMarkerYUV = NTV2_XptMultiLinkOut1DS1 ///< @deprecated Removed in SDK 16.0, redeployed as ::NTV2_XptMultiLinkOut1DS1 + ,NTV2_XptWaterMarkerRGB = NTV2_XptWaterMarkerYUV | 0x80 ///< @deprecated Removed in SDK 16.0 + ,NTV2_XptWaterMarker2YUV = NTV2_XptMultiLinkOut2DS1 ///< @deprecated Removed in SDK 16.0, redeployed as ::NTV2_XptMultiLinkOut2DS1 + ,NTV2_XptWaterMarker2RGB = NTV2_XptWaterMarker2YUV | 0x80 ///< @deprecated Removed in SDK 16.0 + #endif + #if !defined(NTV2_DEPRECATE_15_3) + ,NTV2_XptFrameBuffer1_425YUV = NTV2_XptFrameBuffer1_DS2YUV ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer1_DS2YUV + ,NTV2_XptFrameBuffer1_425RGB = NTV2_XptFrameBuffer1_DS2RGB ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer1_DS2RGB + ,NTV2_XptFrameBuffer2_425YUV = NTV2_XptFrameBuffer2_DS2YUV ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer2_DS2YUV + ,NTV2_XptFrameBuffer2_425RGB = NTV2_XptFrameBuffer2_DS2RGB ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer2_DS2RGB + ,NTV2_XptFrameBuffer3_425YUV = NTV2_XptFrameBuffer3_DS2YUV ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer3_DS2YUV + ,NTV2_XptFrameBuffer3_425RGB = NTV2_XptFrameBuffer3_DS2RGB ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer3_DS2RGB + ,NTV2_XptFrameBuffer4_425YUV = NTV2_XptFrameBuffer4_DS2YUV ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer4_DS2YUV + ,NTV2_XptFrameBuffer4_425RGB = NTV2_XptFrameBuffer4_DS2RGB ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer4_DS2RGB + ,NTV2_XptFrameBuffer5_425YUV = NTV2_XptFrameBuffer5_DS2YUV ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer5_DS2YUV + ,NTV2_XptFrameBuffer5_425RGB = NTV2_XptFrameBuffer5_DS2RGB ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer5_DS2RGB + ,NTV2_XptFrameBuffer6_425YUV = NTV2_XptFrameBuffer6_DS2YUV ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer6_DS2YUV + ,NTV2_XptFrameBuffer6_425RGB = NTV2_XptFrameBuffer6_DS2RGB ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer6_DS2RGB + ,NTV2_XptFrameBuffer7_425YUV = NTV2_XptFrameBuffer7_DS2YUV ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer7_DS2YUV + ,NTV2_XptFrameBuffer7_425RGB = NTV2_XptFrameBuffer7_DS2RGB ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer7_DS2RGB + ,NTV2_XptFrameBuffer8_425YUV = NTV2_XptFrameBuffer8_DS2YUV ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer8_DS2YUV + ,NTV2_XptFrameBuffer8_425RGB = NTV2_XptFrameBuffer8_DS2RGB ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer8_DS2RGB + #endif + #if !defined(NTV2_DEPRECATE_14_3) + ,NTV2_XptHDMIIn = NTV2_XptHDMIIn1 ///< @deprecated Renamed in SDK 14.3 as ::NTV2_XptHDMIIn1 + ,NTV2_XptHDMIInQ2 = NTV2_XptHDMIIn1Q2 ///< @deprecated Renamed in SDK 14.3 as ::NTV2_XptHDMIIn1Q2 + ,NTV2_XptHDMIInQ3 = NTV2_XptHDMIIn1Q3 ///< @deprecated Renamed in SDK 14.3 as ::NTV2_XptHDMIIn1Q3 + ,NTV2_XptHDMIInQ4 = NTV2_XptHDMIIn1Q4 ///< @deprecated Renamed in SDK 14.3 as ::NTV2_XptHDMIIn1Q4 + ,NTV2_XptHDMIInRGB = NTV2_XptHDMIIn1RGB ///< @deprecated Renamed in SDK 14.3 as ::NTV2_XptHDMIIn1RGB + ,NTV2_XptHDMIInQ2RGB = NTV2_XptHDMIIn1Q2RGB ///< @deprecated Renamed in SDK 14.3 as ::NTV2_XptHDMIIn1Q2RGB + ,NTV2_XptHDMIInQ3RGB = NTV2_XptHDMIIn1Q3RGB ///< @deprecated Renamed in SDK 14.3 as ::NTV2_XptHDMIIn1Q3RGB + ,NTV2_XptHDMIInQ4RGB = NTV2_XptHDMIIn1Q4RGB ///< @deprecated Renamed in SDK 14.3 as ::NTV2_XptHDMIIn1Q4RGB + #endif + #if !defined (NTV2_DEPRECATE) + ,NTV2_XptFS1SecondConverter = 0x18 ///< @deprecated Obsolete, do not use. + ,NTV2_XptFS1ProcAmp = 0x19 ///< @deprecated Obsolete, do not use. + ,NTV2_XptFS1TestSignalGenerator = 0x1D ///< @deprecated Obsolete, do not use. + ,NTV2_XptCSCYUV = NTV2_XptCSC1VidYUV ///< @deprecated Use NTV2_XptCSC1VidYUV instead. + ,NTV2_XptLUT = NTV2_XptLUT1Out ///< @deprecated Use NTV2_XptLUT1Out instead. + ,NTV2_XptCSCRGB = NTV2_XptCSC1VidRGB ///< @deprecated Use NTV2_XptCSC1VidRGB instead. + ,NTV2_XptDuallinkIn = NTV2_XptDuallinkIn1 ///< @deprecated Use NTV2_XptDuallinkIn1 instead. + ,NTV2_XptDuallinkOut = NTV2_XptDuallinkOut1 ///< @deprecated Use NTV2_XptDuallinkOut1 instead. + ,NTV2_XptDuallinkOutDS2 = NTV2_XptDuallinkOut1DS2 ///< @deprecated Use NTV2_XptDuallinkOut1DS2 instead. + #endif // !defined (NTV2_DEPRECATE) + ,NTV2_XptDuallinkIn1DS2 = 0x100 + ,NTV2_XptDuallinkIn2DS2 = 0x101 + ,NTV2_XptDuallinkIn3DS2 = 0x102 + ,NTV2_XptDuallinkIn4DS2 = 0x103 + ,NTV2_XptDuallinkIn5DS2 = 0x104 + ,NTV2_XptDuallinkIn6DS2 = 0x105 + ,NTV2_XptDuallinkIn7DS2 = 0x106 + ,NTV2_XptDuallinkIn8DS2 = 0x107 +} NTV2OutputCrosspointID, NTV2OutputXptID; + +#if !defined(NTV2_DEPRECATE_16_0) + typedef NTV2OutputXptID NTV2CrosspointID; ///< @deprecated In SDK 16.0, use ::NTV2OutputXptID instead. +#endif // !defined(NTV2_DEPRECATE_16_0) + +#define NTV2_IS_VALID_OutputCrosspointID(__s__) ((__s__) >= NTV2_XptBlack && (__s__) < NTV2_OUTPUT_CROSSPOINT_INVALID) +#define NTV2_IS_RGB_OutputCrosspointID(__s__) (((unsigned char)(__s__)) & 0x80) + +/** + @brief Identifies a widget input that potentially can accept a signal emitted + from another widget's output (identified by ::NTV2OutputCrosspointID). + @see CNTV2Card::Connect and also \ref ntv2signalrouting +**/ +typedef enum NTV2InputCrosspointID +{ + NTV2_FIRST_INPUT_CROSSPOINT = 0x01, + NTV2_XptFrameBuffer1Input = 0x01, + NTV2_XptFrameBuffer1DS2Input = 0x02, + NTV2_XptFrameBuffer2Input = 0x03, + NTV2_XptFrameBuffer2DS2Input = 0x04, + NTV2_XptFrameBuffer3Input = 0x05, + NTV2_XptFrameBuffer3DS2Input = 0x06, + NTV2_XptFrameBuffer4Input = 0x07, + NTV2_XptFrameBuffer4DS2Input = 0x08, + NTV2_XptFrameBuffer5Input = 0x09, + NTV2_XptFrameBuffer5DS2Input = 0x0A, + NTV2_XptFrameBuffer6Input = 0x0B, + NTV2_XptFrameBuffer6DS2Input = 0x0C, + NTV2_XptFrameBuffer7Input = 0x0D, + NTV2_XptFrameBuffer7DS2Input = 0x0E, + NTV2_XptFrameBuffer8Input = 0x0F, + NTV2_XptFrameBuffer8DS2Input = 0x10, + NTV2_XptCSC1VidInput = 0x11, + NTV2_XptCSC1KeyInput = 0x12, + NTV2_XptCSC2VidInput = 0x13, + NTV2_XptCSC2KeyInput = 0x14, + NTV2_XptCSC3VidInput = 0x15, + NTV2_XptCSC3KeyInput = 0x16, + NTV2_XptCSC4VidInput = 0x17, + NTV2_XptCSC4KeyInput = 0x18, + NTV2_XptCSC5VidInput = 0x19, + NTV2_XptCSC5KeyInput = 0x1A, + NTV2_XptCSC6VidInput = 0x1B, + NTV2_XptCSC6KeyInput = 0x1C, + NTV2_XptCSC7VidInput = 0x1D, + NTV2_XptCSC7KeyInput = 0x1E, + NTV2_XptCSC8VidInput = 0x1F, + NTV2_XptCSC8KeyInput = 0x20, + NTV2_XptLUT1Input = 0x21, + NTV2_XptLUT2Input = 0x22, + NTV2_XptLUT3Input = 0x23, + NTV2_XptLUT4Input = 0x24, + NTV2_XptLUT5Input = 0x25, + NTV2_XptLUT6Input = 0x26, + NTV2_XptLUT7Input = 0x27, + NTV2_XptLUT8Input = 0x28, + NTV2_XptMultiLinkOut1Input = 0x29, ///< @brief New in SDK 16.0 + NTV2_XptMultiLinkOut1InputDS2 = 0x2A, ///< @brief New in SDK 16.0 + NTV2_XptMultiLinkOut2Input = 0x2B, ///< @brief New in SDK 16.0 + NTV2_XptMultiLinkOut2InputDS2 = 0x2C, ///< @brief New in SDK 16.0 + NTV2_XptSDIOut1Input = 0x2D, + NTV2_XptSDIOut1InputDS2 = 0x2E, + NTV2_XptSDIOut2Input = 0x2F, + NTV2_XptSDIOut2InputDS2 = 0x30, + NTV2_XptSDIOut3Input = 0x31, + NTV2_XptSDIOut3InputDS2 = 0x32, + NTV2_XptSDIOut4Input = 0x33, + NTV2_XptSDIOut4InputDS2 = 0x34, + NTV2_XptSDIOut5Input = 0x35, + NTV2_XptSDIOut5InputDS2 = 0x36, + NTV2_XptSDIOut6Input = 0x37, + NTV2_XptSDIOut6InputDS2 = 0x38, + NTV2_XptSDIOut7Input = 0x39, + NTV2_XptSDIOut7InputDS2 = 0x3A, + NTV2_XptSDIOut8Input = 0x3B, + NTV2_XptSDIOut8InputDS2 = 0x3C, + NTV2_XptDualLinkIn1Input = 0x3D, + NTV2_XptDualLinkIn1DSInput = 0x3E, + NTV2_XptDualLinkIn2Input = 0x3F, + NTV2_XptDualLinkIn2DSInput = 0x40, + NTV2_XptDualLinkIn3Input = 0x41, + NTV2_XptDualLinkIn3DSInput = 0x42, + NTV2_XptDualLinkIn4Input = 0x43, + NTV2_XptDualLinkIn4DSInput = 0x44, + NTV2_XptDualLinkIn5Input = 0x45, + NTV2_XptDualLinkIn5DSInput = 0x46, + NTV2_XptDualLinkIn6Input = 0x47, + NTV2_XptDualLinkIn6DSInput = 0x48, + NTV2_XptDualLinkIn7Input = 0x49, + NTV2_XptDualLinkIn7DSInput = 0x4A, + NTV2_XptDualLinkIn8Input = 0x4B, + NTV2_XptDualLinkIn8DSInput = 0x4C, + NTV2_XptDualLinkOut1Input = 0x4D, + NTV2_XptDualLinkOut2Input = 0x4E, + NTV2_XptDualLinkOut3Input = 0x4F, + NTV2_XptDualLinkOut4Input = 0x50, + NTV2_XptDualLinkOut5Input = 0x51, + NTV2_XptDualLinkOut6Input = 0x52, + NTV2_XptDualLinkOut7Input = 0x53, + NTV2_XptDualLinkOut8Input = 0x54, + NTV2_XptMixer1BGKeyInput = 0x55, + NTV2_XptMixer1BGVidInput = 0x56, + NTV2_XptMixer1FGKeyInput = 0x57, + NTV2_XptMixer1FGVidInput = 0x58, + NTV2_XptMixer2BGKeyInput = 0x59, + NTV2_XptMixer2BGVidInput = 0x5A, + NTV2_XptMixer2FGKeyInput = 0x5B, + NTV2_XptMixer2FGVidInput = 0x5C, + NTV2_XptMixer3BGKeyInput = 0x5D, + NTV2_XptMixer3BGVidInput = 0x5E, + NTV2_XptMixer3FGKeyInput = 0x5F, + NTV2_XptMixer3FGVidInput = 0x60, + NTV2_XptMixer4BGKeyInput = 0x61, + NTV2_XptMixer4BGVidInput = 0x62, + NTV2_XptMixer4FGKeyInput = 0x63, + NTV2_XptMixer4FGVidInput = 0x64, + NTV2_XptHDMIOutInput = 0x65, + NTV2_XptHDMIOutQ1Input = NTV2_XptHDMIOutInput, + NTV2_XptHDMIOutQ2Input = 0x66, + NTV2_XptHDMIOutQ3Input = 0x67, + NTV2_XptHDMIOutQ4Input = 0x68, + NTV2_Xpt4KDCQ1Input = 0x69, + NTV2_Xpt4KDCQ2Input = 0x6A, + NTV2_Xpt4KDCQ3Input = 0x6B, + NTV2_Xpt4KDCQ4Input = 0x6C, + NTV2_Xpt425Mux1AInput = 0x6D, + NTV2_Xpt425Mux1BInput = 0x6E, + NTV2_Xpt425Mux2AInput = 0x6F, + NTV2_Xpt425Mux2BInput = 0x70, + NTV2_Xpt425Mux3AInput = 0x71, + NTV2_Xpt425Mux3BInput = 0x72, + NTV2_Xpt425Mux4AInput = 0x73, + NTV2_Xpt425Mux4BInput = 0x74, + NTV2_XptAnalogOutInput = 0x75, + NTV2_Xpt3DLUT1Input = 0x76, ///< @brief New in SDK 16.0 + NTV2_XptAnalogOutCompositeOut = 0x77, // deprecate? + NTV2_XptStereoLeftInput = 0x78, // deprecate? + NTV2_XptStereoRightInput = 0x79, // deprecate? + NTV2_XptProAmpInput = 0x7A, // deprecate? + NTV2_XptIICT1Input = 0x7B, // deprecate? + NTV2_XptWaterMarker1Input = 0x7C, // deprecate? + NTV2_XptWaterMarker2Input = 0x7D, // deprecate? + NTV2_XptUpdateRegister = 0x7E, // deprecate? + NTV2_XptOEInput = 0x7F, + NTV2_XptCompressionModInput = 0x80, // deprecate? + NTV2_XptConversionModInput = 0x81, // deprecate? + NTV2_XptCSC1KeyFromInput2 = 0x82, // deprecate? + NTV2_XptFrameSync2Input = 0x83, // deprecate? + NTV2_XptFrameSync1Input = 0x84, // deprecate? + NTV2_LAST_INPUT_CROSSPOINT = 0x84, + NTV2_INPUT_CROSSPOINT_INVALID = 0xFFFFFFFF + #if !defined(NTV2_DEPRECATE_16_0) + ,NTV2_XptConversionMod2Input = NTV2_XptOEInput ///< @deprecated Removed in SDK 16.0, redeployed as ::NTV2_XptOEInput + ,NTV2_XptSDIOut1Standard = NTV2_XptMultiLinkOut1Input ///< @deprecated Removed in SDK 16.0, redeployed as ::NTV2_XptMultiLinkOut1Input + ,NTV2_XptSDIOut2Standard = NTV2_XptMultiLinkOut1InputDS2 ///< @deprecated Removed in SDK 16.0, redeployed as ::NTV2_XptMultiLinkOut1InputDS2 + ,NTV2_XptSDIOut3Standard = NTV2_XptMultiLinkOut2Input ///< @deprecated Removed in SDK 16.0, redeployed as ::NTV2_XptMultiLinkOut2Input + ,NTV2_XptSDIOut4Standard = NTV2_XptMultiLinkOut2InputDS2 ///< @deprecated Removed in SDK 16.0, redeployed as ::NTV2_XptMultiLinkOut2InputDS2 + ,NTV2_XptIICT2Input = NTV2_Xpt3DLUT1Input ///< @deprecated Removed in SDK 16.0, redeployed as ::NTV2_Xpt3DLUT1Input + #endif + #if !defined(NTV2_DEPRECATE_15_3) + ,NTV2_XptFrameBuffer1BInput = NTV2_XptFrameBuffer1DS2Input ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer1DS2Input + ,NTV2_XptFrameBuffer2BInput = NTV2_XptFrameBuffer2DS2Input ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer2DS2Input + ,NTV2_XptFrameBuffer3BInput = NTV2_XptFrameBuffer3DS2Input ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer3DS2Input + ,NTV2_XptFrameBuffer4BInput = NTV2_XptFrameBuffer4DS2Input ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer4DS2Input + ,NTV2_XptFrameBuffer5BInput = NTV2_XptFrameBuffer5DS2Input ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer5DS2Input + ,NTV2_XptFrameBuffer6BInput = NTV2_XptFrameBuffer6DS2Input ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer6DS2Input + ,NTV2_XptFrameBuffer7BInput = NTV2_XptFrameBuffer7DS2Input ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer7DS2Input + ,NTV2_XptFrameBuffer8BInput = NTV2_XptFrameBuffer8DS2Input ///< @deprecated Renamed in SDK 15.3 as ::NTV2_XptFrameBuffer8DS2Input + #endif +} NTV2InputCrosspointID, NTV2InputXptID; + +#define NTV2_IS_VALID_InputCrosspointID(__s__) ((__s__) >= NTV2_FIRST_INPUT_CROSSPOINT && (__s__) <= NTV2_LAST_INPUT_CROSSPOINT) + + +/** + @brief Identifies firmware widgets that logically can have zero or more signal inputs + (identified by ::NTV2InputCrosspointID) and/or zero or more signal outputs + (identified by ::NTV2OutputCrosspointID). +**/ +#define NTV2_WIDGET_FIRST 0 +typedef enum +{ + NTV2_WgtFrameBuffer1 = NTV2_WIDGET_FIRST + ,NTV2_WgtFrameBuffer2 + ,NTV2_WgtFrameBuffer3 + ,NTV2_WgtFrameBuffer4 + ,NTV2_WgtCSC1 + ,NTV2_WgtCSC2 + ,NTV2_WgtLUT1 + ,NTV2_WgtLUT2 + ,NTV2_WgtFrameSync1 + ,NTV2_WgtFrameSync2 + ,NTV2_WgtSDIIn1 + ,NTV2_WgtSDIIn2 + ,NTV2_Wgt3GSDIIn1 + ,NTV2_Wgt3GSDIIn2 + ,NTV2_Wgt3GSDIIn3 + ,NTV2_Wgt3GSDIIn4 + ,NTV2_WgtSDIOut1 + ,NTV2_WgtSDIOut2 + ,NTV2_WgtSDIOut3 // UNUSED + ,NTV2_WgtSDIOut4 // UNUSED + ,NTV2_Wgt3GSDIOut1 + ,NTV2_Wgt3GSDIOut2 + ,NTV2_Wgt3GSDIOut3 + ,NTV2_Wgt3GSDIOut4 + ,NTV2_WgtDualLinkIn1 // UNUSED + ,NTV2_WgtDualLinkV2In1 + ,NTV2_WgtDualLinkV2In2 + ,NTV2_WgtDualLinkOut1 // UNUSED + ,NTV2_WgtDualLinkOut2 // UNUSED + ,NTV2_WgtDualLinkV2Out1 + ,NTV2_WgtDualLinkV2Out2 + ,NTV2_WgtAnalogIn1 + ,NTV2_WgtAnalogOut1 + ,NTV2_WgtAnalogCompositeOut1 // UNUSED + ,NTV2_WgtHDMIIn1 + ,NTV2_WgtHDMIOut1 + ,NTV2_WgtUpDownConverter1 + ,NTV2_WgtUpDownConverter2 // UNUSED + ,NTV2_WgtMixer1 + ,NTV2_WgtCompression1 + ,NTV2_WgtProcAmp1 // UNUSED + ,NTV2_WgtWaterMarker1 + ,NTV2_WgtWaterMarker2 + ,NTV2_WgtIICT1 // UNUSED + ,NTV2_WgtIICT2 // UNUSED + ,NTV2_WgtTestPattern1 // UNUSED + ,NTV2_WgtGenLock + ,NTV2_WgtDCIMixer1 // UNUSED + ,NTV2_WgtMixer2 + ,NTV2_WgtStereoCompressor // UNUSED + ,NTV2_WgtLUT3 + ,NTV2_WgtLUT4 + ,NTV2_WgtDualLinkV2In3 + ,NTV2_WgtDualLinkV2In4 + ,NTV2_WgtDualLinkV2Out3 + ,NTV2_WgtDualLinkV2Out4 + ,NTV2_WgtCSC3 + ,NTV2_WgtCSC4 + ,NTV2_WgtHDMIIn1v2 + ,NTV2_WgtHDMIOut1v2 + ,NTV2_WgtSDIMonOut1 + ,NTV2_WgtCSC5 + ,NTV2_WgtLUT5 + ,NTV2_WgtDualLinkV2Out5 + ,NTV2_Wgt4KDownConverter + ,NTV2_Wgt3GSDIIn5 + ,NTV2_Wgt3GSDIIn6 + ,NTV2_Wgt3GSDIIn7 + ,NTV2_Wgt3GSDIIn8 + ,NTV2_Wgt3GSDIOut5 + ,NTV2_Wgt3GSDIOut6 + ,NTV2_Wgt3GSDIOut7 + ,NTV2_Wgt3GSDIOut8 + ,NTV2_WgtDualLinkV2In5 + ,NTV2_WgtDualLinkV2In6 + ,NTV2_WgtDualLinkV2In7 + ,NTV2_WgtDualLinkV2In8 + ,NTV2_WgtDualLinkV2Out6 + ,NTV2_WgtDualLinkV2Out7 + ,NTV2_WgtDualLinkV2Out8 + ,NTV2_WgtCSC6 + ,NTV2_WgtCSC7 + ,NTV2_WgtCSC8 + ,NTV2_WgtLUT6 + ,NTV2_WgtLUT7 + ,NTV2_WgtLUT8 + ,NTV2_WgtMixer3 + ,NTV2_WgtMixer4 + ,NTV2_WgtFrameBuffer5 + ,NTV2_WgtFrameBuffer6 + ,NTV2_WgtFrameBuffer7 + ,NTV2_WgtFrameBuffer8 + ,NTV2_WgtHDMIIn1v3 + ,NTV2_WgtHDMIOut1v3 + ,NTV2_Wgt425Mux1 + ,NTV2_Wgt425Mux2 + ,NTV2_Wgt425Mux3 + ,NTV2_Wgt425Mux4 + ,NTV2_Wgt12GSDIIn1 + ,NTV2_Wgt12GSDIIn2 + ,NTV2_Wgt12GSDIIn3 + ,NTV2_Wgt12GSDIIn4 + ,NTV2_Wgt12GSDIOut1 + ,NTV2_Wgt12GSDIOut2 + ,NTV2_Wgt12GSDIOut3 + ,NTV2_Wgt12GSDIOut4 + ,NTV2_WgtHDMIIn1v4 + ,NTV2_WgtHDMIIn2v4 + ,NTV2_WgtHDMIIn3v4 + ,NTV2_WgtHDMIIn4v4 + ,NTV2_WgtHDMIOut1v4 + ,NTV2_WgtHDMIOut1v5 + ,NTV2_WgtMultiLinkOut1 + ,NTV2_Wgt3DLUT1 + ,NTV2_WgtMultiLinkOut2 + ,NTV2_WgtOE1 + ,NTV2_WgtModuleTypeCount + ,NTV2_WgtUndefined = NTV2_WgtModuleTypeCount + ,NTV2_WIDGET_INVALID = NTV2_WgtModuleTypeCount +} NTV2WidgetID; + +#define NTV2_IS_VALID_WIDGET(__w__) (((__w__) >= NTV2_WIDGET_FIRST) && ((__w__) < NTV2_WIDGET_INVALID)) + +typedef enum { + NTV2WidgetType_First = 0 + ,NTV2WidgetType_FrameStore = NTV2WidgetType_First + ,NTV2WidgetType_CSC + ,NTV2WidgetType_LUT + ,NTV2WidgetType_FrameSync + ,NTV2WidgetType_SDIIn + ,NTV2WidgetType_SDIIn3G + ,NTV2WidgetType_SDIOut + ,NTV2WidgetType_SDIOut3G + ,NTV2WidgetType_SDIMonOut + ,NTV2WidgetType_DualLinkV1In + ,NTV2WidgetType_DualLinkV2In + ,NTV2WidgetType_DualLinkV1Out + ,NTV2WidgetType_DualLinkV2Out + ,NTV2WidgetType_AnalogIn + ,NTV2WidgetType_AnalogOut + ,NTV2WidgetType_AnalogCompositeOut + ,NTV2WidgetType_HDMIInV1 + ,NTV2WidgetType_HDMIInV2 + ,NTV2WidgetType_HDMIInV3 + ,NTV2WidgetType_HDMIInV4 + ,NTV2WidgetType_UpDownConverter + ,NTV2WidgetType_Mixer + ,NTV2WidgetType_DCIMixer + ,NTV2WidgetType_Compression + ,NTV2WidgetType_StereoCompressor + ,NTV2WidgetType_ProcAmp + ,NTV2WidgetType_GenLock + ,NTV2WidgetType_4KDownConverter + ,NTV2WidgetType_HDMIOutV1 + ,NTV2WidgetType_HDMIOutV2 + ,NTV2WidgetType_HDMIOutV3 + ,NTV2WidgetType_HDMIOutV4 + ,NTV2WidgetType_HDMIOutV5 + ,NTV2WidgetType_SMPTE425Mux + ,NTV2WidgetType_SDIIn12G + ,NTV2WidgetType_SDIOut12G + ,NTV2WidgetType_MultiLinkOut + ,NTV2WidgetType_LUT3D + ,NTV2WidgetType_OE + ,NTV2WidgetType_WaterMarker + ,NTV2WidgetType_IICT + ,NTV2WidgetType_TestPattern + ,NTV2WidgetType_Max + ,NTV2WidgetType_Invalid = NTV2WidgetType_Max +} NTV2WidgetType; + +#define NTV2_IS_VALID_WIDGET_TYPE(__w__) (((__w__) >= NTV2WidgetType_First) && ((__w__) < NTV2WidgetType_Invalid)) + +#if !defined (NTV2_DEPRECATE) + typedef enum + { + NTV2_FrameSync1Select, + NTV2_FrameSync2Select, + NTV2K2_FrameSync1Select = NTV2_FrameSync1Select, + NTV2K2_FrameSync2Select = NTV2_FrameSync2Select, + NTV2_MAX_NUM_FrameSyncSelect + } NTV2FrameSyncSelect; // FS1 ONLY +#endif // !defined (NTV2_DEPRECATE) + + +/** + @brief Identifies the \ref ntv2hwaccessories that may be attached to an AJA NTV2 device. +**/ +typedef enum +{ + NTV2_BreakoutNone, ///< @brief No identifiable breakout hardware appears to be attached. + NTV2_BreakoutCableXLR, ///< @brief Identifies the AES/EBU audio breakout cable that has XLR connectors + NTV2_BreakoutCableBNC, ///< @brief Identifies the AES/EBU audio breakout cable that has BNC connectors + NTV2_KBox, // Kona2 + NTV2_KLBox, // KonaLS + NTV2_K3Box, // Kona3 + NTV2_KLHiBox, // Kona LHI + NTV2_KLHePlusBox, // Kona LHe+ + NTV2_K3GBox, // Kona3G + NTV2_MAX_NUM_BreakoutTypes, + NTV2_BreakoutType_Invalid = NTV2_BreakoutNone +} NTV2BreakoutType; + +#define NTV2_IS_VALID_BREAKOUT_TYPE(__p__) ((__p__) > NTV2_BreakoutNone && (__p__) < NTV2_MAX_NUM_BreakoutTypes) + + +#define EXTENDED_AUDIO_SUPPORTED + +/** + @brief Identifies a pair of audio channels. + @note The audio channels in the pair are adjacent, and never span an audio group. + @see CNTV2Card::GetAudioPCMControl(const NTV2AudioSystem, const NTV2AudioChannelPair), + CNTV2Card::SetAudioPCMControl(const NTV2AudioSystem, const NTV2AudioChannelPair), + ::NTV2DeviceGetMaxAudioChannels, \ref audiooperation +**/ +typedef enum +{ + NTV2_AudioChannel1_2, ///< @brief This selects audio channels 1 and 2 (Group 1 channels 1 and 2) + NTV2_AudioChannel3_4, ///< @brief This selects audio channels 3 and 4 (Group 1 channels 3 and 4) + NTV2_AudioChannel5_6, ///< @brief This selects audio channels 5 and 6 (Group 2 channels 1 and 2) + NTV2_AudioChannel7_8, ///< @brief This selects audio channels 7 and 8 (Group 2 channels 3 and 4) + NTV2_AudioChannel9_10, ///< @brief This selects audio channels 9 and 10 (Group 3 channels 1 and 2) + NTV2_AudioChannel11_12, ///< @brief This selects audio channels 11 and 12 (Group 3 channels 3 and 4) + NTV2_AudioChannel13_14, ///< @brief This selects audio channels 13 and 14 (Group 4 channels 1 and 2) + NTV2_AudioChannel15_16, ///< @brief This selects audio channels 15 and 16 (Group 4 channels 3 and 4) + NTV2_AudioChannel17_18, ///< @brief This selects audio channels 17 and 18 + NTV2_AudioChannel19_20, ///< @brief This selects audio channels 19 and 20 + NTV2_AudioChannel21_22, ///< @brief This selects audio channels 21 and 22 + NTV2_AudioChannel23_24, ///< @brief This selects audio channels 23 and 24 + NTV2_AudioChannel25_26, ///< @brief This selects audio channels 25 and 26 + NTV2_AudioChannel27_28, ///< @brief This selects audio channels 27 and 28 + NTV2_AudioChannel29_30, ///< @brief This selects audio channels 29 and 30 + NTV2_AudioChannel31_32, ///< @brief This selects audio channels 31 and 32 + NTV2_AudioChannel33_34, ///< @brief This selects audio channels 33 and 34 + NTV2_AudioChannel35_36, ///< @brief This selects audio channels 35 and 36 + NTV2_AudioChannel37_38, ///< @brief This selects audio channels 37 and 38 + NTV2_AudioChannel39_40, ///< @brief This selects audio channels 39 and 40 + NTV2_AudioChannel41_42, ///< @brief This selects audio channels 41 and 42 + NTV2_AudioChannel43_44, ///< @brief This selects audio channels 43 and 44 + NTV2_AudioChannel45_46, ///< @brief This selects audio channels 45 and 46 + NTV2_AudioChannel47_48, ///< @brief This selects audio channels 47 and 48 + NTV2_AudioChannel49_50, ///< @brief This selects audio channels 49 and 50 + NTV2_AudioChannel51_52, ///< @brief This selects audio channels 51 and 52 + NTV2_AudioChannel53_54, ///< @brief This selects audio channels 53 and 54 + NTV2_AudioChannel55_56, ///< @brief This selects audio channels 55 and 56 + NTV2_AudioChannel57_58, ///< @brief This selects audio channels 57 and 58 + NTV2_AudioChannel59_60, ///< @brief This selects audio channels 59 and 60 + NTV2_AudioChannel61_62, ///< @brief This selects audio channels 61 and 62 + NTV2_AudioChannel63_64, ///< @brief This selects audio channels 63 and 64 + NTV2_AudioChannel65_66, ///< @brief This selects audio channels 65 and 66 + NTV2_AudioChannel67_68, ///< @brief This selects audio channels 67 and 68 + NTV2_AudioChannel69_70, ///< @brief This selects audio channels 69 and 70 + NTV2_AudioChannel71_72, ///< @brief This selects audio channels 71 and 72 + NTV2_AudioChannel73_74, ///< @brief This selects audio channels 73 and 74 + NTV2_AudioChannel75_76, ///< @brief This selects audio channels 75 and 76 + NTV2_AudioChannel77_78, ///< @brief This selects audio channels 77 and 78 + NTV2_AudioChannel79_80, ///< @brief This selects audio channels 79 and 80 + NTV2_AudioChannel81_82, ///< @brief This selects audio channels 81 and 82 + NTV2_AudioChannel83_84, ///< @brief This selects audio channels 83 and 84 + NTV2_AudioChannel85_86, ///< @brief This selects audio channels 85 and 86 + NTV2_AudioChannel87_88, ///< @brief This selects audio channels 87 and 88 + NTV2_AudioChannel89_90, ///< @brief This selects audio channels 89 and 90 + NTV2_AudioChannel91_92, ///< @brief This selects audio channels 91 and 92 + NTV2_AudioChannel93_94, ///< @brief This selects audio channels 93 and 94 + NTV2_AudioChannel95_96, ///< @brief This selects audio channels 95 and 96 + NTV2_AudioChannel97_98, ///< @brief This selects audio channels 97 and 98 + NTV2_AudioChannel99_100, ///< @brief This selects audio channels 99 and 100 + NTV2_AudioChannel101_102, ///< @brief This selects audio channels 101 and 102 + NTV2_AudioChannel103_104, ///< @brief This selects audio channels 103 and 104 + NTV2_AudioChannel105_106, ///< @brief This selects audio channels 105 and 106 + NTV2_AudioChannel107_108, ///< @brief This selects audio channels 107 and 108 + NTV2_AudioChannel109_110, ///< @brief This selects audio channels 109 and 110 + NTV2_AudioChannel111_112, ///< @brief This selects audio channels 111 and 112 + NTV2_AudioChannel113_114, ///< @brief This selects audio channels 113 and 114 + NTV2_AudioChannel115_116, ///< @brief This selects audio channels 115 and 116 + NTV2_AudioChannel117_118, ///< @brief This selects audio channels 117 and 118 + NTV2_AudioChannel119_120, ///< @brief This selects audio channels 119 and 120 + NTV2_AudioChannel121_122, ///< @brief This selects audio channels 121 and 122 + NTV2_AudioChannel123_124, ///< @brief This selects audio channels 123 and 124 + NTV2_AudioChannel125_126, ///< @brief This selects audio channels 125 and 126 + NTV2_AudioChannel127_128, ///< @brief This selects audio channels 127 and 128 + NTV2_MAX_NUM_AudioChannelPair, + NTV2_AUDIO_CHANNEL_PAIR_INVALID = NTV2_MAX_NUM_AudioChannelPair +} NTV2AudioChannelPair; + +typedef NTV2AudioChannelPair NTV2Audio2ChannelSelect; + +#define NTV2_IS_VALID_AUDIO_CHANNEL_PAIR(__p__) ((__p__) >= NTV2_AudioChannel1_2 && (__p__) < NTV2_MAX_NUM_AudioChannelPair) +#define NTV2_IS_WITHIN_AUDIO_CHANNELS_1_TO_16(__p__) ((__p__) >= NTV2_AudioChannel1_2 && (__p__) <= NTV2_AudioChannel15_16) +#define NTV2_IS_NORMAL_AUDIO_CHANNEL_PAIR(__p__) ((__p__) >= NTV2_AudioChannel1_2 && (__p__) <= NTV2_AudioChannel15_16) +#define NTV2_IS_EXTENDED_AUDIO_CHANNEL_PAIR(__p__) ((__p__) >= NTV2_AudioChannel17_18 && (__p__) < NTV2_MAX_NUM_AudioChannelPair) + +#if !defined(NTV2_DEPRECATE_16_1) + #define NTV2_AudioMonitor1_2 NTV2_AudioChannel1_2 // Analog Audio Monitor Channels 1-2 + #define NTV2_AudioMonitor3_4 NTV2_AudioChannel3_4 // Analog Audio Monitor Channels 3-4 + #define NTV2_AudioMonitor5_6 NTV2_AudioChannel5_6 // Analog Audio Monitor Channels 5-6 + #define NTV2_AudioMonitor7_8 NTV2_AudioChannel7_8 // Analog Audio Monitor Channels 7-8 + #define NTV2_AudioMonitor9_10 NTV2_AudioChannel9_10 // Analog Audio Monitor Channels 9-10 + #define NTV2_AudioMonitor11_12 NTV2_AudioChannel11_12 // Analog Audio Monitor Channels 11-12 + #define NTV2_AudioMonitor13_14 NTV2_AudioChannel13_14 // Analog Audio Monitor Channels 13-14 + #define NTV2_AudioMonitor15_16 NTV2_AudioChannel15_16 // Analog Audio Monitor Channels 15-16 + #define NTV2_MAX_NUM_AudioMonitorSelect NTV2_AudioChannel17_18 + #define NTV2_AUDIO_MONITOR_INVALID NTV2_MAX_NUM_AudioMonitorSelect + typedef NTV2AudioChannelPair NTV2AudioMonitorSelect; + + #define NTV2_IS_VALID_AUDIO_MONITOR(__p__) ((__p__) < NTV2_MAX_NUM_AudioMonitorSelect) +#endif // !defined(NTV2_DEPRECATE_16_1) + + +typedef enum +{ + NTV2_AudioMixerChannel1, + NTV2_AudioMixerChannel2, + NTV2_AudioMixerChannel3, + NTV2_AudioMixerChannel4, + NTV2_AudioMixerChannel5, + NTV2_AudioMixerChannel6, + NTV2_AudioMixerChannel7, + NTV2_AudioMixerChannel8, + NTV2_AudioMixerChannel9, + NTV2_AudioMixerChannel10, + NTV2_AudioMixerChannel11, + NTV2_AudioMixerChannel12, + NTV2_AudioMixerChannel13, + NTV2_AudioMixerChannel14, + NTV2_AudioMixerChannel15, + NTV2_AudioMixerChannel16, + NTV2_MAX_NUM_AudioMixerChannel, + NTV2_AUDIO_MIXER_CHANNEL_INVALID = NTV2_MAX_NUM_AudioMixerChannel +} NTV2AudioMixerChannel; + +#define NTV2_IS_VALID_AUDIO_MIXER_CHANNEL(__p__) ((__p__) >= NTV2_AudioMixerChannel1 && (__p__) < NTV2_MAX_NUM_AudioMixerChannel) +#define NTV2_IS_AUDIO_MIXER_CHANNELS_1_OR_2(__p__) ((__p__) >= NTV2_AudioMixerChannel1 && (__p__) <= NTV2_AudioMixerChannel2) + +/** + @brief Identifies the Audio Mixer's audio inputs. + @see See \ref audiomixer +**/ +typedef enum +{ + NTV2_AudioMixerInputMain, ///< @brief This selects the Audio Mixer's Main (primary) input + NTV2_AudioMixerInputAux1, ///< @brief This selects the Audio Mixer's 1st Auxiliary input + NTV2_AudioMixerInputAux2, ///< @brief This selects the Audio Mixer's 2nd Auxiliary input + NTV2_MAX_NUM_AudioMixerInput, + NTV2_AUDIO_MIXER_INPUT_INVALID = NTV2_MAX_NUM_AudioMixerInput +} NTV2AudioMixerInput; + +#define NTV2_IS_VALID_AUDIO_MIXER_INPUT(__p__) ((__p__) >= NTV2_AudioMixerInputMain && (__p__) < NTV2_AUDIO_MIXER_INPUT_INVALID) +#define NTV2_IS_AUDIO_MIXER_INPUT_MAIN(__p__) ((__p__) == NTV2_AudioMixerInputMain) + + +/** + @brief Identifies a contiguous, adjacent group of four audio channels. + @see CNTV2Card::GetAESOutputSource, CNTV2Card::SetAESOutputSource, \ref audiooperation +**/ +typedef enum +{ + NTV2_AudioChannel1_4, ///< @brief This selects audio channels 1 thru 4 + NTV2_AudioChannel5_8, ///< @brief This selects audio channels 5 thru 8 + NTV2_AudioChannel9_12, ///< @brief This selects audio channels 9 thru 12 + NTV2_AudioChannel13_16, ///< @brief This selects audio channels 13 thru 16 + NTV2_AudioChannel17_20, ///< @brief This selects audio channels 17 thru 20 + NTV2_AudioChannel21_24, ///< @brief This selects audio channels 21 thru 24 + NTV2_AudioChannel25_28, ///< @brief This selects audio channels 25 thru 28 + NTV2_AudioChannel29_32, ///< @brief This selects audio channels 29 thru 32 + NTV2_AudioChannel33_36, ///< @brief This selects audio channels 33 thru 36 + NTV2_AudioChannel37_40, ///< @brief This selects audio channels 37 thru 40 + NTV2_AudioChannel41_44, ///< @brief This selects audio channels 41 thru 44 + NTV2_AudioChannel45_48, ///< @brief This selects audio channels 45 thru 48 + NTV2_AudioChannel49_52, ///< @brief This selects audio channels 49 thru 52 + NTV2_AudioChannel53_56, ///< @brief This selects audio channels 53 thru 56 + NTV2_AudioChannel57_60, ///< @brief This selects audio channels 57 thru 60 + NTV2_AudioChannel61_64, ///< @brief This selects audio channels 61 thru 64 + NTV2_AudioChannel65_68, ///< @brief This selects audio channels 65 thru 68 + NTV2_AudioChannel69_72, ///< @brief This selects audio channels 69 thru 72 + NTV2_AudioChannel73_76, ///< @brief This selects audio channels 73 thru 76 + NTV2_AudioChannel77_80, ///< @brief This selects audio channels 77 thru 80 + NTV2_AudioChannel81_84, ///< @brief This selects audio channels 81 thru 84 + NTV2_AudioChannel85_88, ///< @brief This selects audio channels 85 thru 88 + NTV2_AudioChannel89_92, ///< @brief This selects audio channels 89 thru 92 + NTV2_AudioChannel93_96, ///< @brief This selects audio channels 93 thru 96 + NTV2_AudioChannel97_100, ///< @brief This selects audio channels 97 thru 100 + NTV2_AudioChannel101_104, ///< @brief This selects audio channels 101 thru 104 + NTV2_AudioChannel105_108, ///< @brief This selects audio channels 105 thru 108 + NTV2_AudioChannel109_112, ///< @brief This selects audio channels 109 thru 112 + NTV2_AudioChannel113_116, ///< @brief This selects audio channels 113 thru 116 + NTV2_AudioChannel117_120, ///< @brief This selects audio channels 117 thru 120 + NTV2_AudioChannel121_124, ///< @brief This selects audio channels 121 thru 124 + NTV2_AudioChannel125_128, ///< @brief This selects audio channels 125 thru 128 + NTV2_MAX_NUM_Audio4ChannelSelect, + NTV2_AUDIO_CHANNEL_QUAD_INVALID = NTV2_MAX_NUM_Audio4ChannelSelect +} NTV2Audio4ChannelSelect; + +typedef NTV2Audio4ChannelSelect NTV2AudioChannelQuad; + +#define NTV2_IS_VALID_AUDIO_CHANNEL_QUAD(__p__) ((__p__) >= NTV2_AudioChannel1_4 && (__p__) < NTV2_MAX_NUM_Audio4ChannelSelect) +#define NTV2_IS_NORMAL_AUDIO_CHANNEL_QUAD(__p__) ((__p__) >= NTV2_AudioChannel1_4 && (__p__) < NTV2_AudioChannel17_20) +#define NTV2_IS_EXTENDED_AUDIO_CHANNEL_QUAD(__p__) ((__p__) >= NTV2_AudioChannel17_20 && (__p__) < NTV2_MAX_NUM_Audio4ChannelSelect) + + +/** + @brief Identifies a contiguous, adjacent group of eight audio channels. + @see CNTV2Card::GetHDMIOutAudioSource8Channel, CNTV2Card::SetHDMIOutAudioSource8Channel, \ref audiooperation +**/ +typedef enum +{ + NTV2_AudioChannel1_8, ///< @brief This selects audio channels 1 thru 8 + NTV2_AudioChannel9_16, ///< @brief This selects audio channels 9 thru 16 + NTV2_AudioChannel17_24, ///< @brief This selects audio channels 17 thru 24 + NTV2_AudioChannel25_32, ///< @brief This selects audio channels 25 thru 32 + NTV2_AudioChannel33_40, ///< @brief This selects audio channels 33 thru 40 + NTV2_AudioChannel41_48, ///< @brief This selects audio channels 41 thru 48 + NTV2_AudioChannel49_56, ///< @brief This selects audio channels 49 thru 56 + NTV2_AudioChannel57_64, ///< @brief This selects audio channels 57 thru 64 + NTV2_AudioChannel65_72, ///< @brief This selects audio channels 65 thru 72 + NTV2_AudioChannel73_80, ///< @brief This selects audio channels 73 thru 80 + NTV2_AudioChannel81_88, ///< @brief This selects audio channels 81 thru 88 + NTV2_AudioChannel89_96, ///< @brief This selects audio channels 89 thru 96 + NTV2_AudioChannel97_104, ///< @brief This selects audio channels 97 thru 104 + NTV2_AudioChannel105_112, ///< @brief This selects audio channels 105 thru 112 + NTV2_AudioChannel113_120, ///< @brief This selects audio channels 113 thru 120 + NTV2_AudioChannel121_128, ///< @brief This selects audio channels 121 thru 128 + NTV2_MAX_NUM_Audio8ChannelSelect, + NTV2_AUDIO_CHANNEL_OCTET_INVALID = NTV2_MAX_NUM_Audio8ChannelSelect +} NTV2Audio8ChannelSelect; + +typedef NTV2Audio8ChannelSelect NTV2AudioChannelOctet; + +#define NTV2_IS_VALID_AUDIO_CHANNEL_OCTET(__p__) ((__p__) >= NTV2_AudioChannel1_8 && (__p__) < NTV2_MAX_NUM_Audio8ChannelSelect) +#define NTV2_IS_NORMAL_AUDIO_CHANNEL_OCTET(__p__) ((__p__) >= NTV2_AudioChannel1_8 && (__p__) < NTV2_AudioChannel17_24) +#define NTV2_IS_EXTENDED_AUDIO_CHANNEL_OCTET(__p__) ((__p__) >= NTV2_AudioChannel17_24 && (__p__) < NTV2_MAX_NUM_Audio8ChannelSelect) + + +typedef enum +{ + NTV2_VideoProcBitFile, // Video processor bit file (loaded in cpu/xilinx) + NTV2_PCIBitFile, // PCI flash bit file (loaded in cpu/xilinx) + NTV2_FWBitFile, // FireWire bit file (loaded in cpu/xilinx) + NTV2_Firmware, // Device firmware (loaded in cpu/xilinx) + + NTV2_BitFile1 = 100, // bit file 1 - resident in device memory, loaded or not + NTV2_BitFile2, // bit file 2 - resident in device memory, loaded or not + NTV2_BitFile3, // bit file 3 - resident in device memory, loaded or not + NTV2_BitFile4, // bit file 4 - resident in device memory, loaded or not + NTV2_BitFile5, // bit file 5 - resident in device memory, loaded or not + NTV2_BitFile6, // bit file 6 - resident in device memory, loaded or not + NTV2_BitFile7, // bit file 7 - resident in device memory, loaded or not + NTV2_BitFile8, // bit file 8 - resident in device memory, loaded or not + NTV2_MAX_NUM_BitFileTypes +} NTV2BitFileType; + + +typedef enum +{ + NTV2_BITFILE_NO_CHANGE = 0, // no bitfile change needed + NTV2_BITFILE_TYPE_INVALID = 0, +#if !defined (NTV2_DEPRECATE) + NTV2_BITFILE_XENAHS_SD = 1, // XENA_HS: load SD bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_XENAHS_HD = 2, // XENA-HS: load HD bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_KONA2_DNCVT = 3, // KONA2: load downconverter bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_KONA2_UPCVT = 4, // KONA2: load upconverter bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_XENALH_SD = 5, // XENA_LH: load SD bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_XENALH_HD = 6, // XENA-LH: load HD bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_XENALS_UART = 7, // XENA-LS: with UART Support // DEPRECATION_CANDIDATE + NTV2_BITFILE_XENALS_CH2 = 8, // XENA-LS: with Video Processing and Channel 2 Support // DEPRECATION_CANDIDATE + NTV2_BITFILE_XENA2_DNCVT = 9, // XENA2: load downconverter bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_XENA2_UPCVT = 10, // XENA2: load upconverter bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_XENA2_XDCVT = 11, // XENA2: load cross downconverter (1080->720) bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_XENA2_XUCVT = 12, // XENA2: load cross upconverter (720->1080) bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_XENALH_HDQRZ = 13, // XENA-LH - HD Qrez bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_XENALH_SDQRZ = 14, // XENA-LH - SD Qrez bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_XENAHS2_SD = 15, // XENA_HS2: load SD bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_XENAHS2_HD = 16, // XENA-HS2: load HD bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_MOAB_DNCVT = 17, // MOAB: load downconverter bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_MOAB_UPCVT = 18, // MOAB: load upconverter bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_MOAB_XDCVT = 19, // MOAB: load cross downconverter (1080->720) bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_MOAB_XUCVT = 20, // MOAB: load cross upconverter (720->1080) bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_XENA2_CSCVT = 21, // XENA2: load color space converter bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_BORG_CODEC = 25, // Borg CoDec bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_BORG_UFC = 26, // Borg VidProc bitfile // DEPRECATION_CANDIDATE + NTV2_BITFILE_LHI_DVI_MAIN = 34, // LHi DVI main bitfile +#endif // !defined (NTV2_DEPRECATE) + NTV2_BITFILE_CORVID1_MAIN = 22, // CORVID1 main bitfile + NTV2_BITFILE_CORVID22_MAIN = 23, // Corvid22 main bitfile + NTV2_BITFILE_KONA3G_MAIN = 24, // Kona3G main bitfile + NTV2_BITFILE_LHI_MAIN = 27, // LHi main bitfile + NTV2_BITFILE_IOEXPRESS_MAIN = 28, // IoExpress main bitfile + NTV2_BITFILE_CORVID3G_MAIN = 29, // Corvid3G main bitfile + NTV2_BITFILE_KONA3G_QUAD = 30, // Kona3G Quad bitfile + NTV2_BITFILE_KONALHE_PLUS = 31, // LHePlus bitfile + NTV2_BITFILE_IOXT_MAIN = 32, // IoXT bitfile + NTV2_BITFILE_CORVID24_MAIN = 33, // Corvid24 main bitfile + NTV2_BITFILE_TTAP_MAIN = 35, // T-Tap main bitfile + NTV2_BITFILE_LHI_T_MAIN = 36, // LHi T main bitfile + NTV2_BITFILE_IO4K_MAIN = 37, + NTV2_BITFILE_IO4KUFC_MAIN = 38, + NTV2_BITFILE_KONA4_MAIN = 39, + NTV2_BITFILE_KONA4UFC_MAIN = 40, + NTV2_BITFILE_CORVID88 = 41, + NTV2_BITFILE_CORVID44 = 42, + NTV2_BITFILE_CORVIDHEVC = 43, + NTV2_BITFILE_KONAIP_2022 = 44, + NTV2_BITFILE_KONAIP_4CH_2SFP = 45, + NTV2_BITFILE_KONAIP_1RX_1TX_1SFP_J2K= 46, + NTV2_BITFILE_KONAIP_2TX_1SFP_J2K= 47, +#if !defined(NTV2_DEPRECATE_15_6) +// NTV2_BITFILE_KONAIP_2RX_1SFP_J2K= 48, // Never built or shipped +#endif // NTV2_DEPRECATE_15_6 + NTV2_BITFILE_KONAIP_1RX_1TX_2110= 49, + NTV2_BITFILE_IO4KPLUS_MAIN = 50, + NTV2_BITFILE_IOIP_2022 = 51, + NTV2_BITFILE_IOIP_2110 = 52, + NTV2_BITFILE_KONAIP_2110 = 53, + NTV2_BITFILE_KONA1 = 54, + NTV2_BITFILE_KONAHDMI = 55, + NTV2_BITFILE_KONA5_MAIN = 56, + NTV2_BITFILE_KONA5_8KMK_MAIN = 57, + NTV2_BITFILE_CORVID44_8KMK_MAIN = 58, + NTV2_BITFILE_KONA5_8K_MAIN = 59, + NTV2_BITFILE_CORVID44_8K_MAIN = 60, + NTV2_BITFILE_TTAP_PRO_MAIN = 61, + NTV2_BITFILE_KONA5_2X4K_MAIN = 62, + NTV2_BITFILE_CORVID44_2X4K_MAIN = 63, + NTV2_BITFILE_KONA5_3DLUT_MAIN = 64, + NTV2_BITFILE_CORVID44_PLNR_MAIN = 65, + NTV2_BITFILE_IOX3_MAIN = 66, + NTV2_BITFILE_KONA5_OE1_MAIN = 67, + NTV2_BITFILE_KONA5_OE2_MAIN = 68, + NTV2_BITFILE_KONA5_OE3_MAIN = 69, + NTV2_BITFILE_KONA5_OE4_MAIN = 70, + NTV2_BITFILE_KONA5_OE5_MAIN = 71, + NTV2_BITFILE_KONA5_OE6_MAIN = 72, + NTV2_BITFILE_KONA5_OE7_MAIN = 73, + NTV2_BITFILE_KONA5_OE8_MAIN = 74, + NTV2_BITFILE_KONA5_OE9_MAIN = 75, + NTV2_BITFILE_KONA5_OE10_MAIN = 76, + NTV2_BITFILE_KONA5_OE11_MAIN = 77, + NTV2_BITFILE_KONA5_OE12_MAIN = 78, + NTV2_BITFILE_KONAIP_2110_RGB12 = 79, + NTV2_BITFILE_IOIP_2110_RGB12 = 80, + NTV2_BITFILE_SOJI_OE1_MAIN = 81, + NTV2_BITFILE_SOJI_OE2_MAIN = 82, + NTV2_BITFILE_SOJI_OE3_MAIN = 83, + NTV2_BITFILE_SOJI_OE4_MAIN = 84, + NTV2_BITFILE_SOJI_OE5_MAIN = 85, + NTV2_BITFILE_SOJI_OE6_MAIN = 86, + NTV2_BITFILE_SOJI_OE7_MAIN = 87, + NTV2_BITFILE_SOJI_3DLUT_MAIN = 88, + NTV2_BITFILE_KONA5_8K_MV_TX_MAIN = 89, + NTV2_BITFILE_NUMBITFILETYPES +} NTV2BitfileType; + + +#if !defined (NTV2_DEPRECATE) + typedef enum + { + NTV2_BITFILE_K2 // KONA2: PCI firmware + } NTV2PCIBitFileType; + + typedef enum + { + NTV2_BITFILE_MOABFW // MOAB: firewire xilinx + } NTV2FWBitFileType; + + + typedef enum + { + NTV2_BITFILE_MOABPPC // MOAB: PPC firmware + } NTV2FirmwareBitFileType; +#endif // !defined (NTV2_DEPRECATE) + + +typedef enum +{ + NTV2_CSC_Method_Unimplemented, + NTV2_CSC_Method_Original, + NTV2_CSC_Method_Enhanced, + NTV2_CSC_Method_Enhanced_4K, + NTV2_MAX_NUM_ColorSpaceMethods +} NTV2ColorSpaceMethod; + + +typedef enum +{ + // For use with the original color space converter + NTV2_Rec709Matrix, // Rec 709 is generally used in HD + NTV2_Rec601Matrix, // Rec 601 is generally used in SD + + // Supported only by the enhanced color space converter + NTV2_Custom_Matrix, // The matrix coefficients are not a standard preset + + NTV2_Unity_Matrix, // The matrix outputs are the same as the inputs + NTV2_Unity_SMPTE_Matrix, // A unity matrix with SMPTE pre- and post- offsets + + // The GBR naming is a reminder the ordering of the hardware input channels is also GRB, not RGB + NTV2_GBRFull_to_YCbCr_Rec709_Matrix, // RGB full range -> YCbCr Rec 709 (HD) + NTV2_GBRFull_to_YCbCr_Rec601_Matrix, // RGB full range -> YCbCr Rec 601 (SD) + NTV2_GBRSMPTE_to_YCbCr_Rec709_Matrix, // RGB SMPTE range -> YCbCr Rec 709 (HD) + NTV2_GBRSMPTE_to_YCbCr_Rec601_Matrix, // RGB SMPTE range -> YCbCr Rec 601 (SD) + + NTV2_YCbCr_to_GBRFull_Rec709_Matrix, // YCbCr -> RGB full range Rec 709 (HD) + NTV2_YCbCr_to_GBRFull_Rec601_Matrix, // YCbCr -> RGB full range Rec 601 (SD) + NTV2_YCbCr_to_GBRSMPTE_Rec709_Matrix, // YCbCr -> RGB SMPTE range Rec 709 (HD) + NTV2_YCbCr_to_GBRSMPTE_Rec601_Matrix, // YCbCr -> RGB SMPTE range Rec 601 (SD) + + NTV2_YCbCrRec601_to_YCbCrRec709_Matrix, // YCbCr Rec 601 (SD) -> YCbCr Rec 709 (HD) + NTV2_YCbCrRec709_to_YCbCrRec601_Matrix, // YCbCr Rec 709 (HD) -> YCbCr Rec 601 (SD) + + NTV2_GBRFull_to_GBRSMPTE_Matrix, // RGB full range -> RGB SMPTE range + NTV2_GBRSMPTE_to_GBRFull_Matrix, // RGB SMPTE range -> RGB full range + + NTV2_GBRFull_to_YCbCr_Rec2020_Matrix, // RGB full range -> YCbCr Rec 2020 + NTV2_GBRSMPTE_to_YCbCr_Rec2020_Matrix, // RGB SMPTE range -> YCbCr Rec 2020 + NTV2_YCbCr_to_GBRFull_Rec2020_Matrix, // YCbCr -> RGB full range Rec 2020 + NTV2_YCbCr_to_GBRSMPTE_Rec2020_Matrix, // YCbCr -> RGB SMPTE range Rec 2020 + + #if !defined (NTV2_DEPRECATE) + NTV2K2_Rec709Matrix = NTV2_Rec709Matrix, + NTV2K2_Rec601Matrix = NTV2_Rec601Matrix, + #endif // !defined (NTV2_DEPRECATE) + NTV2_MAX_NUM_ColorSpaceMatrixTypes, + NTV2_CSC_MATRIX_TYPE_INVALID = NTV2_MAX_NUM_ColorSpaceMatrixTypes +} NTV2ColorSpaceMatrixType; + +#define NTV2_IS_VALID_CSC_MATRIX_TYPE(__p__) ((__p__) >= NTV2_Rec709Matrix && (__p__) < NTV2_MAX_NUM_ColorSpaceMatrixTypes) + + +typedef enum +{ + NTV2_DSKModeOff + ,NTV2_DSKModeFBOverMatte + ,NTV2_DSKModeFBOverVideoIn + ,NTV2_DSKModeGraphicOverMatte + ,NTV2_DSKModeGraphicOverVideoIn + ,NTV2_DSKModeGraphicOverFB + ,NTV2_DSKModeMax + ,NTV2_DSKMODE_INVALID = NTV2_DSKModeMax +} NTV2DSKMode; + + +typedef enum +{ + NTV2_DSKForegroundUnshaped, // DSK Foreground is not pre-multiplied by alpha + NTV2_DSKForegroundShaped // DSK Background has already been pre-multiplied by alpha +} NTV2DSKForegroundMode; + + +typedef enum +{ + NTV2_DSKAudioForeground, // Take audio from frame buffer ("Playback") + NTV2_DSKAudioBackground // Take audio from input ("E-E") +} NTV2DSKAudioMode; + + +// This is a user-pref control (currently only used on the Mac) that allows the user +// to specify which color-space matrix to use when converting between RGB and YUV +typedef enum +{ + NTV2_ColorSpaceTypeAuto, // switch between Rec 601 for SD, Rec 709 for HD + NTV2_ColorSpaceTypeRec601, // always use Rec 601 matrix + NTV2_ColorSpaceTypeRec709, // always use Rec 709 matrix + NTV2_MAX_NUM_ColorSpaceTypes +} NTV2ColorSpaceType; + + +/** + @brief This is a user-pref control (currently only used on the Mac) that allows the user + to specify which flavor of Stereo 3D is to be used +**/ +typedef enum +{ + NTV2_Stereo3DOff, // Stereo Mode disabled + NTV2_Stereo3DSideBySide, // Muxed Single Stream - Side-By-Side + NTV2_Stereo3DTopBottom, // Muxed Single Stream - Top over Bottom + NTV2_Stereo3DDualStream, // Two independant streams + NTV2_MAX_NUM_Stereo3DModes +} NTV2Stereo3DMode; + + +// The Mac implementation of color-space conversion uses the two LUT banks for holding +// two separate gamma-conversion LUTs: one for RGB=>YUV and the other for YUV=>RGB. This +// defines which bank is used for which conversion LUT. +// NOTE: using the LUT Banks this way conflicts with using them for AutoCirculate "Color Correction". +#define kLUTBank_RGB2YUV 0 // uses Bank 0 when converting from RGB=>YUV +#define kLUTBank_YUV2RGB 1 // uses Bank 1 when converting from YUV=>RGB +#define kLUTBank_SMPTE2FULL 0 // uses Bank 0 when converting from SMPTE=>Full range RGB +#define kLUTBank_FULL2SMPTE 1 // uses Bank 0 when converting from Full=>SMPTE range RGB + + +/** + @brief This specifies what function(s) are currently loaded into the LUTs +**/ +typedef enum +{ + NTV2_LUTUnknown, // Don't know... + NTV2_LUTCustom, // None of the below (on purpose) + NTV2_LUTLinear, // Linear (both banks) + NTV2_LUTGamma18_Rec601, // Translates between Mac 1.8 and Rec 601 (Power Function 2.2), Full Range + NTV2_LUTGamma18_Rec709, // Translates between Mac 1.8 and Rec 709, Full Range + NTV2_LUTGamma18_Rec601_SMPTE, // Same as NTV2_LUTGamma18_Rec601, SMPTE range + NTV2_LUTGamma18_Rec709_SMPTE, // Same as NTV2_LUTGamma18_Rec709, SMPTE range + NTV2_LUTRGBRangeFull_SMPTE, // Translates Full <-> SMPTE range + NTV2_MAX_NUM_LutTypes, + NTV2_INVALID_LUT_TYPE = NTV2_MAX_NUM_LutTypes +} NTV2LutType; + +#define NTV2_IS_VALID_LUT_TYPE(__x__) ((__x__) >= NTV2_LUTUnknown && (__x__) < NTV2_MAX_NUM_LutTypes) + +/** + @brief This specifies the LUT bit depth +**/ +typedef enum +{ + NTV2_LUT10Bit, + NTV2_LUT12Bit +} NTV2LutBitDepth; + + +/** + @brief This specifies the HDMI Out Stereo 3D Mode +**/ +typedef enum +{ + NTV2_HDMI3DFramePacking = 0x0, // Frame Packing mode + NTV2_HDMI3DSideBySide = 0x8, // Side By Side Stereo 3D mode + NTV2_HDMI3DTopBottom = 0x6, // Top Over Bottom Stereo 3D mode + NTV2_MAX_NUM_HDMIOut3DModes +} NTV2HDMIOut3DMode; + + +/** + @brief Indicates or specifies HDMI Color Space +**/ +typedef enum +{ + NTV2_HDMIColorSpaceAuto, ///< @brief Automatic (not for OEM use) + NTV2_HDMIColorSpaceRGB, ///< @brief RGB color space + NTV2_HDMIColorSpaceYCbCr, ///< @brief YCbCr color space + NTV2_MAX_NUM_HDMIColorSpaces, + NTV2_INVALID_HDMI_COLORSPACE = NTV2_MAX_NUM_HDMIColorSpaces +} NTV2HDMIColorSpace; + +#define NTV2_IS_VALID_HDMI_COLORSPACE(__x__) ((__x__) > NTV2_HDMIColorSpaceAuto && (__x__) < NTV2_MAX_NUM_HDMIColorSpaces) + + +/** + @brief Indicates or specifies the HDMI protocol +**/ +typedef enum +{ + NTV2_HDMIProtocolHDMI, ///< @brief HDMI protocol + NTV2_HDMIProtocolDVI, ///< @brief DVI protocol + NTV2_MAX_NUM_HDMIProtocols, + NTV2_INVALID_HDMI_PROTOCOL = NTV2_MAX_NUM_HDMIProtocols +} NTV2HDMIProtocol; + +#define NTV2_IS_VALID_HDMI_PROTOCOL(__x__) ((__x__) >= NTV2_HDMIProtocolHDMI && (__x__) < NTV2_MAX_NUM_HDMIProtocols) + + +/** + @brief Indicates or specifies the HDMI RGB range +**/ +typedef enum +{ + NTV2_HDMIRangeSMPTE, ///< @brief Levels are 16 - 235 (SMPTE) + NTV2_HDMIRangeFull, ///< @brief Levels are 0 - 255 (Full) + NTV2_MAX_NUM_HDMIRanges, + NTV2_INVALID_HDMI_RANGE = NTV2_MAX_NUM_HDMIRanges +} NTV2HDMIRange; + +#define NTV2_IS_VALID_HDMI_RANGE(__x__) ((__x__) < NTV2_MAX_NUM_HDMIRanges) + + +/** + @brief Indicates or specifies the HDMI colorimetry +**/ +typedef enum +{ + NTV2_HDMIColorimetryNoData, + NTV2_HDMIColorimetry601, + NTV2_HDMIColorimetry709, + NTV2_HDMIColorimetry2020, + NTV2_HDMIColorimetry2020CL, + NTV2_HDMIColorimetryDCI, + NTV2_MAX_NUM_HDMIColorimetry, + NTV2_INVALID_HDMI_Colorimetry = NTV2_MAX_NUM_HDMIColorimetry +} NTV2HDMIColorimetry; + +#define NTV2_IS_VALID_HDMI_COLORIMETRY(__x__) ((__x__) < NTV2_MAX_NUM_HDMIColorimetry) + + +/** + @brief Indicates or specifies the HDMI audio channel count +**/ +typedef enum +{ + NTV2_HDMIAudio2Channels, ///< @brief 2 audio channels + NTV2_HDMIAudio8Channels, ///< @brief 8 audio channels + NTV2_MAX_NUM_HDMIAudioChannelEnums, + NTV2_INVALID_HDMI_AUDIO_CHANNELS = NTV2_MAX_NUM_HDMIAudioChannelEnums +} NTV2HDMIAudioChannels; + +#define NTV2_IS_VALID_HDMI_AUDIO_CHANNELS(__x__) ((__x__) >= NTV2_HDMIAudio2Channels) && ((__x__) < NTV2_INVALID_HDMI_AUDIO_CHANNELS) + +// LHI version HDMI Color Space I/O +typedef enum +{ + NTV2_LHIHDMIColorSpaceYCbCr, // YCbCr + NTV2_LHIHDMIColorSpaceRGB, // RGB + NTV2_MAX_NUM_LHIHDMIColorSpaces, + NTV2_INVALID_LHI_HDMI_COLORSPACE = NTV2_MAX_NUM_LHIHDMIColorSpaces +} NTV2LHIHDMIColorSpace; + +#define NTV2_IS_VALID_LHI_HDMI_COLORSPACE(__x__) ((__x__) < NTV2_MAX_NUM_LHIHDMIColorSpaces) + + +/** + @brief Indicates or specifies the HDMI video bit depth +**/ +typedef enum +{ + NTV2_HDMI8Bit, ///< @brief 8 bit + NTV2_HDMI10Bit, ///< @brief 10 bit + NTV2_HDMI12Bit, ///< @brief 12 bit + NTV2_MAX_NUM_HDMIBitDepths, + NTV2_INVALID_HDMIBitDepth = NTV2_MAX_NUM_HDMIBitDepths +} NTV2HDMIBitDepth; + +#define NTV2_IS_VALID_HDMI_BITDEPTH(__x__) ((__x__) < NTV2_MAX_NUM_HDMIBitDepths) + + +// This specifies the output selection for the LH board +typedef enum +{ + NTV2LHOutputSelect_VidProc1, + NTV2LHOutputSelect_DownConvert, + NTV2LHOutputSelect_VidProc2, + NTV2_MAX_NUM_LHOutputSelectEnums +} NTV2LHOutputSelect; + + +#if !defined (NTV2_DEPRECATE) + // Deprecated .. used only by Xena DXT application, which never shipped + typedef enum + { DT_XENA_DXT_FIRMWARE_DESIRED_UNINITIALIZED, + DT_XENA_DXT_FIRMWARE_DESIRED_HD, + DT_XENA_DXT_FIRMWARE_DESIRED_SD + } DT_XENA_DXT_FIRMWARE_DESIRED; +#endif // !defined (NTV2_DEPRECATE) + + +typedef enum +{ + NTV2_1080i_5994to525_5994 // 0 + ,NTV2_1080i_2500to625_2500 // 1 + ,NTV2_720p_5994to525_5994 // 2 + ,NTV2_720p_5000to625_2500 // 3 + ,NTV2_525_5994to1080i_5994 // 4 + ,NTV2_525_5994to720p_5994 // 5 + ,NTV2_625_2500to1080i_2500 // 6 + ,NTV2_625_2500to720p_5000 // 7 + ,NTV2_720p_5000to1080i_2500 // 8 + ,NTV2_720p_5994to1080i_5994 // 9 + ,NTV2_720p_6000to1080i_3000 // 10 + ,NTV2_1080i2398to525_2398 // 11 + ,NTV2_1080i2398to525_2997 // 12 + ,NTV2_1080i2400to525_2400 // 13 + ,NTV2_1080p2398to525_2398 // 14 + ,NTV2_1080p2398to525_2997 // 15 + ,NTV2_1080p2400to525_2400 // 16 + ,NTV2_1080i_2500to720p_5000 // 17 + ,NTV2_1080i_5994to720p_5994 // 18 + ,NTV2_1080i_3000to720p_6000 // 19 + ,NTV2_1080i_2398to720p_2398 // 20 + ,NTV2_720p_2398to1080i_2398 // 21 + ,NTV2_525_2398to1080i_2398 // 22 + ,NTV2_525_5994to525_5994 // 23 + ,NTV2_625_2500to625_2500 // 24 + ,NTV2_525_5994to525psf_2997 // 25 + ,NTV2_625_5000to625psf_2500 // 26 + ,NTV2_1080i_5000to1080psf_2500 // 27 + ,NTV2_1080i_5994to1080psf_2997 // 28 + ,NTV2_1080i_6000to1080psf_3000 // 29 + ,NTV2_1080p_3000to720p_6000 // 30 + ,NTV2_1080psf_2398to1080i_5994 // 31 + ,NTV2_1080psf_2400to1080i_3000 // 32 + ,NTV2_1080psf_2500to1080i_2500 // 33 + ,NTV2_1080p_2398to1080i_5994 // 34 + ,NTV2_1080p_2400to1080i_3000 // 35 + ,NTV2_1080p_2500to1080i_2500 // 36 + ,NTV2_NUM_CONVERSIONMODES // 37 + ,NTV2_CONVERSIONMODE_UNKNOWN = NTV2_NUM_CONVERSIONMODES + ,NTV2_CONVERSIONMODE_INVALID = NTV2_NUM_CONVERSIONMODES +} NTV2ConversionMode; + + +typedef enum +{ + NTV2_CSC_RGB_RANGE_FULL, + NTV2_RGBBLACKRANGE_0_0x3FF = NTV2_CSC_RGB_RANGE_FULL, + NTV2_CSC_RGB_RANGE_SMPTE, + NTV2_RGBBLACKRANGE_0x40_0x3C0 = NTV2_CSC_RGB_RANGE_SMPTE, + NTV2_CSC_RGB_RANGE_INVALID, + NTV2_MAX_NUM_RGBBlackRangeEnums = NTV2_CSC_RGB_RANGE_INVALID +} NTV2_CSC_RGB_Range; + +typedef NTV2_CSC_RGB_Range NTV2RGBBlackRange; + +#define NTV2_IS_VALID_CSCRGBRANGE(__v__) ((__v__) >= NTV2_CSC_RGB_RANGE_FULL && (__v__) < NTV2_CSC_RGB_RANGE_INVALID) + + +typedef enum +{ + NTV2_VIDEOLIMITING_LEGALSDI, + NTV2_VIDEOLIMITING_OFF, + NTV2_VIDEOLIMITING_LEGALBROADCAST, + NTV2_MAX_NUM_VideoLimitingEnums, + NTV2_VIDEOLIMITING_INVALID = NTV2_MAX_NUM_VideoLimitingEnums +} NTV2VideoLimiting; + +#define NTV2_IS_VALID_VIDEOLIMITING(__v__) ((__v__) >= NTV2_VIDEOLIMITING_LEGALSDI && (__v__) < NTV2_VIDEOLIMITING_INVALID) +#define NTV2_IS_LIMITING_LEGALSDI(__v__) ((__v__) == NTV2_VIDEOLIMITING_LEGALSDI) +#define NTV2_IS_LIMITING_OFF(__v__) ((__v__) == NTV2_VIDEOLIMITING_OFF) +#define NTV2_IS_LIMITING_LEGALBROADCAST(__v__) ((__v__) == NTV2_VIDEOLIMITING_LEGALBROADCAST) + + +/** + @brief These enum values identify the available VANC modes. + @see CNTV2Card::GetVANCMode, CNTV2Card::SetVANCMode, \ref vidop-fs, \ref vancframegeometries +**/ +typedef enum +{ + NTV2_VANCMODE_OFF, ///< @brief This identifies the mode in which there are no VANC lines in the frame buffer. + NTV2_VANCMODE_TALL, ///< @brief This identifies the "tall" mode in which there are some VANC lines in the frame buffer. + NTV2_VANCMODE_TALLER, ///< @brief This identifies the mode in which there are some + extra VANC lines in the frame buffer. + NTV2_VANCMODE_INVALID ///< @brief This identifies the invalid (unspecified, uninitialized) VANC mode. +} NTV2VANCMode; + +#define NTV2_IS_VALID_VANCMODE(__v__) ((__v__) >= NTV2_VANCMODE_OFF && (__v__) < NTV2_VANCMODE_INVALID) +#define NTV2_IS_VANCMODE_TALL(__v__) ((__v__) == NTV2_VANCMODE_TALL) +#define NTV2_IS_VANCMODE_TALLER(__v__) ((__v__) == NTV2_VANCMODE_TALLER) +#define NTV2_IS_VANCMODE_ON(__v__) ((__v__) > NTV2_VANCMODE_OFF && (__v__) < NTV2_VANCMODE_INVALID) +#define NTV2_IS_VANCMODE_OFF(__v__) ((__v__) == NTV2_VANCMODE_OFF) +#define NTV2VANCModeFromBools(_tall_,_taller_) NTV2VANCMode ((_tall_) ? ((_taller_) ? NTV2_VANCMODE_TALLER : NTV2_VANCMODE_TALL) : NTV2_VANCMODE_OFF) + + +typedef enum +{ + NTV2_VANCDATA_NORMAL, + NTV2_VANCDATA_8BITSHIFT_DISABLE = NTV2_VANCDATA_NORMAL, + NTV2_VANCDATA_8BITSHIFT_ENABLE, + NTV2_VANCDATA_INVALID, + NTV2_MAX_NUM_VANCDataShiftModes = NTV2_VANCDATA_INVALID +} NTV2VANCDataShiftMode; + +#define NTV2_IS_VALID_VANCDATASHIFT(__v__) ((__v__) >= NTV2_VANCDATA_NORMAL && (__v__) < NTV2_MAX_NUM_VANCDataShiftModes) +#define NTV2_IS_VANCDATASHIFT_ENABLED(__v__) ((__v__) == NTV2_VANCDATA_8BITSHIFT_ENABLE) + + +///////////////////////////////////////////////////////////////////////////////////// +// Driver debug message categories + +typedef enum +{ + NTV2_DRIVER_ALL_DEBUG_MESSAGES = -1, // Enable/disable all others + NTV2_DRIVER_VIDEO_DEBUG_MESSAGES = 0, // Video-specific messages + NTV2_DRIVER_AUDIO_DEBUG_MESSAGES, // Audio-specific messages + NTV2_DRIVER_AUTOCIRCULATE_DEBUG_MESSAGES, // ISR Autocirculate msgs + NTV2_DRIVER_AUTOCIRCULATE_CONTROL_DEBUG_MESSAGES,// Autocirculate control msgs + NTV2_DRIVER_DMA_AUDIO_DEBUG_MESSAGES, // Audio Direct Memory Access msgs + NTV2_DRIVER_DMA_VIDEO_DEBUG_MESSAGES, // Video Direct Memory Access msgs + NTV2_DRIVER_RP188_DEBUG_MESSAGES, // For debugging RP188 messages + NTV2_DRIVER_CUSTOM_ANC_DATA_DEBUG_MESSAGES, // For debugging ancillary data + NTV2_DRIVER_DEBUG_DEBUG_MESSAGES, // For debugging debug messages + NTV2_DRIVER_I2C_DEBUG_MESSAGES, // For debugging procamp/I2C writes + NTV2_DRIVER_NUM_DEBUG_MESSAGE_SETS // Must be last! +} NTV2_DriverDebugMessageSet; + + +typedef enum +{ + eFPGAVideoProc, + eFPGACodec, + eFPGA_NUM_FPGAs +} NTV2XilinxFPGA; + + +#if !defined (NTV2_DEPRECATE) + typedef enum + { + eButtonReleased, + eButtonPressed, + eButtonNotSupported + } NTV2ButtonState; +#endif // !defined (NTV2_DEPRECATE) + + +///////////////////////////////////////////////////////////////////////////////////// +// Stereo Compressor Stuff +typedef enum +{ + NTV2_STEREOCOMPRESSOR_PASS_LEFT, + NTV2_STEREOCOMPRESSOR_SIDExSIDE, + NTV2_STEREOCOMPRESSOR_TOP_BOTTOM, + NTV2_STEREOCOMPRESSOR_PASS_RIGHT, + NTV2_STEREOCOMPRESSOR_DISABLE = 0xF +} NTV2StereoCompressorOutputMode; + + +typedef enum +{ + NTV2_STEREOCOMPRESSOR_NO_FLIP = 0x0, + NTV2_STEREOCOMPRESSOR_LEFT_HORZ = 0x1, + NTV2_STEREOCOMPRESSOR_LEFT_VERT = 0x2, + NTV2_STEREOCOMPRESSOR_RIGHT_HORZ = 0x4, + NTV2_STEREOCOMPRESSOR_RIGHT_VERT = 0x8 +} NTV2StereoCompressorFlipMode; + + +typedef enum +{ + NTV2_LUTCONTROL_1_2, + NTV2_LUTCONTROL_3_4, + NTV2_LUTCONTROL_5 +} NTV2LUTControlSelect; + +typedef enum +{ + NTV2_REDPLANE = 0x3, + NTV2_GREENPLANE = 0x2, + NTV2_BLUEPLANE = 0x1 +} NTV2LUTPlaneSelect; + + +/** + @brief Used to identify an Audio System on an NTV2 device. + See \ref audiooperation for more information. +**/ +typedef enum +{ + NTV2_AUDIOSYSTEM_1, ///< @brief This identifies the first Audio System. + NTV2_AUDIOSYSTEM_2, ///< @brief This identifies the 2nd Audio System. + NTV2_AUDIOSYSTEM_3, ///< @brief This identifies the 3rd Audio System. + NTV2_AUDIOSYSTEM_4, ///< @brief This identifies the 4th Audio System. + NTV2_AUDIOSYSTEM_5, ///< @brief This identifies the 5th Audio System. + NTV2_AUDIOSYSTEM_6, ///< @brief This identifies the 6th Audio System. + NTV2_AUDIOSYSTEM_7, ///< @brief This identifies the 7th Audio System. + NTV2_AUDIOSYSTEM_8, ///< @brief This identifies the 8th Audio System. + NTV2_MAX_NUM_AudioSystemEnums, + NTV2_NUM_AUDIOSYSTEMS = NTV2_MAX_NUM_AudioSystemEnums, + NTV2_AUDIOSYSTEM_INVALID = NTV2_NUM_AUDIOSYSTEMS, + NTV2_AUDIOSYSTEM_Plus1 = BIT(16), + NTV2_AUDIOSYSTEM_Plus2 = BIT(17), + NTV2_AUDIOSYSTEM_Plus3 = BIT(18) +} NTV2AudioSystem; + +#define NTV2AudioSystemRemoveValues (~(NTV2_AUDIOSYSTEM_Plus1 | NTV2_AUDIOSYSTEM_Plus2 | NTV2_AUDIOSYSTEM_Plus3)) +#define NTV2_IS_VALID_AUDIO_SYSTEM(__x__) ((__x__ & NTV2AudioSystemRemoveValues) >= NTV2_AUDIOSYSTEM_1 && \ + (__x__ & NTV2AudioSystemRemoveValues) < NTV2_MAX_NUM_AudioSystemEnums) + + +typedef enum +{ + NTV2_SDI1AUDIO, + NTV2_SDI2AUDIO, + NTV2_SDI3AUDIO, + NTV2_SDI4AUDIO, + NTV2_SDI5AUDIO, + NTV2_SDI6AUDIO, + NTV2_SDI7AUDIO, + NTV2_SDI8AUDIO, + NTV2_MAX_NUM_SDIAudioSelectEnums + #if !defined (NTV2_DEPRECATE) + ,NTV2_NUM_SDIAUDIO = NTV2_MAX_NUM_SDIAudioSelectEnums + #endif // !defined (NTV2_DEPRECATE) +} NTV2SDIAudioSelect; + + +/** + @brief This enumerated data type identifies the two possible states of the bypass relays. + See CNTV2Card::GetSDIRelayPosition, CNTV2Card::GetSDIRelayManualControl, CNTV2Card::GetSDIWatchdogStatus, etc. +**/ +typedef enum +{ + NTV2_DEVICE_BYPASSED, ///< @brief Input & output directly connected + NTV2_THROUGH_DEVICE, ///< @brief Input & output routed through device + #if !defined (NTV2_DEPRECATE) + NTV2_BYPASS = NTV2_DEVICE_BYPASSED, + NTV2_STRAIGHT_THROUGH = NTV2_THROUGH_DEVICE, + #endif // NTV2_DEPRECATE + NTV2_MAX_NUM_RelayStates, + NTV2_RELAY_STATE_INVALID = NTV2_MAX_NUM_RelayStates +} NTV2RelayState; + +#define NTV2_IS_VALID_RELAY_STATE(__x__) ((__x__) >= NTV2_DEVICE_BYPASSED && (__x__) < NTV2_MAX_NUM_RelayStates) + + +/** + @brief These enum values are indexes into the capture/playout AutoCirculate timecode arrays + @see AUTOCIRCULATE_TRANSFER::GetInputTimeCode, AUTOCIRCULATE_TRANSFER::SetOutputTimeCode +**/ +typedef enum +{ + NTV2_TCINDEX_DEFAULT, ///< @brief The "default" timecode (mostly used by the AJA "Retail" service and Control Panel) + NTV2_TCINDEX_SDI1, ///< @brief SDI 1 embedded VITC + NTV2_TCINDEX_SDI2, ///< @brief SDI 2 embedded VITC + NTV2_TCINDEX_SDI3, ///< @brief SDI 3 embedded VITC + NTV2_TCINDEX_SDI4, ///< @brief SDI 4 embedded VITC + NTV2_TCINDEX_SDI1_LTC, ///< @brief SDI 1 embedded ATC LTC + NTV2_TCINDEX_SDI2_LTC, ///< @brief SDI 2 embedded ATC LTC + NTV2_TCINDEX_LTC1, ///< @brief Analog LTC 1 + NTV2_TCINDEX_LTC2, ///< @brief Analog LTC 2 + NTV2_TCINDEX_SDI5, ///< @brief SDI 5 embedded VITC + NTV2_TCINDEX_SDI6, ///< @brief SDI 6 embedded VITC + NTV2_TCINDEX_SDI7, ///< @brief SDI 7 embedded VITC + NTV2_TCINDEX_SDI8, ///< @brief SDI 8 embedded VITC + NTV2_TCINDEX_SDI3_LTC, ///< @brief SDI 3 embedded ATC LTC + NTV2_TCINDEX_SDI4_LTC, ///< @brief SDI 4 embedded ATC LTC + NTV2_TCINDEX_SDI5_LTC, ///< @brief SDI 5 embedded ATC LTC + NTV2_TCINDEX_SDI6_LTC, ///< @brief SDI 6 embedded ATC LTC + NTV2_TCINDEX_SDI7_LTC, ///< @brief SDI 7 embedded ATC LTC + NTV2_TCINDEX_SDI8_LTC, ///< @brief SDI 8 embedded ATC LTC + NTV2_TCINDEX_SDI1_2, ///< @brief SDI 1 embedded VITC 2 + NTV2_TCINDEX_SDI2_2, ///< @brief SDI 2 embedded VITC 2 + NTV2_TCINDEX_SDI3_2, ///< @brief SDI 3 embedded VITC 2 + NTV2_TCINDEX_SDI4_2, ///< @brief SDI 4 embedded VITC 2 + NTV2_TCINDEX_SDI5_2, ///< @brief SDI 5 embedded VITC 2 + NTV2_TCINDEX_SDI6_2, ///< @brief SDI 6 embedded VITC 2 + NTV2_TCINDEX_SDI7_2, ///< @brief SDI 7 embedded VITC 2 + NTV2_TCINDEX_SDI8_2, ///< @brief SDI 8 embedded VITC 2 + NTV2_MAX_NUM_TIMECODE_INDEXES, + NTV2_TCINDEX_INVALID = NTV2_MAX_NUM_TIMECODE_INDEXES + #if !defined (NTV2_DEPRECATE) + ,NTV2_NUM_TCSOURCES = NTV2_MAX_NUM_TIMECODE_INDEXES + #endif // !defined (NTV2_DEPRECATE) +} NTV2TCIndex, NTV2TimecodeIndex; + +#define NTV2_IS_VALID_TIMECODE_INDEX(__x__) (int32_t(__x__) >= int32_t(NTV2_TCINDEX_DEFAULT) && int32_t(__x__) < int32_t(NTV2_MAX_NUM_TIMECODE_INDEXES)) + +#define NTV2_IS_ANALOG_TIMECODE_INDEX(__x__) ((__x__) == NTV2_TCINDEX_LTC1 || (__x__) == NTV2_TCINDEX_LTC2) + +#define NTV2_IS_ATC_VITC1_TIMECODE_INDEX(__x__) ( ((__x__) >= NTV2_TCINDEX_SDI1 && (__x__) <= NTV2_TCINDEX_SDI4) \ + || ((__x__) >= NTV2_TCINDEX_SDI5 && (__x__) <= NTV2_TCINDEX_SDI8) ) + +#define NTV2_IS_ATC_VITC2_TIMECODE_INDEX(__x__) ( (__x__) >= NTV2_TCINDEX_SDI1_2 && (__x__) <= NTV2_TCINDEX_SDI8_2 ) + +#define NTV2_IS_ATC_LTC_TIMECODE_INDEX(__x__) ( ((__x__) >= NTV2_TCINDEX_SDI3_LTC && (__x__) <= NTV2_TCINDEX_SDI8_LTC) \ + || ((__x__) == NTV2_TCINDEX_SDI1_LTC) \ + || ((__x__) == NTV2_TCINDEX_SDI2_LTC) ) + +#define NTV2_IS_SDI_TIMECODE_INDEX(__x__) (NTV2_IS_VALID_TIMECODE_INDEX(__x__) && !NTV2_IS_ANALOG_TIMECODE_INDEX(__x__)) + + +#if !defined(NTV2_DEPRECATE) + typedef NTV2TCIndex NTV2TCSource; ///< @deprecated Use NTV2TCIndex instead. + #define NTV2_TCSOURCE_DEFAULT NTV2_TCINDEX_DEFAULT ///< @deprecated Use NTV2_TCINDEX_DEFAULT instead. + #define NTV2_TCSOURCE_SDI1 NTV2_TCINDEX_SDI1 ///< @deprecated Use NTV2_TCINDEX_SDI1 instead. + #define NTV2_TCSOURCE_SDI2 NTV2_TCINDEX_SDI2 ///< @deprecated Use NTV2_TCINDEX_SDI2 instead. + #define NTV2_TCSOURCE_SDI3 NTV2_TCINDEX_SDI3 ///< @deprecated Use NTV2_TCINDEX_SDI3 instead. + #define NTV2_TCSOURCE_SDI4 NTV2_TCINDEX_SDI4 ///< @deprecated Use NTV2_TCINDEX_SDI4 instead. + #define NTV2_TCSOURCE_SDI1_LTC NTV2_TCINDEX_SDI1_LTC ///< @deprecated Use NTV2_TCINDEX_SDI1_LTC instead. + #define NTV2_TCSOURCE_SDI2_LTC NTV2_TCINDEX_SDI2_LTC ///< @deprecated Use NTV2_TCINDEX_SDI2_LTC instead. + #define NTV2_TCSOURCE_LTC1 NTV2_TCINDEX_LTC1 ///< @deprecated Use NTV2_TCINDEX_LTC1 instead. + #define NTV2_TCSOURCE_LTC2 NTV2_TCINDEX_LTC2 ///< @deprecated Use NTV2_TCINDEX_LTC2 instead. + #define NTV2_TCSOURCE_SDI5 NTV2_TCINDEX_SDI5 ///< @deprecated Use NTV2_TCINDEX_SDI5 instead. + #define NTV2_TCSOURCE_SDI6 NTV2_TCINDEX_SDI6 ///< @deprecated Use NTV2_TCINDEX_SDI6 instead. + #define NTV2_TCSOURCE_SDI7 NTV2_TCINDEX_SDI7 ///< @deprecated Use NTV2_TCINDEX_SDI7 instead. + #define NTV2_TCSOURCE_SDI8 NTV2_TCINDEX_SDI8 ///< @deprecated Use NTV2_TCINDEX_SDI8 instead. + #define NTV2_TCSOURCE_SDI3_LTC NTV2_TCINDEX_SDI3_LTC ///< @deprecated Use NTV2_TCINDEX_SDI3_LTC instead. + #define NTV2_TCSOURCE_SDI4_LTC NTV2_TCINDEX_SDI4_LTC ///< @deprecated Use NTV2_TCINDEX_SDI4_LTC instead. + #define NTV2_TCSOURCE_SDI5_LTC NTV2_TCINDEX_SDI5_LTC ///< @deprecated Use NTV2_TCINDEX_SDI5_LTC instead. + #define NTV2_TCSOURCE_SDI6_LTC NTV2_TCINDEX_SDI6_LTC ///< @deprecated Use NTV2_TCINDEX_SDI6_LTC instead. + #define NTV2_TCSOURCE_SDI7_LTC NTV2_TCINDEX_SDI7_LTC ///< @deprecated Use NTV2_TCINDEX_SDI7_LTC instead. + #define NTV2_TCSOURCE_SDI8_LTC NTV2_TCINDEX_SDI8_LTC ///< @deprecated Use NTV2_TCINDEX_SDI8_LTC instead. + #define NTV2_MAX_NUM_TIMECODE_SOURCES NTV2_MAX_NUM_TIMECODE_INDEXES ///< @deprecated Use NTV2_MAX_NUM_TIMECODE_INDEXES instead. + #define NTV2_TCSOURCE_INVALID NTV2_TCINDEX_INVALID ///< @deprecated Use NTV2_TCINDEX_INVALID instead. + #define NTV2_NUM_TCSOURCES NTV2_MAX_NUM_TIMECODE_INDEXES ///< @deprecated Use NTV2_MAX_NUM_TIMECODE_INDEXES instead. + + typedef NTV2TCIndex NTV2TCDestination; ///< @deprecated Use NTV2TCIndex instead. + #define NTV2_TCDEST_DEFAULT NTV2_TCINDEX_DEFAULT ///< @deprecated Use NTV2_TCINDEX_DEFAULT instead. + #define NTV2_TCDEST_SDI1 NTV2_TCINDEX_SDI1 ///< @deprecated Use NTV2_TCINDEX_SDI1 instead. + #define NTV2_TCDEST_SDI2 NTV2_TCINDEX_SDI2 ///< @deprecated Use NTV2_TCINDEX_SDI2 instead. + #define NTV2_TCDEST_SDI3 NTV2_TCINDEX_SDI3 ///< @deprecated Use NTV2_TCINDEX_SDI3 instead. + #define NTV2_TCDEST_SDI4 NTV2_TCINDEX_SDI4 ///< @deprecated Use NTV2_TCINDEX_SDI4 instead. + #define NTV2_TCDEST_SDI1_LTC NTV2_TCINDEX_SDI1_LTC ///< @deprecated Use NTV2_TCINDEX_SDI1_LTC instead. + #define NTV2_TCDEST_SDI2_LTC NTV2_TCINDEX_SDI2_LTC ///< @deprecated Use NTV2_TCINDEX_SDI2_LTC instead. + #define NTV2_TCDEST_LTC1 NTV2_TCINDEX_LTC1 ///< @deprecated Use NTV2_TCINDEX_LTC1 instead. + #define NTV2_TCDEST_LTC2 NTV2_TCINDEX_LTC2 ///< @deprecated Use NTV2_TCINDEX_LTC2 instead. + #define NTV2_TCDEST_SDI5 NTV2_TCINDEX_SDI5 ///< @deprecated Use NTV2_TCINDEX_SDI5 instead. + #define NTV2_TCDEST_SDI6 NTV2_TCINDEX_SDI6 ///< @deprecated Use NTV2_TCINDEX_SDI6 instead. + #define NTV2_TCDEST_SDI7 NTV2_TCINDEX_SDI7 ///< @deprecated Use NTV2_TCINDEX_SDI7 instead. + #define NTV2_TCDEST_SDI8 NTV2_TCINDEX_SDI8 ///< @deprecated Use NTV2_TCINDEX_SDI8 instead. + #define NTV2_TCDEST_SDI3_LTC NTV2_TCINDEX_SDI3_LTC ///< @deprecated Use NTV2_TCINDEX_SDI3_LTC instead. + #define NTV2_TCDEST_SDI4_LTC NTV2_TCINDEX_SDI4_LTC ///< @deprecated Use NTV2_TCINDEX_SDI4_LTC instead. + #define NTV2_TCDEST_SDI5_LTC NTV2_TCINDEX_SDI5_LTC ///< @deprecated Use NTV2_TCINDEX_SDI5_LTC instead. + #define NTV2_TCDEST_SDI6_LTC NTV2_TCINDEX_SDI6_LTC ///< @deprecated Use NTV2_TCINDEX_SDI6_LTC instead. + #define NTV2_TCDEST_SDI7_LTC NTV2_TCINDEX_SDI7_LTC ///< @deprecated Use NTV2_TCINDEX_SDI7_LTC instead. + #define NTV2_TCDEST_SDI8_LTC NTV2_TCINDEX_SDI8_LTC ///< @deprecated Use NTV2_TCINDEX_SDI8_LTC instead. + #define NTV2_MAX_NUM_TIMECODE_DESTS NTV2_MAX_NUM_TIMECODE_INDEXES ///< @deprecated Use NTV2_MAX_NUM_TIMECODE_INDEXES instead. + #define NTV2_TCDEST_INVALID NTV2_TCINDEX_INVALID ///< @deprecated Use NTV2_TCINDEX_INVALID instead. + #define NTV2_NUM_TCDESTS NTV2_MAX_NUM_TIMECODE_INDEXES ///< @deprecated Use NTV2_MAX_NUM_TIMECODE_INDEXES instead. +#endif // !defined(NTV2_DEPRECATE) + + +typedef enum +{ + NTV2_HDMI_V2_HDSD_BIDIRECTIONAL, + NTV2_HDMI_V2_4K_CAPTURE, + NTV2_HDMI_V2_4K_PLAYBACK, + NTV2_HDMI_V2_MODE_INVALID +} NTV2HDMIV2Mode; + +typedef enum +{ + VPIDVersion_0 = 0x0, // deprecated + VPIDVersion_1 = 0x1 // use this one +} VPIDVersion; + +typedef enum +{ + VPIDStandard_Unknown = 0x00, // default + VPIDStandard_483_576 = 0x81, // ntsc / pal + VPIDStandard_483_576_DualLink = 0x82, // no matching ntv2 format + VPIDStandard_483_576_360Mbs = 0x82, // no matching ntv2 format + VPIDStandard_483_576_540Mbs = 0x83, // no matching ntv2 format + VPIDStandard_720 = 0x84, // 720 single link + VPIDStandard_1080 = 0x85, // 1080 single link + VPIDStandard_483_576_1485Mbs = 0x86, // no matching ntv2 format + VPIDStandard_1080_DualLink = 0x87, // 1080 dual link + VPIDStandard_720_3Ga = 0x88, // no matching ntv2 format + VPIDStandard_1080_3Ga = 0x89, // 1080p 50/5994/60 + VPIDStandard_1080_DualLink_3Gb = 0x8A, // 1080 dual link 3Gb + VPIDStandard_720_3Gb = 0x8B, // 2 - 720 links + VPIDStandard_1080_3Gb = 0x8C, // 2 - 1080 links + VPIDStandard_483_576_3Gb = 0x8D, // no matching ntv2 format + VPIDStandard_720_Stereo_3Gb = 0x8E, // 720 Stereo 3Gb + VPIDStandard_1080_Stereo_3Gb = 0x8F, // 1080 Stereo 3Gb + VPIDStandard_1080_QuadLink = 0x90, // 1080 quad link 10Gbs + VPIDStandard_720_Stereo_3Ga = 0x91, // 720 Stereo 3Ga + VPIDStandard_1080_Stereo_3Ga = 0x92, // 1080 Stereo 3Ga + VPIDStandard_1080_Stereo_DualLink_3Gb = 0x93, // 1080 Stereo dual link 3Gb + VPIDStandard_1080_Dual_3Ga = 0x94, // 1080 dual link 3Ga + VPIDStandard_1080_Dual_3Gb = 0x95, // 1080 dual link 3Gb + VPIDStandard_2160_DualLink = 0x96, // 2160 dual link + VPIDStandard_2160_QuadLink_3Ga = 0x97, // 2160 quad link 3Ga + VPIDStandard_2160_QuadDualLink_3Gb = 0x98, // 2160 quad link 3Gb + VPIDStandard_1080_Stereo_Quad_3Ga = 0x99, // 1080 Stereo Quad 3Ga + VPIDStandard_1080_Stereo_Quad_3Gb = 0x9A, // 1080 Stereo Quad 3Gb + VPIDStandard_2160_Stereo_Quad_3Gb = 0x9B, // 2160 Stereo Quad 3Gb + VPIDStandard_1080_OctLink = 0xA0, // 1080 oct link 10Gbs + VPIDStandard_UHDTV1_Single_DualLink_10Gb = 0xA1, // UHDTV1 single or dual link 10Gbs + VPIDStandard_UHDTV2_Quad_OctaLink_10Gb = 0xA2, // UHDTV2 quad or octa link 10Gbs + VPIDStandard_UHDTV1_MultiLink_10Gb = 0xA5, // UHDTV1 multi link 10Gbs + VPIDStandard_UHDTV2_MultiLink_10Gb = 0xA6, // UHDTV2 multi link 10Gbs + VPIDStandard_VC2 = 0xB0, // VC2 compressed 1.5Gbs + VPIDStandard_720_1080_Stereo = 0xB1, // 720 and 1080 Stereo dusl 1.5Gb + VPIDStandard_VC2_Level65_270Mbs = 0xB2, // VC2 level 65 commpressed 270Mbs + VPIDStandard_4K_DCPIF_FSW709_10Gbs = 0xB3, // 4K Digital Cinematography Production Image Formats FS/709 10Gbs + VPIDStandard_FT_2048x1556_Dual = 0xB4, // Film Transfer 2048x1556 dual 1.5Gbs + VPIDStandard_FT_2048x1556_3Gb = 0xB5, // Film Tramsfer 1048x1556 3Gb + VPIDStandard_2160_Single_6Gb = 0xC0, // 2160 single link 6Gb + VPIDStandard_1080_Single_6Gb = 0xC1, // 1080 single link 6Gb + VPIDStandard_1080_AFR_Single_6Gb = 0xC2, // 1080 additional frame rates single link 6Gb + VPIDStandard_2160_Single_12Gb = 0xCE, // 2160 single link 12Gb + VPIDStandard_1080_10_12_AFR_Single_12Gb = 0xCF, // 1080 10 bit or 12 bit additional frame rates single link 12Gb + VPIDStandard_4320_DualLink_12Gb = 0xD0, // 4320 dual link 12Gb ST2802-11 Mode 1 + VPIDStandard_2160_DualLink_12Gb = 0xD1, // 2160 RGB dual link 12Gb ST2082-11 Mode 2 + VPIDStandard_4320_QuadLink_12Gb = 0xD2 // 4320 quad link 12Gb ST2082-12 Mode 1 +} VPIDStandard; + +typedef enum +{ + VPIDPictureRate_None = 0x0, + VPIDPictureRate_Reserved1 = 0x1, + VPIDPictureRate_2398 = 0x2, + VPIDPictureRate_2400 = 0x3, + VPIDPictureRate_4795 = 0x4, + VPIDPictureRate_2500 = 0x5, + VPIDPictureRate_2997 = 0x6, + VPIDPictureRate_3000 = 0x7, + VPIDPictureRate_4800 = 0x8, + VPIDPictureRate_5000 = 0x9, + VPIDPictureRate_5994 = 0xa, + VPIDPictureRate_6000 = 0xb, + VPIDPictureRate_ReservedC = 0xc, + VPIDPictureRate_ReservedD = 0xd, + VPIDPictureRate_ReservedE = 0xe, + VPIDPictureRate_ReservedF = 0xf +} VPIDPictureRate; + +typedef enum +{ + VPIDSampling_YUV_422 = 0x0, + VPIDSampling_YUV_444 = 0x1, + VPIDSampling_GBR_444 = 0x2, + VPIDSampling_YUV_420 = 0x3, + VPIDSampling_YUVA_4224 = 0x4, + VPIDSampling_YUVA_4444 = 0x5, + VPIDSampling_GBRA_4444 = 0x6, + VPIDSampling_Reserved7 = 0x7, + VPIDSampling_YUVD_4224 = 0x8, + VPIDSampling_YUVD_4444 = 0x9, + VPIDSampling_GBRD_4444 = 0xa, + VPIDSampling_ReservedB = 0xb, + VPIDSampling_ReservedC = 0xc, + VPIDSampling_ReservedD = 0xd, + VPIDSampling_ReservedE = 0xe, + VPIDSampling_XYZ_444 = 0xf +} VPIDSampling; + +typedef enum +{ + VPIDChannel_1 = 0x0, + VPIDChannel_2 = 0x1, + VPIDChannel_3 = 0x2, + VPIDChannel_4 = 0x3, + VPIDChannel_5 = 0x4, + VPIDChannel_6 = 0x5, + VPIDChannel_7 = 0x6, + VPIDChannel_8 = 0x7 +} VPIDChannel; + +typedef enum +{ + VPIDDynamicRange_100 = 0x0, + VPIDDynamicRange_200 = 0x1, + VPIDDynamicRange_400 = 0x2, + VPIDDynamicRange_Reserved3 = 0x3 +} VPIDDynamicRange; + +typedef enum +{ + VPIDBitDepth_8 = 0x0, + VPIDBitDepth_10_Full = 0x0, + VPIDBitDepth_10 = 0x1, + VPIDBitDepth_12 = 0x2, + VPIDBitDepth_12_Full = 0x3 +} VPIDBitDepth; + +typedef enum +{ + VPIDLink_1 = 0x0, + VPIDLink_2 = 0x1, + VPIDLink_3 = 0x2, + VPIDLink_4 = 0x3, + VPIDLink_5 = 0x4, + VPIDLink_6 = 0x5, + VPIDLink_7 = 0x6, + VPIDLink_8 = 0x7 +} VPIDLink; + +typedef enum +{ + VPIDAudio_Unknown = 0x0, + VPIDAudio_Copied = 0x1, + VPIDAudio_Additional = 0x2, + VPIDAudio_Reserved = 0x3 +} VPIDAudio; + +/** + @brief These enum values identify RS-422 serial port parity configuration. + @see CNTV2Card::GetRS422Parity, CNTV2Card::SetRS422Parity +**/ +typedef enum +{ + NTV2_RS422_NO_PARITY = 0x0, ///< @brief No parity + NTV2_RS422_ODD_PARITY = 0x1, ///< @brief Odd parity -- this is the power-up default + NTV2_RS422_EVEN_PARITY = 0x2, ///< @brief Even parity + NTV2_RS422_PARITY_INVALID = 0xFF +} NTV2_RS422_PARITY; + +#define NTV2_IS_VALID_RS422_PARITY(_x_) ((_x_) == NTV2_RS422_NO_PARITY || (_x_) == NTV2_RS422_ODD_PARITY || (_x_) == NTV2_RS422_EVEN_PARITY) + + +/** + @brief These enum values identify RS-422 serial port baud rate configuration. + @see CNTV2Card::GetRS422BaudRate, CNTV2Card::SetRS422BaudRate +**/ +typedef enum +{ + NTV2_RS422_BAUD_RATE_38400 = 38400, ///< @brief 38400 baud -- this is the power-up default + NTV2_RS422_BAUD_RATE_19200 = 19200, ///< @brief 19200 baud + NTV2_RS422_BAUD_RATE_9600 = 9600, ///< @brief 9600 baud + NTV2_RS422_BAUD_RATE_INVALID = 0 +} NTV2_RS422_BAUD_RATE; + +#define NTV2_IS_VALID_RS422_BAUD_RATE(_x_) ((_x_) == NTV2_RS422_BAUD_RATE_38400 || (_x_) == NTV2_RS422_BAUD_RATE_19200 || (_x_) == NTV2_RS422_BAUD_RATE_9600) + +typedef enum +{ + NTV2_HDMI_YC422 = 0, ///< @brief Specifies YCbCr 4:2:2 color space. + NTV2_HDMI_RGB = 1, ///< @brief Specifies RGB color space. + NTV2_HDMI_YC420 = 2, ///< @brief Specifies YCbCr 4:2:0 color space. + NTV2_HDMI_422 = NTV2_HDMI_YC422, ///< @deprecated Use NTV2_HDMI_YC422 instead. + NTV2_HDMI_420 = NTV2_HDMI_YC420, ///< @deprecated Use NTV2_HDMI_YC420 instead. + NTV2_NUM_HDMICOLORSPACEVALS = 3, + NTV2_HDMI_INVALID = NTV2_NUM_HDMICOLORSPACEVALS +} NTV2HDMISampleStructure; + +#define NTV2_IS_VALID_HDMI_SAMPLE_STRUCT(_x_) ((_x_) >= NTV2_HDMI_YC422 && (_x_) < NTV2_NUM_HDMICOLORSPACEVALS) + +typedef enum +{ + NTV2_FanSpeed_Invalid = 0, + NTV2_FanSpeed_Low = 50, NTV2_FanSpeed_Min = NTV2_FanSpeed_Low, + NTV2_FanSpeed_Medium = 75, + NTV2_FanSpeed_High = 100, NTV2_FanSpeed_Max = NTV2_FanSpeed_High +} NTV2FanSpeed; + +#define NTV2_IS_VALID_FAN_SPEED(_x_) ((_x_) == NTV2_FanSpeed_Low || (_x_) == NTV2_FanSpeed_Medium || (_x_) == NTV2_FanSpeed_High) + +typedef enum +{ + NTV2DieTempScale_Celsius, + NTV2DieTempScale_Fahrenheit, + NTV2DieTempScale_Kelvin, + NTV2DieTempScale_Rankine, + NTV2DieTempScale_INVALID +} NTV2DieTempScale; + +#define NTV2_IS_VALID_DIETEMP_SCALE(_x_) ((_x_) >= NTV2DieTempScale_Celsius && (_x_) < NTV2DieTempScale_INVALID) + +/** + @brief These enumerations identify the various ancillary data regions located at the bottom + of each frame buffer on the NTV2 device. + @note These are only applicable to devices that support custom anc insertion/extraction + (see ::NTV2DeviceCanDoCustomAnc). Also see \ref anccapture and \ref ancplayout . +**/ +typedef enum +{ + NTV2_AncRgn_Field1, ///< @brief Identifies the "normal" Field 1 ancillary data region. + NTV2_AncRgn_Field2, ///< @brief Identifies the "normal" Field 2 ancillary data region. + NTV2_AncRgn_MonField1, ///< @brief Identifies the "monitor" or "auxiliary" Field 1 ancillary data region. + NTV2_AncRgn_MonField2, ///< @brief Identifies the "monitor" or "auxiliary" Field 2 ancillary data region. + NTV2_MAX_NUM_AncRgns, + NTV2_AncRgn_FIRST = NTV2_AncRgn_Field1, + NTV2_AncRgn_LAST = NTV2_AncRgn_MonField2, + NTV2_AncRgn_INVALID = NTV2_MAX_NUM_AncRgns, + NTV2_AncRgn_All = 0xFFFF ///< @brief Identifies "all" ancillary data regions. +} NTV2AncillaryDataRegion, NTV2AncDataRgn; + +#define NTV2_IS_ALL_ANC_RGNS(_x_) ((_x_) == NTV2_AncRgn_All) +#define NTV2_IS_VALID_ANC_RGN(_x_) (NTV2_IS_ALL_ANC_RGNS(_x_) || ((_x_) >= NTV2_AncRgn_Field1 && (_x_) < NTV2_MAX_NUM_AncRgns)) +#define NTV2_IS_NORMAL_ANC_RGN(_x_) ((_x_) == NTV2_AncRgn_Field1 || (_x_) == NTV2_AncRgn_Field2) +#define NTV2_IS_MONITOR_ANC_RGN(_x_) ((_x_) == NTV2_AncRgn_MonField1 || (_x_) == NTV2_AncRgn_MonField2) + + +typedef enum +{ + NTV2_VPID_TC_SDR_TV, + NTV2_VPID_TC_HLG, + NTV2_VPID_TC_PQ, + NTV2_VPID_TC_Unspecified +} NTV2VPIDTransferCharacteristics, NTV2VPIDXferChars, NTV2HDRXferChars; + +typedef enum +{ + NTV2_VPID_Color_Rec709, + NTV2_VPID_Color_Reserved, + NTV2_VPID_Color_UHDTV, + NTV2_VPID_Color_Unknown +} NTV2VPIDColorimetry, NTV2HDRColorimetry; + +typedef enum +{ + NTV2_VPID_Luminance_YCbCr, + NTV2_VPID_Luminance_ICtCp +} NTV2VPIDLuminance, NTV2HDRLuminance; + +typedef enum +{ + NTV2_VPID_Range_Narrow, + NTV2_VPID_Range_Full +} NTV2VPIDRGBRange; + + +#if !defined (NTV2_DEPRECATE) + typedef NTV2AnalogType NTV2K2AnalogType; ///< @deprecated Use NTV2AnalogType instead. + typedef NTV2Audio2ChannelSelect NTV2K2Audio2ChannelSelect; ///< @deprecated Use NTV2Audio2ChannelSelect instead. + typedef NTV2Audio4ChannelSelect NTV2K2Audio4ChannelSelect; ///< @deprecated Use NTV2Audio4ChannelSelect instead. + typedef NTV2Audio8ChannelSelect NTV2K2Audio8ChannelSelect; ///< @deprecated Use NTV2Audio8ChannelSelect instead. + typedef NTV2AudioMapSelect NTV2K2AudioMapSelect; ///< @deprecated Use NTV2AudioMapSelect instead. + typedef NTV2AudioMonitorSelect NTV2K2AudioMonitorSelect; ///< @deprecated Use NTV2AudioMonitorSelect instead. + typedef NTV2BitFileType NTV2K2BitFileType; ///< @deprecated Use NTV2BitFileType instead. + typedef NTV2BreakoutType NTV2K2BreakoutType; ///< @deprecated Use NTV2BreakoutType instead. + typedef NTV2ColorSpaceMatrixType NTV2K2ColorSpaceMatrixType; ///< @deprecated Use NTV2ColorSpaceMatrixType instead. + typedef NTV2ColorSpaceMode NTV2K2ColorSpaceMode; ///< @deprecated Use NTV2ColorSpaceMode instead. + typedef NTV2ConversionMode NTV2K2ConversionMode; ///< @deprecated Use NTV2ConversionMode instead. + typedef NTV2CrosspointID NTV2CrosspointSelections; ///< @deprecated Use NTV2CrosspointID instead. + typedef NTV2CrosspointSelections NTV2K2CrosspointSelections; ///< @deprecated Use NTV2CrosspointID instead. + typedef NTV2DownConvertMode NTV2K2DownConvertMode; ///< @deprecated Use NTV2DownConvertMode instead. + typedef NTV2EncodeAsPSF NTV2K2EncodeAsPSF; ///< @deprecated Use NTV2EncodeAsPSF instead. + typedef NTV2FrameBufferQuality NTV2K2FrameBufferQuality; ///< @deprecated Use NTV2FrameBufferQuality instead. + typedef NTV2Framesize NTV2K2Framesize; ///< @deprecated Use NTV2Framesize instead. + typedef NTV2FrameSyncSelect NTV2K2FrameSyncSelect; ///< @deprecated Use NTV2FrameSyncSelect instead. + typedef NTV2InputAudioSelect NTV2K2InputAudioSelect; ///< @deprecated Use NTV2InputAudioSelect instead. + typedef NTV2InputVideoSelect NTV2K2InputVideoSelect; ///< @deprecated Use NTV2InputVideoSelect instead. + typedef NTV2IsoConvertMode NTV2K2IsoConvertMode; ///< @deprecated Use NTV2IsoConvertMode instead. + typedef NTV2OutputVideoSelect NTV2K2OutputVideoSelect; ///< @deprecated Use NTV2OutputVideoSelect instead. + typedef NTV2QuarterSizeExpandMode NTV2K2QuarterSizeExpandMode; ///< @deprecated Use NTV2QuarterSizeExpandMode instead. + typedef NTV2RegisterWriteMode NTV2RegWriteMode; ///< @deprecated Use NTV2RegisterWriteMode instead. + typedef NTV2RGBBlackRange NTV2K2RGBBlackRange; ///< @deprecated Use NTV2RGBBlackRange instead. + typedef NTV2SDIInputFormatSelect NTV2K2SDIInputFormatSelect; ///< @deprecated Use NTV2SDIInputFormatSelect instead. + typedef NTV2Stereo3DMode NTV2K2Stereo3DMode; ///< @deprecated Use NTV2Stereo3DMode instead. + typedef NTV2UpConvertMode NTV2K2UpConvertMode; ///< @deprecated Use NTV2UpConvertMode instead. + typedef NTV2VideoDACMode NTV2K2VideoDACMode; ///< @deprecated Use NTV2VideoDACMode instead. + + // NTV2CrosspointSelections + #define NTV2K2_XptBlack NTV2_XptBlack ///< @deprecated Use NTV2_XptBlack instead. + #define NTV2K2_XptSDIIn1 NTV2_XptSDIIn1 ///< @deprecated Use NTV2_XptSDIIn1 instead. + #define NTV2K2_XptSDIIn1DS2 NTV2_XptSDIIn1DS2 ///< @deprecated Use NTV2_XptSDIIn1DS2 instead. + #define NTV2K2_XptSDIIn2 NTV2_XptSDIIn2 ///< @deprecated Use NTV2_XptSDIIn2 instead. + #define NTV2K2_XptSDIIn2DS2 NTV2_XptSDIIn2DS2 ///< @deprecated Use NTV2_XptSDIIn2DS2 instead. + #define NTV2K2_XptLUT1YUV NTV2_XptLUT1YUV ///< @deprecated Use NTV2_XptLUT1YUV instead. + #define NTV2K2_XptCSCYUV NTV2_XptCSC1VidYUV ///< @deprecated Use NTV2_XptCSC1VidYUV instead. + #define NTV2K2_XptCSC1VidYUV NTV2_XptCSC1VidYUV ///< @deprecated Use NTV2_XptCSC1VidYUV instead. + #define NTV2K2_XptConversionModule NTV2_XptConversionModule ///< @deprecated Use NTV2_XptConversionModule instead. + #define NTV2K2_XptCompressionModule NTV2_XptCompressionModule ///< @deprecated Use NTV2_XptCompressionModule instead. + #define NTV2K2_XptFrameBuffer1YUV NTV2_XptFrameBuffer1YUV ///< @deprecated Use NTV2_XptFrameBuffer1YUV instead. + #define NTV2K2_XptFrameSync1YUV NTV2_XptFrameSync1YUV ///< @deprecated Use NTV2_XptFrameSync1YUV instead. + #define NTV2K2_XptFrameSync2YUV NTV2_XptFrameSync2YUV ///< @deprecated Use NTV2_XptFrameSync2YUV instead. + #define NTV2K2_XptDuallinkOut NTV2_XptDuallinkOut1 ///< @deprecated Use NTV2_XptDuallinkOut1 instead. + #define NTV2K2_XptDuallinkOutDS2 NTV2_XptDuallinkOut1DS2 ///< @deprecated Use NTV2_XptDuallinkOut1DS2 instead. + #define NTV2K2_XptDuallinkOut2 NTV2_XptDuallinkOut2 ///< @deprecated Use NTV2_XptDuallinkOut2 instead. + #define NTV2K2_XptDuallinkOut2DS2 NTV2_XptDuallinkOut2DS2 ///< @deprecated Use NTV2_XptDuallinkOut2DS2 instead. + #define NTV2K2_XptDuallinkOut3 NTV2_XptDuallinkOut3 ///< @deprecated Use NTV2_XptDuallinkOut3 instead. + #define NTV2K2_XptDuallinkOut3DS2 NTV2_XptDuallinkOut3DS2 ///< @deprecated Use NTV2_XptDuallinkOut3DS2 instead. + #define NTV2K2_XptDuallinkOut4 NTV2_XptDuallinkOut4 ///< @deprecated Use NTV2_XptDuallinkOut4 instead. + #define NTV2K2_XptDuallinkOut4DS2 NTV2_XptDuallinkOut4DS2 ///< @deprecated Use NTV2_XptDuallinkOut4DS2 instead. + #define NTV2K2_XptAlphaOut NTV2_XptAlphaOut ///< @deprecated Use NTV2_XptAlphaOut instead. + #define NTV2K2_XptAnalogIn NTV2_XptAnalogIn ///< @deprecated Use NTV2_XptAnalogIn instead. + #define NTV2K2_XptHDMIIn NTV2_XptHDMIIn1 ///< @deprecated Use NTV2_XptHDMIIn1 instead. + #define NTV2K2_XptHDMIInQ2 NTV2_XptHDMIIn1Q2 ///< @deprecated Use NTV2_XptHDMIIn1Q2 instead. + #define NTV2K2_XptHDMIInQ3 NTV2_XptHDMIIn1Q3 ///< @deprecated Use NTV2_XptHDMIIn1Q3 instead. + #define NTV2K2_XptHDMIInQ4 NTV2_XptHDMIIn1Q4 ///< @deprecated Use NTV2_XptHDMIIn1Q4 instead. + #define NTV2K2_XptHDMIInRGB NTV2_XptHDMIIn1RGB ///< @deprecated Use NTV2_XptHDMIIn1RGB instead. + #define NTV2K2_XptHDMIInQ2RGB NTV2_XptHDMIIn1Q2RGB ///< @deprecated Use NTV2_XptHDMIIn1Q2RGB instead. + #define NTV2K2_XptHDMIInQ3RGB NTV2_XptHDMIIn1Q3RGB ///< @deprecated Use NTV2_XptHDMIIn1Q3RGB instead. + #define NTV2K2_XptHDMIInQ4RGB NTV2_XptHDMIIn1Q4RGB ///< @deprecated Use NTV2_XptHDMIIn1Q4RGB instead. + #define NTV2K2_XptFS1SecondConverter NTV2_XptFS1SecondConverter ///< @deprecated This is obsolete. + #define NTV2KS_XptFS1ProcAmp NTV2_XptFS1ProcAmp ///< @deprecated This is obsolete. + #define NTV2KS_XptFS1TestSignalGenerator NTV2_XptFS1TestSignalGenerator ///< @deprecated This is obsolete. + #define NTV2K2_XptDuallinkIn NTV2_XptDuallinkIn1 ///< @deprecated Use NTV2_XptDuallinkIn1 instead. + #define NTV2K2_XptDuallinkIn2 NTV2_XptDuallinkIn2 ///< @deprecated Use NTV2_XptDuallinkIn2 instead. + #define NTV2K2_XptDuallinkIn3 NTV2_XptDuallinkIn3 ///< @deprecated Use NTV2_XptDuallinkIn3 instead. + #define NTV2K2_XptDuallinkIn4 NTV2_XptDuallinkIn4 ///< @deprecated Use NTV2_XptDuallinkIn4 instead. + #define NTV2K2_XptLUT NTV2_XptLUT1Out ///< @deprecated Use NTV2_XptLUT1Out instead. + #define NTV2K2_XptLUT1RGB NTV2_XptLUT1Out ///< @deprecated Use NTV2_XptLUT1Out instead. + #define NTV2K2_XptCSCRGB NTV2_XptCSC1VidRGB ///< @deprecated Use NTV2_XptCSC1VidRGB instead. + #define NTV2K2_XptCSC1VidRGB NTV2_XptCSC1VidRGB ///< @deprecated Use NTV2_XptCSC1VidRGB instead. + #define NTV2K2_XptFrameBuffer1RGB NTV2_XptFrameBuffer1RGB ///< @deprecated Use NTV2_XptFrameBuffer1RGB instead. + #define NTV2K2_XptFrameSync1RGB NTV2_XptFrameSync1RGB ///< @deprecated Use NTV2_XptFrameSync1RGB instead. + #define NTV2K2_XptFrameSync2RGB NTV2_XptFrameSync2RGB ///< @deprecated Use NTV2_XptFrameSync2RGB instead. + #define NTV2K2_XptLUT2RGB NTV2_XptLUT2Out ///< @deprecated Use NTV2_XptLUT2Out instead. + #define NTV2K2_XptCSC1KeyYUV NTV2_XptCSC1KeyYUV ///< @deprecated Use NTV2_XptCSC1KeyYUV instead. + #define NTV2K2_XptFrameBuffer2YUV NTV2_XptFrameBuffer2YUV ///< @deprecated Use NTV2_XptFrameBuffer2YUV instead. + #define NTV2K2_XptFrameBuffer2RGB NTV2_XptFrameBuffer2RGB ///< @deprecated Use NTV2_XptFrameBuffer2RGB instead. + #define NTV2K2_XptCSC2VidYUV NTV2_XptCSC2VidYUV ///< @deprecated Use NTV2_XptCSC2VidYUV instead. + #define NTV2K2_XptCSC2VidRGB NTV2_XptCSC2VidRGB ///< @deprecated Use NTV2_XptCSC2VidRGB instead. + #define NTV2K2_XptCSC2KeyYUV NTV2_XptCSC2KeyYUV ///< @deprecated Use NTV2_XptCSC2KeyYUV instead. + #define NTV2K2_XptMixerVidYUV NTV2_XptMixerVidYUV ///< @deprecated Use NTV2_XptMixerVidYUV instead. + #define NTV2K2_XptMixerKeyYUV NTV2_XptMixerKeyYUV ///< @deprecated Use NTV2_XptMixerKeyYUV instead. + #define NTV2K2_XptWaterMarkerRGB NTV2_XptWaterMarkerRGB ///< @deprecated Use NTV2_XptWaterMarkerRGB instead. + #define NTV2K2_XptWaterMarkerYUV NTV2_XptWaterMarkerYUV ///< @deprecated Use NTV2_XptWaterMarkerYUV instead. + #define NTV2K2_XptWaterMarker2RGB NTV2_XptWaterMarker2RGB ///< @deprecated Use NTV2_XptWaterMarker2RGB instead. + #define NTV2K2_XptWaterMarker2YUV NTV2_XptWaterMarker2YUV ///< @deprecated Use NTV2_XptWaterMarker2YUV instead. + #define NTV2K2_XptIICTRGB NTV2_XptIICTRGB ///< @deprecated Use NTV2_XptIICTRGB instead. + #define NTV2K2_XptIICT2RGB NTV2_XptIICT2RGB ///< @deprecated Use NTV2_XptIICT2RGB instead. + #define NTV2K2_XptTestPatternYUV NTV2_XptTestPatternYUV ///< @deprecated Use NTV2_XptTestPatternYUV instead. + #define NTV2K2_XptDCIMixerVidYUV NTV2_XptDCIMixerVidYUV ///< @deprecated Use NTV2_XptDCIMixerVidYUV instead. + #define NTV2K2_XptDCIMixerVidRGB NTV2_XptDCIMixerVidRGB ///< @deprecated Use NTV2_XptDCIMixerVidRGB instead. + #define NTV2K2_XptMixer2VidYUV NTV2_XptMixer2VidYUV ///< @deprecated Use NTV2_XptMixer2VidYUV instead. + #define NTV2K2_XptMixer2KeyYUV NTV2_XptMixer2KeyYUV ///< @deprecated Use NTV2_XptMixer2KeyYUV instead. + #define NTV2K2_XptStereoCompressorOut NTV2_XptStereoCompressorOut ///< @deprecated Use NTV2_XptStereoCompressorOut instead. + #define NTV2K2_XptLUT3Out NTV2_XptLUT3Out ///< @deprecated Use NTV2_XptLUT3Out instead. + #define NTV2K2_XptLUT4Out NTV2_XptLUT4Out ///< @deprecated Use NTV2_XptLUT4Out instead. + #define NTV2K2_XptFrameBuffer3YUV NTV2_XptFrameBuffer3YUV ///< @deprecated Use NTV2_XptFrameBuffer3YUV instead. + #define NTV2K2_XptFrameBuffer3RGB NTV2_XptFrameBuffer3RGB ///< @deprecated Use NTV2_XptFrameBuffer3RGB instead. + #define NTV2K2_XptFrameBuffer4YUV NTV2_XptFrameBuffer4YUV ///< @deprecated Use NTV2_XptFrameBuffer4YUV instead. + #define NTV2K2_XptFrameBuffer4RGB NTV2_XptFrameBuffer4RGB ///< @deprecated Use NTV2_XptFrameBuffer4RGB instead. + #define NTV2K2_XptSDIIn3 NTV2_XptSDIIn3 ///< @deprecated Use NTV2_XptSDIIn3 instead. + #define NTV2K2_XptSDIIn3DS2 NTV2_XptSDIIn3DS2 ///< @deprecated Use NTV2_XptSDIIn3DS2 instead. + #define NTV2K2_XptSDIIn4 NTV2_XptSDIIn4 ///< @deprecated Use NTV2_XptSDIIn4 instead. + #define NTV2K2_XptSDIIn4DS2 NTV2_XptSDIIn4DS2 ///< @deprecated Use NTV2_XptSDIIn4DS2 instead. + #define NTV2K2_XptCSC3VidYUV NTV2_XptCSC3VidYUV ///< @deprecated Use NTV2_XptCSC3VidYUV instead. + #define NTV2K2_XptCSC3VidRGB NTV2_XptCSC3VidRGB ///< @deprecated Use NTV2_XptCSC3VidRGB instead. + #define NTV2K2_XptCSC3KeyYUV NTV2_XptCSC3KeyYUV ///< @deprecated Use NTV2_XptCSC3KeyYUV instead. + #define NTV2K2_XptCSC4VidYUV NTV2_XptCSC4VidYUV ///< @deprecated Use NTV2_XptCSC4VidYUV instead. + #define NTV2K2_XptCSC4VidRGB NTV2_XptCSC4VidRGB ///< @deprecated Use NTV2_XptCSC4VidRGB instead. + #define NTV2K2_XptCSC4KeyYUV NTV2_XptCSC4KeyYUV ///< @deprecated Use NTV2_XptCSC4KeyYUV instead. + #define NTV2K2_XptCSC5VidYUV NTV2_XptCSC5VidYUV ///< @deprecated Use NTV2_XptCSC5VidYUV instead. + #define NTV2K2_XptCSC5VidRGB NTV2_XptCSC5VidRGB ///< @deprecated Use NTV2_XptCSC5VidRGB instead. + #define NTV2K2_XptCSC5KeyYUV NTV2_XptCSC5KeyYUV ///< @deprecated Use NTV2_XptCSC5KeyYUV instead. + #define NTV2K2_XptLUT5Out NTV2_XptLUT5Out ///< @deprecated Use NTV2_XptLUT5Out instead. + #define NTV2K2_XptDuallinkOut5 NTV2_XptDuallinkOut5 ///< @deprecated Use NTV2_XptDuallinkOut5 instead. + #define NTV2K2_XptDuallinkOut5DS2 NTV2_XptDuallinkOut5DS2 ///< @deprecated Use NTV2_XptDuallinkOut5DS2 instead. + #define NTV2K2_Xpt4KDownConverterOut NTV2_Xpt4KDownConverterOut ///< @deprecated Use NTV2_Xpt4KDownConverterOut instead. + #define NTV2K2_Xpt4KDownConverterOutRGB NTV2_Xpt4KDownConverterOutRGB ///< @deprecated Use NTV2_Xpt4KDownConverterOutRGB instead. + #define NTV2K2_XptFrameBuffer5YUV NTV2_XptFrameBuffer5YUV ///< @deprecated Use NTV2_Xpt4KDownConverterOutRGB instead. + #define NTV2K2_XptFrameBuffer5RGB NTV2_XptFrameBuffer5RGB ///< @deprecated Use NTV2_XptFrameBuffer5YUV instead. + #define NTV2K2_XptFrameBuffer6YUV NTV2_XptFrameBuffer6YUV ///< @deprecated Use NTV2_XptFrameBuffer5RGB instead. + #define NTV2K2_XptFrameBuffer6RGB NTV2_XptFrameBuffer6RGB ///< @deprecated Use NTV2_XptFrameBuffer6YUV instead. + #define NTV2K2_XptFrameBuffer7YUV NTV2_XptFrameBuffer7YUV ///< @deprecated Use NTV2_XptFrameBuffer6RGB instead. + #define NTV2K2_XptFrameBuffer7RGB NTV2_XptFrameBuffer7RGB ///< @deprecated Use NTV2_XptFrameBuffer7YUV instead. + #define NTV2K2_XptFrameBuffer8YUV NTV2_XptFrameBuffer8YUV ///< @deprecated Use NTV2_XptFrameBuffer7RGB instead. + #define NTV2K2_XptFrameBuffer8RGB NTV2_XptFrameBuffer8RGB ///< @deprecated Use NTV2_XptFrameBuffer8YUV instead. + #define NTV2K2_XptSDIIn5 NTV2_XptSDIIn5 ///< @deprecated Use NTV2_XptFrameBuffer8RGB instead. + #define NTV2K2_XptSDIIn5DS2 NTV2_XptSDIIn5DS2 ///< @deprecated Use NTV2_XptSDIIn5 instead. + #define NTV2K2_XptSDIIn6 NTV2_XptSDIIn6 ///< @deprecated Use NTV2_XptSDIIn5DS2 instead. + #define NTV2K2_XptSDIIn6DS2 NTV2_XptSDIIn6DS2 ///< @deprecated Use NTV2_XptSDIIn6 instead. + #define NTV2K2_XptSDIIn7 NTV2_XptSDIIn7 ///< @deprecated Use NTV2_XptSDIIn6DS2 instead. + #define NTV2K2_XptSDIIn7DS2 NTV2_XptSDIIn7DS2 ///< @deprecated Use NTV2_XptSDIIn7DS2 instead. + #define NTV2K2_XptSDIIn8 NTV2_XptSDIIn8 ///< @deprecated Use NTV2_XptSDIIn8 instead. + #define NTV2K2_XptSDIIn8DS2 NTV2_XptSDIIn8DS2 ///< @deprecated Use NTV2_XptSDIIn8DS2 instead. + #define NTV2K2_XptCSC6VidYUV NTV2_XptCSC6VidYUV ///< @deprecated Use NTV2_XptCSC6VidYUV instead. + #define NTV2K2_XptCSC6VidRGB NTV2_XptCSC6VidRGB ///< @deprecated Use NTV2_XptCSC6VidRGB instead. + #define NTV2K2_XptCSC6KeyYUV NTV2_XptCSC6KeyYUV ///< @deprecated Use NTV2_XptCSC6KeyYUV instead. + #define NTV2K2_XptCSC7VidYUV NTV2_XptCSC7VidYUV ///< @deprecated Use NTV2_XptCSC7VidYUV instead. + #define NTV2K2_XptCSC7VidRGB NTV2_XptCSC7VidRGB ///< @deprecated Use NTV2_XptCSC7VidRGB instead. + #define NTV2K2_XptCSC7KeyYUV NTV2_XptCSC7KeyYUV ///< @deprecated Use NTV2_XptCSC7KeyYUV instead. + #define NTV2K2_XptCSC8VidYUV NTV2_XptCSC8VidYUV ///< @deprecated Use NTV2_XptCSC8VidYUV instead. + #define NTV2K2_XptCSC8VidRGB NTV2_XptCSC8VidRGB ///< @deprecated Use NTV2_XptCSC8VidRGB instead. + #define NTV2K2_XptCSC8KeyYUV NTV2_XptCSC8KeyYUV ///< @deprecated Use NTV2_XptCSC8KeyYUV instead. + #define NTV2K2_XptLUT6Out NTV2_XptLUT6Out ///< @deprecated Use NTV2_XptLUT6Out instead. + #define NTV2K2_XptLUT7Out NTV2_XptLUT7Out ///< @deprecated Use NTV2_XptLUT7Out instead. + #define NTV2K2_XptLUT8Out NTV2_XptLUT8Out ///< @deprecated Use NTV2_XptLUT8Out instead. + #define NTV2K2_XptDuallinkOut6 NTV2_XptDuallinkOut6 ///< @deprecated Use NTV2_XptDuallinkOut6 instead. + #define NTV2K2_XptDuallinkOut6DS2 NTV2_XptDuallinkOut6DS2 ///< @deprecated Use NTV2_XptDuallinkOut6DS2 instead. + #define NTV2K2_XptDuallinkOut7 NTV2_XptDuallinkOut7 ///< @deprecated Use NTV2_XptDuallinkOut7 instead. + #define NTV2K2_XptDuallinkOut7DS2 NTV2_XptDuallinkOut7DS2 ///< @deprecated Use NTV2_XptDuallinkOut7DS2 instead. + #define NTV2K2_XptDuallinkOut8 NTV2_XptDuallinkOut8 ///< @deprecated Use NTV2_XptDuallinkOut8 instead. + #define NTV2K2_XptDuallinkOut8DS2 NTV2_XptDuallinkOut8DS2 ///< @deprecated Use NTV2_XptDuallinkOut8DS2 instead. + #define NTV2K2_XptMixer3VidYUV NTV2_XptMixer3VidYUV ///< @deprecated Use NTV2_XptMixer3VidYUV instead. + #define NTV2K2_XptMixer3KeyYUV NTV2_XptMixer3KeyYUV ///< @deprecated Use NTV2_XptMixer3KeyYUV instead. + #define NTV2K2_XptMixer4VidYUV NTV2_XptMixer4VidYUV ///< @deprecated Use NTV2_XptMixer4VidYUV instead. + #define NTV2K2_XptMixer4KeyYUV NTV2_XptMixer4KeyYUV ///< @deprecated Use NTV2_XptMixer4KeyYUV instead. + #define NTV2K2_XptDuallinkIn5 NTV2_XptDuallinkIn5 ///< @deprecated Use NTV2_XptDuallinkIn5 instead. + #define NTV2K2_XptDuallinkIn6 NTV2_XptDuallinkIn6 ///< @deprecated Use NTV2_XptDuallinkIn6 instead. + #define NTV2K2_XptDuallinkIn7 NTV2_XptDuallinkIn7 ///< @deprecated Use NTV2_XptDuallinkIn7 instead. + #define NTV2K2_XptDuallinkIn8 NTV2_XptDuallinkIn8 ///< @deprecated Use NTV2_XptDuallinkIn8 instead. + #define NTV2K2_XptRuntimeCalc NTV2_XptRuntimeCalc ///< @deprecated Use NTV2_XptRuntimeCalc instead. + #define NTV2_XptMixerVidYUV NTV2_XptMixer1VidYUV ///< @deprecated Use NTV2_XptMixer1VidYUV instead. + #define NTV2_XptMixerKeyYUV NTV2_XptMixer1KeyYUV ///< @deprecated User NTV2_XptMixer1KeyYUV instead. + + // NTV2BitFileType + #define NTV2K2_VideoProcBitFile NTV2_VideoProcBitFile ///< @deprecated Use NTV2_VideoProcBitFile instead. + #define NTV2K2_PCIBitFile NTV2_PCIBitFile ///< @deprecated Use NTV2_PCIBitFile instead. + #define NTV2K2_FWBitFile NTV2_FWBitFile ///< @deprecated Use NTV2_FWBitFile instead. + #define NTV2K2_Firmware NTV2_Firmware ///< @deprecated Use NTV2_Firmware instead. + #define NTV2K2_BitFile1 NTV2_BitFile1 ///< @deprecated Use NTV2_BitFile1 instead. + #define NTV2K2_BitFile2 NTV2_BitFile2 ///< @deprecated Use NTV2_BitFile2 instead. + #define NTV2K2_BitFile3 NTV2_BitFile3 ///< @deprecated Use NTV2_BitFile3 instead. + #define NTV2K2_BitFile4 NTV2_BitFile4 ///< @deprecated Use NTV2_BitFile4 instead. + #define NTV2K2_BitFile5 NTV2_BitFile5 ///< @deprecated Use NTV2_BitFile5 instead. + #define NTV2K2_BitFile6 NTV2_BitFile6 ///< @deprecated Use NTV2_BitFile6 instead. + #define NTV2K2_BitFile7 NTV2_BitFile7 ///< @deprecated Use NTV2_BitFile7 instead. + #define NTV2K2_BitFile8 NTV2_BitFile8 ///< @deprecated Use NTV2_BitFile8 instead. + + // NTV2ConversionMode + #define NTV2K2_1080i_5994to525_5994 NTV2_1080i_5994to525_5994 ///< @deprecated Use NTV2_1080i_5994to525_5994 instead. + #define NTV2K2_1080i_2500to625_2500 NTV2_1080i_2500to625_2500 ///< @deprecated Use NTV2_1080i_2500to625_2500 instead. + #define NTV2K2_720p_5994to525_5994 NTV2_720p_5994to525_5994 ///< @deprecated Use NTV2_720p_5994to525_5994 instead. + #define NTV2K2_720p_5000to625_2500 NTV2_720p_5000to625_2500 ///< @deprecated Use NTV2_720p_5000to625_2500 instead. + #define NTV2K2_525_5994to1080i_5994 NTV2_525_5994to1080i_5994 ///< @deprecated Use NTV2_525_5994to1080i_5994 instead. + #define NTV2K2_525_5994to720p_5994 NTV2_525_5994to720p_5994 ///< @deprecated Use NTV2_525_5994to720p_5994 instead. + #define NTV2K2_625_2500to1080i_2500 NTV2_625_2500to1080i_2500 ///< @deprecated Use NTV2_625_2500to1080i_2500 instead. + #define NTV2K2_625_2500to720p_5000 NTV2_625_2500to720p_5000 ///< @deprecated Use NTV2_625_2500to720p_5000 instead. + #define NTV2K2_720p_5000to1080i_2500 NTV2_720p_5000to1080i_2500 ///< @deprecated Use NTV2_720p_5000to1080i_2500 instead. + #define NTV2K2_720p_5994to1080i_5994 NTV2_720p_5994to1080i_5994 ///< @deprecated Use NTV2_720p_5994to1080i_5994 instead. + #define NTV2K2_720p_6000to1080i_3000 NTV2_720p_6000to1080i_3000 ///< @deprecated Use NTV2_720p_6000to1080i_3000 instead. + #define NTV2K2_1080i2398to525_2398 NTV2_1080i2398to525_2398 ///< @deprecated Use NTV2_1080i2398to525_2398 instead. + #define NTV2K2_1080i2398to525_2997 NTV2_1080i2398to525_2997 ///< @deprecated Use NTV2_1080i2398to525_2997 instead. + #define NTV2K2_1080i2400to525_2400 NTV2_1080i2400to525_2400 ///< @deprecated Use NTV2_1080i2400to525_2400 instead. + #define NTV2K2_1080p2398to525_2398 NTV2_1080p2398to525_2398 ///< @deprecated Use NTV2_1080p2398to525_2398 instead. + #define NTV2K2_1080p2398to525_2997 NTV2_1080p2398to525_2997 ///< @deprecated Use NTV2_1080p2398to525_2997 instead. + #define NTV2K2_1080p2400to525_2400 NTV2_1080p2400to525_2400 ///< @deprecated Use NTV2_1080p2400to525_2400 instead. + #define NTV2K2_1080i_2500to720p_5000 NTV2_1080i_2500to720p_5000 ///< @deprecated Use NTV2_1080i_2500to720p_5000 instead. + #define NTV2K2_1080i_5994to720p_5994 NTV2_1080i_5994to720p_5994 ///< @deprecated Use NTV2_1080i_5994to720p_5994 instead. + #define NTV2K2_1080i_3000to720p_6000 NTV2_1080i_3000to720p_6000 ///< @deprecated Use NTV2_1080i_3000to720p_6000 instead. + #define NTV2K2_1080i_2398to720p_2398 NTV2_1080i_2398to720p_2398 ///< @deprecated Use NTV2_1080i_2398to720p_2398 instead. + #define NTV2K2_720p_2398to1080i_2398 NTV2_720p_2398to1080i_2398 ///< @deprecated Use NTV2_720p_2398to1080i_2398 instead. + #define NTV2K2_525_2398to1080i_2398 NTV2_525_2398to1080i_2398 ///< @deprecated Use NTV2_525_2398to1080i_2398 instead. + #define NTV2K2_525_5994to525_5994 NTV2_525_5994to525_5994 ///< @deprecated Use NTV2_525_5994to525_5994 instead. + #define NTV2K2_625_2500to625_2500 NTV2_625_2500to625_2500 ///< @deprecated Use NTV2_625_2500to625_2500 instead. + #define NTV2K2_525_5994to525psf_2997 NTV2_525_5994to525psf_2997 ///< @deprecated Use NTV2_525_5994to525psf_2997 instead. + #define NTV2K2_625_5000to625psf_2500 NTV2_625_5000to625psf_2500 ///< @deprecated Use NTV2_625_5000to625psf_2500 instead. + #define NTV2K2_1080i_5000to1080psf_2500 NTV2_1080i_5000to1080psf_2500 ///< @deprecated Use NTV2_1080i_5000to1080psf_2500 instead. + #define NTV2K2_1080i_5994to1080psf_2997 NTV2_1080i_5994to1080psf_2997 ///< @deprecated Use NTV2_1080i_5994to1080psf_2997 instead. + #define NTV2K2_1080i_6000to1080psf_3000 NTV2_1080i_6000to1080psf_3000 ///< @deprecated Use NTV2_1080i_6000to1080psf_3000 instead. + #define NTV2K2_1080p_3000to720p_6000 NTV2_1080p_3000to720p_6000 ///< @deprecated Use NTV2_1080p_3000to720p_6000 instead. + #define NTV2K2_1080psf_2398to1080i_5994 NTV2_1080psf_2398to1080i_5994 ///< @deprecated Use NTV2_1080psf_2398to1080i_5994 instead. + #define NTV2K2_1080psf_2400to1080i_3000 NTV2_1080psf_2400to1080i_3000 ///< @deprecated Use NTV2_1080psf_2400to1080i_3000 instead. + #define NTV2K2_1080psf_2500to1080i_2500 NTV2_1080psf_2500to1080i_2500 ///< @deprecated Use NTV2_1080psf_2500to1080i_2500 instead. + #define NTV2K2_1080p_2398to1080i_5994 NTV2_1080p_2398to1080i_5994 ///< @deprecated Use NTV2_1080p_2398to1080i_5994 instead. + #define NTV2K2_1080p_2400to1080i_3000 NTV2_1080p_2400to1080i_3000 ///< @deprecated Use NTV2_1080p_2400to1080i_3000 instead. + #define NTV2K2_1080p_2500to1080i_2500 NTV2_1080p_2500to1080i_2500 ///< @deprecated Use NTV2_1080p_2500to1080i_2500 instead. + #define NTV2K2_NUM_CONVERSIONMODES NTV2_NUM_CONVERSIONMODES ///< @deprecated Use NTV2_NUM_CONVERSIONMODES instead. + #define NTV2K2_CONVERSIONMODE_UNKNOWN NTV2_CONVERSIONMODE_UNKNOWN ///< @deprecated Use NTV2_CONVERSIONMODE_UNKNOWN instead. + + // NTV2RGBBlackRange + #define NTV2K2_RGBBLACKRANGE_0_0x3FF NTV2_RGBBLACKRANGE_0_0x3FF ///< @deprecated Use NTV2_RGBBLACKRANGE_0_0x3FF instead. + #define NTV2K2_RGBBLACKRANGE_0x40_0x3C0 NTV2_RGBBLACKRANGE_0x40_0x3C0 ///< @deprecated Use NTV2_RGBBLACKRANGE_0x40_0x3C0 instead. + + // NTV2Framesize + #define NTV2K2_FRAMESIZE_2MB NTV2_FRAMESIZE_2MB ///< @deprecated Use NTV2_FRAMESIZE_2MB instead. + #define NTV2K2_FRAMESIZE_4MB NTV2_FRAMESIZE_4MB ///< @deprecated Use NTV2_FRAMESIZE_4MB instead. + #define NTV2K2_FRAMESIZE_8MB NTV2_FRAMESIZE_8MB ///< @deprecated Use NTV2_FRAMESIZE_8MB instead. + #define NTV2K2_FRAMESIZE_16MB NTV2_FRAMESIZE_16MB ///< @deprecated Use NTV2_FRAMESIZE_16MB instead. + + // NTV2VideoDACMode + #define NTV2K2_480iRGB NTV2_480iRGB ///< @deprecated Use NTV2_480iRGB instead. + #define NTV2K2_480iYPbPrSMPTE NTV2_480iYPbPrSMPTE ///< @deprecated Use NTV2_480iYPbPrSMPTE instead. + #define NTV2K2_480iYPbPrBetacam525 NTV2_480iYPbPrBetacam525 ///< @deprecated Use NTV2_480iYPbPrBetacam525 instead. + #define NTV2K2_480iYPbPrBetacamJapan NTV2_480iYPbPrBetacamJapan ///< @deprecated Use NTV2_480iYPbPrBetacamJapan instead. + #define NTV2K2_480iNTSC_US_Composite NTV2_480iNTSC_US_Composite ///< @deprecated Use NTV2_480iNTSC_US_Composite instead. + #define NTV2K2_480iNTSC_Japan_Composite NTV2_480iNTSC_Japan_Composite ///< @deprecated Use NTV2_480iNTSC_Japan_Composite instead. + #define NTV2K2_576iRGB NTV2_576iRGB ///< @deprecated Use NTV2_576iRGB instead. + #define NTV2K2_576iYPbPrSMPTE NTV2_576iYPbPrSMPTE ///< @deprecated Use NTV2_576iYPbPrSMPTE instead. + #define NTV2K2_576iPAL_Composite NTV2_576iPAL_Composite ///< @deprecated Use NTV2_576iPAL_Composite instead. + #define NTV2K2_1080iRGB NTV2_1080iRGB ///< @deprecated Use NTV2_1080iRGB instead. + #define NTV2K2_1080psfRGB NTV2_1080psfRGB ///< @deprecated Use NTV2_1080psfRGB instead. + #define NTV2K2_720pRGB NTV2_720pRGB ///< @deprecated Use NTV2_720pRGB instead. + #define NTV2K2_1080iSMPTE NTV2_1080iSMPTE ///< @deprecated Use NTV2_1080iSMPTE instead. + #define NTV2K2_1080psfSMPTE NTV2_1080psfSMPTE ///< @deprecated Use NTV2_1080psfSMPTE instead. + #define NTV2K2_720pSMPTE NTV2_720pSMPTE ///< @deprecated Use NTV2_720pSMPTE instead. + #define NTV2K2_1080iXVGA NTV2_1080iXVGA ///< @deprecated Use NTV2_1080iXVGA instead. + #define NTV2K2_1080psfXVGA NTV2_1080psfXVGA ///< @deprecated Use NTV2_1080psfXVGA instead. + #define NTV2K2_720pXVGA NTV2_720pXVGA ///< @deprecated Use NTV2_720pXVGA instead. + #define NTV2K2_2Kx1080RGB NTV2_2Kx1080RGB ///< @deprecated Use NTV2_2Kx1080RGB instead. + #define NTV2K2_2Kx1080SMPTE NTV2_2Kx1080SMPTE ///< @deprecated Use NTV2_2Kx1080SMPTE instead. + #define NTV2K2_2Kx1080XVGA NTV2_2Kx1080XVGA ///< @deprecated Use NTV2_2Kx1080XVGA instead. + + // NTV2LSVideoADCMode + #define NTV2K2_480iADCComponentBeta NTV2_480iADCComponentBeta ///< @deprecated Use NTV2_480iADCComponentBeta instead. + #define NTV2K2_480iADCComponentSMPTE NTV2_480iADCComponentSMPTE ///< @deprecated Use NTV2_480iADCComponentSMPTE instead. + #define NTV2K2_480iADCSVideoUS NTV2_480iADCSVideoUS ///< @deprecated Use NTV2_480iADCSVideoUS instead. + #define NTV2K2_480iADCCompositeUS NTV2_480iADCCompositeUS ///< @deprecated Use NTV2_480iADCCompositeUS instead. + #define NTV2K2_480iADCComponentBetaJapan NTV2_480iADCComponentBetaJapan ///< @deprecated Use NTV2_480iADCComponentBetaJapan instead. + #define NTV2K2_480iADCComponentSMPTEJapan NTV2_480iADCComponentSMPTEJapan ///< @deprecated Use NTV2_480iADCComponentSMPTEJapan instead. + #define NTV2K2_480iADCSVideoJapan NTV2_480iADCSVideoJapan ///< @deprecated Use NTV2_480iADCSVideoJapan instead. + #define NTV2K2_480iADCCompositeJapan NTV2_480iADCCompositeJapan ///< @deprecated Use NTV2_480iADCCompositeJapan instead. + #define NTV2K2_576iADCComponentBeta NTV2_576iADCComponentBeta ///< @deprecated Use NTV2_576iADCComponentBeta instead. + #define NTV2K2_576iADCComponentSMPTE NTV2_576iADCComponentSMPTE ///< @deprecated Use NTV2_576iADCComponentSMPTE instead. + #define NTV2K2_576iADCSVideo NTV2_576iADCSVideo ///< @deprecated Use NTV2_576iADCSVideo instead. + #define NTV2K2_576iADCComposite NTV2_576iADCComposite ///< @deprecated Use NTV2_576iADCComposite instead. + #define NTV2K2_720p_60 NTV2_720p_60 ///< @deprecated Use NTV2_720p_60 instead. + #define NTV2K2_1080i_30 NTV2_1080i_30 ///< @deprecated Use NTV2_1080i_30 instead. + #define NTV2K2_720p_50 NTV2_720p_50 ///< @deprecated Use NTV2_720p_50 instead. + #define NTV2K2_1080i_25 NTV2_1080i_25 ///< @deprecated Use NTV2_1080i_25 instead. + #define NTV2K2_1080pSF24 NTV2_1080pSF24 ///< @deprecated Use NTV2_1080pSF24 instead. + + // NTV2AnalogType + #define NTV2K2_AnlgComposite NTV2_AnlgComposite ///< @deprecated Use NTV2_AnlgComposite instead. + #define NTV2K2_AnlgComponentSMPTE NTV2_AnlgComponentSMPTE ///< @deprecated Use NTV2_AnlgComponentSMPTE instead. + #define NTV2K2_AnlgComponentBetacam NTV2_AnlgComponentBetacam ///< @deprecated Use NTV2_AnlgComponentBetacam instead. + #define NTV2K2_AnlgComponentRGB NTV2_AnlgComponentRGB ///< @deprecated Use NTV2_AnlgComponentRGB instead. + #define NTV2K2_AnlgXVGA NTV2_AnlgXVGA ///< @deprecated Use NTV2_AnlgXVGA instead. + #define NTV2K2_AnlgSVideo NTV2_AnlgSVideo ///< @deprecated Use NTV2_AnlgSVideo instead. + + // R2BlackLevel + #define NTV2K2_Black75IRE R2_Black_75IRE ///< @deprecated Use R2_Black_75IRE instead. + #define NTV2K2_Black0IRE R2_Black_0IRE ///< @deprecated Use R2_Black_0IRE instead. + + // NTV2InputVideoSelect + #define NTV2K2_Input1Select NTV2_Input1Select ///< @deprecated Use NTV2_Input1Select instead. + #define NTV2K2_Input2Select NTV2_Input2Select ///< @deprecated Use NTV2_Input2Select instead. + #define NTV2K2_AnalogInputSelect NTV2_AnalogInputSelect ///< @deprecated Use NTV2_AnalogInputSelect instead. + #define NTV2K2_Input3Select NTV2_Input3Select ///< @deprecated Use NTV2_Input3Select instead. + #define NTV2K2_Input4Select NTV2_Input4Select ///< @deprecated Use NTV2_Input4Select instead. + #define NTV2K2_Input5Select NTV2_Input5Select ///< @deprecated Use NTV2_Input5Select instead. + #define NTV2K2_DualLinkInputSelect NTV2_Input2xDLHDSelect ///< @deprecated Use NTV2_Input2xDLHDSelect instead. + #define NTV2K2_DualLink2xSdi4k NTV2_Input2x4kSelect ///< @deprecated Use NTV2_Input2x4kSelect instead. + #define NTV2K2_DualLink4xSdi4k NTV2_Input4x4kSelect ///< @deprecated Use NTV2_Input4x4kSelect instead. + #define NTV2K2_InputSelectMax NTV2_MAX_NUM_InputVideoSelectEnums ///< @deprecated Use NTV2_MAX_NUM_InputVideoSelectEnums instead. + + // NTV2SDIInputFormatSelect + #define NTV2K2_YUVSelect NTV2_RGBSelect ///< @deprecated Use NTV2_RGBSelect instead. + #define NTV2K2_RGBSelect NTV2_RGBSelect ///< @deprecated Use NTV2_RGBSelect instead. + #define NTV2K2_Stereo3DSelect NTV2_Stereo3DSelect ///< @deprecated Use NTV2_Stereo3DSelect instead. + + // NTV2InputAudioSelect + #define NTV2K2_AES_EBU_XLRSelect NTV2_AES_EBU_XLRSelect ///< @deprecated Use NTV2_AES_EBU_XLRSelect instead. + #define NTV2K2_AES_EBU_BNCSelect NTV2_AES_EBU_BNCSelect ///< @deprecated Use NTV2_AES_EBU_BNCSelect instead. + #define NTV2K2_Input1Embedded1_8Select NTV2_Input1Embedded1_8Select ///< @deprecated Use NTV2_Input1Embedded1_8Select instead. + #define NTV2K2_Input1Embedded9_16Select NTV2_Input1Embedded9_16Select ///< @deprecated Use NTV2_Input1Embedded9_16Select instead. + #define NTV2K2_Input2Embedded1_8Select NTV2_Input2Embedded1_8Select ///< @deprecated Use NTV2_Input2Embedded1_8Select instead. + #define NTV2K2_Input2Embedded9_16Select NTV2_Input2Embedded9_16Select ///< @deprecated Use NTV2_Input2Embedded9_16Select instead. + #define NTV2K2_AnalogSelect NTV2_AnalogSelect ///< @deprecated Use NTV2_AnalogSelect instead. + #define NTV2K2_HDMISelect NTV2_HDMISelect ///< @deprecated Use NTV2_HDMISelect instead. + #define NTV2K2_AudioInputOther NTV2_AudioInputOther ///< @deprecated Use NTV2_AudioInputOther instead. + + // NTV2AudioMapSelect + #define NTV2K2_AudioMap12_12 NTV2_AudioMap12_12 ///< @deprecated Use NTV2_AudioMap12_12 instead. + #define NTV2K2_AudioMap34_12 NTV2_AudioMap34_12 ///< @deprecated Use NTV2_AudioMap34_12 instead. + #define NTV2K2_AudioMap56_12 NTV2_AudioMap56_12 ///< @deprecated Use NTV2_AudioMap56_12 instead. + #define NTV2K2_AudioMap78_12 NTV2_AudioMap78_12 ///< @deprecated Use NTV2_AudioMap78_12 instead. + #define NTV2K2_AudioMap910_12 NTV2_AudioMap910_12 ///< @deprecated Use NTV2_AudioMap910_12 instead. + #define NTV2K2_AudioMap1112_12 NTV2_AudioMap1112_12 ///< @deprecated Use NTV2_AudioMap1112_12 instead. + #define NTV2K2_AudioMap1314_12 NTV2_AudioMap1314_12 ///< @deprecated Use NTV2_AudioMap1314_12 instead. + #define NTV2K2_AudioMap1516_12 NTV2_AudioMap1516_12 ///< @deprecated Use NTV2_AudioMap1516_12 instead. + + // NTV2OutputVideoSelect + #define NTV2K2_PrimaryOutputSelect NTV2_PrimaryOutputSelect ///< @deprecated Use NTV2_PrimaryOutputSelect instead. + #define NTV2K2_SecondaryOutputSelect NTV2_SecondaryOutputSelect ///< @deprecated Use NTV2_SecondaryOutputSelect instead. + #define NTV2K2_DualLinkOutputSelect NTV2_RgbOutputSelect ///< @deprecated Use NTV2_RgbOutputSelect instead. + #define NTV2K2_VideoPlusKeySelect NTV2_VideoPlusKeySelect ///< @deprecated Use NTV2_VideoPlusKeySelect instead. + #define NTV2K2_StereoOutputSelect NTV2_StereoOutputSelect ///< @deprecated Use NTV2_StereoOutputSelect instead. + #define NTV2K2_Quadrant1Select NTV2_Quadrant1Select ///< @deprecated Use NTV2_Quadrant1Select instead. + #define NTV2K2_Quadrant2Select NTV2_Quadrant2Select ///< @deprecated Use NTV2_Quadrant2Select instead. + #define NTV2K2_Quadrant3Select NTV2_Quadrant3Select ///< @deprecated Use NTV2_Quadrant3Select instead. + #define NTV2K2_Quadrant4Select NTV2_Quadrant4Select ///< @deprecated Use NTV2_Quadrant4Select instead. + #define NTV2k2_Quarter4k NTV2_Quarter4k ///< @deprecated Use NTV2_Quarter4k instead. + + // NTV2UpConvertMode + #define NTV2K2_UpConvertAnamorphic NTV2_UpConvertAnamorphic ///< @deprecated Use NTV2_UpConvertAnamorphic instead. + #define NTV2K2_UpConvertPillarbox4x3 NTV2_UpConvertPillarbox4x3 ///< @deprecated Use NTV2_UpConvertPillarbox4x3 instead. + #define NTV2K2_UpConvertZoom14x9 NTV2_UpConvertZoom14x9 ///< @deprecated Use NTV2_UpConvertZoom14x9 instead. + #define NTV2K2_UpConvertZoomLetterbox NTV2_UpConvertZoomLetterbox ///< @deprecated Use NTV2_UpConvertZoomLetterbox instead. + #define NTV2K2_UpConvertZoomWide NTV2_UpConvertZoomWide ///< @deprecated Use NTV2_UpConvertZoomWide instead. + + // NTV2DownConvertMode + #define NTV2K2_DownConvertLetterbox NTV2_DownConvertLetterbox ///< @deprecated Use NTV2_DownConvertLetterbox instead. + #define NTV2K2_DownConvertCrop NTV2_DownConvertCrop ///< @deprecated Use NTV2_DownConvertCrop instead. + #define NTV2K2_DownConvertAnamorphic NTV2_DownConvertAnamorphic ///< @deprecated Use NTV2_DownConvertAnamorphic instead. + #define NTV2K2_DownConvert14x9 NTV2_DownConvert14x9 ///< @deprecated Use NTV2_DownConvert14x9 instead. + + // NTV2IsoConvertMode + #define NTV2K2_IsoLetterBox NTV2_IsoLetterBox ///< @deprecated Use NTV2_IsoLetterBox instead. + #define NTV2K2_IsoHCrop NTV2_IsoHCrop ///< @deprecated Use NTV2_IsoHCrop instead. + #define NTV2K2_IsoPillarBox NTV2_IsoPillarBox ///< @deprecated Use NTV2_IsoPillarBox instead. + #define NTV2K2_IsoVCrop NTV2_IsoVCrop ///< @deprecated Use NTV2_IsoVCrop instead. + #define NTV2K2_Iso14x9 NTV2_Iso14x9 ///< @deprecated Use NTV2_Iso14x9 instead. + #define NTV2K2_IsoPassThrough NTV2_IsoPassThrough ///< @deprecated Use NTV2_IsoPassThrough instead. + + // NTV2QuarterSizeExpandMode + #define NTV2K2_QuarterSizeExpandOff NTV2_QuarterSizeExpandOff ///< @deprecated Use NTV2_QuarterSizeExpandOff instead. + #define NTV2K2_QuarterSizeExpandOn NTV2_QuarterSizeExpandOn ///< @deprecated Use NTV2_QuarterSizeExpandOn instead. + + // NTV2FrameBufferQuality + #define NTV2K2_StandardQuality NTV2_StandardQuality ///< @deprecated Use NTV2_StandardQuality instead. + #define NTV2K2_HighQuality NTV2_HighQuality ///< @deprecated Use NTV2_HighQuality instead. + #define NTV2K2_ProRes NTV2_ProRes ///< @deprecated Use NTV2_ProRes instead. + #define NTV2K2_ProResHQ NTV2_ProResHQ ///< @deprecated Use NTV2_ProResHQ instead. + #define NTV2K2_ProResLT NTV2_ProResLT ///< @deprecated Use NTV2_ProResLT instead. + #define NTV2K2_ProResProxy NTV2_ProResProxy ///< @deprecated Use NTV2_ProResProxy instead. + + // NTV2EncodeAsPSF + #define NTV2K2_NoPSF NTV2_NoPSF ///< @deprecated Use NTV2_NoPSF instead. + #define NTV2K2_IsPSF NTV2_IsPSF ///< @deprecated Use NTV2_IsPSF instead. + + // NTV2BreakoutType + #define NTV2K2_BreakoutNone NTV2_BreakoutNone ///< @deprecated Use NTV2_BreakoutNone instead. + #define NTV2K2_BreakoutCableXLR NTV2_BreakoutCableXLR ///< @deprecated Use NTV2_BreakoutCableXLR instead. + #define NTV2K2_BreakoutCableBNC NTV2_BreakoutCableBNC ///< @deprecated Use NTV2_BreakoutCableBNC instead. + #define NTV2K2_KBox NTV2_KBox ///< @deprecated Use NTV2_KBox instead. + #define NTV2K2_KLBox NTV2_KLBox ///< @deprecated Use NTV2_KLBox instead. + #define NTV2K2_K3Box NTV2_K3Box ///< @deprecated Use NTV2_K3Box instead. + #define NTV2K2_KLHiBox NTV2_KLHiBox ///< @deprecated Use NTV2_KLHiBox instead. + #define NTV2K2_KLHePlusBox NTV2_KLHePlusBox ///< @deprecated Use NTV2_KLHePlusBox instead. + #define NTV2K2_K3GBox NTV2_K3GBox ///< @deprecated Use NTV2_K3GBox instead. + + // NTV2AudioMonitorSelect + #define NTV2K2_AudioMonitor1_2 NTV2_AudioMonitor1_2 ///< @deprecated Use NTV2_AudioMonitor1_2 instead. + #define NTV2K2_AudioMonitor3_4 NTV2_AudioMonitor3_4 ///< @deprecated Use NTV2_AudioMonitor3_4 instead. + #define NTV2K2_AudioMonitor5_6 NTV2_AudioMonitor5_6 ///< @deprecated Use NTV2_AudioMonitor5_6 instead. + #define NTV2K2_AudioMonitor7_8 NTV2_AudioMonitor7_8 ///< @deprecated Use NTV2_AudioMonitor7_8 instead. + #define NTV2K2_AudioMonitor9_10 NTV2_AudioMonitor9_10 ///< @deprecated Use NTV2_AudioMonitor9_10 instead. + #define NTV2K2_AudioMonitor11_12 NTV2_AudioMonitor11_12 ///< @deprecated Use NTV2_AudioMonitor11_12 instead. + #define NTV2K2_AudioMonitor13_14 NTV2_AudioMonitor13_14 ///< @deprecated Use NTV2_AudioMonitor13_14 instead. + #define NTV2K2_AudioMonitor15_16 NTV2_AudioMonitor15_16 ///< @deprecated Use NTV2_AudioMonitor15_16 instead. + + // NTV2Audio2ChannelSelect + #define NTV2K2_AudioChannel1_2 NTV2_AudioChannel1_2 ///< @deprecated Use NTV2_AudioChannel1_2 instead. + #define NTV2K2_AudioChannel3_4 NTV2_AudioChannel3_4 ///< @deprecated Use NTV2_AudioChannel3_4 instead. + #define NTV2K2_AudioChannel5_6 NTV2_AudioChannel5_6 ///< @deprecated Use NTV2_AudioChannel5_6 instead. + #define NTV2K2_AudioChannel7_8 NTV2_AudioChannel7_8 ///< @deprecated Use NTV2_AudioChannel7_8 instead. + #define NTV2K2_AudioChannel9_10 NTV2_AudioChannel9_10 ///< @deprecated Use NTV2_AudioChannel9_10 instead. + #define NTV2K2_AudioChannel11_12 NTV2_AudioChannel11_12 ///< @deprecated Use NTV2_AudioChannel11_12 instead. + #define NTV2K2_AudioChannel13_14 NTV2_AudioChannel13_14 ///< @deprecated Use NTV2_AudioChannel13_14 instead. + #define NTV2K2_AudioChannel15_16 NTV2_AudioChannel15_16 ///< @deprecated Use NTV2_AudioChannel15_16 instead. + #define NTV2_MAX_NUM_Audio2ChannelSelect NTV2_MAX_NUM_AudioChannelPair ///< @deprecated Use NTV2_MAX_NUM_AudioChannelPair instead. + + // NTV2Audio4ChannelSelect + #define NTV2K2_AudioChannel1_4 NTV2_AudioChannel1_4 ///< @deprecated Use NTV2_AudioChannel1_4 instead. + #define NTV2K2_AudioChannel5_8 NTV2_AudioChannel5_8 ///< @deprecated Use NTV2_AudioChannel5_8 instead. + #define NTV2K2_AudioChannel9_12 NTV2_AudioChannel9_12 ///< @deprecated Use NTV2_AudioChannel9_12 instead. + #define NTV2K2_AudioChannel13_16 NTV2_AudioChannel13_16 ///< @deprecated Use NTV2_AudioChannel13_16 instead. + + // NTV2Audio8ChannelSelect + #define NTV2K2_AudioChannel1_8 NTV2_AudioChannel1_8 ///< @deprecated Use NTV2_AudioChannel1_8 instead. + #define NTV2K2_AudioChannel9_16 NTV2_AudioChannel9_16 ///< @deprecated Use NTV2_AudioChannel9_16 instead. + + // NTV2ColorSpaceType + #define NTV2_ColorSpaceAuto NTV2_ColorSpaceTypeAuto ///< @deprecated Use NTV2_ColorSpaceTypeAuto instead. + #define NTV2_ColorSpaceRec601 NTV2_ColorSpaceTypeRec601 ///< @deprecated Use NTV2_ColorSpaceTypeRec601 instead. + #define NTV2_ColorSpaceRec709 NTV2_ColorSpaceTypeRec709 ///< @deprecated Use NTV2_ColorSpaceTypeRec709 instead. + + // NTV2Stereo3DMode + #define NTV2K2_Stereo3DOff NTV2_Stereo3DOff ///< @deprecated Use NTV2_Stereo3DOff instead. + #define NTV2K2_Stereo3DSideBySide NTV2_Stereo3DSideBySide ///< @deprecated Use NTV2_Stereo3DSideBySide instead. + #define NTV2K2_Stereo3DTopBottom NTV2_Stereo3DTopBottom ///< @deprecated Use NTV2_Stereo3DTopBottom instead. + #define NTV2K2_Stereo3DDualStream NTV2_Stereo3DDualStream ///< @deprecated Use NTV2_Stereo3DDualStream instead. + + // NTV2ColorSpaceMode + #define NTV2K2_ColorSpaceAuto NTV2_ColorSpaceModeAuto ///< @deprecated Use NTV2_ColorSpaceModeAuto instead. + #define NTV2K2_ColorSpaceYCbCr NTV2_ColorSpaceModeYCbCr ///< @deprecated Use NTV2_ColorSpaceModeYCbCr instead. + #define NTV2K2_ColorSpaceRGB NTV2_ColorSpaceModeRGB ///< @deprecated Use NTV2_ColorSpaceModeRGB instead. + + #define NTV2_INPUT_SOURCE_IS_VALID(_inpSrc_) (((_inpSrc_) >= 0) && ((_inpSrc_) < NTV2_NUM_INPUTSOURCES)) + #define IS_VALID_NTV2FrameGeometry(__s__) ((__s__) >= NTV2_FG_1920x1080 && (__s__) < NTV2_FG_NUMFRAMEGEOMETRIES) + #define IS_VALID_NTV2FrameBufferFormat(__s__) ((__s__) >= NTV2_FBF_10BIT_YCBCR && (__s__) < NTV2_FBF_NUMFRAMEBUFFERFORMATS) + #define IS_VALID_NTV2V2Standard(__s__) ((__s__) >= NTV2_V2_STANDARD_1080 && (__s__) < NTV2_V2_STANDARD_UNDEFINED) + #define IS_VALID_NTV2Standard(__s__) ((__s__) >= NTV2_STANDARD_1080 && (__s__) < NTV2_STANDARD_UNDEFINED) + #define NTV2_IS_VALID_NTV2AudioSystem(__x__) ((__x__) >= NTV2_AUDIOSYSTEM_1 && (__x__) < NTV2_MAX_NUM_AudioSystemEnums) + #define NTV2_AUDIO_CHANNEL_PAIR_IS_VALID(__p__) ((__p__) >= NTV2_AudioChannel1_2 && (__p__) < NTV2_MAX_NUM_AudioChannelPair) + #define NTV2_IS_VALID_NTV2Crosspoint(__x__) ((__x__) >= NTV2CROSSPOINT_CHANNEL1 && (__x__) < NTV2_NUM_CROSSPOINTS) + #define NTV2_OUTPUT_DEST_IS_VALID(_dest_) (((_dest_) >= 0) && ((_dest_) < NTV2_NUM_OUTPUTDESTINATIONS)) + #define IS_VALID_NTV2Channel(__x__) ((__x__) >= NTV2_CHANNEL1 && (__x__) < NTV2_MAX_NUM_CHANNELS) + #define IS_VALID_NTV2ReferenceSource(__x__) ((__x__) >= NTV2_REFERENCE_EXTERNAL && (__x__) < NTV2_NUM_REFERENCE_INPUTS) + +#endif // !defined (NTV2_DEPRECATE) + +typedef enum +{ + NTV2IpErrNone, + NTV2IpErrInvalidChannel, + NTV2IpErrInvalidFormat, + NTV2IpErrInvalidBitdepth, + NTV2IpErrInvalidUllHeight, + NTV2IpErrInvalidUllLevels, + NTV2IpErrUllNotSupported, + NTV2IpErrNotReady, + NTV2IpErrSoftwareMismatch, + NTV2IpErrSFP1NotConfigured, + NTV2IpErrSFP2NotConfigured, + NTV2IpErrInvalidIGMPVersion, + NTV2IpErrCannotGetMacAddress, + NTV2IpErrNotSupported, + NTV2IpErrWriteSOMToMB, + NTV2IpErrWriteSeqToMB, + NTV2IpErrWriteCountToMB, + NTV2IpErrTimeoutNoSOM, + NTV2IpErrTimeoutNoSeq, + NTV2IpErrTimeoutNoBytecount, + NTV2IpErrExceedsFifo, + NTV2IpErrNoResponseFromMB, + NTV2IpErrAcquireMBTimeout, + NTV2IpErrInvalidMBResponse, + NTV2IpErrInvalidMBResponseSize, + NTV2IpErrInvalidMBResponseNoMac, + NTV2IpErrMBStatusFail, + NTV2IpErrGrandMasterInfo, + NTV2IpErrSDPTooLong, + NTV2IpErrSDPNotFound, + NTV2IpErrSDPEmpty, + NTV2IpErrSDPInvalid, + NTV2IpErrSDPURLInvalid, + NTV2IpErrSDPNoVideo, + NTV2IpErrSDPNoAudio, + NTV2IpErrSDPNoANC, + NTV2IpErrSFPNotFound, + NTV2IpErrInvalidConfig, + NTV2IpErrLLDPNotFound, + NTV2IpNumErrTypes +} NTV2IpError; + + +#define FGVCROSSPOINTMASK (BIT_0+BIT_1+BIT_2+BIT_3) +#define FGVCROSSPOINTSHIFT (0) +#define BGVCROSSPOINTMASK (BIT_4+BIT_5+BIT_6+BIT_7) +#define BGVCROSSPOINTSHIFT (4) +#define FGKCROSSPOINTMASK (BIT_8+BIT_9+BIT_10+BIT_11) +#define FGKCROSSPOINTSHIFT (8) +#define BGKCROSSPOINTMASK (BIT_12+BIT_13+BIT_14+BIT_15) +#define BGKCROSSPOINTSHIFT (12) + +#define VIDPROCMUX1MASK (BIT_0+BIT_1) +#define VIDPROCMUX1SHIFT (0) +#define VIDPROCMUX2MASK (BIT_2+BIT_3) +#define VIDPROCMUX2SHIFT (2) +#define VIDPROCMUX3MASK (BIT_4+BIT_5) +#define VIDPROCMUX3SHIFT (4) +#define VIDPROCMUX4MASK (BIT_6+BIT_7) +#define VIDPROCMUX4SHIFT (6) +#define VIDPROCMUX5MASK (BIT_8+BIT_9) +#define VIDPROCMUX5SHIFT (8) + +#define SPLITMODEMASK (BIT_30+BIT_31) +#define SPLITMODESHIFT (30) + + +#endif //NTV2ENUMS_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2fixed.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2fixed.h new file mode 100644 index 0000000..df6e683 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2fixed.h @@ -0,0 +1,104 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2fixed.h + @brief Declares several fixed-point math routines. Assumes 16-bit fraction. + @copyright (C) 2004-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef NTV2FIXED_H +#define NTV2FIXED_H + +#include "ajatypes.h" + +#define FIXED_ONE (1<<16) + +#ifdef MSWindows + //Visual Studio 2008 or lower + #if (_MSC_VER <= 1500) + #define inline __inline + #endif +#endif + +#if defined (AJAMac) | defined (AJAVirtual) + // MacOS still defines the functions below in CarbonCore/FixMath.h + #ifdef FixedRound + #undef FixedRound + #endif + #ifdef FloatToFixed + #undef FloatToFixed + #endif + #ifdef FixedToFloat + #undef FixedToFloat + #endif + #if !defined (FixedTrunc) + // Conflicts with FixedTrunc function in AJABase's videoutilities.h + #define FixedTrunc(__x__) ((__x__)>>16) + #endif + #define FixedRound(__x__) (((__x__) < 0) ? (-((-(__x__)+0x8000)>>16)) : (((__x__) + 0x8000)>>16)) + #define FixedMix(__min__,__max__,__mixer__) (FixedRound(((__max__)-(__min__))*(__mixer__)+(__min__))) + #define FloatToFixed(__x__) ((Fixed_)((__x__) * (float)FIXED_ONE)) + #define FixedToFloat(__x__) (((float)(__x__) / (float) 65536.0)) + #define FixedFrac(__x__) (((__x__) < 0) ? (-(__x__) & 0xFFFF)) : ((__x__) & 0xFFFF) + +#else // not AJAMac + + // Prevent unsupported-floating link errors in Linux device driver. + // The following are not used in the Linux driver but cause the 2.6 kernel + // linker to fail anyway. + #ifndef __KERNEL__ + inline Fixed_ FloatToFixed(float inFlt) + { + return (Fixed_)(inFlt * (float)FIXED_ONE); + } + + inline float FixedToFloat(Fixed_ inFix) + { + return((float)inFix/(float)65536.0); + } + #endif // if __KERNEL__ undefined + + inline Word FixedRound(Fixed_ inFix) + { + Word retValue; + + if ( inFix < 0 ) + { + retValue = (Word)(-((-inFix+0x8000)>>16)); + } + else + { + retValue = (Word)((inFix + 0x8000)>>16); + } + return retValue; + } + + inline Fixed_ FixedFrac(Fixed_ inFix) + { + Fixed_ retValue; + + if ( inFix < 0 ) + { + retValue = -inFix&0xFFFF; + } + else + { + retValue = inFix&0xFFFF; + } + + return retValue; + } + + inline Fixed_ FixedTrunc(Fixed_ inFix) + { + return (inFix>>16); + } + + inline Word FixedMix(Word min, Word max, Fixed_ mixer) + { + Fixed_ result = (max-min)*mixer+min; + + return FixedRound(result); + } +#endif // else not AJAMac + +#endif // NTV2FIXED_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2formatdescriptor.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2formatdescriptor.h new file mode 100644 index 0000000..3accf92 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2formatdescriptor.h @@ -0,0 +1,399 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2formatdescriptor.h + @brief Declares the NTV2FormatDescriptor class. + @copyright (C) 2016-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2FORMATDESC_H +#define NTV2FORMATDESC_H + +#include "ajaexport.h" +#include "ajatypes.h" +#include "ntv2enums.h" +#include "ntv2publicinterface.h" +#include +#include +#include +#if defined (AJALinux) + #include +#endif + + +typedef std::vector NTV2RasterLineOffsets; ///< @brief An ordered sequence of zero-based line offsets into a frame buffer. +typedef NTV2RasterLineOffsets::const_iterator NTV2RasterLineOffsetsConstIter; ///< @brief A handy const iterator into an NTV2RasterLineOffsets. +typedef NTV2RasterLineOffsets::iterator NTV2RasterLineOffsetsIter; ///< @brief A handy non-const iterator into an NTV2RasterLineOffsets. + +/** + @brief Streams a human-readable dump of the given NTV2RasterLineOffsets sequence into the specified output stream. + @param[in] inObj Specifies the NTV2RasterLineOffsets to be streamed to the output stream. + @param inOutStream Specifies the output stream to receive the dump. Defaults to std::cout. + @return A non-constant reference to the given output stream. +**/ +AJAExport std::ostream & NTV2PrintRasterLineOffsets (const NTV2RasterLineOffsets & inObj, std::ostream & inOutStream = std::cout); + +/** + @brief This provides additional information about a video frame for a given video standard or format and pixel format, + including the total number of lines, number of pixels per line, line pitch, and which line contains the start + of active video. + @note It is possible to construct a format descriptor that is not supported by the AJA device. +**/ +class AJAExport NTV2FormatDescriptor +{ +public: + /** + @name Constructors + **/ + ///@{ + /** + @brief My default constructor initializes me in an "invalid" state. + **/ + explicit NTV2FormatDescriptor (); ///< @brief My default constructor + + /** + @brief Construct from line and pixel count, plus line pitch. + @param[in] inNumLines Specifies the total number of lines. + @param[in] inNumPixels Specifies the total number of pixels. + @param[in] inLinePitch Specifies the line pitch as the number of 32-bit words per line. + @param[in] inFirstActiveLine Optionally specifies the first active line of video, where zero is the first (top) line. Defaults to zero. + **/ + explicit NTV2FormatDescriptor ( const ULWord inNumLines, + const ULWord inNumPixels, + const ULWord inLinePitch, + const ULWord inFirstActiveLine = 0); +#if !defined (NTV2_DEPRECATE_13_0) + explicit NTV2_DEPRECATED_f(NTV2FormatDescriptor (const NTV2Standard inVideoStandard, + const NTV2FrameBufferFormat inFrameBufferFormat, + const bool inVANCenabled, + const bool in2Kby1080 = false, + const bool inWideVANC = false)); ///< @deprecated Use the constructor that accepts an ::NTV2VANCMode parameter instead. + + explicit NTV2_DEPRECATED_f(NTV2FormatDescriptor (const NTV2VideoFormat inVideoFormat, + const NTV2FrameBufferFormat inFrameBufferFormat, + const bool inVANCenabled, + const bool inWideVANC = false)); ///< @deprecated Use the constructor that accepts an ::NTV2VANCMode parameter instead. +#endif // !defined (NTV2_DEPRECATE_13_0) + + /** + @brief Constructs me from the given video standard, pixel format, and VANC settings. + @param[in] inStandard Specifies the video standard being used. + @param[in] inFrameBufferFormat Specifies the pixel format of the frame buffer. + @param[in] inVancMode Specifies the VANC mode. Defaults to OFF. + **/ + explicit NTV2FormatDescriptor ( const NTV2Standard inStandard, + const NTV2FrameBufferFormat inFrameBufferFormat, + const NTV2VANCMode inVancMode = NTV2_VANCMODE_OFF); + + /** + @brief Constructs me from the given video format, pixel format and VANC settings. + @param[in] inVideoFormat Specifies the video format being used. + @param[in] inFrameBufferFormat Specifies the pixel format of the frame buffer. + @param[in] inVancMode Specifies the VANC mode. + **/ + explicit NTV2FormatDescriptor ( const NTV2VideoFormat inVideoFormat, + const NTV2FrameBufferFormat inFrameBufferFormat, + const NTV2VANCMode inVancMode = NTV2_VANCMODE_OFF); + ///@} + + /** + @name Inquiry + **/ + ///@{ + inline bool IsValid (void) const {return numLines && numPixels && mNumPlanes && mLinePitch[0];} ///< @return True if valid; otherwise false. + inline bool IsVANC (void) const {return firstActiveLine > 0;} ///< @return True if VANC geometry; otherwise false. + inline bool IsPlanar (void) const {return GetNumPlanes() > 1 || NTV2_IS_FBF_PLANAR (mPixelFormat);} ///< @return True if planar format; otherwise false. + + /** + @return The number of samples spanned per sample used, usually 1 for most formats. + Returns zero if an invalid plane is specified. + @param[in] inPlaneIndex0 Specifies the plane of interest. Defaults to zero. + @note Used for asymmetric vertical sampling, such as 3-plane 4:2:0 formats, where + the returned value is 1 for the Y plane, and 2 for the Cb/Cr planes. + **/ + ULWord GetVerticalSampleRatio (const UWord inPlaneIndex0 = 0) const; // New in SDK 16.0 + + /** + @return The total number of bytes required to hold the raster plane, including any VANC lines. + Returns zero upon error. + @note To determine the byte count of all planes of a planar format, call GetTotalBytes. + @param[in] inPlaneIndex0 Specifies the plane of interest. Defaults to zero. + **/ + inline ULWord GetTotalRasterBytes (const UWord inPlaneIndex0 = 0) const + { const ULWord vSamp(GetVerticalSampleRatio(inPlaneIndex0)); + return vSamp ? (GetFullRasterHeight() * GetBytesPerRow(inPlaneIndex0) / vSamp) : 0; + } + + /** + @return The total number of bytes required to hold the raster, including any VANC, and all planes of planar formats. + **/ + ULWord GetTotalBytes (void) const; // New in SDK 16.0 + + /** + @return The result of GetTotalBytes rounded up to the nearest page size. + @param[in] inPageSize Optionally specifies the page size to use. Defaults to 4096 (4K) bytes. + **/ + ULWord GetVideoWriteSize (ULWord inPageSize = 4096UL) const; // New in SDK 16.2 + + /** + @return The total number of bytes required to hold the visible raster (i.e. active lines after any VANC lines). + @param[in] inPlaneIndex0 Specifies the plane of interest. Defaults to zero, the first plane. + **/ + inline ULWord GetVisibleRasterBytes (const UWord inPlaneIndex0 = 0) const {return GetVisibleRasterHeight() * GetBytesPerRow(inPlaneIndex0);} + + /** + @return The number of bytes per row/line of the raster. + @param[in] inPlaneIndex0 Specifies the plane of interest. Defaults to zero. + **/ + inline ULWord GetBytesPerRow (const UWord inPlaneIndex0 = 0) const {return inPlaneIndex0 < mNumPlanes ? mLinePitch[inPlaneIndex0] : 0;} + + inline ULWord GetRasterWidth (void) const {return numPixels;} ///< @return The width of the raster, in pixels. + inline UWord GetNumPlanes (void) const {return mNumPlanes;} ///< @return The number of planes in the raster. + std::string PlaneToString (const UWord inPlaneIndex0) const; ///< @return A string containing a human-readable name for the specified plane. + + /** + @return The zero-based index number of the plane that contains the byte at the given offset, + or 0xFFFF if the offset is not within any plane in the buffer. + @param[in] inByteOffset The offset, in bytes, to the byte of interest in the frame. + **/ + UWord ByteOffsetToPlane (const ULWord inByteOffset) const; + + /** + @return The zero-based index number of the raster line (row) that contains the byte at the given offset, + or 0xFFFF if the offset does not fall within any plane or line in the buffer. + @param[in] inByteOffset The offset, in bytes, to the byte of interest in the raster buffer. + **/ + UWord ByteOffsetToRasterLine (const ULWord inByteOffset) const; + + /** + @return True if the given byte offset is at the start of a new raster line (row); otherwise false. + @param[in] inByteOffset The offset, in bytes, to the byte of interest in the frame. + **/ + bool IsAtLineStart (ULWord inByteOffset) const; + + /** + @return The height of the raster, in lines. + @param[in] inVisibleOnly Specify true to return just the visible height; otherwise false (the default) to return the full height. + **/ + inline ULWord GetRasterHeight (const bool inVisibleOnly = false) const {return inVisibleOnly ? GetVisibleRasterHeight() : GetFullRasterHeight();} + + /** + @return The full height of the raster, in lines (including VANC, if any). + **/ + inline ULWord GetFullRasterHeight (void) const {return numLines;} + + /** + @return The zero-based index number of the first active (visible) line in the raster. This will be zero for non-VANC rasters. + **/ + inline ULWord GetFirstActiveLine (void) const {return firstActiveLine;} + + /** + @return The visible height of the raster, in lines (excluding VANC, if any). + **/ + inline ULWord GetVisibleRasterHeight (void) const {return GetFullRasterHeight() - GetFirstActiveLine();} + + /** + @brief Answers with an NTV2_POINTER that describes the given row (and plane) given the NTV2_POINTER + that describes the frame buffer. + @param[in] inFrameBuffer Specifies the frame buffer (that includes all planes, if planar). + @param inOutRowBuffer Receives the NTV2_POINTER that references the row (and plane) in the frame buffer. + @param[in] inRowIndex0 Specifies the row of interest in the buffer, where zero is the topmost row. + @param[in] inPlaneIndex0 Optionally specifies the plane of interest. Defaults to zero. + @return True if successful; otherwise false. + **/ + bool GetRowBuffer (const NTV2_POINTER & inFrameBuffer, NTV2_POINTER & inOutRowBuffer, const ULWord inRowIndex0, const UWord inPlaneIndex0 = 0) const; // New in SDK 16.0 + + /** + @return A pointer to the start of the given row in the given buffer, or NULL if row index is bad + (using my description of the buffer contents). + @param[in] pInStartAddress A pointer to the raster buffer. + @param[in] inRowIndex0 Specifies the row of interest in the buffer, where zero is the topmost row. + @param[in] inPlaneIndex0 Specifies the plane of interest. Defaults to zero. + **/ + const void * GetRowAddress (const void * pInStartAddress, const ULWord inRowIndex0, const UWord inPlaneIndex0 = 0) const; + + /** + @return A non-const pointer to the start of the given row in the given buffer, or NULL if row index is bad + (using my description of the buffer contents). + @param[in] pInStartAddress A non-const pointer to the raster buffer. + @param[in] inRowIndex0 Specifies the row of interest in the buffer, where zero is the topmost row. + @param[in] inPlaneIndex0 Specifies the plane of interest. Defaults to zero. + **/ + void * GetWriteableRowAddress (void * pInStartAddress, const ULWord inRowIndex0, const UWord inPlaneIndex0 = 0) const; + + /** + @return The absolute byte offset from the start of the frame buffer to the start of the given raster line + in the given plane (or 0xFFFFFFFF if the row and/or plane indexes are bad). + @note This function assumes that the planes contiguously abut each other in memory, in ascending address order. + @param[in] inRowIndex0 Specifies the row of interest in the buffer, where zero is the topmost row. + @param[in] inPlaneIndex0 Specifies the plane of interest. Defaults to zero. + **/ + ULWord RasterLineToByteOffset (const ULWord inRowIndex0, const UWord inPlaneIndex0 = 0) const; + + /** + @return A pointer to the start of the first visible row in the given buffer, or NULL if invalid + (using my description of the buffer contents). + @param[in] pInStartAddress A pointer to the raster buffer. + **/ + inline UByte * GetTopVisibleRowAddress (UByte * pInStartAddress) const {return (UByte *) GetRowAddress (pInStartAddress, firstActiveLine);} + + /** + @brief Compares two buffers line-by-line (using my description of the buffer contents). + @param[in] pInStartAddress1 A valid, non-NULL pointer to the start of the first raster buffer. + @param[in] pInStartAddress2 A valid, non-NULL pointer to the start of the second raster buffer. + @param[out] outFirstChangedRowNum Receives the zero-based row number of the first row that's different, + or 0xFFFFFFFF if identical. + @return True if successful; otherwise false. + **/ + bool GetFirstChangedRow (const void * pInStartAddress1, const void * pInStartAddress2, ULWord & outFirstChangedRowNum) const; + + /** + @brief Compares two buffers line-by-line (using my description of the buffer contents). + @param[out] outDiffs Receives the ordered sequence of line offsets of the lines that differed. + This will be empty if the two buffers are identical (or if an error occurs). + @param[in] pInBuffer1 Specifies the non-NULL address of the first memory buffer whose contents are to be compared. + @param[in] pInBuffer2 Specifies the non-NULL address of the second memory buffer whose contents are to be compared. + @param[in] inMaxLines Optionally specifies the maximum number of lines to compare. If zero, all lines are compared. + Defaults to zero (all lines). + @return True if successful; otherwise false. + @note The buffers must be large enough to accommodate my video standard/format or else a memory access violation will occur. + **/ + bool GetChangedLines (NTV2RasterLineOffsets & outDiffs, const void * pInBuffer1, const void * pInBuffer2, const ULWord inMaxLines = 0) const; + + /** + @return The full-raster NTV2FrameDimensions (including VANC lines, if any). + **/ + NTV2FrameDimensions GetFullRasterDimensions (void) const; + + /** + @return The visible NTV2FrameDimensions (excluding VANC lines, if any). + **/ + NTV2FrameDimensions GetVisibleRasterDimensions (void) const; + + /** + @brief Answers with the equivalent SMPTE line number for the given line offset into the frame buffer I describe. + @param[in] inLineOffset Specifies the zero-based line offset into the frame buffer that I describe. + @param[out] outSMPTELine Receives the equivalent SMPTE line number. + @param[out] outIsField2 Receives true if the line number is associated with Field 2 (interlaced only); otherwise false. + @return True if successful; otherwise false. + **/ + bool GetSMPTELineNumber (const ULWord inLineOffset, ULWord & outSMPTELine, bool & outIsField2) const; + + /** + @brief Answers with the equivalent line offset into the raster I describe for the given SMPTE line number. + @param[in] inSMPTELine Specifies the SMPTE line number. + @param[out] outLineOffset Receives the zero-based line offset into the raster I describe. + @return True if successful; otherwise false. + **/ + bool GetLineOffsetFromSMPTELine (const ULWord inSMPTELine, ULWord & outLineOffset) const; + + /** + @brief Sets the given ::NTV2SegmentedXferInfo to match my raster, as a source or destination. + @param inSegmentInfo Specifies the segmented transfer object to modify. + @param[in] inIsSource Specify 'true' (the default) to set the "source" aspect of the transfer + info object; otherwise 'false' to set the "destination" aspect of it. + @return A non-const reference to the ::NTV2SegmentedXferInfo object. + **/ + NTV2SegmentedXferInfo & GetSegmentedXferInfo (NTV2SegmentedXferInfo & inSegmentInfo, const bool inIsSource = true) const; + + /** + @return True if I'm equal to the given NTV2FormatDescriptor. + @param[in] inRHS The right-hand-side operand that I'll be compared with. + **/ + bool operator == (const NTV2FormatDescriptor & inRHS) const; + + /** + @brief Writes a human-readable description of me into the given output stream. + @param inOutStream The output stream to be written into. + @param[in] inDetailed If true (the default), writes a detailed description; otherwise writes a brief one. + @return The output stream I was handed. + **/ + std::ostream & Print (std::ostream & inOutStream, const bool inDetailed = true) const; + + /** + @brief Writes the given frame buffer line offset as a formatted SMPTE line number into the given output stream. + @param inOutStream The output stream to be written into. + @param[in] inLineOffset Specifies the zero-based line offset in the frame buffer. + @param[in] inForTextMode Defaults to false. If true, omits the space between the field indicator and the line number, and adds leading zeroes to line number. + @return The output stream I was handed. + **/ + std::ostream & PrintSMPTELineNumber (std::ostream & inOutStream, const ULWord inLineOffset, const bool inForTextMode = false) const; + + inline NTV2Standard GetVideoStandard (void) const {return mStandard;} ///< @return The video standard I was created with. + inline NTV2VideoFormat GetVideoFormat (void) const {return mVideoFormat;} ///< @return The video format I was created with. + inline NTV2FrameBufferFormat GetPixelFormat (void) const {return mPixelFormat;} ///< @return The pixel format I was created with. + inline NTV2VANCMode GetVANCMode (void) const {return mVancMode;} ///< @return The VANC mode I was created with. + inline bool IsSDFormat (void) const {return NTV2_IS_SD_VIDEO_FORMAT(GetVideoFormat()) || NTV2_IS_SD_STANDARD(GetVideoStandard());} ///< @return True if I was created with an SD video format or standard. + inline bool IsQuadRaster (void) const {return NTV2_IS_QUAD_STANDARD(mStandard) || NTV2_IS_4K_VIDEO_FORMAT(mVideoFormat);} ///< @return True if I was created with a 4K/UHD video format or standard. + inline bool IsTallVanc (void) const {return mVancMode == NTV2_VANCMODE_TALL;} ///< @return True if I was created with just "tall" VANC. + inline bool IsTallerVanc (void) const {return mVancMode == NTV2_VANCMODE_TALLER;} ///< @return True if I was created with "taller" VANC. + inline NTV2FrameGeometry GetFrameGeometry (void) const {return mFrameGeometry;} ///< @return The frame geometry I was created with. + bool Is2KFormat (void) const; ///< @return True if I was created with a 2Kx1080 video format. + ///@} + + void MakeInvalid (void); ///< @brief Resets me into an invalid (NULL) state. + + private: + friend class CNTV2CaptionRenderer; // The caption renderer needs to call SetPixelFormat + inline void SetPixelFormat (const NTV2PixelFormat inPixFmt) {mPixelFormat = inPixFmt;} ///< @brief Internal use only + void FinalizePlanar (void); ///< @brief Completes initialization for planar formats + + // Member Data + public: + ULWord numLines; ///< @brief Height -- total number of lines + ULWord numPixels; ///< @brief Width -- total number of pixels per line + ULWord linePitch; ///< @brief Number of 32-bit words per line. Shadows mLinePitch[0] * sizeof(ULWord). + ULWord firstActiveLine; ///< @brief First active line of video (0 if NTV2_VANCMODE_OFF) + private: + NTV2Standard mStandard; ///< @brief My originating video standard + NTV2VideoFormat mVideoFormat; ///< @brief My originating video format (if known) + NTV2FrameBufferFormat mPixelFormat; ///< @brief My originating frame buffer format + NTV2VANCMode mVancMode; ///< @brief My originating VANC mode + ULWord mLinePitch[4]; ///< @brief Number of bytes per row/line (per-plane) + UWord mNumPlanes; ///< @brief Number of planes + NTV2FrameGeometry mFrameGeometry; ///< @brief My originating frame geometry + +}; // NTV2FormatDescriptor + +typedef NTV2FormatDescriptor NTV2FormatDesc; ///< @brief Shorthand for ::NTV2FormatDescriptor + + +/** + @brief Writes the given NTV2FormatDescriptor to the specified output stream. + @param inOutStream Specifies the output stream to receive the human-readable representation of the NTV2FormatDescriptor. + @param[in] inFormatDesc Specifies the NTV2FormatDescriptor instance to print to the output stream. + @return A non-constant reference to the specified output stream. +**/ +AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2FormatDescriptor & inFormatDesc) {return inFormatDesc.Print (inOutStream);} + + +#if !defined (NTV2_DEPRECATE_13_0) + AJAExport NTV2FormatDescriptor GetFormatDescriptor (const NTV2Standard inVideoStandard, + const NTV2FrameBufferFormat inFrameBufferFormat, + const bool inVANCenabled = false, + const bool in2Kby1080 = false, + const bool inWideVANC = false); + +AJAExport NTV2FormatDescriptor GetFormatDescriptor (const NTV2VideoFormat inVideoFormat, + const NTV2FrameBufferFormat inFrameBufferFormat, + const bool inVANCenabled = false, + const bool inWideVANC = false); +#endif // !defined (NTV2_DEPRECATE_12_6) + +/** + @brief Unpacks a line of NTV2_FBF_10BIT_YCBCR video into 16-bit-per-component YUV data. + @param[in] pIn10BitYUVLine A valid, non-NULL pointer to the start of the line that contains the packed NTV2_FBF_10BIT_YCBCR data + to be converted. + @param[in] inFormatDesc Describes the raster. + @param[out] out16BitYUVLine Receives the unpacked 16-bit-per-component YUV data. The sequence is cleared before filling. + The UWord sequence will be Cb0, Y0, Cr0, Y1, Cb1, Y2, Cr1, Y3, Cb2, Y4, Cr2, Y5, . . . + @return True if successful; otherwise false. +**/ +AJAExport bool UnpackLine_10BitYUVtoUWordSequence (const void * pIn10BitYUVLine, const NTV2FormatDescriptor & inFormatDesc, UWordSequence & out16BitYUVLine); + + +#if !defined (NTV2_DEPRECATE) + extern AJAExport const NTV2FormatDescriptor formatDescriptorTable [NTV2_NUM_STANDARDS] [NTV2_FBF_NUMFRAMEBUFFERFORMATS]; +#endif // !defined (NTV2_DEPRECATE) + + +#endif // NTV2FORMATDESC_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2konaflashprogram.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2konaflashprogram.h new file mode 100644 index 0000000..ac74490 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2konaflashprogram.h @@ -0,0 +1,217 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2konaflashprogram.h + @brief Declares the CNTV2KonaFlashProgram class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef NTV2KONAFLASHPROGRAM_H +#define NTV2KONAFLASHPROGRAM_H + +#include "ntv2card.h" +#include +#include +#include +#include +#include +#include +#include +#include "ntv2debug.h" +#include "ntv2mcsfile.h" +#include "ntv2spiinterface.h" +#include "ntv2bitfile.h" + +#define MAXBITFILE_HEADERSIZE 512 +#define MAXMCSINFOSIZE 256 +#define MAXMCSLICENSESIZE 256 +#define MCS_STEPS 6 + +typedef enum +{ + MAIN_FLASHBLOCK, + FAILSAFE_FLASHBLOCK, + AUTO_FLASHBLOCK, + SOC1_FLASHBLOCK, + SOC2_FLASHBLOCK, + MAC_FLASHBLOCK, + MCS_INFO_BLOCK, + LICENSE_BLOCK +} FlashBlockID; + +typedef enum +{ + BANK_0, + BANK_1, + BANK_2, + BANK_3 +} BankSelect; + +struct MacAddr +{ + uint8_t mac[6]; + std::string AsString(void) const; +}; + + +class AJAExport CNTV2FlashProgress +{ + public: + static CNTV2FlashProgress & nullUpdater; + + CNTV2FlashProgress() {} + virtual ~CNTV2FlashProgress() {} + virtual bool UpdatePercentage (const size_t inPercentage) {(void) inPercentage; return true;} +}; // CNTV2PercentUpdater + + +class AJAExport CNTV2KonaFlashProgram : public CNTV2Card +{ +public: + CNTV2KonaFlashProgram(); + CNTV2KonaFlashProgram (const UWord boardNumber); + virtual ~CNTV2KonaFlashProgram(); + static std::string FlashBlockIDToString (const FlashBlockID inID, const bool inShortDisplay = false); // New in SDK 16.0 + +public: + virtual bool SetBoard (UWord boardNumber, uint32_t index = 0); + bool ReadHeader (FlashBlockID flashBlock); + bool ReadInfoString(); + bool SetBitFile (const std::string & inBitfileName, std::ostream & outMsgs, const FlashBlockID blockNumber = AUTO_FLASHBLOCK); // New in SDK 16.0 + bool SetMCSFile (const std::string & sMCSFileName); + std::string Program (bool fullVerify = false); + bool ProgramFromMCS(bool verify); + bool ProgramSOC(bool verify = true); + bool ProgramCustom (const std::string & sCustomFileName, const uint32_t addr, std::ostream & outMsgs); + bool EraseBlock (FlashBlockID blockNumber); + bool EraseChip (UWord chip = 0); + bool CreateSRecord (bool bChangeEndian); + bool CreateEDIDIntelRecord (); + void SetQuietMode (); + bool VerifyFlash (FlashBlockID flashBlockNumber, bool fullVerify = false); + bool ReadFlash (NTV2_POINTER & outBuffer, const FlashBlockID flashID, CNTV2FlashProgress & inFlashProgress = CNTV2FlashProgress::nullUpdater); // New in SDK 16.0 + bool SetBankSelect (BankSelect bankNumber); + bool SetFlashBlockIDBank(FlashBlockID blockID); + bool ROMHasBankSelect(); + uint32_t ReadBankSelect (); + bool SetMBReset(); + bool IsInstalledFWRunning (bool & outIsRunning, std::ostream & outErrorMsgs); + + std::string GetDesignName (void) const {return _parser.DesignName();} + std::string GetPartName (void) const {return _parser.PartName();} + std::string GetDate (void) const {return _parser.Date();} + std::string GetTime (void) const {return _parser.Time();} + const NTV2BitfileHeaderParser & Parser (void) const {return _parser;} + uint32_t GetNumBytes(void) const {return _numBytes;} + const std::string & GetMCSInfo (void) const {return _mcsInfo;} + void ParsePartitionFromFileLines(uint32_t address, uint16_t & partitionOffset); + bool CreateBankRecord(BankSelect bankID); + + bool ProgramMACAddresses(MacAddr * mac1, MacAddr * mac2); + bool ReadMACAddresses(MacAddr & mac1, MacAddr & mac2); + bool ProgramLicenseInfo(const std::string & licenseString); + bool ReadLicenseInfo(std::string & licenseString); + void DisplayData(uint32_t address, uint32_t len); + bool ProgramInfoFromString(std::string infoString); + bool FullProgram(std::vector & dataBuffer); + + int32_t NextMcsStep() {return ++_mcsStep;} + + bool WaitForFlashNOTBusy(); + bool ProgramFlashValue(uint32_t address, uint32_t value); + bool FastProgramFlash256(uint32_t address, uint32_t* buffer); + bool EraseSector(uint32_t sectorAddress); + bool CheckFlashErasedWithBlockID(FlashBlockID flashBlockNumber); + uint32_t ReadDeviceID(); + bool SetDeviceProperties(); + void DetermineFlashTypeAndBlockNumberFromFileName(const std::string & bitFileName); + static void SRecordOutput (const char *pSRecord); + + uint32_t GetSectorAddressForSector(FlashBlockID flashBlockNumber,uint32_t sectorNumber) + { + return GetBaseAddressForProgramming(flashBlockNumber)+(sectorNumber*_sectorSize); + } + + uint32_t GetBaseAddressForProgramming(FlashBlockID flashBlockNumber) + { + switch ( flashBlockNumber ) + { + default: + case MAIN_FLASHBLOCK: return _mainOffset; + case FAILSAFE_FLASHBLOCK: return _failSafeOffset; + case SOC1_FLASHBLOCK: return _soc1Offset; + case SOC2_FLASHBLOCK: return _soc2Offset; + case MAC_FLASHBLOCK: return _macOffset; + case MCS_INFO_BLOCK: return _mcsInfoOffset; + case LICENSE_BLOCK: return _licenseOffset; + } + + } + + uint32_t GetNumberOfSectors(FlashBlockID flashBlockNumber) + { + switch ( flashBlockNumber ) + { + default: + case MAIN_FLASHBLOCK: return _numSectorsMain; + case FAILSAFE_FLASHBLOCK: return _numSectorsFailSafe; + case SOC1_FLASHBLOCK: return _numSectorsSOC1; + case SOC2_FLASHBLOCK: return _numSectorsSOC2; + case MAC_FLASHBLOCK: return 1; + case MCS_INFO_BLOCK: return 1; + case LICENSE_BLOCK: return 1; + } + } + + bool VerifySOCPartition(FlashBlockID flashID, uint32_t FlashBlockOffset); + bool CheckAndFixMACs(); + bool MakeMACsFromSerial( const char *sSerialNumber, MacAddr *pMac1, MacAddr *pMac2 ); + +protected: + NTV2_POINTER _bitFileBuffer; + uint8_t * _customFileBuffer; + uint32_t _bitFileSize; + NTV2BitfileHeaderParser _parser; + std::string _bitFileName; + std::string _mcsInfo; + uint32_t _spiDeviceID; + uint32_t _flashSize; + uint32_t _bankSize; + uint32_t _sectorSize; + uint32_t _mainOffset; + uint32_t _failSafeOffset; + uint32_t _macOffset; + uint32_t _mcsInfoOffset; + uint32_t _licenseOffset; + uint32_t _soc1Offset; + uint32_t _soc2Offset; + uint32_t _numSectorsMain; + uint32_t _numSectorsSOC1; + uint32_t _numSectorsSOC2; + uint32_t _numSectorsFailSafe; + uint32_t _numBytes; + FlashBlockID _flashID; + uint32_t _deviceID; + bool _bQuiet; + int32_t _mcsStep; + CNTV2MCSfile _mcsFile; + std::vector _partitionBuffer; + uint32_t _failSafePadding; + CNTV2SpiFlash * _spiFlash; + + typedef enum { + READID_COMMAND = 0x9F, + WRITEENABLE_COMMAND = 0x06, + WRITEDISABLE_COMMAND = 0x04, + READSTATUS_COMMAND = 0x05, + WRITESTATUS_COMMAND = 0x01, + READFAST_COMMAND = 0x0B, + PAGEPROGRAM_COMMAND = 0x02, + SECTORERASE_COMMAND = 0xD8, + CHIPERASE_COMMAND = 0xC7, + BANKSELECT_COMMMAND = 0x17, + READBANKSELECT_COMMAND = 0x16 + } _FLASH_STUFF; + +}; // CNTV2KonaFlashProgram + +#endif // NTV2KONAFLASHPROGRAM_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2linuxdriverinterface.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2linuxdriverinterface.h new file mode 100644 index 0000000..3e661fe --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2linuxdriverinterface.h @@ -0,0 +1,165 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2linuxdriverinterface.h + @brief Declares the CNTV2LinuxDriverInterface class. + @copyright (C) 2003-2021 AJA Video Systems, Inc. +**/ +#ifndef NTV2LINUXDRIVERINTERFACE_H +#define NTV2LINUXDRIVERINTERFACE_H + +#include "ntv2driverinterface.h" +#include "ntv2linuxpublicinterface.h" +#include "ntv2devicefeatures.h" + +#include +#include +#include +#include + +#define CopyMemory(a,b,c) memcpy((a),(b),(c)) + +// oem dma: save locked pages in a stl::vector +#include +typedef std::vector DMA_LOCKED_VEC; + +/** + @brief Linux implementation of CNTV2DriverInterface. +**/ +class CNTV2LinuxDriverInterface : public CNTV2DriverInterface +{ + public: + CNTV2LinuxDriverInterface(); + AJA_VIRTUAL ~CNTV2LinuxDriverInterface(); + + AJA_VIRTUAL bool WriteRegister (const ULWord inRegNum, const ULWord inValue, const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0); + AJA_VIRTUAL bool ReadRegister (const ULWord inRegNum, ULWord & outValue, const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0); +#if !defined(NTV2_DEPRECATE_14_3) + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadRegister (const ULWord inRegNum, ULWord * pOutValue, const ULWord inRegMask = 0xFFFFFFFF, const ULWord inRegShift = 0x0)) + {return pOutValue && ReadRegister(inRegNum, *pOutValue, inRegMask, inRegShift);} +#endif // !defined(NTV2_DEPRECATE_14_3) + + AJA_VIRTUAL bool RestoreHardwareProcampRegisters (void); + + AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine, + const bool inIsRead, + const ULWord inFrameNumber, + ULWord * pFrameBuffer, + const ULWord inOffsetBytes, + const ULWord inTotalByteCount, + const bool inSynchronous = true); + + AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine, + const bool inIsRead, + const ULWord inFrameNumber, + ULWord * pFrameBuffer, + const ULWord inCardOffsetBytes, + const ULWord inTotalByteCount, + const ULWord inNumSegments, + const ULWord inHostPitchPerSeg, + const ULWord inCardPitchPerSeg, + const bool inSynchronous = true); + + AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine, + const NTV2Channel inDMAChannel, + const bool inTarget, + const ULWord inFrameNumber, + const ULWord inCardOffsetBytes, + const ULWord inByteCount, + const ULWord inNumSegments, + const ULWord inSegmentHostPitch, + const ULWord inSegmentCardPitch, + const PCHANNEL_P2P_STRUCT & inP2PData); + + AJA_VIRTUAL bool ConfigureSubscription (const bool bSubscribe, const INTERRUPT_ENUMS eInterruptType, PULWord & hSubcription) + {(void)bSubscribe; (void)eInterruptType; (void)hSubcription; return true;} + AJA_VIRTUAL bool ConfigureInterrupt (const bool bEnable, const INTERRUPT_ENUMS eInterruptType); + AJA_VIRTUAL bool GetInterruptCount (const INTERRUPT_ENUMS eInterrupt, ULWord & outCount); + AJA_VIRTUAL bool WaitForInterrupt (INTERRUPT_ENUMS eInterrupt, ULWord timeOutMs = 68); // default of 68 ms timeout is enough time for 2K at 14.98 HZ + + AJA_VIRTUAL bool AutoCirculate (AUTOCIRCULATE_DATA &autoCircData); + AJA_VIRTUAL bool NTV2Message (NTV2_HEADER * pInOutMessage); + AJA_VIRTUAL bool ControlDriverDebugMessages(NTV2_DriverDebugMessageSet msgSet, + bool enable); + AJA_VIRTUAL bool HevcSendMessage(HevcMessageHeader* pMessage); + + AJA_VIRTUAL bool SetupBoard(void); + + // Driver allocated buffer (DMA performance enhancement, requires + // bigphysarea patch to kernel) + AJA_VIRTUAL bool MapDMADriverBuffer(); + AJA_VIRTUAL bool UnmapDMADriverBuffer(); + + AJA_VIRTUAL bool DmaReadFrameDriverBuffer ( NTV2DMAEngine DMAEngine, ULWord frameNumber, unsigned long dmaBufferFrame, + ULWord bytes, + ULWord downSample, + ULWord linePitch, + ULWord poll); + + AJA_VIRTUAL bool DmaReadFrameDriverBuffer ( NTV2DMAEngine DMAEngine, ULWord frameNumber, unsigned long dmaBufferFrame, + ULWord offsetSrc, + ULWord offsetDest, + ULWord bytes, + ULWord downSample, + ULWord linePitch, + ULWord poll); + + AJA_VIRTUAL bool DmaWriteFrameDriverBuffer (NTV2DMAEngine DMAEngine, ULWord frameNumber, unsigned long dmaBufferFrame, + ULWord bytes, ULWord poll); + AJA_VIRTUAL bool DmaWriteFrameDriverBuffer (NTV2DMAEngine DMAEngine, ULWord frameNumber, unsigned long dmaBufferFrame, + ULWord offsetSrc, ULWord offsetDest, ULWord bytes, ULWord poll); + + // User allocated buffer methods. Not as fast as driverbuffer methods, but no kernel patch required. + AJA_VIRTUAL bool DmaWriteWithOffsets (NTV2DMAEngine DMAEngine, ULWord frameNumber, ULWord * pFrameBuffer, + ULWord offsetSrc, ULWord offsetDest, ULWord bytes); + AJA_VIRTUAL bool DmaReadWithOffsets (NTV2DMAEngine DMAEngine, ULWord frameNumber, ULWord * pFrameBuffer, + ULWord offsetSrc, ULWord offsetDest, ULWord bytes); + +public: +#if !defined(NTV2_DEPRECATE_13_0) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetRelativeVideoPlaybackDelay (ULWord frmDelay)) {(void)frmDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetRelativeVideoPlaybackDelay (ULWord* frmDelay)){(void)frmDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAudioPlaybackPinDelay (ULWord msDelay)) {(void)msDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioPlaybackPinDelay (ULWord* msDelay)) {(void)msDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAudioRecordPinDelay (ULWord msDelay)) {(void)msDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioRecordPinDelay (ULWord* msDelay)) {(void)msDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. +#endif // !defined(NTV2_DEPRECATE_13_0) +#if !defined(NTV2_DEPRECATE_16_0) + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool GetStreamingApplication(ULWord & outAppType, int32_t & outPID)) {return CNTV2DriverInterface::GetStreamingApplication(outAppType,outPID);} ///< @deprecated Deprecated starting in SDK 16.0. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool GetStreamingApplication(ULWord * pAppType, int32_t * pPID)) {return pAppType && pPID ? CNTV2DriverInterface::GetStreamingApplication(*pAppType,*pPID) : false;} ///< @deprecated Deprecated starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapFrameBuffers(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool UnmapFrameBuffers(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapRegisters(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool UnmapRegisters(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool GetBA0MemorySize(ULWord* memSize)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool GetBA1MemorySize(ULWord* memSize)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool GetBA2MemorySize(ULWord* memSize)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool GetBA4MemorySize(ULWord* memSize)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapXena2Flash(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool UnmapXena2Flash(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapDNXRegisters(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool UnmapDNXRegisters(void));///< @deprecated Obsolete starting in SDK 16.0. +#endif // !defined(NTV2_DEPRECATE_16_0) + AJA_VIRTUAL bool GetDMADriverBufferPhysicalAddress(ULWord* physAddr); // Supported! + AJA_VIRTUAL bool GetDMADriverBufferAddress(ULWord** pDMADriverBuffer); // Supported! + AJA_VIRTUAL bool GetDMANumDriverBuffers(ULWord* pNumDmaDriverBuffers); // Supported! + AJA_VIRTUAL bool SetAudioOutputMode(NTV2_GlobalAudioPlaybackMode mode); // Supported! + AJA_VIRTUAL bool GetAudioOutputMode(NTV2_GlobalAudioPlaybackMode* mode);// Supported! + + +protected: // PRIVATE METHODS + AJA_VIRTUAL bool OpenLocalPhysical (const UWord inDeviceIndex); ///< @brief Opens the local/physical device connection. + AJA_VIRTUAL bool CloseLocalPhysical (void); + +protected: // INSTANCE DATA + std::string _bitfileDirectory; + HANDLE _hDevice; +#if !defined(NTV2_DEPRECATE_16_0) + ULWord * _pDMADriverBufferAddress; + ULWord _BA0MemorySize; + ULWord * _pDNXRegisterBaseAddress; + ULWord _BA2MemorySize; + ULWord _BA4MemorySize; // XENA2 only +#endif // !defined(NTV2_DEPRECATE_16_0) +}; // CNTV2LinuxDriverInterface + +#endif // NTV2LINUXDRIVERINTERFACE_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2linuxpublicinterface.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2linuxpublicinterface.h new file mode 100644 index 0000000..c07a407 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2linuxpublicinterface.h @@ -0,0 +1,254 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2linuxpublicinterface.h + @brief Types and defines shared between NTV2 user application interface and Linux device driver. + @copyright (C) 2004-2021 AJA Video Systems, Inc. +**/ +#ifndef NTV2LINUXPUBLICINTERFACE_H +#define NTV2LINUXPUBLICINTERFACE_H + +#include "ajatypes.h" +#include "ntv2enums.h" +#include "ntv2publicinterface.h" + +#define NTV2_DEVICE_TYPE 0xBB + +#define NTV2_LINUX_DRIVER_VERSION NTV2DriverVersionEncodedBuildType | NTV2DriverVersionEncode(AJA_NTV2_SDK_VERSION_MAJOR, AJA_NTV2_SDK_VERSION_MINOR, AJA_NTV2_SDK_VERSION_POINT, AJA_NTV2_SDK_BUILD_NUMBER) + + +// Read,Write IOCTL's + // Input: REGISTER_ACCESS structure + // Output: NONE +#define IOCTL_NTV2_WRITE_REGISTER \ + _IOW(NTV2_DEVICE_TYPE, 48, REGISTER_ACCESS) + + // Input: REGISTER_ACCESS structure + // Output: REGISTER_ACCESS structure +#define IOCTL_NTV2_READ_REGISTER \ + _IOWR(NTV2_DEVICE_TYPE, 49 , REGISTER_ACCESS) + +// DMA Ioctls use METHOD_IN_DIRECT ... thus special macro NTV2_MAKE_IN_DIRECT_IOCTL +#define IOCTL_NTV2_DMA_READ_FRAME \ + _IOW(NTV2_DEVICE_TYPE, 146,NTV2_DMA_CONTROL_STRUCT) + +#define IOCTL_NTV2_DMA_WRITE_FRAME \ + _IOW(NTV2_DEVICE_TYPE, 147,NTV2_DMA_CONTROL_STRUCT) + +#define IOCTL_NTV2_DMA_READ_FRAME_SEGMENT \ + _IOW(NTV2_DEVICE_TYPE, 148,NTV2_DMA_SEGMENT_CONTROL_STRUCT) + +#define IOCTL_NTV2_DMA_WRITE_FRAME_SEGMENT \ + _IOW(NTV2_DEVICE_TYPE, 149,NTV2_DMA_SEGMENT_CONTROL_STRUCT) + +// DMA Ioctls use METHOD_IN_DIRECT ... thus special macro NTV2_MAKE_IN_DIRECT_IOCTL +#define IOCTL_NTV2_DMA_READ \ + _IOW(NTV2_DEVICE_TYPE, 175,NTV2_DMA_CONTROL_STRUCT) + +#define IOCTL_NTV2_DMA_WRITE \ + _IOW(NTV2_DEVICE_TYPE, 176,NTV2_DMA_CONTROL_STRUCT) + +#define IOCTL_NTV2_DMA_READ_SEGMENT \ + _IOW(NTV2_DEVICE_TYPE, 177,NTV2_DMA_SEGMENT_CONTROL_STRUCT) + +#define IOCTL_NTV2_DMA_WRITE_SEGMENT \ + _IOW(NTV2_DEVICE_TYPE, 178,NTV2_DMA_SEGMENT_CONTROL_STRUCT) + +#define IOCTL_NTV2_DMA_P2P \ + _IOW(NTV2_DEVICE_TYPE, 179,NTV2_DMA_P2P_CONTROL_STRUCT) + + +// Interrupt control (enable, disable, get count) +// +#define IOCTL_NTV2_INTERRUPT_CONTROL \ + _IOW(NTV2_DEVICE_TYPE, 220, NTV2_INTERRUPT_CONTROL_STRUCT) + +// Wait for interrupt +// +#define IOCTL_NTV2_WAITFOR_INTERRUPT \ + _IOW(NTV2_DEVICE_TYPE, 221, NTV2_WAITFOR_INTERRUPT_STRUCT) + +// Control debug messages. +// +#define IOCTL_NTV2_CONTROL_DRIVER_DEBUG_MESSAGES \ + _IOW(NTV2_DEVICE_TYPE, 230, NTV2_CONTROL_DRIVER_DEBUG_MESSAGES_STRUCT) + +// Put board interrupts and LEDs in known state +// +#define IOCTL_NTV2_SETUP_BOARD \ + _IO(NTV2_DEVICE_TYPE, 231) + +// Reload procamp hardware registers from software copy after ADC chip reset +#define IOCTL_NTV2_RESTORE_HARDWARE_PROCAMP_REGISTERS \ + _IO(NTV2_DEVICE_TYPE, 232) + +// +// Downloaded Xilinx bitfile management IOCTLs +// +// +#define IOCTL_NTV2_SET_BITFILE_INFO \ + _IOWR(NTV2_DEVICE_TYPE, 240, BITFILE_INFO_STRUCT) + +#define IOCTL_NTV2_GET_BITFILE_INFO \ + _IOWR(NTV2_DEVICE_TYPE, 241, BITFILE_INFO_STRUCT) + +// +// Autocirculate IOCTLs +// +// +#define IOCTL_NTV2_AUTOCIRCULATE_CONTROL \ + _IOW(NTV2_DEVICE_TYPE, 250, AUTOCIRCULATE_DATA) + +#define IOCTL_NTV2_AUTOCIRCULATE_STATUS \ + _IOWR(NTV2_DEVICE_TYPE, 251, AUTOCIRCULATE_STATUS_STRUCT) + +#define IOCTL_NTV2_AUTOCIRCULATE_FRAMESTAMP \ + _IOWR(NTV2_DEVICE_TYPE, 252, AUTOCIRCULATE_FRAME_STAMP_COMBO_STRUCT) + +#define IOCTL_NTV2_AUTOCIRCULATE_TRANSFER \ + _IOWR(NTV2_DEVICE_TYPE, 253, AUTOCIRCULATE_TRANSFER_COMBO_STRUCT) + +#define IOCTL_NTV2_AUTOCIRCULATE_CAPTURETASK \ + _IOWR(NTV2_DEVICE_TYPE, 254, AUTOCIRCULATE_FRAME_STAMP_COMBO_STRUCT) + +#define IOCTL_AJANTV2_MESSAGE \ + _IOWR(NTV2_DEVICE_TYPE, 255, AUTOCIRCULATE_STATUS) + +// +// UART Write/Read IOCTLs +// +#define IOCTL_NTV2_WRITE_UART_TX \ + _IOWR(NTV2_DEVICE_TYPE, 201, NTV2_UART_STRUCT) + +#if 0 /* not yet */ +#define IOCTL_NTV2_READ_UART_RX \ + _IOWR(NTV2_DEVICE_TYPE, 202, NTV2_UART_STRUCT) +#endif + + +// When adding new IOCTLs, note that the number is only 8 bits. +// So don't go above 255. + +// Structure used to request an address range +typedef struct _MAP_MEMORY { + void* Address; + ULWord Length; +} MAP_MEMORY, *PMAP_MEMORY; + + +typedef struct { + ULWord RegisterNumber; + ULWord RegisterValue; + ULWord RegisterMask; + ULWord RegisterShift; +} REGISTER_ACCESS, *PREGISTER_ACCESS; + +// Virtual registers +#include "ntv2virtualregisters.h" + +// Structure used to request a DMA transfer +typedef struct +{ + NTV2DMAEngine engine; + NTV2Channel dmaChannel; + ULWord frameNumber; // 0-NUM_FRAMEBUFFERS-1 + PULWord frameBuffer; // if small integer, then interpreted as DMA driver buffer # in + // driver(i.e. GetDMABufferAddress) + ULWord frameOffsetSrc; // For Audio DMA, we want to write from a specific location within the 'frame' + ULWord frameOffsetDest; // For Audio DMA, we want to write to a specific location within the 'frame' + ULWord numBytes; // number of bytes to transfer + ULWord downSample; // applies only to KHD, used for 1/4 size preview + ULWord linePitch; // applies only if downSample true, gets every linePitch lines + ULWord poll; // if poll = true it doesn't block, needs to be checked manually +} NTV2_DMA_CONTROL_STRUCT, *P_NTV2_DMA_CONTROL_STRUCT; + +// Structure used to request a DMA transfer +typedef struct +{ + NTV2DMAEngine engine; + NTV2Channel dmaChannel; + ULWord frameNumber; // 0-NUM_FRAMEBUFFERS-1 + PULWord frameBuffer; // if small integer, then interpreted as DMA driver buffer # in + // driver(i.e. GetDMABufferAddress) + ULWord frameOffsetSrc; // For Audio DMA, we want to write from a specific location within the 'frame' + ULWord frameOffsetDest; // For Audio DMA, we want to write to a specific location within the 'frame' + ULWord numBytes; // number of bytes to transfer + ULWord poll; // if poll = true it doesn't block, needs to be checked manually + ULWord videoNumSegments; // partial segment transfer - number of segment of size numBytes + ULWord videoSegmentHostPitch; // + ULWord videoSegmentCardPitch; // +} NTV2_DMA_SEGMENT_CONTROL_STRUCT, *P_NTV2_DMA_SEGMENT_CONTROL_STRUCT; + +// Structure used to request a P2P transfer +typedef struct { + bool bRead; // True for a Target operation, false for a Transfer + NTV2DMAEngine dmaEngine; // engine for transfer + NTV2Channel dmaChannel; // frame buffer channel for message + ULWord ulFrameNumber; // frame number for target/transfer + ULWord ulFrameOffset; // offset into frame to start transfer + ULWord ulVidNumBytes; // transfer size in bytes + ULWord ulVidNumSegments; // number of video segments to transfer + ULWord ulVidSegmentHostPitch; // segment host pitch + ULWord ulVidSegmentCardPitch; // segment card pitch + ULWord64 ullVideoBusAddress; // frame buffer bus address + ULWord64 ullMessageBusAddress; // message register bus address (0 if not required) + ULWord ulVideoBusSize; // size of the video aperture (bytes) + ULWord ulMessageData; // message data (write to message bus address to complete video transfer) +} NTV2_DMA_P2P_CONTROL_STRUCT, *P_NTV2_DMA_P2P_CONTROL_STRUCT; + +// Structure to enable/disable interrupts +typedef struct +{ + INTERRUPT_ENUMS eInterruptType; // Which interrupt to enable/disable. Not all interrupts supported. + ULWord enable; // 0: disable, nonzero: enable + ULWord interruptCount; // In: interrupt type. Out: interrupt count +} NTV2_INTERRUPT_CONTROL_STRUCT, *P_NTV2_INTERRUPT_CONTROL_STRUCT; + +// Structure to wait for interrupts +typedef struct +{ + INTERRUPT_ENUMS eInterruptType; // Which interrupt to wait on. + ULWord timeOutMs; // Timeout in milliseconds + ULWord success; // On return, nonzero if interrupt occured +} NTV2_WAITFOR_INTERRUPT_STRUCT, *P_NTV2_WAITFOR_INTERRUPT_STRUCT; + +// Structure to control driver debug messages +typedef struct +{ + NTV2_DriverDebugMessageSet msgSet; // Which set of message to turn on/off + bool enable; // If true, turn messages on + ULWord success;// On return, nonzero on failure +} NTV2_CONTROL_DRIVER_DEBUG_MESSAGES_STRUCT, *P_NTV2_CONTROL_DRIVER_DEBUG_MESSAGES_STRUCT; + +typedef struct +{ + NTV2Crosspoint channelSpec;// Which channel + AUTOCIRCULATE_TRANSFER_STRUCT acTransfer; // Transfer ctl + AUTOCIRCULATE_TRANSFER_STATUS_STRUCT acStatus; // Results + NTV2RoutingTable acXena2RoutingTable; // Xena2 crosspoint table + AUTOCIRCULATE_TASK_STRUCT acTask; // driver tasks +} AUTOCIRCULATE_TRANSFER_COMBO_STRUCT, *P_AUTOCIRCULATE_TRANSFER_COMBO_STRUCT; + +typedef struct +{ + FRAME_STAMP_STRUCT acFrameStamp; // frame stamp + AUTOCIRCULATE_TASK_STRUCT acTask; // driver tasks +} AUTOCIRCULATE_FRAME_STAMP_COMBO_STRUCT, *P_AUTOCIRCULATE_FRAME_STAMP_COMBO_STRUCT; + +/* +typedef struct +{ + ULWord requestedByteCount; // number of bytes to write OR MAX number of bytes to read + ULWord actualByteCount; // actual number of byte successfully written or read + UByte bytes[]; // WRITE: an array of bytes to write of size requestedByteCount + // READ: an empty array of MAX size requestedByteCount into which the read goes +} NTV2_UART_STRUCT, *P_NTV2_UART_STRUCT; +*/ + +// Driver buffers are numbered 0 .. whatever +#define ntv2DMADriverbuffer(n) (n) + + +#define IOCTL_HEVC_MESSAGE \ + _IOWR(NTV2_DEVICE_TYPE, 120, unsigned long) + +#endif diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2m31enums.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2m31enums.h new file mode 100644 index 0000000..12e7228 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2m31enums.h @@ -0,0 +1,371 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2m31enums.h + @brief Enumerations for controlling NTV2 devices with m31 HEVC encoders. + @copyright (C) 2015-2021 AJA Video Systems, Inc. All rights reserved. +**/ + + +#ifndef NTV2M31ENUMS_H +#define NTV2M31ENUMS_H + +typedef enum +{ + // File presets + M31_FILE_720X480_420_8_5994i, // 0 + M31_FILE_720X480_420_8_5994p, // 1 + M31_FILE_720X480_420_8_60i, // 2 + M31_FILE_720X480_420_8_60p, // 3 + M31_FILE_720X480_422_10_5994i, // 4 + M31_FILE_720X480_422_10_5994p, // 5 + M31_FILE_720X480_422_10_60i, // 6 + M31_FILE_720X480_422_10_60p, // 7 + + M31_FILE_720X576_420_8_50i, // 8 + M31_FILE_720X576_420_8_50p, // 9 + M31_FILE_720X576_422_10_50i, // 10 + M31_FILE_720X576_422_10_50p, // 11 + + M31_FILE_1280X720_420_8_2398p, // 12 + M31_FILE_1280X720_420_8_24p, // 13 + M31_FILE_1280X720_420_8_25p, // 14 + M31_FILE_1280X720_420_8_2997p, // 15 + M31_FILE_1280X720_420_8_30p, // 16 + M31_FILE_1280X720_420_8_50p, // 17 + M31_FILE_1280X720_420_8_5994p, // 18 + M31_FILE_1280X720_420_8_60p, // 19 + + M31_FILE_1280X720_422_10_2398p, // 20 + M31_FILE_1280X720_422_10_24p, // 21 + M31_FILE_1280X720_422_10_25p, // 22 + M31_FILE_1280X720_422_10_2997p, // 23 + M31_FILE_1280X720_422_10_30p, // 24 + M31_FILE_1280X720_422_10_50p, // 25 + M31_FILE_1280X720_422_10_5994p, // 26 + M31_FILE_1280X720_422_10_60p, // 27 + + M31_FILE_1920X1080_420_8_2398p, // 28 + M31_FILE_1920X1080_420_8_24p, // 29 + M31_FILE_1920X1080_420_8_25p, // 30 + M31_FILE_1920X1080_420_8_2997p, // 31 + M31_FILE_1920X1080_420_8_30p, // 32 + M31_FILE_1920X1080_420_8_50i, // 33 + M31_FILE_1920X1080_420_8_50p, // 34 + M31_FILE_1920X1080_420_8_5994i, // 35 + M31_FILE_1920X1080_420_8_5994p, // 36 + M31_FILE_1920X1080_420_8_60i, // 37 + M31_FILE_1920X1080_420_8_60p, // 38 + + M31_FILE_1920X1080_422_10_2398p, // 39 + M31_FILE_1920X1080_422_10_24p, // 40 + M31_FILE_1920X1080_422_10_25p, // 41 + M31_FILE_1920X1080_422_10_2997p, // 42 + M31_FILE_1920X1080_422_10_30p, // 43 + M31_FILE_1920X1080_422_10_50i, // 44 + M31_FILE_1920X1080_422_10_50p, // 45 + M31_FILE_1920X1080_422_10_5994i, // 46 + M31_FILE_1920X1080_422_10_5994p, // 47 + M31_FILE_1920X1080_422_10_60i, // 48 + M31_FILE_1920X1080_422_10_60p, // 49 + + M31_FILE_2048X1080_420_8_2398p, // 50 + M31_FILE_2048X1080_420_8_24p, // 51 + M31_FILE_2048X1080_420_8_25p, // 52 + M31_FILE_2048X1080_420_8_2997p, // 53 + M31_FILE_2048X1080_420_8_30p, // 54 + M31_FILE_2048X1080_420_8_50p, // 55 + M31_FILE_2048X1080_420_8_5994p, // 56 + M31_FILE_2048X1080_420_8_60p, // 57 + + M31_FILE_2048X1080_422_10_2398p, // 58 + M31_FILE_2048X1080_422_10_24p, // 59 + M31_FILE_2048X1080_422_10_25p, // 60 + M31_FILE_2048X1080_422_10_2997p, // 61 + M31_FILE_2048X1080_422_10_30p, // 62 + M31_FILE_2048X1080_422_10_50p, // 63 + M31_FILE_2048X1080_422_10_5994p, // 64 + M31_FILE_2048X1080_422_10_60p, // 65 + + M31_FILE_3840X2160_420_8_2398p, // 66 + M31_FILE_3840X2160_420_8_24p, // 67 + M31_FILE_3840X2160_420_8_25p, // 68 + M31_FILE_3840X2160_420_8_2997p, // 69 + M31_FILE_3840X2160_420_8_30p, // 70 + M31_FILE_3840X2160_420_8_50p, // 71 + M31_FILE_3840X2160_420_8_5994p, // 72 + M31_FILE_3840X2160_420_8_60p, // 73 + + M31_FILE_3840X2160_420_10_50p, // 74 + M31_FILE_3840X2160_420_10_5994p, // 75 + M31_FILE_3840X2160_420_10_60p, // 76 + + M31_FILE_3840X2160_422_8_2398p, // 77 + M31_FILE_3840X2160_422_8_24p, // 78 + M31_FILE_3840X2160_422_8_25p, // 79 + M31_FILE_3840X2160_422_8_2997p, // 80 + M31_FILE_3840X2160_422_8_30p, // 81 + M31_FILE_3840X2160_422_8_50p, // 82 + M31_FILE_3840X2160_422_8_5994p, // 83 + M31_FILE_3840X2160_422_8_60p, // 84 + + M31_FILE_3840X2160_422_10_2398p, // 85 + M31_FILE_3840X2160_422_10_24p, // 86 + M31_FILE_3840X2160_422_10_25p, // 87 + M31_FILE_3840X2160_422_10_2997p, // 88 + M31_FILE_3840X2160_422_10_30p, // 89 + M31_FILE_3840X2160_422_10_50p, // 90 + M31_FILE_3840X2160_422_10_5994p, // 91 + M31_FILE_3840X2160_422_10_60p, // 92 + + M31_FILE_4096X2160_420_10_5994p, // 93 + M31_FILE_4096X2160_420_10_60p, // 94 + M31_FILE_4096X2160_422_10_50p, // 95 + M31_FILE_4096X2160_422_10_5994p_IF, // 96 + M31_FILE_4096X2160_422_10_60p_IF, // 97 + + // Vif presets + M31_VIF_720X480_420_8_5994i, // 98 + M31_VIF_720X480_420_8_5994p, // 99 + M31_VIF_720X480_420_8_60i, // 100 + M31_VIF_720X480_420_8_60p, // 101 + M31_VIF_720X480_422_10_5994i, // 102 + M31_VIF_720X480_422_10_5994p, // 103 + M31_VIF_720X480_422_10_60i, // 104 + M31_VIF_720X480_422_10_60p, // 105 + + M31_VIF_720X576_420_8_50i, // 106 + M31_VIF_720X576_420_8_50p, // 107 + M31_VIF_720X576_422_10_50i, // 108 + M31_VIF_720X576_422_10_50p, // 109 + + M31_VIF_1280X720_420_8_50p, // 110 + M31_VIF_1280X720_420_8_5994p, // 111 + M31_VIF_1280X720_420_8_60p, // 112 + M31_VIF_1280X720_422_10_50p, // 113 + M31_VIF_1280X720_422_10_5994p, // 114 + M31_VIF_1280X720_422_10_60p, // 115 + + M31_VIF_1920X1080_420_8_50i, // 116 + M31_VIF_1920X1080_420_8_50p, // 117 + M31_VIF_1920X1080_420_8_5994i, // 118 + M31_VIF_1920X1080_420_8_5994p, // 119 + M31_VIF_1920X1080_420_8_60i, // 120 + M31_VIF_1920X1080_420_8_60p, // 121 + M31_VIF_1920X1080_420_10_50i, // 122 + M31_VIF_1920X1080_420_10_50p, // 123 + M31_VIF_1920X1080_420_10_5994i, // 124 + M31_VIF_1920X1080_420_10_5994p, // 125 + M31_VIF_1920X1080_420_10_60i, // 126 + M31_VIF_1920X1080_420_10_60p, // 127 + M31_VIF_1920X1080_422_10_5994i, // 128 + M31_VIF_1920X1080_422_10_5994p, // 129 + M31_VIF_1920X1080_422_10_60i, // 130 + M31_VIF_1920X1080_422_10_60p, // 131 + + M31_VIF_3840X2160_420_8_30p, // 132 + M31_VIF_3840X2160_420_8_50p, // 133 + M31_VIF_3840X2160_420_8_5994p, // 134 + M31_VIF_3840X2160_420_8_60p, // 135 + M31_VIF_3840X2160_420_10_50p, // 136 + M31_VIF_3840X2160_420_10_5994p, // 137 + M31_VIF_3840X2160_420_10_60p, // 138 + + M31_VIF_3840X2160_422_10_30p, // 139 + M31_VIF_3840X2160_422_10_50p, // 140 + M31_VIF_3840X2160_422_10_5994p, // 141 + M31_VIF_3840X2160_422_10_60p, // 142 + + M31_NUMVIDEOPRESETS +} M31VideoPreset; + + +#define IS_VALID_M31VideoPreset(__s__) ((__s__) >= M31_FILE_720X480_420_8_5994i && (__s__) < M31_NUMVIDEOPRESETS) + +typedef enum +{ + M31_VIRTUAL_CH0, + M31_VIRTUAL_CH1, + M31_VIRTUAL_CH2, + M31_VIRTUAL_CH3, + M31_VIRTUAL_CH4, + M31_VIRTUAL_CH5, + M31_VIRTUAL_CH6, + M31_VIRTUAL_CH7, + + M31_VIRTUAL_CH8, + M31_VIRTUAL_CH9, + M31_VIRTUAL_CH10, + M31_VIRTUAL_CH11, + M31_VIRTUAL_CH12, + M31_VIRTUAL_CH13, + M31_VIRTUAL_CH14, + M31_VIRTUAL_CH15, + + M31_VIRTUAL_CH16, + M31_VIRTUAL_CH17, + M31_VIRTUAL_CH18, + M31_VIRTUAL_CH19, + M31_VIRTUAL_CH20, + M31_VIRTUAL_CH21, + M31_VIRTUAL_CH22, + M31_VIRTUAL_CH23, + + M31_VIRTUAL_CH24, + M31_VIRTUAL_CH25, + M31_VIRTUAL_CH26, + M31_VIRTUAL_CH27, + M31_VIRTUAL_CH28, + M31_VIRTUAL_CH29, + M31_VIRTUAL_CH30, + M31_VIRTUAL_CH31 +} M31VirtualChannel; + +#define IS_VALID_M31VirtualChannel(__s__) ((__s__) >= M31_VIRTUAL_CH0 && (__s__) <= M31_VIRTUAL_CH31) + +typedef enum +{ + M31_CH0, + M31_CH1, + M31_CH2, + M31_CH3 +} M31Channel; + +#define IS_VALID_M31Channel(__s__) ((__s__) >= M31_CH0 && (__s__) <= M31_CH3) + +typedef enum +{ + M31_1920X1080i = 0, // SMPTE274M + M31_1280X720p = 2, // SMPTE296M-2001 + M31_720X480i = 4, // ITU-R BT.656.4 + M31_720X576i = 5, // ITU-R BT.656.4 + M31_720X480p = 8, // SMPTE293M + M31_720X576p = 9, // ITU-REC1358 + M31_1920X1080p = 30, // SMPTE274M + M31_3840X2160_SMPTE435M = 50, // Square Division + M31_3840X2160_SMPTE274M = 51, // 2-Sample Interleave + M31_ARBITRARY_RESOLUTION = 255 // 2-Sample Interleave + +} M31VideoFormat; + +typedef enum +{ + M31_READCC, + M31_SETCC, + M31_WRITECCPLUS, + M31_READCCPLUS, + M31_PUSH +} M31CC; + +typedef enum +{ + M31_NOTUSE, + M31_4K2K, + M31_FULLHD, + M31_HD, + M31_SD +} M31ResoType; + +#define IS_VALID_M31ResoType(__s__) ((__s__) >= M31_NOTUSE && (__s__) <= M31_SD) + +typedef enum +{ + M31_YCSeparate, + M31_YCMultiplex +} M31YCMode; + +typedef enum +{ + M31_RobustModeStop, + M31_RobustModeBlue, + M31_RobustModeColor +} M31RobustMode; + +typedef enum +{ + M31_Slave, + M31_Master +} M31SyncMasterMode; + +typedef enum +{ + M31_DefaultPort = 0, + M31_PortA = 1, + M31_PortB = 2, + M31_PortC = 4, + M31_PortD = 8 +} M31InputPort; + +typedef enum +{ + M31_SourceVI, + M31_SourceVEI +} M31SourceVI; + +typedef enum +{ + M31_SourceVA, + M31_SourceVAReserved +} M31SourceVA; + +typedef enum +{ + M31_ChromaMono, + M31_Chroma420, + M31_Chroma422 +} M31ChromaFormat; + +typedef enum +{ + M31_BitDepth8 = 8, + M31_BitDepth9 = 9, + M31_BitDepth10 = 10 +} M31BitDepth; + +typedef enum +{ + M31_PTSModeAuto, + M31_PTSModeHost +} M31PTSMode; + +typedef enum +{ + M31_Progressive, + M31_Interlace +} M31ScanMode; + +typedef enum +{ + M31_EncodeModeDefault, + M31_EncodeModeMode1, + M31_EncodeModeMode2 +} M31EncodeMode; + +typedef enum +{ + M31_ProfileMain = 1, + M31_ProfileMain10 = 2, + M31_ProfileMainSP = 3, + M31_Profile422 = 4 +} M31Profile; + +typedef enum +{ + M31_MainTier, + M31_HighTier +} M31Tier; + +typedef enum +{ + M31_FrameRateUD = 0, + M31_FrameRate2398 = 1, + M31_FrameRate24 = 2, + M31_FrameRate25 = 3, + M31_FrameRate2997 = 4, + M31_FrameRate30 = 5, + M31_FrameRate50 = 6, + M31_FrameRate5994 = 7, + M31_FrameRate60 = 8 +} M31FrameRate; + +#endif //NTV2M31ENUMS_H + diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2m31publicinterface.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2m31publicinterface.h new file mode 100644 index 0000000..03e4412 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2m31publicinterface.h @@ -0,0 +1,882 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2m31publicinterface.h + @brief Declares structs used for the Corvid HEVC. + @copyright (C) 2012-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef NTV2M31PUBLICINTERFACE_H +#define NTV2M31PUBLICINTERFACE_H + +#include "ajatypes.h" +#include "ntv2m31enums.h" + +#define CPARAM_REG_START 0x20000000 + +// Common param register index (to get actual register location we multiply index by 4 then add CPARAM_REG_START) + +typedef enum +{ + kRegCParamCC, // 0x20000000 + kRegCParamReserved0, // 0x20000004 + kRegCParamStillColor, // 0x20000008 + kRegCParamScBuf, // 0x2000000C + + kRegCParamResoType7_0, // 0x20000010 + kRegCParamResoType15_8, // 0x20000014 + kRegCParamResoType23_16, // 0x20000018 + kRegCParamResoType31_24 // 0x2000001C + +} CParamRegisterIndex; + + +typedef enum +{ + kRegMaskCParamCC = 0xFFFF, + + // kRegCParamStillColor + kRegMaskCParamStillColorY = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kRegMaskCParamStillColorCb = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kRegMaskCParamStillColorCr = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + + // kRegCParamScBuf + kRegMaskCParamScRobustMode = BIT(8)+BIT(9)+BIT(10)+BIT(11), + kRegMaskCParamScBuf = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + + // kRegCParamResoType7_0 + kRegMaskCParamResoType7 = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskCParamResoType6 = BIT(24)+BIT(25)+BIT(26)+BIT(27), + kRegMaskCParamResoType5 = BIT(20)+BIT(21)+BIT(22)+BIT(23), + kRegMaskCParamResoType4 = BIT(16)+BIT(17)+BIT(18)+BIT(19), + kRegMaskCParamResoType3 = BIT(12)+BIT(13)+BIT(15)+BIT(15), + kRegMaskCParamResoType2 = BIT(8)+BIT(9)+BIT(10)+BIT(11), + kRegMaskCParamResoType1 = BIT(4)+BIT(5)+BIT(6)+BIT(7), + kRegMaskCParamResoType0 = BIT(0)+BIT(1)+BIT(2)+BIT(3) + +} CParamRegisterMask; + + +typedef enum +{ + kRegShiftCParamCC = 0, + + // kRegCParamStillColor + kRegShiftCParamStillColorY = 16, + kRegShiftCParamStillColorCb = 8, + kRegShiftCParamStillColorCr = 0, + + // kRegCParamScBuf + kRegShiftCParamScRobustMode = 8, + kRegShiftCParamScBuf = 0, + + // kRegCParamResoType7_0 + kRegShiftCParamResoType7 = 28, + kRegShiftCParamResoType6 = 24, + kRegShiftCParamResoType5 = 20, + kRegShiftCParamResoType4 = 16, + kRegShiftCParamResoType3 = 12, + kRegShiftCParamResoType2 = 8, + kRegShiftCParamResoType1 = 4, + kRegShiftCParamResoType0 = 0 + +} CParamRegisterShift; + + +#define VIPARAM_REG_START 0x20000020 +#define VIPARAM_CH_SIZE 0x30 + +// VI param register index (to get actual register location we multiply index by 4 then add VIPARAM_REG_START) + +typedef enum +{ + kRegVI0ParamCC, // 0x20000020 + kRegVI1ParamCC, // 0x20000024 + kRegVI2ParamCC, // 0x20000028 + kRegVI3ParamCC, // 0x2000002C + + // Channel 0 + kRegVI0Param, // 0x20000030 + kRegVI0ParamStartLine, // 0x20000034 + kRegVI0ParamMaxCount, // 0x20000038 + kRegVI0ParamValidPosLine, // 0x2000003C + kRegVI0ParamValidLineCount, // 0x20000040 + kRegVI0ParamValidVCount, // 0x20000044 + kRegVI0ParamReserved0, // 0x20000048 + kRegVI0ParamReserved1, // 0x2000004C + kRegVI0ParamReserved2, // 0x20000050 + kRegVI0ParamReserved3, // 0x20000054 + kRegVI0ParamMisc, // 0x20000058 + kRegVI0ParamReserved4, // 0x2000005C + + // Channel 1 + kRegVI1Param, // 0x20000060 + kRegVI1ParamStartLine, // 0x20000064 + kRegVI1ParamMaxCount, // 0x20000068 + kRegVI1ParamValidPosLine, // 0x2000006C + kRegVI1ParamValidLineCount, // 0x20000070 + kRegVI1ParamValidVCount, // 0x20000074 + kRegVI1ParamReserved0, // 0x20000078 + kRegVI1ParamReserved1, // 0x2000007C + kRegVI1ParamReserved2, // 0x20000080 + kRegVI1ParamReserved3, // 0x20000084 + kRegVI1ParamMisc, // 0x20000088 + kRegVI1ParamReserved4, // 0x2000008C + + // Channel 2 + kRegVI2Param, // 0x20000090 + kRegVI2ParamStartLine, // 0x20000094 + kRegVI2ParamMaxCount, // 0x20000098 + kRegVI2ParamValidPosLine, // 0x2000009C + kRegVI2ParamValidLineCount, // 0x200000A0 + kRegVI2ParamValidVCount, // 0x200000A4 + kRegVI2ParamReserved0, // 0x200000A8 + kRegVI2ParamReserved1, // 0x200000AC + kRegVI2ParamReserved2, // 0x200000B0 + kRegVI2ParamReserved3, // 0x200000B4 + kRegVI2ParamMisc, // 0x200000B8 + kRegVI2ParamReserved4, // 0x200000BC + + // Channel 3 + kRegVI3Param, // 0x200000C0 + kRegVI3ParamStartLine, // 0x200000C4 + kRegVI3ParamMaxCount, // 0x200000C8 + kRegVI3ParamValidPosLine, // 0x200000CC + kRegVI3ParamValidLineCount, // 0x200000D0 + kRegVI3ParamValidVCount, // 0x200000D4 + kRegVI3ParamReserved0, // 0x200000D8 + kRegVI3ParamReserved1, // 0x200000DC + kRegVI3ParamReserved2, // 0x200000E0 + kRegVI3ParamReserved3, // 0x200000E4 + kRegVI3ParamMisc, // 0x200000E8 + kRegVI3ParamReserved4, // 0x200000EC + + // Extras at the end don't belong to a channel + kRegVIParamReserved0, // 0x200000F0 + kRegVIParamReserved1, // 0x200000F4 + kRegVIParamReserved2, // 0x200000F8 + kRegVIParamReserved3 // 0x200000FC + +} VIParamRegisterIndex; + + +typedef enum +{ + kRegMaskVIParamCC = 0xFFFF, + + // kRegVI0Param + kRegMaskVIParamYCMux = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVIParamYCSwap = BIT(24)+BIT(25)+BIT(26)+BIT(27), + kRegMaskVIParamPrivate01 = BIT(20)+BIT(21)+BIT(22)+BIT(23), + kRegMaskVIParamPrivate02 = BIT(16)+BIT(17)+BIT(18)+BIT(19), + kRegMaskVIParamPrivate03 = BIT(12)+BIT(13)+BIT(15)+BIT(15), + kRegMaskVIParamPrivate04 = BIT(8)+BIT(9)+BIT(10)+BIT(11), + kRegMaskVIParamFormat = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + + // kRegVI0ParamStartLine + kRegMaskVIParamPrivate05 = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVIParamPrivate06 = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + // kRegVI0ParamMaxCount + kRegMaskVIParamPrivate07 = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVIParamPrivate08 = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + // kRegVI1ParamValidPosLine + kRegMaskVIParamPrivate09 = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVIParamPrivate10 = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + // kRegVI0ParamValidLineCount + kRegMaskVIParamPrivate11 = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVIParamPrivate12 = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + // kRegVI0ParamValidVCount + kRegMaskVIParamPrivate13 = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + // kRegVI0ParamMisc + kRegMaskVIParamGPIO = BIT(0), + kRegMaskVIParamSyncMembers = BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kRegMaskVIParamSyncMaster = BIT(8)+BIT(9)+BIT(10)+BIT(11), + kRegMaskVIParamInputPort = BIT(12)+BIT(13)+BIT(15)+BIT(15) + +} VIParamRegisterMask; + + +typedef enum +{ + kRegShiftVIParamCC = 0, + + // kRegVI0Param + kRegShiftVIParamYCMux = 28, + kRegShiftVIParamYCSwap = 24, + kRegShiftVIParamPrivate01 = 20, + kRegShiftVIParamPrivate02 = 16, + kRegShiftVIParamPrivate03 = 12, + kRegShiftVIParamPrivate04 = 8, + kRegShiftVIParamFormat = 0, + + // kRegVI0ParamStartLine + kRegShiftVIParamPrivate05 = 16, + kRegShiftVIParamPrivate06 = 0, + + // kRegVI0ParamMaxCount + kRegShiftVIParamPrivate07 = 16, + kRegShiftVIParamPrivate08 = 0, + + // kRegVI1ParamValidPosLine + kRegShiftVIParamPrivate09 = 16, + kRegShiftVIParamPrivate10 = 0, + + // kRegVI0ParamValidLineCount + kRegShiftVIParamPrivate11 = 16, + kRegShiftVIParamPrivate12 = 0, + + // kRegVI0ParamValidVCount + kRegShiftVIParamPrivate13 = 16, + + // kRegVI0ParamMisc + kRegShiftVIParamGPIO = 0, + kRegShiftVIParamSyncMembers = 3, + kRegShiftVIParamSyncMaster = 8, + kRegShiftVIParamInputPort = 12 + +} VIParamRegisterShift; + + +#define VINPARAM_REG_START 0x20000100 +#define VINPARAM_CH_SIZE 0x20 + +// VIn param register index (to get actual register location we multiply index by 4 then add VINPARAM_REG_START) + +// Note: Each encoder channel has the following VIn registers. This register map will be repeated for each of the 32 virtual +// channels. The current firmware supports four physical encoder channels. + +typedef enum +{ + kRegVINParamCC, // 0x20000100 + kRegVINParamSource, // 0x20000104 + kRegVINParamOut, // 0x20000108 + kRegVINParamSize, // 0x2000010C + + kRegVINParamPTSModeInitialMSB, // 0x20000110 + kRegVINParamInitialPTS, // 0x20000114 + kRegVINParamInitialSerialNum, // 0x20000118 + kRegVINParamReserved1 // 0x2000011C + +} VINParamRegisterIndex; + + +typedef enum +{ + kRegMaskVINParamCC = 0xFFFF, + + // kRegVINParamSource + kRegMaskVINParamSource = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVINParamSourceId = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kRegMaskVINParamChromaFormat = BIT(4)+ BIT(5)+BIT(6)+BIT(7), + kRegMaskVINParamBitDepth = BIT(0)+BIT(1)+BIT(2)+BIT(3), + + // kRegVINParamOut + kRegMaskVInParamFrameRate = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVInParamPrivate01 = BIT(0)+BIT(1)+BIT(2)+BIT(3), + + // kRegVINParamSize + kRegMaskVINParamHSize = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVINParamVSize = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + // kRegVINParamPTSModeInitialMSB + kRegMaskVINParamPTSMode = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVINParamInitialPTSMSB = BIT(0), + + kRegMaskVINParamInitialPTS = 0xFFFFFFFF, + kRegMaskVINParamInitialSerialNum = 0xFFFFFFFF + +} VINParamRegisterMask; + + +typedef enum +{ + kRegShiftVINParamCC = 0, + + // kRegVINParamSource + kRegShiftVINParamSource = 28, + kRegShiftVINParamSourceId = 16, + kRegShiftVINParamChromaFormat = 4, + kRegShiftVINParamBitDepth = 0, + + // kRegVINParamOut + kRegShiftVInParamFrameRate = 24, + kRegShiftVInParamPrivate01 = 0, + + // kRegVINParamSize + kRegShiftVINParamHSize = 16, + kRegShiftVINParamVSize = 0, + + // kRegVINParamPTSModeInitialMSB + kRegShiftVINParamPTSMode = 28, + kRegShiftVINParamInitialPTSMSB = 0, + + kRegShiftVINParamInitialPTS = 0, + kRegShiftVINParamInitialSerialNum = 0 + +} VINParamRegisterShift; + + +#define VAPARAM_REG_START 0x20000800 +#define VAPARAM_CH_SIZE 0x30 + +// VA param register index (to get actual register location we multiply index by 4 then add VAPARAM_REG_START) + +// Note: Each encoder channel has the following VA registers. This register map will be repeated for each of the 32 virtual +// channels. The current firmware supports four physical encoder channels. + +typedef enum +{ + kRegVAParamCC, // 0x20000800 + kRegVAParamSource, // 0x20000804 + kRegVAParamRateFormat, // 0x20000808 + kRegVAParamSizeVA, // 0x2000080C + kRegVAParamSizeEH, // 0x20000810 + + kRegVAParamCoef1_0, // 0x20000814 + kRegVAParamCoef3_2, // 0x20000818 + kRegVAParamCoef5_4, // 0x2000081C + kRegVAParamCoef7_6, // 0x20000820 + + kRegVAParamStartOffset, // 0x20000824 + kRegVAParamSceneChange, // 0x20000828 + kRegVAParamReserved2 // 0x2000082C + +} VAParamRegisterIndex; + + +typedef enum +{ + kRegMaskVAParamCC = 0xFFFF, + + // kRegVAParamSource + kRegMaskVAParamSource = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVAParamSourceId = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kRegMaskVAInterlace = BIT(8)+ BIT(9)+BIT(10)+BIT(11), + kRegMaskVAParamChromaFormat = BIT(4)+ BIT(5)+BIT(6)+BIT(7), + kRegMaskVAParamBitDepth = BIT(0)+BIT(1)+BIT(2)+BIT(3), + + // kRegVAParamRateFormat + kRegMaskVAParamFrameRate = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVAParamChromaFormatOut = BIT(4)+ BIT(5)+BIT(6)+BIT(7), + kRegMaskVAParamBitDepthOut = BIT(0)+BIT(1)+BIT(2)+BIT(3), + + // kRegVAParamSizeVA + kRegMaskVAParamHSizeVA = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVAParamVSizeVA = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + // kRegVAParamSizeEH + kRegMaskVAParamHSizeEH = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVAParamVSizeEH = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + // kRegVAParamCoef1_0 + kRegMaskVAParamCoef1 = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVAParamCoef0 = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + // kRegVAParamCoef3_2 + kRegMaskVAParamCoef3 = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVAParamCoef2 = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + // kRegVAParamCoef5_4 + kRegMaskVAParamCoef5 = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVAParamCoef4 = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + // kRegVAParamCoef7_6 + kRegMaskVAParamCoef7 = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVAParamCoef6 = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + // kRegVAParamStartOffset + kRegMaskVAParamPrivate01 = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVAParamPrivate02 = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + // kRegVAParamSceneChange + kRegMaskVAParamSceneChange = BIT(16)+BIT(17)+BIT(18)+BIT(19) + +} VAParamRegisterMask; + + +typedef enum +{ + kRegShiftVAParamCC = 0, + + // kRegVAParamSource + kRegShiftVAParamSource = 28, + kRegShiftVAParamSourceId = 16, + kRegShiftVAInterlace = 8, + kRegShiftVAParamChromaFormat = 4, + kRegShiftVAParamBitDepth = 0, + + // kRegVAParamRateFormat + kRegShiftVAParamFrameRate = 24, + kRegShiftVAParamChromaFormatOut = 4, + kRegShiftVAParamBitDepthOut = 0, + + // kRegVAParamSizeVA + kRegShiftVAParamHSizeVA = 16, + kRegShiftVAParamVSizeVA = 0, + + // kRegVAParamSizeEH + kRegShiftVAParamHSizeEH = 16, + kRegShiftVAParamVSizeEH = 0, + + // kRegVAParamCoef1_0 + kRegShiftVAParamCoef1 = 16, + kRegShiftVAParamCoef0 = 0, + + // kRegVAParamCoef3_2 + kRegShiftVAParamCoef3 = 16, + kRegShiftVAParamCoef2 = 0, + + // kRegVAParamCoef5_4 + kRegShiftVAParamCoef5 = 16, + kRegShiftVAParamCoef4 = 0, + + // kRegVAParamCoef7_6 + kRegShiftVAParamCoef7 = 16, + kRegShiftVAParamCoef6 = 0, + + // kRegVAParamStartOffset + kRegShiftVAParamPrivate01 = 16, + kRegShiftVAParamPrivate02 = 0, + + // kRegVAParamSceneChange + kRegShiftVAParamSceneChange = 16 + +} VAParamRegisterShift; + + +#define EHPARAM_REG_START 0x20001000 +#define EHPARAM_CH_SIZE 0x100 + +// VA param register index (to get actual register location we multiply index by 4 then add VAPARAM_REG_START) + +// Note: Each encoder channel has the following VA registers. This register map will be repeated for each of the 32 virtual +// channels. The current firmware supports four physical encoder channels. + +typedef enum +{ + kRegEHParamCC, // 0x20001000 + kRegEHParamSource, // 0x20001004 + kRegEHParamSizeVA, // 0x20001008 + kRegEHParamSizeEH, // 0x2000100C + + kRegEHParamProfile, // 0x20001010 + kRegEHParamAspectRatio, // 0x20001014 + kRegEHParamSAR, // 0x20001018 + + kRegEHParamSlice, // 0x2000101C + kRegEHParamGop1, // 0x20001020 + kRegEHParamGop2, // 0x20001024 + kRegEHParamRCMode, // 0x20001028 + + kRegEHParamBitRate, // 0x2000102C + kRegEHParamVBRMaxBitRate, // 0x20001030 + kRegEHParamVBRAveBitRate, // 0x20001034 + kRegEHParamVBRMinBitRate, // 0x20001038 + kRegEHParamVBRFillerBitRate, // 0x2000103C + + kRegEHParamNumUnitsInTickMax, // 0x20001040 + kRegEHParamTimeScale, // 0x20001044 + kRegEHParamNumUnitsInTick, // 0x20001048 + kRegEHParamCPBDelay, // 0x2000104C + kRegEHParamReserved1, // 0x20001050 + kRegEHParamReserved2, // 0x20001054 + + kRegEHParamCUTUSize, // 0x20001058 + kRegEHParamTUDepth, // 0x2000105C + kRegEHParamTSkip, // 0x20001060 + kRegEHParamAMP_WP, // 0x20001064 + kRegEHParamReserved3, // 0x20001068 + + kRegEHParamPCM, // 0x2000106C + kRegEHParamSAO, // 0x20001070 + kRegEHParamDF, // 0x20001074 + kRegEHParamRDOQ, // 0x20001078 + kRegEHParamPPS, // 0x2000107C + kRegEHParamBufCtrl, // 0x20001080 + + kRegEHParamOverscan, // 0x20001084 + kRegEHParamVideo, // 0x20001088 + kRegEHParamMatrixCoef, // 0x2000108C + + kRegEHParamCropLR, // 0x20001090 + kRegEHParamCropTB, // 0x20001094 + kRegEHParamGDR, // 0x20001098 + kRegEHParamRecovery, // 0x2000109C + + kRegEHParamPanScanLR, // 0x200010A0 + kRegEHParamPanScanTB, // 0x200010A4 + kRegEHParamHash, // 0x200010A8 + + kRegEHParamReserved4, // 0x200010AC + kRegEHParamReserved5, // 0x200010B0 + kRegEHParamReserved6, // 0x200010B4 + kRegEHParamReserved7, // 0x200010B8 + kRegEHParamReserved8, // 0x200010BC + kRegEHParamReserved9, // 0x200010C0 + kRegEHParamReserved10, // 0x200010C4 + kRegEHParamReserved11, // 0x200010C8 + kRegEHParamReserved12, // 0x200010CC + kRegEHParamReserved13, // 0x200010D0 + kRegEHParamReserved14, // 0x200010D4 + kRegEHParamReserved15, // 0x200010D8 + kRegEHParamReserved16, // 0x200010DC + kRegEHParamReserved17, // 0x200010E0 + kRegEHParamReserved18, // 0x200010E4 + kRegEHParamReserved19, // 0x200010E8 + kRegEHParamReserved20, // 0x200010EC + kRegEHParamReserved21, // 0x200010F0 + kRegEHParamReserved22, // 0x200010F4 + kRegEHParamReserved23, // 0x200010F8 + kRegEHParamReserved24 // 0x200010FC + +} EHParamRegisterIndex; + + +typedef enum +{ + kRegMaskEHParamCC = 0xFFFF, + + // kRegEHParamSource + kRegMaskEHParamSource = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamSourceId = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kRegMaskEHParamHsEncodeMode = BIT(12)+BIT(13)+BIT(14)+BIT(15), + kRegMaskEHParamInterlace = BIT(8)+ BIT(9)+BIT(10)+BIT(11), + kRegMaskEHParamChromaFormat = BIT(4)+ BIT(5)+BIT(6)+BIT(7), + kRegMaskEHParamBitDepth = BIT(0)+BIT(1)+BIT(2)+BIT(3), + + // kRegEHParamSizeVA + kRegMaskEHParamHSizeVA = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamVSizeVA = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + // kRegEHParamSizeEH + kRegMaskEHParamHSizeEH = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamVSizeEH = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + //kRegEHParamProfile + kRegMaskEHParamProfile = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamLevel = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kRegMaskEHParamTier = BIT(12)+BIT(13)+BIT(14)+BIT(15), + + //kRegEHParamAspectRatio + kRegMaskEHParamAspectRatio = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegEHParamSAR + kRegMaskEHParamSARWidth = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamSARHeight = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + //kRegEHParamSlice + kRegMaskEHParamPrivate01 = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamPrivate02 = BIT(24)+BIT(25)+BIT(26)+BIT(27), + kRegMaskEHParamPrivate03 = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kRegMaskEHParamPrivate04 = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kRegMaskEHParamPrivate05 = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + + //kRegEHParamGop1 + kRegMaskEHParamFrameNumInGOP = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamGOPHierarchy = BIT(20)+BIT(21)+BIT(22)+BIT(23), + kRegMaskEHParamUseTemporalID = BIT(16)+BIT(17)+BIT(18)+BIT(19), + kRegMaskEHParamPrivate06 = BIT(4)+BIT(5)+BIT(6)+BIT(7), + kRegMaskEHParamPrivate07 = BIT(0)+BIT(1)+BIT(2)+BIT(3), + + //kRegEHParamGop2 + kRegMaskEHParamPASL0B = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamIpPeriod = BIT(24)+BIT(25)+BIT(26)+BIT(27), + kRegMaskEHParamAdaptiveGOP = BIT(20)+BIT(21)+BIT(22)+BIT(23), + kRegMaskEHParamClosedGOP = BIT(16)+BIT(17)+BIT(18)+BIT(19), + kRegMaskEHParamIDRInterval = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + //kRegEHParamRCMode + kRegMaskEHParamRCMode = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamMinQpCtrl = BIT(24)+BIT(25)+BIT(26)+BIT(27), + kRegMaskEHParamPrivate08 = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kRegMaskEHParamAdaptiveQuant = BIT(0)+BIT(1)+BIT(2)+BIT(3), + + kRegMaskEHParamBitRate = 0xFFFFFFFF, + kRegMaskEHParamVBRMaxBitRate = 0xFFFFFFFF, + kRegMaskEHParamVBRAveBitRate = 0xFFFFFFFF, + kRegMaskEHParamPrivate09 = 0xFFFFFFFF, + kRegMaskEHParamPrivate10 = 0xFFFFFFFF, + kRegMaskEHParamNumUnitsInTickMax = 0xFFFFFFFF, + kRegMaskEHParamTimeScale = 0xFFFFFFFF, + kRegMaskEHParamNumUnitsInTick = 0xFFFFFFFF, + kRegMaskEHParamCPBDelay = 0xFFFFFFFF, + + //kRegEHParamCUTUSize + kRegMaskEHParamPrivate11 = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamMinCUSize = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kRegMaskEHParamMaxTUSize = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kRegMaskEHParamMinTUSize = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + + //kRegEHParamTUDepth + kRegMaskEHParamTUDepthIntra = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kRegMaskEHParamTUDepthInter = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + + //kRegEHParamTSkip + kRegMaskEHParamPrivate12 = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamPrivate13 = BIT(24)+BIT(25)+BIT(26)+BIT(27), + kRegMaskEHParamIntraSmoothing = BIT(20)+BIT(21)+BIT(22)+BIT(23), + kRegMaskEHParamPrivate14 = BIT(16)+BIT(17)+BIT(18)+BIT(19), + kRegMaskEHParamMergeCand = BIT(12)+BIT(13)+BIT(14)+BIT(15), + + //kRegEHParamAMP_WP + kRegMaskEHParamPrivate15 = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamPrivate16 = BIT(12)+BIT(13)+BIT(14)+BIT(15), + + //kRegEHParamPCM + kRegMaskEHParamPrivate17 = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamPrivate18 = BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27), + kRegMaskEHParamPrivate19 = BIT(12)+BIT(13)+BIT(14)+BIT(15)+BIT(16)+BIT(17)+BIT(18)+BIT(19), + kRegMaskEHParamPrivate20 = BIT(8)+BIT(9)+BIT(10)+BIT(11), + kRegMaskEHParamPrivate21 = BIT(4)+BIT(5)+BIT(6)+BIT(7), + kRegMaskEHParamPrivate22 = BIT(0)+BIT(1)+BIT(2)+BIT(3), + + //kRegEHParamSAO + kRegMaskEHParamPrivate23 = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamPrivate24 = BIT(12)+BIT(13)+BIT(14)+BIT(15), + + //kRegEHParamDF + kRegMaskEHParamDF = BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegEHParamRDOQ + kRegMaskEHParamPrivate25 = BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegEHParamPPS + kRegMaskEHParamPPSInsertion = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamEOS = BIT(12)+BIT(13)+BIT(14)+BIT(15), + kRegMaskEHParamESGap = BIT(4)+BIT(5)+BIT(6)+BIT(7), + kRegMaskEHParamMP4 = BIT(0)+BIT(1)+BIT(2)+BIT(3), + + //kRegEHParamBufCtrl + kRegMaskEHParamBufCtrl = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamVCLHRD = BIT(24)+BIT(25)+BIT(26)+BIT(27), + kRegMaskEHParamPrivate26 = BIT(20)+BIT(21)+BIT(22)+BIT(23), + kRegMaskEHParamVPSTiming = BIT(12)+BIT(13)+BIT(14)+BIT(15), + + //kRegEHParamOverscan + kRegMaskEHParamOverscanInfo = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamBitRestriction = BIT(24)+BIT(25)+BIT(26)+BIT(27), + + //kRegEHParamVideo + kRegMaskEHParamVideoSignalType = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamVideoFormat = BIT(24)+BIT(25)+BIT(26)+BIT(27), + kRegMaskEHParamVideoFullRange = BIT(20)+BIT(21)+BIT(22)+BIT(23), + kRegMaskEHParamColourDescription = BIT(16)+BIT(17)+BIT(18)+BIT(19), + kRegMaskEHParamColourPrimaries = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kRegMaskEHParamTransferChar = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + + //kRegEHParamMatrixCoef + kRegMaskEHParamMatrixCoef = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamChromaLocInfo = BIT(8)+BIT(9)+BIT(10)+BIT(11), + kRegMaskEHParamSampleLocTop = BIT(4)+BIT(5)+BIT(6)+BIT(7), + kRegMaskEHParamSampleLocBot = BIT(0)+BIT(1)+BIT(2)+BIT(3), + + //kRegEHParamCropLR + kRegMaskEHParamCropLeft = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamCropRight = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + //kRegEHParamCropTB + kRegMaskEHParamCropTop = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamCropBottom = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + //kRegEHParamGDR + kRegMaskEHParamPrivate27 = BIT(4)+BIT(5)+BIT(6)+BIT(7), + kRegMaskEHParamPrivate28 = BIT(0)+BIT(1)+BIT(2)+BIT(3), + + //kRegEHParamRecovery + kRegMaskEHParamPrivate29 = BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamUseTpIrap = BIT(24)+BIT(25)+BIT(26)+BIT(27), + kRegMaskEHParamPicTiming = BIT(16)+BIT(17)+BIT(18)+BIT(19), + kRegMaskEHParamScanType = BIT(8)+BIT(9)+BIT(10)+BIT(11), + kRegMaskEHParamFramePacking = BIT(0)+BIT(1)+BIT(2)+BIT(3), + + //kRegEHParamPanScanLR + kRegMaskEHParamScanLeft = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamScanRight = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + //kRegEHParamPanScanTB + kRegMaskEHParamScanTop = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskEHParamScanBottom = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + //kRegEHParamHash + kRegMaskEHParamPrivate30 = BIT(30)+BIT(31) + +} EHParamRegisterMask; + + +typedef enum +{ + kRegShiftEHParamCC = 0, + + // kRegEHParamSource + kRegShiftEHParamSource = 28, + kRegShiftEHParamSourceId = 16, + kRegShiftEHParamHsEncodeMode = 12, + kRegShiftEHParamInterlace = 8, + kRegShiftEHParamChromaFormat = 4, + kRegShiftEHParamBitDepth = 0, + + // kRegEHParamSizeVA + kRegShiftEHParamHSizeVA = 16, + kRegShiftEHParamVSizeVA = 0, + + // kRegEHParamSizeEH + kRegShiftEHParamHSizeEH = 16, + kRegShiftEHParamVSizeEH = 0, + + //kRegEHParamProfile + kRegShiftEHParamProfile = 24, + kRegShiftEHParamLevel = 16, + kRegShiftEHParamTier = 12, + + //kRegEHParamAspectRatio + kRegShiftEHParamAspectRatio = 24, + + //kRegEHParamSAR + kRegShiftEHParamSARWidth = 16, + kRegShiftEHParamSARHeight = 0, + + //kRegEHParamSlice + kRegShiftEHParamPrivate01 = 28, + kRegShiftEHParamPrivate02 = 24, + kRegShiftEHParamPrivate03 = 16, + kRegShiftEHParamPrivate04 = 8, + kRegShiftEHParamPrivate05 = 0, + + //kRegEHParamGop1 + kRegShiftEHParamFrameNumInGOP = 24, + kRegShiftEHParamGOPHierarchy = 20, + kRegShiftEHParamUseTemporalID = 16, + kRegShiftEHParamPrivate06 = 4, + kRegShiftEHParamPrivate07 = 0, + + //kRegEHParamGop2 + kRegShiftEHParamPASL0B = 28, + kRegShiftEHParamIpPeriod = 24, + kRegShiftEHParamAdaptiveGOP = 20, + kRegShiftEHParamClosedGOP = 16, + kRegShiftEHParamIDRInterval = 0, + + //kRegEHParamRCMode + kRegShiftEHParamRCMode = 28, + kRegShiftEHParamMinQpCtrl = 24, + kRegShiftEHParamPrivate08 = 16, + kRegShiftEHParamAdaptiveQuant = 0, + + kRegShiftEHParamBitRate = 0, + kRegShiftEHParamVBRMaxBitRate = 0, + kRegShiftEHParamVBRAveBitRate = 0, + kRegShiftEHParamPrivate09 = 0, + kRegShiftEHParamPrivate10 = 0, + kRegShiftEHParamNumUnitsInTickMax = 0, + kRegShiftEHParamTimeScale = 0, + kRegShiftEHParamNumUnitsInTick = 0, + kRegShiftEHParamCPBDelay = 0, + + //kRegEHParamCUTUSize + kRegShiftEHParamPrivate11 = 24, + kRegShiftEHParamMinCUSize = 16, + kRegShiftEHParamMaxTUSize = 8, + kRegShiftEHParamMinTUSize = 0, + + //kRegEHParamTUDepth + kRegShiftEHParamTUDepthIntra = 8, + kRegShiftEHParamTUDepthInter = 0, + + //kRegEHParamTSkip + kRegShiftEHParamPrivate12 = 28, + kRegShiftEHParamPrivate13 = 24, + kRegShiftEHParamIntraSmoothing = 20, + kRegShiftEHParamPrivate14 = 16, + kRegShiftEHParamMergeCand = 12, + + //kRegEHParamAMP_WP + kRegShiftEHParamPrivate15 = 28, + kRegShiftEHParamPrivate16 = 12, + + //kRegEHParamPCM + kRegShiftEHParamPrivate17 = 28, + kRegShiftEHParamPrivate18 = 20, + kRegShiftEHParamPrivate19 = 12, + kRegShiftEHParamPrivate20 = 8, + kRegShiftEHParamPrivate21 = 4, + kRegShiftEHParamPrivate22 = 0, + + //kRegEHParamSAO + kRegShiftEHParamPrivate23 = 28, + kRegShiftEHParamPrivate24 = 12, + + //kRegEHParamDF + kRegShiftEHParamDF = 28, + + //kRegEHParamRDOQ + kRegShiftEHParamPrivate25 = 28, + + //kRegEHParamPPS + kRegShiftEHParamPPSInsertion = 28, + kRegShiftEHParamEOS = 12, + kRegShiftEHParamESGap = 4, + kRegShiftEHParamMP4 = 0, + + //kRegEHParamBufCtrl + kRegShiftEHParamBufCtrl = 28, + kRegShiftEHParamVCLHRD = 24, + kRegShiftEHParamPrivate26 = 20, + kRegShiftEHParamVPSTiming = 12, + + //kRegEHParamOverscan + kRegShiftEHParamOverscanInfo = 28, + kRegShiftEHParamBitRestriction = 24, + + //kRegEHParamVideo + kRegShiftEHParamVideoSignalType = 28, + kRegShiftEHParamVideoFormat = 24, + kRegShiftEHParamVideoFullRange = 20, + kRegShiftEHParamColourDescription = 16, + kRegShiftEHParamColourPrimaries = 8, + kRegShiftEHParamTransferChar = 0, + + //kRegEHParamMatrixCoef + kRegShiftEHParamMatrixCoef = 24, + kRegShiftEHParamChromaLocInfo = 8, + kRegShiftEHParamSampleLocTop = 4, + kRegShiftEHParamSampleLocBot = 0, + + //kRegEHParamCropLR + kRegShiftEHParamCropLeft = 16, + kRegShiftEHParamCropRight = 0, + + //kRegEHParamCropTB + kRegShiftEHParamCropTop = 16, + kRegShiftEHParamCropBottom = 0, + + //kRegEHParamGDR + kRegShiftEHParamPrivate27 = 4, + kRegShiftEHParamPrivate28 = 0, + + //kRegEHParamRecovery + kRegShiftEHParamPrivate29 = 28, + kRegShiftEHParamUseTpIrap = 24, + kRegShiftEHParamPicTiming = 16, + kRegShiftEHParamScanType = 8, + kRegShiftEHParamFramePacking = 0, + + //kRegEHParamPanScanLR + kRegShiftEHParamScanLeft = 16, + kRegShiftEHParamScanRight = 0, + + //kRegEHParamPanScanTB + kRegShiftEHParamScanTop = 16, + kRegShiftEHParamScanBottom = 0, + + //kRegEHParamHash + kRegShiftEHParamPrivate30 = 30 + + +} EHParamRegisterShift; + + +#endif // NTV2M31PUBLICINTERFACE_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2mailbox.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2mailbox.h new file mode 100644 index 0000000..ea17348 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2mailbox.h @@ -0,0 +1,108 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2mailbox.h + @brief Declares the CNTV2MailBox class. + @copyright (C) 2014-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef CNTV2MAILBOX_H +#define CNTV2MAILBOX_H + +#include "ntv2card.h" +#include "ntv2enums.h" +#include "ntv2registers2022.h" +#include + +#define MB_tWRDATA 0 // 0x00 +#define MB_tRDDATA 2 // 0x08 +#define MB_tSTATUS 4 // 0x10 +#define MB_tERROR 5 // 0x14 +#define MB_tSIT 6 // 0x18 // send interrupt threshold +#define MB_tRIT 6 // 0x18 // receive interrupt threshold +#define MB_tIS 8 // 0x20 // interrupt status register +#define MB_tIE 9 // 0x24 // interrupt enable register +#define MB_tIP 10 // 0x28 // interrupt pending register + +#define MBS_RX_EMPTY BIT(0) +#define MBS_TX_FULL BIT(1) +#define MBS_SEND_LT_TA BIT(2) // send level <= SIT +#define MBS_RCV_GT_TA BIT(3) // receive level > RIT + +#define MBE_RX_EMPTY BIT(1) +#define MBE_TX_FULL BIT(2) + +#define MB_RX_INT BIT(1) + +#define FIFO_SIZE 1024 // 32-bit words +#define MB_TIMEOUT 50 // milliseconds + +#define SEQNUM_MIN 1 +#define SEQNUM_MAX 500 + +class AJAExport CNTV2MailBox +{ +public: + CNTV2MailBox(CNTV2Card & device); + ~CNTV2MailBox(); + + bool sendMsg(char * msg, uint32_t timeout); // returns response + bool sendMsg(uint32_t timeout); + + void getError(std::string & error); + void getResponse(std::string & response); + + bool WriteChannelRegister (ULWord reg, ULWord value, ULWord mask = 0xFFFFFFFF, ULWord shift = 0x0); + + bool ReadChannelRegister (const ULWord inReg, ULWord & outValue, const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0x0); + inline bool ReadChannelRegister (ULWord inReg, ULWord *pOutValue, ULWord mask = 0xFFFFFFFF, ULWord shift = 0x0) {return pOutValue ? ReadChannelRegister (inReg, *pOutValue, mask, shift) : false;} + + void SetChannel(ULWord channelOffset, ULWord channelNumber); + + bool AcquireMailbox(); + void ReleaseMailbox(); + +protected: + bool rcvMsg(uint32_t timeout); + + bool writeMB(uint32_t val, uint32_t timeout = MB_TIMEOUT); + bool readMB(uint32_t & val, uint32_t timeout = MB_TIMEOUT); + + bool waitSOM(uint32_t timeout); + bool waitRxReady(uint32_t timeout); + bool waitTxReady(uint32_t timeout); + + bool rxReady(); + + uint32_t getStatus(); + uint32_t getFeatures(); + + CNTV2Card &mDevice; + + NTV2IpError mIpErrorCode; + std::string mIpInternalErrorString; + +private: + void startTimer(); + uint64_t getElapsedTime(); + int64_t getSystemCounter(); + int64_t getSystemFrequency(); + uint64_t getSystemMilliseconds(); + + + uint32_t nextSeqNum() {if (++_seqNum > SEQNUM_MAX) return SEQNUM_MIN; else return _seqNum;} + uint32_t currentSeqNum() {return _seqNum;} + + uint32_t chanOffset; + uint32_t chanNumber; + + uint32_t bOffset; // base offset +protected: + uint32_t txBuf[FIFO_SIZE+1]; // CNTV2MBController needs access to this +private: + uint32_t rxBuf[FIFO_SIZE+1]; + + uint64_t _startTime; + uint32_t _seqNum; +}; + +#endif // CNTV2MAILBOX_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2mbcontroller.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2mbcontroller.h new file mode 100644 index 0000000..ab3647f --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2mbcontroller.h @@ -0,0 +1,185 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2mbcontroller.h + @brief Declares the CNTV2MBController class. + @copyright (C) 2015-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef NTV2MBCONTROLLER_H +#define NTV2MBCONTROLLER_H + +#include "ntv2card.h" +#include "ntv2mailbox.h" +#include +#include + +enum eMBCmd +{ + MB_CMD_SET_NET = 0, + MB_CMD_GET_MAC_FROM_ARP_TABLE = 3, + MB_CMD_SEND_ARP_REQ = 4, + MB_CMD_UNKNOWN = 5, + MB_CMD_SET_IGMP_VERSION = 6, + MB_CMD_FETCH_GM_INFO = 7, + MB_CMD_TAKE_SDP = 8, + MB_CMD_FETCH_SDP = 9, + MB_CMD_DISABLE_NET_IF = 10, + MB_CMD_FETCH_SFP_INFO = 11, + MB_CMD_SET_LLDP_INFO = 12, + MB_CMD_GET_LLDP_INFO = 13 +}; + +enum eNTV2PacketInterval +{ + PACKET_INTERVAL_125uS, + PACKET_INTERVAL_1mS +}; + +enum eSFP +{ + SFP_1, + SFP_2, + SFP_MAX_NUM_SFPS, + SFP_INVALID = SFP_MAX_NUM_SFPS +}; + +#define NTV2_IS_VALID_SFP(__sfp__) (((__sfp__) >= SFP_1) && ((__sfp__) < SFP_INVALID)) + +enum eArpState +{ + ARP_ERROR, + ARP_VALID, + ARP_INCOMPLETE, + ARP_NOT_FOUND +}; + +typedef enum +{ + eIGMPVersion_2, + eIGMPVersion_3, + eIGMPVersion_Default = eIGMPVersion_3 +} eIGMPVersion_t; + +typedef struct +{ + uint8_t mac[6]; +} MACAddr; + +typedef struct +{ + uint8_t data[64]; +} SFPMSAData; + +struct SFPStatus +{ + bool SFP_present; // true indicates SFP plugged in + bool SFP_rxLoss; // true indicates loss of signal + bool SFP_txFault; // true indicates tx fault + bool SFP_linkUp; // true indicates link is up +}; + +typedef enum +{ + PTP_NO_PTP, + PTP_ERROR, + PTP_NOT_LOCKED, + PTP_LOCKING, + PTP_LOCKED +} PTPLockStatus; + +struct PTPStatus +{ + uint8_t PTP_gmId[8]; // GrandMasterID + uint8_t PTP_masterId[8]; // MasterID + PTPLockStatus PTP_LockedState; // locked state +}; + + +// IGMP Control Block +#define IGMPCB_REG_STATE 0 +#define IGMPCB_REG_MCAST_ADDR 1 +#define IGMPCB_REG_SRC_ADDR 2 +#define IGMPCB_SIZE 3 + +#define IGMPCB_STATE_USED BIT(0) +#define IGMPCB_STATE_ENABLED BIT(1) +#define IGMPCB_STATE_BUSY BIT(31) // ignore when busy + +#define S2022_LINK_A_ACTIVE BIT(31) +#define S2022_LINK_B_ACTIVE BIT(30) +#define S2022_DUAL_LINK BIT(29) + +class IPVNetConfig +{ +public: + IPVNetConfig() { init(); } + + void init(); + + bool operator == ( const IPVNetConfig &other ); + bool operator != ( const IPVNetConfig &other ); + + uint32_t ipc_ip; + uint32_t ipc_subnet; + uint32_t ipc_gateway; +}; + +class AJAExport CNTV2MBController : public CNTV2MailBox +{ +public: + CNTV2MBController(CNTV2Card & device); + +protected: + // all these methods block until response received or timeout + bool SetMBNetworkConfiguration(eSFP port, std::string ipaddr, std::string netmask,std::string gateway); + bool DisableNetworkInterface(eSFP port); + bool GetRemoteMAC(std::string remote_IPAddress, eSFP port, NTV2Stream stream, std::string & MACaddress); + bool SetIGMPVersion(uint32_t version); + + void SetIGMPGroup(eSFP port, NTV2Stream stream, uint32_t mcast_addr, uint32_t src_addr, bool enable); + void UnsetIGMPGroup(eSFP port, NTV2Stream stream); + void EnableIGMPGroup(eSFP port, NTV2Stream stream, bool enable); + + bool SetTxLinkState(NTV2Channel channel, bool sfp1Enable, bool sfp2Enable); + bool GetTxLinkState(NTV2Channel channel, bool & sfp1Enable, bool & sfp2Enable); + bool SetRxLinkState(NTV2Channel channel, bool sfp1Enable, bool sfp2Enable); + bool GetRxLinkState(NTV2Channel channel, bool & sfp1Enable, bool & sfp2Enable); + + bool SetDualLinkMode(bool enable); + bool GetDualLinkMode(bool & enable); + + bool SetRxMatch(NTV2Channel channel, eSFP link, uint8_t match); + bool GetRxMatch(NTV2Channel channel, eSFP link, uint8_t & match); + + bool SetSFPActive(eSFP sfp); + bool SetSFPInactive(eSFP sfp); + bool GetSFPActive(eSFP sfp); + + bool SetTxFormat(NTV2Channel chan, NTV2VideoFormat fmt); + bool GetTxFormat(NTV2Channel chan, NTV2VideoFormat & fmt); + + uint64_t GetNTPTimestamp(); + bool PushSDP(std::string filename, std::stringstream & sdpstream); + bool GetSDP(std::string url, std::string & sdp); + + bool GetSFPInfo(eSFP port, SFPMSAData & sfpdata); + + bool SetLLDPInfo(std::string sysname); + bool GetLLDPInfo(std::string &chassisId0, std::string &portId0, + std::string &chassisId1, std::string &portId1); + + +private: + eArpState GetRemoteMACFromArpTable(std::string remote_IPAddress, eSFP port, NTV2Stream stream, std::string & MACaddress); + bool SendArpRequest(std::string remote_IPAddress, eSFP port); + + void splitResponse(const std::string response, std::vector & results); + bool getDecimal(const std::string & resp, const std::string & parm, uint32_t & result); + bool getHex(const std::string & resp, const std::string & parm, uint32_t &result); + bool getString(const std::string & resp, const std::string & parm, std::string & result); + uint32_t getIGMPCBOffset(eSFP port, NTV2Stream stream); + +private: +}; + +#endif // NTV2MBCONTROLLER_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2mcsfile.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2mcsfile.h new file mode 100644 index 0000000..2a48ad2 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2mcsfile.h @@ -0,0 +1,117 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2mcsfile.h + @brief Declares the CNTV2MCSfile class. + @copyright (C) 2015-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef NTV2MCSFILE_H +#define NTV2MCSFILE_H + +#include +#include +#include +#include "ntv2utils.h" +#ifdef AJALinux + #include + #include +#endif + +typedef enum +{ + IRT_UNKNOWN, + IRT_DR, // Data Record + IRT_EOFR, // End Of File Record + IRT_ESAR, // Extended Segment Address Record + IRT_ELAR // Extended Linear Address Record +} IntelRecordType; + + +struct IntelRecordInfo +{ + IntelRecordInfo() + : byteCount (0) + , linearAddress (0) + , segmentAddress (0) + , recordType (IRT_UNKNOWN) + , checkSum (0) {} + + uint8_t byteCount; + uint16_t linearAddress; + uint32_t segmentAddress; + IntelRecordType recordType; + uint8_t * dataBuffer[16]; + uint8_t checkSum; +}; + + +/** + @brief Instances of me can parse an MCS file. +**/ +class CNTV2MCSfile +{ +public: + /** + @brief My constructor. + **/ + CNTV2MCSfile(); + + /** + @brief My destructor. + **/ + virtual ~CNTV2MCSfile(); + + /** + @brief Opens the bitfile at the given path, then parses its header. + @param[in] inMCSFilePath Specifies the path to the MCS bitfile to be parsed. + @return True if open & parse succeeds; otherwise false. + **/ + virtual bool Open (const std::string & inMCSFilePath); + + /** + @brief Closes mcs file (if open). + **/ + virtual void Close (void); + virtual bool InsertBitFile (const std::string & inBitFileName, const std::string & inMCSFileName, const std::string & inUserMessage); + virtual void IRecordOutput (const char *pIRecord); + + virtual uint32_t GetFileByteStream (uint32_t numberOfLines = 0); + virtual bool isReady (void) const; + virtual bool FindExtendedLinearAddressRecord (uint16_t address = 0x0000); + virtual bool GetCurrentParsedRecord (IntelRecordInfo &recordInfo); + virtual uint32_t GetPartition (UByteSequence & patitionBuffer, uint16_t baseELARaddress, uint16_t & partitionOffset, bool nextPartition = false); + virtual const std::string & GetBitfileDateString (void) const {return mBitfileDate;} + virtual const std::string & GetBitfileDesignString (void) const {return mBitfileDesignName;} + virtual const std::string & GetBitfilePartNameString (void) const {return mBitfilePartName;} + virtual const std::string & GetBitfileTimeString (void) const {return mBitfileTime;} + virtual std::string GetMCSPackageVersionString (void) const; + virtual std::string GetMCSPackageDateString (void) const; + virtual bool GetMCSHeaderInfo (const std::string & inMCSFileName); + virtual inline const std::string & GetLastError (void) const {return mLastError;} ///< @return A string containing the error message, if any, from the last function that failed. + +protected: // Protected Methods + virtual void SetLastError (const std::string & inStr, const bool inAppend = false); + +private: + virtual bool ParseCurrentRecord (IntelRecordInfo &recordInfo); + virtual void GetMCSInfo (); + + std::ifstream mMCSFileStream; + std::string mCurrentRecord; + uint32_t mFileSize; + NTV2StringList mFileLines; + NTV2StringListIter mBaseELARLocation; + NTV2StringListIter mCurrentLocation; + std::string mCommentString; + std::string mMCSInfoString; + + //bitfile information contained in the MCS file + std::string mBitfileDate; + std::string mBitfileTime; + std::string mBitfileDesignName; + std::string mBitfilePartName; + std::string mLastError; // Last error message + +}; // CNTV2MCSfile + +#endif // NTV2MCSFILE_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2nubaccess.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2nubaccess.h new file mode 100644 index 0000000..c21aa50 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2nubaccess.h @@ -0,0 +1,112 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2nubaccess.h + @brief Declares functions to connect/open/close/send/receive data via the NTV2 "nub". + @copyright (C) 2006-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2NUBACCESS_H +#define NTV2NUBACCESS_H + +#include "ajaexport.h" +#include "ntv2nubtypes.h" +#include + +#define NTV2_REMOTE_ACCESS_SUCCESS 0 +#define NTV2_REMOTE_ACCESS_NOT_CONNECTED -1 +#define NTV2_REMOTE_ACCESS_OUT_OF_MEMORY -2 +#define NTV2_REMOTE_ACCESS_SEND_ERR -3 +#define NTV2_REMOTE_ACCESS_CONNECTION_CLOSED -4 +#define NTV2_REMOTE_ACCESS_RECV_ERR -5 +#define NTV2_REMOTE_ACCESS_TIMEDOUT -6 +#define NTV2_REMOTE_ACCESS_NO_CARD -7 +#define NTV2_REMOTE_ACCESS_NOT_OPEN_RESP -8 +#define NTV2_REMOTE_ACCESS_NON_NUB_PKT -9 +#define NTV2_REMOTE_ACCESS_NOT_READ_REGISTER_RESP -10 +#define NTV2_REMOTE_ACCESS_NOT_WRITE_REGISTER_RESP -11 +#define NTV2_REMOTE_ACCESS_NOT_AUTOCIRC_RESP -12 +#define NTV2_REMOTE_ACCESS_NOT_WAIT_FOR_INTERRUPT_RESP -13 +#define NTV2_REMOTE_ACCESS_WAIT_FOR_INTERRUPT_FAILED -14 +#define NTV2_REMOTE_AUTOCIRC_FAILED -15 +#define NTV2_REMOTE_ACCESS_DRIVER_GET_BITFILE_INFO_FAILED -16 +#define NTV2_REMOTE_ACCESS_NOT_DRIVER_GET_BITFILE_INFO -17 +#define NTV2_REMOTE_ACCESS_NOT_DOWNLOAD_TEST_PATTERN -18 +#define NTV2_REMOTE_ACCESS_DOWNLOAD_TEST_PATTERN_FAILED -19 +#define NTV2_REMOTE_ACCESS_READ_REG_MULTI_FAILED -20 +#define NTV2_REMOTE_ACCESS_NOT_READ_REG_MULTI -21 +#define NTV2_REMOTE_ACCESS_GET_DRIVER_VERSION_FAILED -22 +#define NTV2_REMOTE_ACCESS_NOT_GET_DRIVER_VERSION_RESP -23 +#define NTV2_REMOTE_ACCESS_READ_REG_FAILED -24 +#define NTV2_REMOTE_ACCESS_DRIVER_GET_BUILD_INFO_FAILED -25 +#define NTV2_REMOTE_ACCESS_NOT_DRIVER_GET_BUILD_INFO -26 +#define NTV2_REMOTE_ACCESS_UNIMPLEMENTED -27 + + +/** + @brief Interface to remote or fake devices. +**/ +class AJAExport NTV2RPCAPI +{ + public: + static NTV2RPCAPI * MakeNTV2NubRPCAPI (const std::string & inSpec, const std::string & inPort = ""); + static NTV2RPCAPI * FindNTV2SoftwareDevice (const std::string & inName, const std::string & inParams = ""); + + public: + NTV2RPCAPI (); + virtual ~NTV2RPCAPI(); + // Inquiry + virtual bool IsConnected (void) const; + virtual std::string Name (void) const; + virtual std::ostream & Print (std::ostream & oss) const; + virtual NTV2NubProtocolVersion NubProtocolVersion (void) const; + virtual uint32_t Version (void) const; + virtual NTV2_POINTER & localStorage (void); + virtual const NTV2_POINTER & localStorage (void) const; + +// virtual int NTV2Connect (const std::string & inHostname, const UWord inDeviceIndex); + virtual int NTV2Disconnect (void); + + virtual int NTV2ReadRegisterRemote (const ULWord regNum, ULWord & outRegValue, const ULWord regMask, const ULWord regShift); + + virtual int NTV2WriteRegisterRemote (const ULWord regNum, const ULWord regValue, const ULWord regMask, const ULWord regShift); + + virtual int NTV2AutoCirculateRemote (AUTOCIRCULATE_DATA & autoCircData); + + virtual int NTV2WaitForInterruptRemote (const INTERRUPT_ENUMS eInterrupt, const ULWord timeOutMs); + + virtual int NTV2DriverGetBitFileInformationRemote (BITFILE_INFO_STRUCT & bitFileInfo, const NTV2BitFileType bitFileType); + + virtual int NTV2DriverGetBuildInformationRemote (BUILD_INFO_STRUCT & buildInfo); + + virtual int NTV2DownloadTestPatternRemote (const NTV2Channel channel, const NTV2PixelFormat testPatternFBF, + const UWord signalMask, const bool testPatDMAEnb, const ULWord testPatNum); + + virtual int NTV2ReadRegisterMultiRemote (const ULWord numRegs, ULWord & outFailedRegNum, NTV2RegInfo outRegs[]); + + virtual int NTV2GetDriverVersionRemote (ULWord & outDriverVersion); + + virtual int NTV2DMATransferRemote (const NTV2DMAEngine inDMAEngine, const bool inIsRead, + const ULWord inFrameNumber, ULWord * pFrameBuffer, + const ULWord inCardOffsetBytes, const ULWord inTotalByteCount, + const ULWord inNumSegments, const ULWord inSegmentHostPitch, + const ULWord inSegmentCardPitch, const bool inSynchronous); + + virtual int NTV2MessageRemote (NTV2_HEADER * pInMessage); + + protected: + virtual int NTV2OpenRemote (const UWord inDeviceIndex); + virtual int NTV2CloseRemote (void); + + protected: + std::string _hostname; + uint32_t _instanceData[1024]; // private storage + NTV2_POINTER _pvt; +}; // NTV2RPCAPI + +inline std::ostream & operator << (std::ostream & oss, const NTV2RPCAPI & inObj) {return inObj.Print(oss);} + +extern "C" { + typedef NTV2RPCAPI* (*fpCreateNTV2SoftwareDevice) (void * /*pInDLLHandle*/, const std::string & /*inParams*/, const uint32_t /*inHostSDKVersion*/); +} + +#endif // NTV2NUBACCESS_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2nubpktcom.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2nubpktcom.h new file mode 100644 index 0000000..8ebfed0 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2nubpktcom.h @@ -0,0 +1,58 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2nubpktcom.h + @brief Declares functions that handle NTV2 "nub" packets. + @copyright (C) 2006-2021 AJA Video Systems, Inc. +**/ + +#ifndef __NTV2NUBPKTCOM_H +#define __NTV2NUBPKTCOM_H + +#include "ajaexport.h" +#include "ntv2nubtypes.h" + +#ifdef MSWindows + #include + typedef int socklen_t ; +#else + #include +#endif + +extern AJAExport const char *NTV2NubQueryRespStrProtVer1[eNumNTV2NubPktTypes]; +extern AJAExport const char *NTV2NubQueryRespStrProtVer2[eNumNTV2NubPktTypes]; + +#if !defined (AJAMac) || !defined (ntohll) + unsigned long long ntohll(unsigned long long n); +#endif +#if !defined (AJAMac) || !defined (htonll) + unsigned long long htonll(unsigned long long n); +#endif + +const AJAExport char * nubQueryRespStr (NTV2NubProtocolVersion protocolVersion, + NTV2NubPktType pktType); + +AJAExport void * GetNubPktPayloadPtr (NTV2NubPkt * pPkt); + +AJAExport NTV2NubPkt * BuildNubBasePacket (NTV2NubProtocolVersion protocolVersion, + NTV2NubPktType pktType, + ULWord payloadSize, + char ** pPayload); + +AJAExport bool NBOifyNTV2NubPkt (NTV2NubPkt * pPkt); +AJAExport bool deNBOifyNTV2NubPkt (NTV2NubPkt * pPkt, ULWord size); +AJAExport bool isNTV2NubPacketType (NTV2NubPkt * pPkt, NTV2NubPktType nubPktType); +AJAExport int sendall (AJASocket s, char * buf, int * len); +AJAExport int recvtimeout_sec (AJASocket s, char * buf, int len, int timeout_seconds); +AJAExport int recvtimeout_usec (AJASocket s, char * buf, int len, int timeout_uSecs); + +#define RVCFROMTIMEOUT_ERR (-1) +#define RVCFROMTIMEOUT_TIMEDOUT (-2) + +AJAExport int recvfromtimeout (AJASocket s, char * buf, int len, int timeout, + struct sockaddr * their_addr, socklen_t * addr_len); + +// Debug functions +AJAExport void dumpDiscoveryPacket (NTV2NubPkt * pPkt, NTV2DiscoverRespPayload * boardInventory = AJA_NULL); +AJAExport void dumpBoardInventory (NTV2DiscoverRespPayload * boardInventory); + +#endif // __NTV2NUBPKTCOM_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2nubtypes.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2nubtypes.h new file mode 100644 index 0000000..fbadf8c --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2nubtypes.h @@ -0,0 +1,270 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2nubtypes.h + @brief Declares data types and structures used in NTV2 "nub" packets. + @copyright (C) 2006-2021 AJA Video Systems, Inc. +**/ + +#ifndef __NTV2NUBTYPES_H +#define __NTV2NUBTYPES_H + +#include "ntv2publicinterface.h" + +#define NTV2DISCOVERYPORT 7777 // the port users will be connecting to + +#define NTV2NUBPORT 7474 // port we're listening on + +#define INVALID_NUB_HANDLE (-1) + +typedef ULWord NTV2NubProtocolVersion; + +const ULWord ntv2NubProtocolVersionNone = 0; +const ULWord ntv2NubProtocolVersion1 = 1; +const ULWord ntv2NubProtocolVersion2 = 2; +const ULWord ntv2NubProtocolVersion3 = 3; // Added get buildinfo +const ULWord maxKnownProtocolVersion = 3; + +typedef enum +{ + eDiscoverQueryPkt = 0, + eDiscoverRespPkt = 1, + eNubOpenQueryPkt = 2, + eNubOpenRespPkt = 3, + eNubReadRegisterSingleQueryPkt = 4, + eNubReadRegisterSingleRespPkt = 5, + eNubWriteRegisterQueryPkt = 6, + eNubWriteRegisterRespPkt = 7, + eNubGetAutoCirculateQueryPkt = 8, + eNubGetAutoCirculateRespPkt = 9, + eNubV1ControlAutoCirculateQueryPkt = 8, // Dupe #, maintained for bkwd compat + eNubV1ControlAutoCirculateRespPkt = 9, // Dupe #, maintained for bkwd compat + eNubWaitForInterruptQueryPkt = 10, + eNubWaitForInterruptRespPkt = 11, + eNubDriverGetBitFileInformationQueryPkt = 12, + eNubDriverGetBitFileInformationRespPkt = 13, + eNubDownloadTestPatternQueryPkt = 14, + eNubDownloadTestPatternRespPkt = 15, + eNubReadRegisterMultiQueryPkt = 16, + eNubReadRegisterMultiRespPkt = 17, + eNubGetDriverVersionQueryPkt = 18, + eNubGetDriverVersionRespPkt = 19, + eNubV2ControlAutoCirculateQueryPkt = 20, // Replaces eNubV1ControlAutoCirculateQueryPkt + eNubV2ControlAutoCirculateRespPkt = 21, // Replaces eNubV1ControlAutoCirculateRespPkt + eNubDriverGetBuildInformationQueryPkt = 22, + eNubDriverGetBuildInformationRespPkt = 23, + eNubDriverDmaTransferQueryPkt = 24, + eNubDriverDmaTransferRespPkt = 25, + eNubDriverMessageQueryPkt = 26, + eNubDriverMessageRespPkt = 27, + eNumNTV2NubPktTypes +} NTV2NubPktType; + + +typedef struct +{ + NTV2NubProtocolVersion protocolVersion; + NTV2NubPktType pktType; + ULWord dataLength; // Length of payload in bytes + ULWord reserved[13]; // Future use +} NTV2NubPktHeader; + +#define NTV2_NUBPKT_MAX_DATASIZE 8192 // ISO C++ forbids zero-size arrays + +typedef struct +{ + NTV2NubPktHeader hdr; + unsigned char data[NTV2_NUBPKT_MAX_DATASIZE]; // Variable-length payload +} NTV2NubPkt; + +#define NTV2_DISCOVER_BOARDINFO_DESC_STRMAX 32 + +typedef struct +{ + ULWord boardMask; // One or more of NTV2DeviceType +} NTV2DiscoverQueryPayload; + + +typedef struct +{ + ULWord boardNumber; // Card number, 0 .. 3 + ULWord boardType; // e.g. BOARDTYPE_KHD + ULWord boardID; // From register 50 + char description[NTV2_DISCOVER_BOARDINFO_DESC_STRMAX]; // "IPADDR: board identifier" +} NTV2DiscoverBoardInfo; + + +// Enough for 4 KSDs, 4 KHDs, 4 HDNTVs and 4 XENA2s. +// Which would imply a system with 16 PCI slots. +// Four would probably be enough... +#define NTV2_NUB_MAXBOARDS_PER_HOST 16 + +typedef struct +{ + ULWord numBoards; // Number of entries in the table below + NTV2DiscoverBoardInfo discoverBoardInfo[NTV2_NUB_MAXBOARDS_PER_HOST]; +} NTV2DiscoverRespPayload; + +typedef struct +{ + ULWord boardNumber; // Card number, 0 .. 3 + ULWord boardType; // e.g. BOARDTYPE_KHD + LWord handle; // A session cookie required for reg gets/sets and close +} NTV2BoardOpenInfo; + +// Single read/writes +typedef struct +{ + LWord handle; // A session cookie required for reg gets/sets and close + ULWord registerNumber; + ULWord registerValue; + ULWord registerMask; + ULWord registerShift; + ULWord result; // Actually a bool, returned from RegisterRead/RegisterWrite +} NTV2ReadWriteRegisterPayload; + +// Multi reads. TODO: Support writes. + +// This following number is enough for the watcher for OEM2K. +// If it is increased, increase the protocol version number. +// Be sure the number of registers fits into the maximum packet +// size. +#define NTV2_NUB_NUM_MULTI_REGS 200 +typedef struct +{ + LWord handle; // A session cookie required for reg gets/sets and close + ULWord numRegs; // In: number to read/write. (Write not supported yet). + ULWord result; // Actually a bool, returned from RegisterRead + ULWord whichRegisterFailed; // Only if result is false. Regs after that contain garbage. +} NTV2ReadWriteMultiRegisterPayloadHeader; + +typedef struct +{ + NTV2ReadWriteMultiRegisterPayloadHeader payloadHeader; + NTV2ReadWriteRegisterSingle aRegs[NTV2_NUB_NUM_MULTI_REGS]; +} NTV2ReadWriteMultiRegisterPayload; + +typedef struct +{ + LWord handle; // A session cookie required for reg gets/sets and close + ULWord result; // Actually a bool, returned from RegisterRead/RegisterWrite + ULWord eCommand; // From AUTOCIRCULATE_DATA. + ULWord channelSpec; + ULWord state; + ULWord startFrame; // Acually LWORD + ULWord endFrame; // Acually LWORD + ULWord activeFrame; // Acually LWORD Current Frame# actually being output (or input), -1, if not active + ULWord64 rdtscStartTime; // Performance Counter at start + ULWord64 audioClockStartTime; // Register 28 with Wrap Logic + ULWord64 rdtscCurrentTime; // Performance Counter at time of call + ULWord64 audioClockCurrentTime; // Register 28 with Wrap Logic + ULWord framesProcessed; + ULWord framesDropped; + ULWord bufferLevel; // how many buffers ready to record or playback + + ULWord bWithAudio; + ULWord bWithRP188; + ULWord bFbfChange; + ULWord bFboChange ; + ULWord bWithColorCorrection; + ULWord bWithVidProc; + ULWord bWithCustomAncData; +} NTV2GetAutoCircPayload; + +typedef struct +{ + ULWord handle; // A session cookie + ULWord result; // Actually a bool + ULWord eCommand; // From AUTOCIRCULATE_DATA. + ULWord channelSpec; + + ULWord lVal1; + ULWord lVal2; + ULWord lVal3; + ULWord lVal4; + ULWord lVal5; + ULWord lVal6; + + ULWord bVal1; + ULWord bVal2; + ULWord bVal3; + ULWord bVal4; + ULWord bVal5; + ULWord bVal6; + ULWord bVal7; + ULWord bVal8; + + // Can't send pointers over network so pvVal1 etc do not appear here. + +} NTV2ControlAutoCircPayload; + +typedef struct +{ + LWord handle; // A session cookie required for reg gets/sets and close + ULWord result; // Actually a bool + ULWord eInterrupt; + ULWord timeOutMs; +} NTV2WaitForInterruptPayload; + +typedef struct +{ + LWord handle; // A session cookie required for reg gets/sets and close + ULWord result; // Actually a bool + ULWord bitFileType; // Actually enum: NTV2K2BitFileType + BITFILE_INFO_STRUCT bitFileInfo; // Joy: a portable proprietary type +} NTV2DriverGetBitFileInformationPayload; + +typedef struct +{ + LWord handle; // A session cookie required for reg gets/sets and close + ULWord result; // Actually a bool + BUILD_INFO_STRUCT buildInfo; // Another portable proprietary type +} NTV2DriverGetBuildInformationPayload; + + +typedef struct +{ + LWord handle; // A session cookie required for reg gets/sets and close + ULWord result; // Actually a bool + ULWord channel; // Actually an enum: NTV2Channel + ULWord testPatternFrameBufferFormat;// Actually an enum: NTV2FrameBufferFormat + ULWord signalMask; + ULWord testPatternDMAEnable; // Actually a bool + ULWord testPatternNumber; +} NTV2DownloadTestPatternPayload; + +#if 0 +#define NTV2NUB_DISCOVER_QUERY "Our chief weapons are?" +#define NTV2NUB_DISCOVER_RESP "Fear and surprise!" + +#define NTV2NUB_OPEN_QUERY "I didn't expect a kind of Spanish Inquisition." +#define NTV2NUB_OPEN_RESP "NOBODY expects the Spanish Inquisition!" + +#define NTV2NUB_READ_REG_SINGLE_QUERY "Cardinal Fang! Fetch...THE COMFY CHAIR!" +#define NTV2NUB_READ_REG_SINGLE_RESP "The...Comfy Chair?" + +#define NTV2NUB_WRITE_REG_QUERY "Biggles! Put her in the Comfy Chair!" +#define NTV2NUB_WRITE_REG_RESP "Is that really all it is?" + +#define NTV2NUB_GET_AUTOCIRCULATE_QUERY "Right! How do you plead?" +#define NTV2NUB_GET_AUTOCIRCULATE_RESP "Innocent." + +#define NTV2NUB_CONTROL_AUTOCIRCULATE_QUERY "Biggles! Fetch...THE SOFT CUSHIONS!" +#define NTV2NUB_CONTROL_AUTOCIRCULATE_RESP "Here they are, lord." + +#define NTV2NUB_WAIT_FOR_INTERRUPT_QUERY "My old man said follow the..." +#define NTV2NUB_WAIT_FOR_INTERRUPT_RESP "That's enough." + +#define NTV2NUB_DRIVER_GET_BITFILE_INFO_QUERY "Oh no - what kind of trouble?" +#define NTV2NUB_DRIVER_GET_BITFILE_INFO_RESP "One on't cross beams gone owt askew on treddle." + +#define NTV2NUB_DOWNLOAD_TEST_PATTERN_QUERY "You have three last chances, the nature of which I have divulged in my previous utterance." +#define NTV2NUB_DOWNLOAD_TEST_PATTERN_RESP "I don't know what you're talking about." + +#define NTV2NUB_READ_REG_MULTI_QUERY "Surprise and..." +#define NTV2NUB_READ_REG_MULTI_RESP "Ah!... our chief weapons are surprise... blah blah blah." + +#define NTV2NUB_GET_DRIVER_VERSION_QUERY "Shall I...?" +#define NTV2NUB_GET_DRIVER_VERSION_RESP "No, just pretend for God's sake. Ha! Ha! Ha!" +#endif + +#endif // __NTV2NUBTYPES_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2publicinterface.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2publicinterface.h new file mode 100644 index 0000000..3444b99 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2publicinterface.h @@ -0,0 +1,9871 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2publicinterface.h + @brief Declares enums and structs used by all platform drivers and the SDK. + @copyright (C) 2012-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef NTV2PUBLICINTERFACE_H +#define NTV2PUBLICINTERFACE_H + +#include "ajatypes.h" +#include "ntv2enums.h" +#if !defined(NTV2_BUILDING_DRIVER) + #include + #include + #include + #include + #include + #include + #include + #include "ajaexport.h" + #include "string.h" + #if defined(MSWindows) + #pragma warning(disable:4800) // int/bool conversion + #pragma warning(disable:4127) // Stop MSVC from bitching about "do{...}while(false)" macros + #endif +#endif // user-space clients only + +#if defined (MSWindows) + #include +#elif defined (AJAMac) + #pragma GCC diagnostic ignored "-Wunused-private-field" +#endif + + +typedef enum +{ + kRegGlobalControl, // 0 + kRegCh1Control, // 1 + kRegCh1PCIAccessFrame, // 2 + kRegCh1OutputFrame, // 3 + kRegCh1InputFrame, // 4 + kRegCh2Control, // 5 + kRegCh2PCIAccessFrame, // 6 + kRegCh2OutputFrame, // 7 + kRegCh2InputFrame, // 8 + kRegVidProc1Control, // 9 + kRegVidProcXptControl, // 10 + kRegMixer1Coefficient, // 11 + kRegSplitControl, // 12 + kRegFlatMatteValue, // 13 + kRegOutputTimingControl, // 14 + kRegReserved15, // 15 + kRegReserved16, // 16 + kRegFlashProgramReg, // 17 + kRegLineCount, // 18 + kRegOutputTimingFinePhase, // 19 (was kRegReserved3) + kRegAud1Delay = kRegOutputTimingFinePhase, //19 + kRegVidIntControl, // 20 + kRegStatus, // 21 + kRegInputStatus, // 22 + kRegAud1Detect, // 23 + kRegAud1Control, // 24 + kRegAud1SourceSelect, // 25 + kRegAud1OutputLastAddr, // 26 + kRegAud1InputLastAddr, // 27 + kRegAud1Counter, // 28 + kRegRP188InOut1DBB, // 29 + kRegRP188InOut1Bits0_31, // 30 + kRegRP188InOut1Bits32_63, // 31 + kRegDMA1HostAddr, // 32 + kRegDMA1LocalAddr, // 33 + kRegDMA1XferCount, // 34 + kRegDMA1NextDesc, // 35 + kRegDMA2HostAddr, // 36 + kRegDMA2LocalAddr, // 37 + kRegDMA2XferCount, // 38 + kRegDMA2NextDesc, // 39 + kRegDMA3HostAddr, // 40 + kRegDMA3LocalAddr, // 41 + kRegDMA3XferCount, // 42 + kRegDMA3NextDesc, // 43 + kRegDMA4HostAddr, // 44 + kRegDMA4LocalAddr, // 45 + kRegDMA4XferCount, // 46 + kRegDMA4NextDesc, // 47 + kRegDMAControl, // 48 + kRegDMAIntControl, // 49 + kRegBoardID, // 50 + kRegReserved51, // 51 + kRegReserved52, // 52 + kRegReserved53, // 53 + kRegReserved54, // 54 + kRegReserved55, // 55 + kRegReserved56, // 56 + kRegReserved57, // 57 + kRegXenaxFlashControlStatus, // 58 + kRegXenaxFlashAddress, // 59 + kRegXenaxFlashDIN, // 60 + kRegXenaxFlashDOUT, // 61 + kRegReserved62, // 62 + kRegCPLDVersion, // 63 + kRegRP188InOut2DBB, // 64 + kRegRP188InOut2Bits0_31, // 65 + kRegRP188InOut2Bits32_63, // 66 + kRegCanDoStatus, // 67 SDK 15.6 and later + kRegCh1ColorCorrectionControl, // 68 CamelCase fix in SDK 16.0 + kRegCh2ColorCorrectionControl, // 69 CamelCase fix SDK 16.0 + kRegRS422Transmit, // 70 + kRegRS422Receive, // 71 + kRegRS422Control, // 72 + kRegReserved73, // 73 + kRegReserved74, // 74 + kRegReserved75, // 75 + kRegReserved76, // 76 + kRegReserved77, // 77 + kRegReserved78, // 78 + kRegReserved79, // 79 + kRegReserved80, // 80 + + kRegAnalogInputStatus, // 81 + kRegAnalogInputControl, // 82 + kRegReserved83, // 83 + kRegFS1ProcAmpC1Y_C1CB, // 84 + kRegFS1ProcAmpC1CR_C2CB, // 85 + kRegFS1ProcAmpC2CROffsetY, // 86 + kRegFS1AudioDelay, // 87 + kRegAud2Delay = kRegFS1AudioDelay, //87 + kRegBitfileDate, // 88 + kRegBitfileTime, // 89 + + kRegFS1I2CControl, // 90 + kRegFS1I2C1Address, // 91 + kRegFS1I2C1Data, // 92 + kRegFS1I2C2Address, // 93 + kRegFS1I2C2Data, // 94 + kRegFS1ReferenceSelect, // 95 + kRegAverageAudioLevelChan1_2, // 96 + kRegAverageAudioLevelChan3_4, // 97 + kRegAverageAudioLevelChan5_6, // 98 + kRegAverageAudioLevelChan7_8, // 99 + + kRegDMA1HostAddrHigh, // 100 + kRegDMA1NextDescHigh, // 101 + kRegDMA2HostAddrHigh, // 102 + kRegDMA2NextDescHigh, // 103 + kRegDMA3HostAddrHigh, // 104 + kRegDMA3NextDescHigh, // 105 + kRegDMA4HostAddrHigh, // 106 + kRegDMA4NextDescHigh, // 107 + + kRegGlobalControl3, // 108 + kRegReserved109, // 109 // Used for camera record flag kRegLANCAndLensTap = kRegReserved109, // Borg //Note: Lens Tap is no longer supported by software. ref bug 3342. 4/5/2012 + kRegLTCEmbeddedBits0_31, // 110 + kRegLTCEmbeddedBits32_63, // 111 + kRegLTCAnalogBits0_31, // 112 + kRegLTCAnalogBits32_63, // 113 + + kRegLTCOutBits0_31 = kRegLTCEmbeddedBits0_31, // 110 + kRegLTCOutBits32_63 = kRegLTCEmbeddedBits32_63, // 111 + kRegLTCInBits0_31 = kRegLTCAnalogBits0_31, // 112 + kRegLTCInBits32_63 = kRegLTCAnalogBits32_63, // 113 + + kRegReserved114, // 114 + kRegAudioControl2, // 115 + kRegSysmonControl, // 116 + kRegSysmonConfig1_0, // 117 + kRegSysmonConfig2, // 118 + kRegSysmonVccIntDieTemp, // 119 + + kRegInternalExternalVoltage, // 120 + kRegFlashProgramReg2, // 121 + kRegHDMIOut3DStatus1, // 122 + kRegHDMIOut3DStatus2, // 123 + kRegHDMIOut3DControl, // 124 + kRegHDMIOutControl, // 125 + kRegHDMIInputStatus, // 126 + kRegHDMIInputControl, // 127 + kRegAnalogOutControl, // 128 + kRegSDIOut1Control, // 129 + + kRegSDIOut2Control, // 130 + kRegConversionControl, // 131 + kRegFrameSync1Control, // 132 + kRegI2CWriteData, // 133 + kRegFrameSync2Control, // 134 + kRegI2CWriteControl, // 135 + kRegXptSelectGroup1, // 136 + kRegXptSelectGroup2, // 137 + kRegXptSelectGroup3, // 138 + kRegXptSelectGroup4, // 139 + kRegXptSelectGroup5, // 140 + kRegXptSelectGroup6, // 141 + + kRegCSCoefficients1_2, // 142 + kRegCSCoefficients3_4, // 143 + kRegCSCoefficients5_6, // 144 + kRegCSCoefficients7_8, // 145 + kRegCSCoefficients9_10, // 146 + + kRegCS2Coefficients1_2, // 147 + kRegCS2Coefficients3_4, // 148 + kRegCS2Coefficients5_6, // 149 + kRegCS2Coefficients7_8, // 150 + kRegCS2Coefficients9_10, // 151 + + kRegField1Line21CaptionDecode, // 152 // OBSOLETE + kRegField2Line21CaptionDecode, // 153 // OBSOLETE + kRegField1Line21CaptionEncode, // 154 // OBSOLETE + kRegField2Line21CaptionEncode, // 155 // OBSOLETE + kRegVANCGrabberSetup, // 156 // OBSOLETE + kRegVANCGrabberStatus1, // 157 // OBSOLETE + kRegVANCGrabberStatus2, // 158 // OBSOLETE + kRegVANCGrabberDataBuffer, // 159 // OBSOLETE + kRegVANCInserterSetup1, // 160 // OBSOLETE + kRegVANCInserterSetup2, // 161 // OBSOLETE + kRegVANCInserterDataBuffer, // 162 // OBSOLETE + + kRegXptSelectGroup7, // 163 + kRegXptSelectGroup8, // 164 + kRegCh1ControlExtended, // 165 + kRegCh2ControlExtended, // 166 + kRegAFDVANCGrabber, // 167 + kRegFS1DownConverter2Control, // 168 + kRegSDIOut3Control, // 169 + kRegSDIOut4Control, // 170 + kRegAFDVANCInserterSDI1, // 171 + kRegAFDVANCInserterSDI2, // 172 + kRegAudioChannelMappingCh1, // 173 // OBSOLETE + kRegXptSelectGroup36, // 174 + kRegXptSelectGroup37, // 175 + kRegAudioChannelMappingCh4, // 176 // OBSOLETE + kRegAudioChannelMappingCh5, // 177 // OBSOLETE + kRegAudioChannelMappingCh6, // 178 // OBSOLETE + kRegAudioChannelMappingCh7, // 179 // OBSOLETE + kRegAudioChannelMappingCh8, // 180 // OBSOLETE + + kRegReserved181, // 181 + kRegReserved182, // 182 + kRegReserved183, // 183 + kRegReserved184, // 184 + kRegReserved185, // 185 + kRegReserved186, // 186 + kRegReserved187, // 187 + kRegVideoPayloadIDLinkA, // 188 + kRegVideoPayloadIDLinkB, // 189 + kRegSDIIn1VPIDA = kRegVideoPayloadIDLinkA, + kRegSDIIn1VPIDB = kRegVideoPayloadIDLinkB, + kRegAudioOutputSourceMap, // 190 + kRegXptSelectGroup11, // 191 + kRegStereoCompressor, // 192 + kRegXptSelectGroup12, // 193 + kRegFrameApertureOffset, // 194 + kRegFirmwareUserID, // 195 + kRegReserved196, // 196 + kRegReserved197, // 197 + kRegReserved198, // 198 + kRegReserved199, // 199 + kRegReserved200, // 200 + kRegReserved201, // 201 + kRegRP188InOut1Bits0_31_2, // 202 + kRegRP188InOut1Bits32_63_2, // 203 + kRegRP188InOut2Bits0_31_2, // 204 + kRegRP188InOut2Bits32_63_2, // 205 + kRegRP188InOut3Bits0_31_2, // 206 + kRegRP188InOut3Bits32_63_2, // 207 + kRegRP188InOut4Bits0_31_2, // 208 + kRegRP188InOut4Bits32_63_2, // 209 + kRegRP188InOut5Bits0_31_2, // 210 + kRegRP188InOut5Bits32_63_2, // 211 + kRegRP188InOut6Bits0_31_2, // 212 + kRegRP188InOut6Bits32_63_2, // 213 + kRegRP188InOut7Bits0_31_2, // 214 + kRegRP188InOut7Bits32_63_2, // 215 + kRegRP188InOut8Bits0_31_2, // 216 + kRegRP188InOut8Bits32_63_2, // 217 + kRegReserved218, // 218 + kRegReserved219, // 219 + kRegReserved220, // 220 + kRegReserved221, // 221 + kRegReserved222, // 222 + kRegReserved223, // 223 + kRegReserved224, // 224 + kRegReserved225, // 225 + kRegReserved226, // 226 + kRegReserved227, // 227 + kRegReserved228, // 228 + kRegReserved229, // 229 + kRegReserved230, // 230 + kRegReserved231, // 231 + kRegSDIInput3GStatus, // 232 + kRegLTCStatusControl, // 233 + kRegSDIOut1VPIDA, // 234 + kRegSDIOut1VPIDB, // 235 + kRegSDIOut2VPIDA, // 236 + kRegSDIOut2VPIDB, // 237 + kRegSDIIn2VPIDA, // 238 + kRegSDIIn2VPIDB, // 239 + kRegAud2Control, // 240 + kRegAud2SourceSelect, // 241 + kRegAud2OutputLastAddr, // 242 + kRegAud2InputLastAddr, // 243 + kRegRS4222Transmit, // 244 + kRegRS4222Receive, // 245 + kRegRS4222Control, // 246 + kRegVidProc2Control, // 247 + kRegMixer2Coefficient, // 248 + kRegFlatMatte2Value, // 249 + kRegXptSelectGroup9, // 250 + kRegXptSelectGroup10, // 251 + kRegLTC2EmbeddedBits0_31, // 252 + kRegLTC2EmbeddedBits32_63, // 253 + kRegLTC2AnalogBits0_31, // 254 + kRegLTC2AnalogBits32_63, // 255 + kRegSDITransmitControl, // 256 + kRegCh3Control, // 257 + kRegCh3OutputFrame, // 258 + kRegCh3InputFrame, // 259 + kRegCh4Control, // 260 + kRegCh4OutputFrame, // 261 + kRegCh4InputFrame, // 262 + kRegXptSelectGroup13, // 263 + kRegXptSelectGroup14, // 264 + kRegStatus2, // 265 + kRegVidIntControl2, // 266 + kRegGlobalControl2, // 267 + kRegRP188InOut3DBB, // 268 + kRegRP188InOut3Bits0_31, // 269 + kRegRP188InOut3Bits32_63, // 270 + kRegSDIOut3VPIDA, // 271 + kRegSDIOut3VPIDB, // 272 + kRegRP188InOut4DBB, // 273 + kRegRP188InOut4Bits0_31, // 274 + kRegRP188InOut4Bits32_63, // 275 + kRegSDIOut4VPIDA, // 276 + kRegSDIOut4VPIDB, // 277 + kRegAud3Control, // 278 + kRegAud4Control, // 279 + kRegAud3SourceSelect, // 280 + kRegAud4SourceSelect, // 281 + kRegAudDetect2, // 282 + kRegAud3OutputLastAddr, // 283 + kRegAud3InputLastAddr, // 284 + kRegAud4OutputLastAddr, // 285 + kRegAud4InputLastAddr, // 286 + kRegSDIInput3GStatus2, // 287 + kRegInputStatus2, // 288 + kRegCh3PCIAccessFrame, // 289 + kRegCh4PCIAccessFrame, // 290 + + kRegCS3Coefficients1_2, // 291 + kRegCS3Coefficients3_4, // 292 + kRegCS3Coefficients5_6, // 293 + kRegCS3Coefficients7_8, // 294 + kRegCS3Coefficients9_10, // 295 + + kRegCS4Coefficients1_2, // 296 + kRegCS4Coefficients3_4, // 297 + kRegCS4Coefficients5_6, // 298 + kRegCS4Coefficients7_8, // 299 + kRegCS4Coefficients9_10, // 300 + + kRegXptSelectGroup17, // 301 + kRegXptSelectGroup15, // 302 + kRegXptSelectGroup16, // 303 + + kRegAud3Delay, // 304 + kRegAud4Delay, // 305 + + kRegSDIIn3VPIDA, // 306 + kRegSDIIn3VPIDB, // 307 + kRegSDIIn4VPIDA, // 308 + kRegSDIIn4VPIDB, // 309 + + kRegSDIWatchdogControlStatus, // 310 + kRegSDIWatchdogTimeout, // 311 + kRegSDIWatchdogKick1, // 312 + kRegSDIWatchdogKick2, // 313 + kRegReserved314, // 314 + kRegReserved315, // 315 + + kRegLTC3EmbeddedBits0_31, // 316 + kRegLTC3EmbeddedBits32_63, // 317 + + kRegLTC4EmbeddedBits0_31, // 318 + kRegLTC4EmbeddedBits32_63, // 319 + + kRegReserved320, // 320 + kRegReserved321, // 321 + kRegReserved322, // 322 + kRegReserved323, // 323 + kRegReserved324, // 324 + kRegReserved325, // 325 + kRegReserved326, // 326 + kRegReserved327, // 327 + kRegReserved328, // 328 + + kRegHDMITimeCode, // 329 + + //HDMI HDR Registers + kRegHDMIHDRGreenPrimary, // 330 + kRegHDMIHDRBluePrimary, // 331 + kRegHDMIHDRRedPrimary, // 332 + kRegHDMIHDRWhitePoint, // 333 + kRegHDMIHDRMasteringLuminence, // 334 + kRegHDMIHDRLightLevel, // 335 + kRegHDMIHDRControl, // 336 + + kRegSDIOut5Control, // 337 + kRegSDIOut5VPIDA, // 338 + kRegSDIOut5VPIDB, // 339 + + kRegRP188InOut5Bits0_31, // 340 + kRegRP188InOut5Bits32_63, // 341 + kRegRP188InOut5DBB, // 342 + + kReg3DLUTLoadControl, // 343 + + kRegLTC5EmbeddedBits0_31, // 344 + kRegLTC5EmbeddedBits32_63, // 345 + + kRegDL5Control, // 346 + + kRegCS5Coefficients1_2, // 347 + kRegCS5Coefficients3_4, // 348 + kRegCS5Coefficients5_6, // 349 + kRegCS5Coefficients7_8, // 350 + kRegCS5Coefficients9_10, // 351 + + kRegXptSelectGroup18, // 352 + + kRegReserved353, // 353 + + kRegDC1, // 354 + kRegDC2, // 355 + kRegXptSelectGroup19, // 356 + + kRegXptSelectGroup20, // 357 + kRegRasterizerControl, // 358 + + //HDMI V2 In Registers + kRegHDMIV2I2C1Control, // 359 + kRegHDMIV2I2C1Data, // 360 + kRegHDMIV2VideoSetup, // 361 + kRegHDMIV2HSyncDurationAndBackPorch, // 362 + kRegHDMIV2HActive, // 363 + kRegHDMIV2VSyncDurationAndBackPorchField1, // 364 + kRegHDMIV2VSyncDurationAndBackPorchField2, // 365 + kRegHDMIV2VActiveField1, // 366 + kRegHDMIV2VActiveField2, // 367 + kRegHDMIV2VideoStatus, // 368 + kRegHDMIV2HorizontalMeasurements, // 369 + kRegHDMIV2HBlankingMeasurements, // 370 + kRegHDMIV2HBlankingMeasurements1, // 371 + kRegHDMIV2VerticalMeasurementsField0, // 372 + kRegHDMIV2VerticalMeasurementsField1, // 373 + kRegHDMIV2i2c2Control, // 374 + kRegHDMIV2i2c2Data, // 375 + + kRegLUTV2Control, // 376 + + //Scott: New Dax/Multi-channel Registers + kRegGlobalControlCh2, // 377 + kRegGlobalControlCh3, // 378 + kRegGlobalControlCh4, // 379 + kRegGlobalControlCh5, // 380 + kRegGlobalControlCh6, // 381 + kRegGlobalControlCh7, // 382 + kRegGlobalControlCh8, // 383 + + kRegCh5Control, // 384 + kRegCh5OutputFrame, // 385 + kRegCh5InputFrame, // 386 + kRegCh5PCIAccessFrame, // 387 + + kRegCh6Control, // 388 + kRegCh6OutputFrame, // 389 + kRegCh6InputFrame, // 390 + kRegCh6PCIAccessFrame, // 391 + + kRegCh7Control, // 392 + kRegCh7OutputFrame, // 393 + kRegCh7InputFrame, // 394 + kRegCh7PCIAccessFrame, // 395 + + kRegCh8Control, // 396 + kRegCh8OutputFrame, // 397 + kRegCh8InputFrame, // 398 + kRegCh8PCIAccessFrame, // 399 + + kRegXptSelectGroup21, // 400 + kRegXptSelectGroup22, // 401 + kRegXptSelectGroup30, // 402 + kRegXptSelectGroup23, // 403 + kRegXptSelectGroup24, // 404 + kRegXptSelectGroup25, // 405 + kRegXptSelectGroup26, // 406 + kRegXptSelectGroup27, // 407 + kRegXptSelectGroup28, // 408 + kRegXptSelectGroup29, // 409 + + kRegSDIIn5VPIDA, // 410 + kRegSDIIn5VPIDB, // 411 + + kRegSDIIn6VPIDA, // 412 + kRegSDIIn6VPIDB, // 413 + kRegSDIOut6VPIDA, // 414 + kRegSDIOut6VPIDB, // 415 + kRegRP188InOut6Bits0_31, // 416 + kRegRP188InOut6Bits32_63, // 417 + kRegRP188InOut6DBB, // 418 + kRegLTC6EmbeddedBits0_31, // 419 + kRegLTC6EmbeddedBits32_63, // 420 + + kRegSDIIn7VPIDA, // 421 + kRegSDIIn7VPIDB, // 422 + kRegSDIOut7VPIDA, // 423 + kRegSDIOut7VPIDB, // 424 + kRegRP188InOut7Bits0_31, // 425 + kRegRP188InOut7Bits32_63, // 426 + kRegRP188InOut7DBB, // 427 + kRegLTC7EmbeddedBits0_31, // 428 + kRegLTC7EmbeddedBits32_63, // 429 + + kRegSDIIn8VPIDA, // 430 + kRegSDIIn8VPIDB, // 431 + kRegSDIOut8VPIDA, // 432 + kRegSDIOut8VPIDB, // 433 + kRegRP188InOut8Bits0_31, // 434 + kRegRP188InOut8Bits32_63, // 435 + kRegRP188InOut8DBB, // 436 + kRegLTC8EmbeddedBits0_31, // 437 + kRegLTC8EmbeddedBits32_63, // 438 + + kRegXptSelectGroup31, // 439 + + kRegAud5Control, // 440 + kRegAud5SourceSelect, // 441 + kRegAud5OutputLastAddr, // 442 + kRegAud5InputLastAddr, // 443 + + kRegAud6Control, // 444 + kRegAud6SourceSelect, // 445 + kRegAud6OutputLastAddr, // 446 + kRegAud6InputLastAddr, // 447 + + kRegAud7Control, // 448 + kRegAud7SourceSelect, // 449 + kRegAud7OutputLastAddr, // 450 + kRegAud7InputLastAddr, // 451 + + kRegAud8Control, // 452 + kRegAud8SourceSelect, // 453 + kRegAud8OutputLastAddr, // 454 + kRegAud8InputLastAddr, // 455 + + kRegAudioDetect5678, // 456 + + kRegSDI5678Input3GStatus, // 457 + + kRegInput56Status, // 458 + kRegInput78Status, // 459 + + kRegCS6Coefficients1_2, // 460 + kRegCS6Coefficients3_4, // 461 + kRegCS6Coefficients5_6, // 462 + kRegCS6Coefficients7_8, // 463 + kRegCS6Coefficients9_10, // 464 + + kRegCS7Coefficients1_2, // 465 + kRegCS7Coefficients3_4, // 466 + kRegCS7Coefficients5_6, // 467 + kRegCS7Coefficients7_8, // 468 + kRegCS7Coefficients9_10, // 469 + + kRegCS8Coefficients1_2, // 470 + kRegCS8Coefficients3_4, // 471 + kRegCS8Coefficients5_6, // 472 + kRegCS8Coefficients7_8, // 473 + kRegCS8Coefficients9_10, // 474 + + kRegSDIOut6Control, // 475 + kRegSDIOut7Control, // 476 + kRegSDIOut8Control, // 477 + + kRegOutputTimingControlch2, // 478 + kRegOutputTimingControlch3, // 479 + kRegOutputTimingControlch4, // 480 + kRegOutputTimingControlch5, // 481 + kRegOutputTimingControlch6, // 482 + kRegOutputTimingControlch7, // 483 + kRegOutputTimingControlch8, // 484 + + kRegVidProc3Control, // 485 + kRegMixer3Coefficient, // 486 + kRegFlatMatte3Value, // 487 + + kRegVidProc4Control, // 488 + kRegMixer4Coefficient, // 489 + kRegFlatMatte4Value, // 490 + + kRegTRSErrorStatus, // 491 + + kRegAud5Delay, // 492 + kRegAud6Delay, // 493 + kRegAud7Delay, // 494 + kRegAud8Delay, // 495 + + kRegPCMControl4321, // 496 + kRegPCMControl8765, // 497 + + kRegCh1Control2MFrame, // 498 + kRegCh2Control2MFrame, // 499 + kRegCh3Control2MFrame, // 500 + kRegCh4Control2MFrame, // 501 + kRegCh5Control2MFrame, // 502 + kRegCh6Control2MFrame, // 503 + kRegCh7Control2MFrame, // 504 + kRegCh8Control2MFrame, // 505 + kRegXptSelectGroup32, // 506 + kRegXptSelectGroup33, // 507 + kRegXptSelectGroup34, // 508 + kRegXptSelectGroup35, // 509 + kRegReserved510, // 510 + kRegReserved511, // 511 + + kRegNumRegisters +} NTV2RegisterNumber; + +typedef NTV2RegisterNumber RegisterNum; + +#define kRegCh1ColorCorrectioncontrol kRegCh1ColorCorrectionControl // CamelCase fixed in SDK 16.0 +#define kRegCh2ColorCorrectioncontrol kRegCh2ColorCorrectionControl // CamelCase fixed in SDK 16.0 + +// Discontinuous block of registers used for monitoring the incoming SDI signals +typedef enum NTV2RXSDIStatusRegister +{ + kRegRXSDI1Status = 2048, // 2048 + kRegRXSDI1CRCErrorCount, // 2049 + kRegRXSDI1FrameCountLow, // 2050 + kRegRXSDI1FrameCountHigh, // 2051 + kRegRXSDI1FrameRefCountLow, // 2052 + kRegRXSDI1FrameRefCountHigh, // 2053 + kRegRXSDI1Unused2054, // 2054 + kRegRXSDI1Unused2055, // 2055 + + kRegRXSDI2Status, // 2056 + kRegRXSDI2CRCErrorCount, // 2057 + kRegRXSDI2FrameCountLow, // 2058 + kRegRXSDI2FrameCountHigh, // 2059 + kRegRXSDI2FrameRefCountLow, // 2060 + kRegRXSDI2FrameRefCountHigh, // 2061 + kRegRXSDI2Unused2062, // 2062 + kRegRXSDI2Unused2063, // 2063 + + kRegRXSDI3Status, // 2064 + kRegRXSDI3CRCErrorCount, // 2065 + kRegRXSDI3FrameCountLow, // 2066 + kRegRXSDI3FrameCountHigh, // 2067 + kRegRXSDI3FrameRefCountLow, // 2068 + kRegRXSDI3FrameRefCountHigh, // 2069 + kRegRXSDI3Unused2070, // 2070 + kRegRXSDI3Unused2071, // 2071 + + kRegRXSDI4Status, // 2072 + kRegRXSDI4CRCErrorCount, // 2073 + kRegRXSDI4FrameCountLow, // 2074 + kRegRXSDI4FrameCountHigh, // 2075 + kRegRXSDI4FrameRefCountLow, // 2076 + kRegRXSDI4FrameRefCountHigh, // 2077 + kRegRXSDI4Unused2078, // 2078 + kRegRXSDI4Unused2079, // 2079 + + kRegRXSDI5Status, // 2080 + kRegRXSDI5CRCErrorCount, // 2081 + kRegRXSDI5FrameCountLow, // 2082 + kRegRXSDI5FrameCountHigh, // 2083 + kRegRXSDI5FrameRefCountLow, // 2084 + kRegRXSDI5FrameRefCountHigh, // 2085 + kRegRXSDI5Unused2086, // 2086 + kRegRXSDI5Unused2087, // 2087 + + kRegRXSDI6Status, // 2088 + kRegRXSDI6CRCErrorCount, // 2089 + kRegRXSDI6FrameCountLow, // 2090 + kRegRXSDI6FrameCountHigh, // 2091 + kRegRXSDI6FrameRefCountLow, // 2092 + kRegRXSDI6FrameRefCountHigh, // 2093 + kRegRXSDI6Unused2094, // 2094 + kRegRXSDI6Unused2095, // 2095 + + kRegRXSDI7Status, // 2096 + kRegRXSDI7CRCErrorCount, // 2097 + kRegRXSDI7FrameCountLow, // 2098 + kRegRXSDI7FrameCountHigh, // 2099 + kRegRXSDI7FrameRefCountLow, // 2100 + kRegRXSDI7FrameRefCountHigh, // 2101 + kRegRXSDI7Unused2102, // 2102 + kRegRXSDI7Unused2103, // 2103 + + kRegRXSDI8Status, // 2104 + kRegRXSDI8CRCErrorCount, // 2105 + kRegRXSDI8FrameCountLow, // 2106 + kRegRXSDI8FrameCountHigh, // 2107 + kRegRXSDI8FrameRefCountLow, // 2108 + kRegRXSDI8FrameRefCountHigh, // 2109 + kRegRXSDI8Unused2110, // 2110 + kRegRXSDI8Unused2111, // 2111 + + kRegRXSDIFreeRunningClockLow, // 2112 + kRegRXSDIFreeRunningClockHigh, // 2113 + + kRegNumRXSDIRegisters = 2113 - 2048 + 1 +} NTV2RXSDIStatusRegisters; + +typedef enum +{ + kReg1DLUTLoadControl1 = 2200, //2200 + kReg1DLUTLoadControl2, //2201 + kReg1DLUTLoadControl3, //2202 + kReg1DLUTLoadControl4, //2203 + kReg1DLUTLoadControl5, //2204 + kReg1DLUTLoadControl6, //2205 + kReg1DLUTLoadControl7, //2206 + kReg1DLUTLoadControl8 //2207 +}NTV2LUTControlRegisters; + +typedef enum +{ + kRegAudioMixerInputSelects = 2304 // 2304 + ,kRegAudioMixerMainGain // 2305 + ,kRegAudioMixerAux1GainCh1 // 2306 + ,kRegAudioMixerAux2GainCh1 // 2307 + ,kRegAudioMixerChannelSelect // 2308 + ,kRegAudioMixerMutes // 2309 + ,kRegAudioMixerAux1GainCh2 // 2310 + ,kRegAudioMixerAux2GainCh2 // 2311 + ,kRegAudioMixerOutGain // 2312 + ,kRegAudioMixerOutLGain = kRegAudioMixerOutGain + ,kRegAudioMixerOutRGain // 2313 + ,kRegAudioMixerAux1InputLevels = 2318 // 2318 + ,kRegAudioMixerAux2InputLevels // 2319 + ,kRegAudioMixerMainInputLevelsPair0 // 2320 + ,kRegAudioMixerMainInputLevelsPair1 // 2321 + ,kRegAudioMixerMainInputLevelsPair2 // 2322 + ,kRegAudioMixerMainInputLevelsPair3 // 2323 + ,kRegAudioMixerMainInputLevelsPair4 // 2324 + ,kRegAudioMixerMainInputLevelsPair5 // 2325 + ,kRegAudioMixerMainInputLevelsPair6 // 2326 + ,kRegAudioMixerMainInputLevelsPair7 // 2327 + ,kRegAudioMixerMixedChannelOutputLevels // 2328 + ,kRegAudioMixerMainOutputLevelsPair0 = kRegAudioMixerMixedChannelOutputLevels // 2328 + ,kRegAudioMixerMainOutputLevelsPair1 // 2329 + ,kRegAudioMixerMainOutputLevelsPair2 // 2330 + ,kRegAudioMixerMainOutputLevelsPair3 // 2331 + ,kRegAudioMixerMainOutputLevelsPair4 // 2332 + ,kRegAudioMixerMainOutputLevelsPair5 // 2333 + ,kRegAudioMixerMainOutputLevelsPair6 // 2334 + ,kRegAudioMixerMainOutputLevelsPair7 // 2335 +} NTV2AudioMixerRegisters; + +// Discontinuous block of registers used for detecting non-PCM embedded audio. +typedef enum _NTV2NonPCMAudioDetectRegisters +{ + kRegFirstNonPCMAudioDetectRegister = 2130, + kRegNonPCMAudioDetectEngine1 = kRegFirstNonPCMAudioDetectRegister, // 2130 + kRegNonPCMAudioDetectEngine2 = kRegFirstNonPCMAudioDetectRegister + 2, // 2132 + kRegNonPCMAudioDetectEngine3 = kRegFirstNonPCMAudioDetectRegister + 4, // 2134 + kRegNonPCMAudioDetectEngine4 = kRegFirstNonPCMAudioDetectRegister + 6, // 2136 + kRegNonPCMAudioDetectEngine5 = kRegFirstNonPCMAudioDetectRegister + 8, // 2138 + kRegNonPCMAudioDetectEngine6 = kRegFirstNonPCMAudioDetectRegister + 10, // 2140 + kRegNonPCMAudioDetectEngine7 = kRegFirstNonPCMAudioDetectRegister + 12, // 2142 + kRegNonPCMAudioDetectEngine8 = kRegFirstNonPCMAudioDetectRegister + 14, // 2144 + kRegLastNonPCMAudioDetectRegister = kRegNonPCMAudioDetectEngine8 +} NTV2NonPCMAudioDetectRegisters; + +// New in SDK 15.6: +// Some boards have new firmware that implements a "valid route" bitmap ROM accessed by a contiguous block of registers: +typedef enum _NTV2XptValidROMRegisters +{ + kRegFirstValidXptROMRegister = 3072, // Starts at reg 3072 + kRegNumValidXptROMRegisters = 1024, // It's 4096 bytes long + kRegLastValidXptROMRegister = kRegFirstValidXptROMRegister + kRegNumValidXptROMRegisters - 1, + kRegInvalidValidXptROMRegister = kRegFirstValidXptROMRegister + kRegNumValidXptROMRegisters +} NTV2XptValidROMRegisters; + +// Discontinuous block of registers used to control the enhanced color space converters +typedef enum +{ + kRegEnhancedCSC1Mode = 5120, // 5120 + kRegEnhancedCSC1InOffset0_1, // 5121 + kRegEnhancedCSC1InOffset2, // 5122 + kRegEnhancedCSC1CoeffA0, // 5123 + kRegEnhancedCSC1CoeffA1, // 5124 + kRegEnhancedCSC1CoeffA2, // 5125 + kRegEnhancedCSC1CoeffB0, // 5126 + kRegEnhancedCSC1CoeffB1, // 5127 + kRegEnhancedCSC1CoeffB2, // 5128 + kRegEnhancedCSC1CoeffC0, // 5129 + kRegEnhancedCSC1CoeffC1, // 5130 + kRegEnhancedCSC1CoeffC2, // 5131 + kRegEnhancedCSC1OutOffsetA_B, // 5132 + kRegEnhancedCSC1OutOffsetC, // 5133 + kRegEnhancedCSC1KeyMode, // 5134 + kRegEnhancedCSC1KeyClipOffset, // 5135 + kRegEnhancedCSC1KeyGain, // 5136 + + kRegNumEnhancedCSCRegisters = 5136 - 5120 + 1, + + kRegEnhancedCSC2Mode = 5184, // 5184 + kRegEnhancedCSC2InOffset0_1, // 5185 + kRegEnhancedCSC2InOffset2, // 5186 + kRegEnhancedCSC2CoeffA0, // 5187 + kRegEnhancedCSC2CoeffA1, // 5188 + kRegEnhancedCSC2CoeffA2, // 5189 + kRegEnhancedCSC2CoeffB0, // 5190 + kRegEnhancedCSC2CoeffB1, // 5191 + kRegEnhancedCSC2CoeffB2, // 5192 + kRegEnhancedCSC2CoeffC0, // 5193 + kRegEnhancedCSC2CoeffC1, // 5194 + kRegEnhancedCSC2CoeffC2, // 5195 + kRegEnhancedCSC2OutOffsetA_B, // 5196 + kRegEnhancedCSC2OutOffsetC, // 5197 + kRegEnhancedCSC2KeyMode, // 5198 + kRegEnhancedCSC2KeyClipOffset, // 5199 + kRegEnhancedCSC2KeyGain, // 5200 + + kRegEnhancedCSC3Mode = 5248, // 5248 + kRegEnhancedCSC3InOffset0_1, // 5249 + kRegEnhancedCSC3InOffset2, // 5250 + kRegEnhancedCSC3CoeffA0, // 5251 + kRegEnhancedCSC3CoeffA1, // 5252 + kRegEnhancedCSC3CoeffA2, // 5253 + kRegEnhancedCSC3CoeffB0, // 5254 + kRegEnhancedCSC3CoeffB1, // 5255 + kRegEnhancedCSC3CoeffB2, // 5256 + kRegEnhancedCSC3CoeffC0, // 5257 + kRegEnhancedCSC3CoeffC1, // 5258 + kRegEnhancedCSC3CoeffC2, // 5259 + kRegEnhancedCSC3OutOffsetA_B, // 5260 + kRegEnhancedCSC3OutOffsetC, // 5261 + kRegEnhancedCSC3KeyMode, // 5262 + kRegEnhancedCSC3KeyClipOffset, // 5263 + kRegEnhancedCSC3KeyGain, // 5264 + + kRegEnhancedCSC4Mode = 5312, // 5312 + kRegEnhancedCSC4InOffset0_1, // 5313 + kRegEnhancedCSC4InOffset2, // 5314 + kRegEnhancedCSC4CoeffA0, // 5315 + kRegEnhancedCSC4CoeffA1, // 5316 + kRegEnhancedCSC4CoeffA2, // 5317 + kRegEnhancedCSC4CoeffB0, // 5318 + kRegEnhancedCSC4CoeffB1, // 5319 + kRegEnhancedCSC4CoeffB2, // 5320 + kRegEnhancedCSC4CoeffC0, // 5321 + kRegEnhancedCSC4CoeffC1, // 5322 + kRegEnhancedCSC4CoeffC2, // 5323 + kRegEnhancedCSC4OutOffsetA_B, // 5324 + kRegEnhancedCSC4OutOffsetC, // 5325 + kRegEnhancedCSC4KeyMode, // 5326 + kRegEnhancedCSC4KeyClipOffset, // 5327 + kRegEnhancedCSC4KeyGain, // 5328 + + kRegEnhancedCSC5Mode = 5376, // 5376 + kRegEnhancedCSC5InOffset0_1, // 5377 + kRegEnhancedCSC5InOffset2, // 5378 + kRegEnhancedCSC5CoeffA0, // 5379 + kRegEnhancedCSC5CoeffA1, // 5380 + kRegEnhancedCSC5CoeffA2, // 5381 + kRegEnhancedCSC5CoeffB0, // 5382 + kRegEnhancedCSC5CoeffB1, // 5383 + kRegEnhancedCSC5CoeffB2, // 5384 + kRegEnhancedCSC5CoeffC0, // 5385 + kRegEnhancedCSC5CoeffC1, // 5386 + kRegEnhancedCSC5CoeffC2, // 5387 + kRegEnhancedCSC5OutOffsetA_B, // 5388 + kRegEnhancedCSC5OutOffsetC, // 5389 + kRegEnhancedCSC5KeyMode, // 5390 + kRegEnhancedCSC5KeyClipOffset, // 5391 + kRegEnhancedCSC5KeyGain, // 5392 + + kRegEnhancedCSC6Mode = 5440, // 5440 or fight + kRegEnhancedCSC6InOffset0_1, // 5441 + kRegEnhancedCSC6InOffset2, // 5442 + kRegEnhancedCSC6CoeffA0, // 5443 + kRegEnhancedCSC6CoeffA1, // 5444 + kRegEnhancedCSC6CoeffA2, // 5445 + kRegEnhancedCSC6CoeffB0, // 5446 + kRegEnhancedCSC6CoeffB1, // 5447 + kRegEnhancedCSC6CoeffB2, // 5448 + kRegEnhancedCSC6CoeffC0, // 5449 + kRegEnhancedCSC6CoeffC1, // 5450 + kRegEnhancedCSC6CoeffC2, // 5451 + kRegEnhancedCSC6OutOffsetA_B, // 5452 + kRegEnhancedCSC6OutOffsetC, // 5453 + kRegEnhancedCSC6KeyMode, // 5454 + kRegEnhancedCSC6KeyClipOffset, // 5455 + kRegEnhancedCSC6KeyGain, // 5456 + + kRegEnhancedCSC7Mode = 5504, // 5504 + kRegEnhancedCSC7InOffset0_1, // 5505 + kRegEnhancedCSC7InOffset2, // 5506 + kRegEnhancedCSC7CoeffA0, // 5507 + kRegEnhancedCSC7CoeffA1, // 5508 + kRegEnhancedCSC7CoeffA2, // 5509 + kRegEnhancedCSC7CoeffB0, // 5510 + kRegEnhancedCSC7CoeffB1, // 5511 + kRegEnhancedCSC7CoeffB2, // 5512 + kRegEnhancedCSC7CoeffC0, // 5513 + kRegEnhancedCSC7CoeffC1, // 5514 + kRegEnhancedCSC7CoeffC2, // 5515 + kRegEnhancedCSC7OutOffsetA_B, // 5516 + kRegEnhancedCSC7OutOffsetC, // 5517 + kRegEnhancedCSC7KeyMode, // 5518 + kRegEnhancedCSC7KeyClipOffset, // 5519 + kRegEnhancedCSC7KeyGain, // 5520 + + kRegEnhancedCSC8Mode = 5568, // 5568 + kRegEnhancedCSC8InOffset0_1, // 5569 + kRegEnhancedCSC8InOffset2, // 5570 + kRegEnhancedCSC8CoeffA0, // 5571 + kRegEnhancedCSC8CoeffA1, // 5572 + kRegEnhancedCSC8CoeffA2, // 5573 + kRegEnhancedCSC8CoeffB0, // 5574 + kRegEnhancedCSC8CoeffB1, // 5575 + kRegEnhancedCSC8CoeffB2, // 5576 + kRegEnhancedCSC8CoeffC0, // 5577 + kRegEnhancedCSC8CoeffC1, // 5578 + kRegEnhancedCSC8CoeffC2, // 5579 + kRegEnhancedCSC8OutOffsetA_B, // 5580 + kRegEnhancedCSC8OutOffsetC, // 5581 + kRegEnhancedCSC8KeyMode, // 5582 + kRegEnhancedCSC8KeyClipOffset, // 5583 + kRegEnhancedCSC8KeyGain // 5584 + +} NTV2EnhancedCSCRegisters; + +typedef enum _NTV2OERegisters +{ + kRegOEData1 = 0x1700, + kRegOEData256 = 0x173F +} NTV2OERegisters; + +typedef enum +{ + kRegHDMIOutputAudioConfig = 0x1d4B +}NTV2HDMIOutAudioRegisters; + +typedef enum _NTV2HDMIRegisters +{ + kRegHDMIOutputAuxData = 0x0a00, + kRegHDMIOutputConfig1 = 0x1d14, + kRegHDMIInputStatus1 = 0x1d15, + kRegHDMIControl1 = 0x1d16, + kRegHDMIOutputConfig2 = 0x2514, + kRegHDMIInputStatus2 = 0x2515, + kRegHDMIControl2 = 0x2516, + kRegHDMIOutputConfig3 = 0x2c12, + kRegHDMIInputStatus3 = 0x2c13, + kRegHDMIControl3 = 0x2c14, + kRegHDMIOutputConfig4 = 0x3012, + kRegHDMIInputStatus4 = 0x3013, + kRegHDMIControl4 = 0x3014 +} NTV2HDMIRegisters; + +typedef enum _NTV2MultiRasterRegisters +{ + kRegMRQ1Control = 0x1740, + kRegMRQ2Control, + kRegMRQ3Control, + kRegMRQ4Control, + kRegMROutControl, + kRegMRSupport = 0x1747 +} NTV2MultiRasterRegisters; + +typedef enum +{ + kRegRotaryEncoder = 0x940 +} NTV2RotaryEncoderRegister; + +#define NTV2_HDMIAuxMaxFrames 8 +#define NTV2_HDMIAuxDataSize 32 + +#if !defined (NTV2_DEPRECATE) + #define KRegDMA1HostAddr kRegDMA1HostAddr ///< @deprecated Use kRegDMA1HostAddr instead. + #define KRegDMA2HostAddr kRegDMA2HostAddr ///< @deprecated Use kRegDMA2HostAddr instead. + #define KRegDMA3HostAddr kRegDMA3HostAddr ///< @deprecated Use kRegDMA3HostAddr instead. + #define KRegDMA4HostAddr kRegDMA4HostAddr ///< @deprecated Use kRegDMA4HostAddr instead. + #define kRegPanControl kRegReserved15 ///< @deprecated Do not use (not supported). + #define kRegReserved2 kRegReserved16 ///< @deprecated Do not use. + #define kRegVidProcControl kRegVidProc1Control ///< @deprecated Use kRegVidProc1Control instead. + #define kRegMixerCoefficient kRegMixer1Coefficient ///< @deprecated Use kRegMixer1Coefficient instead. + #define kRegAudDetect kRegAud1Detect ///< @deprecated Use kRegAud1Detect instead. + #define kRegAudControl kRegAud1Control ///< @deprecated Use kRegAud1Control instead. + #define kRegAudSourceSelect kRegAud1SourceSelect ///< @deprecated Use kRegAud1SourceSelect instead. + #define kRegAudOutputLastAddr kRegAud1OutputLastAddr ///< @deprecated Use kRegAud1OutputLastAddr instead. + #define kRegAudInputLastAddr kRegAud1InputLastAddr ///< @deprecated Use kRegAud1InputLastAddr instead. + #define kRegAudCounter kRegAud1Counter ///< @deprecated Use kRegAud1Counter instead. + #define kRegFlatMattleValue kRegFlatMatteValue ///< @deprecated Use kRegFlatMatteValue instead. + #define kRegFlatMattle2Value kRegFlatMatte2Value ///< @deprecated Use kRegFlatMatte2Value instead. + + #define kK2RegAnalogOutControl kRegAnalogOutControl ///< @deprecated Use kRegAnalogOutControl instead. + #define kK2RegSDIOut1Control kRegSDIOut1Control ///< @deprecated Use kRegSDIOut1Control instead. + #define kK2RegSDIOut2Control kRegSDIOut2Control ///< @deprecated Use kRegSDIOut2Control instead. + #define kK2RegConversionControl kRegConversionControl ///< @deprecated Use kRegConversionControl instead. + #define kK2RegFrameSync1Control kRegFrameSync1Control ///< @deprecated Use kRegFrameSync1Control instead. + #define kK2RegFrameSync2Control kRegFrameSync2Control ///< @deprecated Use kRegFrameSync2Control instead. + #define kK2RegXptSelectGroup1 kRegXptSelectGroup1 ///< @deprecated Use kRegXptSelectGroup1 instead. + #define kK2RegXptSelectGroup2 kRegXptSelectGroup2 ///< @deprecated Use kRegXptSelectGroup2 instead. + #define kK2RegXptSelectGroup3 kRegXptSelectGroup3 ///< @deprecated Use kRegXptSelectGroup3 instead. + #define kK2RegXptSelectGroup4 kRegXptSelectGroup4 ///< @deprecated Use kRegXptSelectGroup4 instead. + #define kK2RegXptSelectGroup5 kRegXptSelectGroup5 ///< @deprecated Use kRegXptSelectGroup5 instead. + #define kK2RegXptSelectGroup6 kRegXptSelectGroup6 ///< @deprecated Use kRegXptSelectGroup6 instead. + #define kK2RegCSCoefficients1_2 kRegCSCoefficients1_2 ///< @deprecated Use kRegCSCoefficients1_2 instead. + #define kK2RegCSCoefficients3_4 kRegCSCoefficients3_4 ///< @deprecated Use kRegCSCoefficients3_4 instead. + #define kK2RegCSCoefficients5_6 kRegCSCoefficients5_6 ///< @deprecated Use kRegCSCoefficients5_6 instead. + #define kK2RegCSCoefficients7_8 kRegCSCoefficients7_8 ///< @deprecated Use kRegCSCoefficients7_8 instead. + #define kK2RegCSCoefficients9_10 kRegCSCoefficients9_10 ///< @deprecated Use kRegCSCoefficients9_10 instead. + #define kK2RegCS2Coefficients1_2 kRegCS2Coefficients1_2 ///< @deprecated Use kRegCS2Coefficients1_2 instead. + #define kK2RegCS2Coefficients3_4 kRegCS2Coefficients3_4 ///< @deprecated Use kRegCS2Coefficients3_4 instead. + #define kK2RegCS2Coefficients5_6 kRegCS2Coefficients5_6 ///< @deprecated Use kRegCS2Coefficients5_6 instead. + #define kK2RegCS2Coefficients7_8 kRegCS2Coefficients7_8 ///< @deprecated Use kRegCS2Coefficients7_8 instead. + #define kK2RegCS2Coefficients9_10 kRegCS2Coefficients9_10 ///< @deprecated Use kRegCS2Coefficients9_10 instead. + #define kK2RegXptSelectGroup7 kRegXptSelectGroup7 ///< @deprecated Use kRegXptSelectGroup7 instead. + #define kK2RegXptSelectGroup8 kRegXptSelectGroup8 ///< @deprecated Use kRegXptSelectGroup8 instead. + #define kK2RegSDIOut3Control kRegSDIOut3Control ///< @deprecated Use kRegSDIOut3Control instead. + #define kK2RegSDIOut4Control kRegSDIOut4Control ///< @deprecated Use kRegSDIOut4Control instead. + #define kK2RegXptSelectGroup11 kRegXptSelectGroup11 ///< @deprecated Use kRegXptSelectGroup11 instead. + #define kK2RegXptSelectGroup12 kRegXptSelectGroup12 ///< @deprecated Use kRegXptSelectGroup12 instead. + #define kK2RegXptSelectGroup9 kRegXptSelectGroup9 ///< @deprecated Use kRegXptSelectGroup9 instead. + #define kK2RegXptSelectGroup10 kRegXptSelectGroup10 ///< @deprecated Use kRegXptSelectGroup10 instead. + #define kK2RegXptSelectGroup13 kRegXptSelectGroup13 ///< @deprecated Use kRegXptSelectGroup13 instead. + #define kK2RegXptSelectGroup14 kRegXptSelectGroup14 ///< @deprecated Use kRegXptSelectGroup14 instead. + #define kK2RegCS3Coefficients1_2 kRegCS3Coefficients1_2 ///< @deprecated Use kRegCS3Coefficients1_2 instead. + #define kK2RegCS3Coefficients3_4 kRegCS3Coefficients3_4 ///< @deprecated Use kRegCS3Coefficients3_4 instead. + #define kK2RegCS3Coefficients5_6 kRegCS3Coefficients5_6 ///< @deprecated Use kRegCS3Coefficients5_6 instead. + #define kK2RegCS3Coefficients7_8 kRegCS3Coefficients7_8 ///< @deprecated Use kRegCS3Coefficients7_8 instead. + #define kK2RegCS3Coefficients9_10 kRegCS3Coefficients9_10 ///< @deprecated Use kRegCS3Coefficients9_10 instead. + #define kK2RegCS4Coefficients1_2 kRegCS4Coefficients1_2 ///< @deprecated Use kRegCS4Coefficients1_2 instead. + #define kK2RegCS4Coefficients3_4 kRegCS4Coefficients3_4 ///< @deprecated Use kRegCS4Coefficients3_4 instead. + #define kK2RegCS4Coefficients5_6 kRegCS4Coefficients5_6 ///< @deprecated Use kRegCS4Coefficients5_6 instead. + #define kK2RegCS4Coefficients7_8 kRegCS4Coefficients7_8 ///< @deprecated Use kRegCS4Coefficients7_8 instead. + #define kK2RegCS4Coefficients9_10 kRegCS4Coefficients9_10 ///< @deprecated Use kRegCS4Coefficients9_10 instead. + #define kK2RegXptSelectGroup17 kRegXptSelectGroup17 ///< @deprecated Use kRegXptSelectGroup17 instead. + #define kK2RegXptSelectGroup15 kRegXptSelectGroup15 ///< @deprecated Use kRegXptSelectGroup15 instead. + #define kK2RegXptSelectGroup16 kRegXptSelectGroup16 ///< @deprecated Use kRegXptSelectGroup16 instead. + #define kK2RegSDIOut5Control kRegSDIOut5Control ///< @deprecated Use kRegSDIOut5Control instead. + #define kK2RegCS5Coefficients1_2 kRegCS5Coefficients1_2 ///< @deprecated Use kRegCS5Coefficients1_2 instead. + #define kK2RegCS5Coefficients3_4 kRegCS5Coefficients3_4 ///< @deprecated Use kRegCS5Coefficients3_4 instead. + #define kK2RegCS5Coefficients5_6 kRegCS5Coefficients5_6 ///< @deprecated Use kRegCS5Coefficients5_6 instead. + #define kK2RegCS5Coefficients7_8 kRegCS5Coefficients7_8 ///< @deprecated Use kRegCS5Coefficients7_8 instead. + #define kK2RegCS5Coefficients9_10 kRegCS5Coefficients9_10 ///< @deprecated Use kRegCS5Coefficients9_10 instead. + #define kK2RegXptSelectGroup18 kRegXptSelectGroup18 ///< @deprecated Use kRegXptSelectGroup18 instead. + #define kK2RegXptSelectGroup19 kRegXptSelectGroup19 ///< @deprecated Use kRegXptSelectGroup19 instead. + #define kK2RegXptSelectGroup20 kRegXptSelectGroup20 ///< @deprecated Use kRegXptSelectGroup20 instead. + #define kK2RegCS6Coefficients1_2 kRegCS6Coefficients1_2 ///< @deprecated Use kRegCS6Coefficients1_2 instead. + #define kK2RegCS6Coefficients3_4 kRegCS6Coefficients3_4 ///< @deprecated Use kRegCS6Coefficients3_4 instead. + #define kK2RegCS6Coefficients5_6 kRegCS6Coefficients5_6 ///< @deprecated Use kRegCS6Coefficients5_6 instead. + #define kK2RegCS6Coefficients7_8 kRegCS6Coefficients7_8 ///< @deprecated Use kRegCS6Coefficients7_8 instead. + #define kK2RegCS6Coefficients9_10 kRegCS6Coefficients9_10 ///< @deprecated Use kRegCS6Coefficients9_10 instead. + #define kK2RegCS7Coefficients1_2 kRegCS7Coefficients1_2 ///< @deprecated Use kRegCS7Coefficients1_2 instead. + #define kK2RegCS7Coefficients3_4 kRegCS7Coefficients3_4 ///< @deprecated Use kRegCS7Coefficients3_4 instead. + #define kK2RegCS7Coefficients5_6 kRegCS7Coefficients5_6 ///< @deprecated Use kRegCS7Coefficients5_6 instead. + #define kK2RegCS7Coefficients7_8 kRegCS7Coefficients7_8 ///< @deprecated Use kRegCS7Coefficients7_8 instead. + #define kK2RegCS7Coefficients9_10 kRegCS7Coefficients9_10 ///< @deprecated Use kRegCS7Coefficients9_10 instead. + #define kK2RegCS8Coefficients1_2 kRegCS8Coefficients1_2 ///< @deprecated Use kRegCS8Coefficients1_2 instead. + #define kK2RegCS8Coefficients3_4 kRegCS8Coefficients3_4 ///< @deprecated Use kRegCS8Coefficients3_4 instead. + #define kK2RegCS8Coefficients5_6 kRegCS8Coefficients5_6 ///< @deprecated Use kRegCS8Coefficients5_6 instead. + #define kK2RegCS8Coefficients7_8 kRegCS8Coefficients7_8 ///< @deprecated Use kRegCS8Coefficients7_8 instead. + #define kK2RegCS8Coefficients9_10 kRegCS8Coefficients9_10 ///< @deprecated Use kRegCS8Coefficients9_10 instead. + #define kK2RegSDIOut6Control kRegSDIOut6Control ///< @deprecated Use kRegSDIOut6Control instead. + #define kK2RegSDIOut7Control kRegSDIOut7Control ///< @deprecated Use kRegSDIOut7Control instead. + #define kK2RegSDIOut8Control kRegSDIOut8Control ///< @deprecated Use kRegSDIOut8Control instead. + + + // Special Registers for the XENAX + #define XENAX_REG_START 256 + #define XENAX_NUM_REGS (119+36+41) + #define NUM_HW_REGS (XENAX_REG_START + XENAX_NUM_REGS) + + // Registers unique to a particular device with their own address space + // These are 16-bit registers + #define BORG_FUSION_REG_START 8000 + + typedef enum + { + kRegBorgFusionBootFPGAVerBoardID = BORG_FUSION_REG_START, // 0 + kRegBorgFusionFPGAConfigCtrl, // 1 + kRegBorgFusionPanelPushButtonDebounced, // 2 + kRegBorgFusionPanelPushButtonChanges, // 3 + kRegBorgFusionLEDPWMThreshholds, // 4 + kRegBorgFusionPowerCtrl, // 5 + kRegBorgFusionIRQ3nIntCtrl, // 6 + kRegBorgFusionIRQ3nIntSrc, // 7 + kRegBorgFusionDisplayCtrlStatus, // 8 + kRegBorgFusionDisplayWriteData, // 9 + kRegBorgFusionAnalogFlags, // 10 + kRegBorgFusionReserved11, // 11 + kRegBonesActelCFSlots = kRegBorgFusionReserved11, // Compact Flash S1 & S2 status + kRegBorgFusionReserved12, // 12 + kRegBonesActelCFSlotsChanges = kRegBorgFusionReserved12, // Compact Flash Slot Changes Present + kRegBorgFusionReserved13, // 13 + kRegBorgFusionReserved14, // 14 + kRegBorgFusionReserved15, // 15 + kRegBorgFusionTempSensor1, // 16 + kRegBorgFusionTempSensor2, // 17 + kRegBorgFusion5_0vPowerRail, // 18: +5.0 v power rail, 8mV res + kRegBorgFusion2_5vPowerRail, // 19: +2.5v power rail, 4mV res + kRegBorgFusion1_95vPowerRail, // 20: +1.95v power rail, 4mV res + kRegBorgFusion1_8vPowerRail, // 21: +1.8v power rail, 2mV res + kRegBorgFusion1_5vPowerRail, // 22: +1.5v power rail, 2mV res + kRegBorgFusion1_0vPowerRail, // 23: +1.0v power rail, 2mV res + kRegBorgFusion12vPowerRail, // 24: +12v input power, 8mV res + kRegBorgFusion3_3vPowerRail, // 25: +3.3v power rail, 4mV res + + kRegBorgFusionProdIdLo = BORG_FUSION_REG_START + 50,// 50, lo 16b of kRegBoardID data + kRegBorgFusionProdIdHi, // 51, hi 16b of kRegBoardID data + kRegBorgFusionNumRegistersDummy, + kRegBorgFusionNumRegisters = kRegBorgFusionNumRegistersDummy - BORG_FUSION_REG_START + 1 + } BorgFusionRegisterNum; + + #define DNX_REG_START 8100 + + typedef enum + { + // The paragraph numbers following the Block and Section register + // descriptions refer to the "KiProMini: DNX Codec" document + // originally written by Avid and adapted by Paul Greaves. + + // Block 1.1: Nestor Common + kRegDNX_DeviceID = DNX_REG_START, // ro (read only) + kRegDNX_Revision, // ro + kRegDNX_Diagnostics, + kRegDNX_Reset, + kRegDNX_NestorControl, + kRegDNX_NestorAutoloadControl, + kRegDNX_Status, + kRegDNX_NestorInterrupt, + kRegDNX_NestorInterruptEnable, + kRegDNX_EncoderM1AStatus, // ro (Was Flash Addr) + kRegDNX_EncoderM2AStatus, // ro (Was Flash Data) + kRegDNX_DecoderM1BStatus, // ro (Was Temp Sensor Addr Ctl) + kRegDNX_DecoderM2BStatus, // ro (Was Temp Sensor Wr Ctl) + kRegDNX_TempSensorReadData, // ro (Unused) + kRegDNX_Timeout, + + // Block 1.2: SMPTE Format + kRegDNX_Field1StartEnd, + kRegDNX_Field1ActiveStartEnd, + kRegDNX_Field2StartEnd, + kRegDNX_Field2ActiveStartEnd, + kRegDNX_HorizontalStartEnd, + kRegDNX_FormatChromaClipping, + kRegDNX_FormatLumaClipping, + kRegDNX_Reserved1, + + // Section 1.2.9: Formatter + kRegDNX_A0Parameter, + kRegDNX_A1Parameter, + kRegDNX_A2Parameter, + kRegDNX_A3Parameter, + kRegDNX_A4Parameter, + kRegDNX_A5Parameter, + kRegDNX_A6Parameter, + kRegDNX_A7Parameter, + kRegDNX_A8Parameter, + kRegDNX_A9Parameter, + kRegDNX_TOFHorizontalResetValue, + kRegDNX_TOFVerticalResetValue, + kRegDNX_HorizontalStartOfHANCCode, + kRegDNX_HorizontalStartOfSAVCode, + kRegDNX_HorizontalStartOfActiveVideo, + kRegDNX_HorizontalEndOfLine, + + // Block 1.5: Encoder + kRegDNX_EncoderInterrupt, + kRegDNX_EncoderControl, + kRegDNX_EncoderInterruptEnable, + kRegDNX_RateControlAddress, + kRegDNX_RateControlReadData, // ro + kRegDNX_MacroblockLineNumber, // ro + kRegDNX_RateControlIndex, // ro + kRegDNX_DCTPackerIndex, // ro + kRegDNX_EncodeTableWrite, + kRegDNX_EncoderDebug, // ro + + // Section 1.5.11: The VCID used for encoding + kRegDNX_EncoderVCIDRegister, + + // Section 1.5.12.1/2: Encoder Parameter RAM + // We are only supporting seven VCID + // types at this time. + kRegDNX_EncoderParameterRAMLocation0_0, + kRegDNX_EncoderParameterRAMLocation1_0, + + kRegDNX_EncoderParameterRAMLocation0_1, + kRegDNX_EncoderParameterRAMLocation1_1, + + kRegDNX_EncoderParameterRAMLocation0_2, + kRegDNX_EncoderParameterRAMLocation1_2, + + kRegDNX_EncoderParameterRAMLocation0_3, + kRegDNX_EncoderParameterRAMLocation1_3, + + kRegDNX_EncoderParameterRAMLocation0_4, + kRegDNX_EncoderParameterRAMLocation1_4, + + kRegDNX_EncoderParameterRAMLocation0_5, + kRegDNX_EncoderParameterRAMLocation1_5, + + kRegDNX_EncoderParameterRAMLocation0_6, + kRegDNX_EncoderParameterRAMLocation1_6, + + // Block 1.6: Decoder + kRegDNX_DecoderInterrupt, + kRegDNX_DecoderControl, + kRegDNX_DecoderInterruptEnable, + kRegDNX_DecodeTime, // ro + kRegDNX_FrameCount, // ro + kRegDNX_DecodeTableWrite, + kRegDNX_DecoderDebug, // ro + kRegDNX_Pipe1StallStatus1, // ro + kRegDNX_Pipe1StallStatus2, // ro + kRegDNX_Pipe2StallStatus1, // ro + kRegDNX_Pipe2StallStatus2, // ro + + // Section 1.6.12: The VCID to use regardless of the frame header + kRegDNX_DecoderVCIDRegister, + + // Section 1.6.13: Decoder Parameter RAM + kRegDNX_DecoderParameterRAMLocation0_0, + kRegDNX_DecoderParameterRAMLocation1_0, + + kRegDNX_DecoderParameterRAMLocation0_1, + kRegDNX_DecoderParameterRAMLocation1_1, + + kRegDNX_DecoderParameterRAMLocation0_2, + kRegDNX_DecoderParameterRAMLocation1_2, + + kRegDNX_DecoderParameterRAMLocation0_3, + kRegDNX_DecoderParameterRAMLocation1_3, + + kRegDNX_DecoderParameterRAMLocation0_4, + kRegDNX_DecoderParameterRAMLocation1_4, + + kRegDNX_DecoderParameterRAMLocation0_5, + kRegDNX_DecoderParameterRAMLocation1_5, + + kRegDNX_DecoderParameterRAMLocation0_6, + kRegDNX_DecoderParameterRAMLocation1_6, + + kRegDNX_MaximumRegister = kRegDNX_DecoderParameterRAMLocation1_6, + kRegDNX_NumberOfRegisters = ((kRegDNX_MaximumRegister - DNX_REG_START) + 1) + } DNXRegisterNum; +#endif // !defined (NTV2_DEPRECATE) +#if defined (NTV2_DEPRECATE_13_0) + #define kRegAuxInterruptDelay kRegBitfileDate ///< @deprecated Use kRegBitfileDate instead. + #define kRegReserved89 kRegBitfileTime ///< @deprecated Use kRegBitfileTime instead. +#endif // NTV2_DEPRECATE_13_0 + +// Virtual registers +#include "ntv2virtualregisters.h" + +typedef struct +{ + ULWord initialized; + ULWord contrast; + ULWord brightness; + ULWord hue; + ULWord CbOffset; // Not user controllable + ULWord CrOffset; // Not user controllable + ULWord saturationCb; + ULWord saturationCr; +} VirtualProcAmpRegisters_base; + +typedef struct +{ + VirtualProcAmpRegisters_base SD; + VirtualProcAmpRegisters_base HD; +} VirtualProcAmpRegisters; + +// These have a nice mapping to the virtual registers +typedef struct +{ + UByte contrast; + UByte brightness; + UByte hue; + UByte CbOffset; // Not user controllable + UByte CrOffset; // Not user controllable + UByte saturationCb; + UByte saturationCr; +} ADV7189BProcAmpRegisters; // Works for SD portion of ADV7402A also + +// These do not have a nice mapping to the virtual registers +// All are 10-bit registers spread out over two I2C addresses. +typedef struct +{ + UByte hex73; // [7:6] set, [5:0] upper bits contrast + UByte hex74; // [7:4] lower bits contrast, [3:0] upper bits saturation Cb + UByte hex75; // [7:2] lower bits saturation Cb, [1:0] upper bits saturation Cr + UByte hex76; // [7:0] lower bits saturation Cr + UByte hex77; // [7:6] clear, [5:0] upper bits brightness. + UByte hex78; // [7:4] lower bits brightness, [3:0] high bits Cb offset + UByte hex79; // [7:2] lower bits Cb offset, [1:0] high bits Cr offset + UByte hex7A; // [7:0] lower bits Cr offset +} ADV7402AHDProcAmpRegisters; + +// Kind of a hack +// This will have to be a union or something if/when we add another proc amp processor +typedef struct +{ + ADV7189BProcAmpRegisters SD; // Works for SD portion of ADV7402A also + ADV7402AHDProcAmpRegisters HD; +} HardwareProcAmpRegisterImage; + +// SD procamp regs +typedef enum +{ + kRegADV7189BContrast = 0x08, + kRegADV7189BBrightness = 0x0A, + kRegADV7189BHue = 0x0B, + kRegADV7189BCbOffset = 0xE1, + kRegADV7189BCrOffset = 0xE2, + kRegADV7189BSaturationCb = 0xE3, + kRegADV7189BSaturationCr = 0xE4 +} ADV7189BRegisterNum; // Works for SD portion of ADV7402A also + +typedef enum +{ + // Global Control + kRegMaskFrameRate = BIT(0) + BIT(1) + BIT(2), + kRegMaskFrameRateHiBit = BIT(22), + kRegMaskGeometry = BIT(3) + BIT(4) + BIT(5) + BIT(6), + kRegMaskStandard = BIT(7) + BIT(8) + BIT(9), + kRegMaskRefSource = BIT(10) + BIT(11) + BIT(12), + kRegMaskRefInputVoltage = BIT(12), // DEPRECATED! - Now part of kRegMaskRefSource - do not use on new boards + kRegMaskSmpte372Enable = BIT(15), + kRegMaskLED = BIT(16) + BIT(17) + BIT(18) + BIT(19), + kRegMaskRegClocking = BIT(21) + BIT(20), + kRegMaskDualLinkInEnable = BIT(23), + kRegMaskQuadTsiEnable = BIT(24), + kRegMaskBankSelect = BIT(25) + BIT(26), + kRegMaskDualLinkOutEnable = BIT(27), + kRegMaskRP188ModeCh1 = BIT(28), + kRegMaskRP188ModeCh2 = BIT(29), + kRegMaskCCHostBankSelect = BIT(30) + BIT(31), + + // Global Control 2 + kRegMaskRefSource2 = BIT(0), + kRegMaskPCRReferenceEnable = BIT(1), + kRegMaskQuadMode = BIT(3), + kRegMaskAud1PlayCapMode = BIT(4), + kRegMaskAud2PlayCapMode = BIT(5), + kRegMaskAud3PlayCapMode = BIT(6), + kRegMaskAud4PlayCapMode = BIT(7), + kRegMaskAud5PlayCapMode = BIT(8), + kRegMaskAud6PlayCapMode = BIT(9), + kRegMaskAud7PlayCapMode = BIT(10), + kRegMaskAud8PlayCapMode = BIT(11), + kRegMaskQuadMode2 = BIT(12), + kRegMaskSmpte372Enable4 = BIT(13), + kRegMaskSmpte372Enable6 = BIT(14), + kRegMaskSmpte372Enable8 = BIT(15), + kRegMaskIndependentMode = BIT(16), + kRegMask2MFrameSupport = BIT(17), + kRegMaskAudioMixerPresent = BIT(18), + kRegMaskIsDNXIV = BIT(19), + kRegMask425FB12 = BIT(20), + kRegMask425FB34 = BIT(21), + kRegMask425FB56 = BIT(22), + kRegMask425FB78 = BIT(23), + kRegMaskRP188ModeCh3 = BIT(28), + kRegMaskRP188ModeCh4 = BIT(29), + kRegMaskRP188ModeCh5 = BIT(30), + kRegMaskRP188ModeCh6 = BIT(31), + kRegMaskRP188ModeCh7 = BIT(26), + kRegMaskRP188ModeCh8 = BIT(27), + + // kRegGlobalControl3 (reg 108) + kRegMaskAnalogIOControl = BIT(1) + BIT(0), + kRegMaskAnalogIOControl_14 = BIT(0), + kRegMaskAnalogIOControl_58 = BIT(1), + kRegMaskQuadQuadMode = BIT(2), + kRegMaskQuadQuadMode2 = BIT(3), + kRegMaskQuadQuadSquaresMode = BIT(4), + kRegMaskVUMeterSelect = BIT(5), + kRegMaskFramePulseEnable = BIT(6), + kRegMaskFramePulseRefSelect = BIT(8) + BIT(9) + BIT(10) + BIT(11), + + // Audio Control 2 + kRegMaskAud1RateHigh = BIT(0), + kRegMaskAud2RateHigh = BIT(1), + kRegMaskAud3RateHigh = BIT(2), + kRegMaskAud4RateHigh = BIT(3), + kRegMaskAud5RateHigh = BIT(4), + kRegMaskAud6RateHigh = BIT(5), + kRegMaskAud7RateHigh = BIT(6), + kRegMaskAud8RateHigh = BIT(7), + + // Channel Control - kRegCh1Control, kRegCh2Control, kRegCh3Control, kRegCh4Control + kRegMaskMode = BIT(0), + kRegMaskFrameFormat = BIT(1) + BIT(2) + BIT(3) + BIT(4), + kRegMaskAlphaFromInput2 = BIT(5), + kRegMaskFrameFormatHiBit = BIT(6), // KAM + kRegMaskChannelDisable = BIT(7), + kRegMaskWriteBack = BIT(8), + kRegMaskFrameOrientation = BIT(10), + kRegMaskQuarterSizeMode = BIT(11), + kRegMaskFrameBufferMode = BIT(12), + kKHRegMaskDownconvertInput = BIT(14), + kLSRegMaskVideoInputSelect = BIT(15), + kRegMaskDitherOn8BitInput = BIT(16), + kRegMaskQuality = BIT(17), + kRegMaskEncodeAsPSF = BIT(18), + kK2RegMaskFrameSize = BIT(21) + BIT(20), + kRegMaskChannelCompressed = BIT(22), + kRegMaskRGB8b10bCvtMode = BIT(23), + kRegMaskVBlankRGBRange = BIT(24), + kRegMaskQuality2 = BIT(25) + BIT(26), + kRegCh1BlackOutputMask = BIT(27), // KiPro black output bit + kRegMaskSonySRExpressBit = BIT(28), + kRegMaskFrameSizeSetBySW = BIT(29), + kRegMaskVidProcVANCShift = BIT(31), + + // Video Crosspoint Control + kRegMaskVidXptFGVideo = BIT(0) + BIT(1) + BIT(2), + kRegMaskVidXptBGVideo = BIT(4) + BIT(5) + BIT(6), + kRegMaskVidXptFGKey = BIT(8) + BIT(9) + BIT(10), + kRegMaskVidXptBGKey = BIT(12) + BIT(13) + BIT(14), + kRegMaskVidXptSecVideo = BIT(16) + BIT(17) + BIT(18), + + // Video Processing Control + kRegMaskVidProcMux1 = BIT(0) + BIT(1), + kRegMaskVidProcMux2 = BIT(2) + BIT(3), + kRegMaskVidProcMux3 = BIT(4) + BIT(5), + kRegMaskVidProcMux4 = BIT(6) + BIT(7), + kRegMaskVidProcMux5 = BIT(8) + BIT(9) + BIT(10), + kRegMaskVidProcLimiting = BIT(11) + BIT(12), + kRegMaskVidProcVancSource = BIT(13), + kRegMaskVidProcRGBRange = BIT(14), + kRegMaskVidProcFGMatteEnable = BIT(18), + kRegMaskVidProcBGMatteEnable = BIT(19), + kRegMaskVidProcFGControl = BIT(20) + BIT(21), + kRegMaskVidProcBGControl = BIT(22) + BIT(23), + kRegMaskVidProcMode = BIT(24) + BIT(25), + kRegMaskVidProcRGBModeSupported = BIT(26), + kRegMaskVidProcSyncFail = BIT(27), + kRegMaskVidProcSplitStd = BIT(28) + BIT(29) + BIT(30), + kRegMaskVidProcSubtitleEnable = BIT(31), + + // kRegStatus + kRegMaskHardwareVersion = BIT(0) + BIT(1) + BIT(2) + BIT(3), + kRegMaskFPGAVersion = BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11), + kRegMaskLTCInPresent = BIT(17), + + // Video Interrupt Control + kRegMaskIntEnableMask = BIT(5) + BIT(4) + BIT(3) + BIT(2) + BIT(1) + BIT(0), + + // Audio Control + kRegMaskCaptureEnable = BIT(0), + kRegMaskNumBits = BIT(1), // shouldn't this be BIT(2)? + kRegMaskOutputTone = BIT(1), + kRegMask20BitMode = BIT(2), + kRegMaskLoopBack = BIT(3), + kRegMaskAudioTone = BIT(7), + kRegMaskResetAudioInput = BIT(8), + kRegMaskResetAudioOutput = BIT(9), + kRegMaskInputStartAtVBI = BIT(10), // New in 15.6 + kRegMaskPauseAudio = BIT(11), + kRegMaskEmbeddedOutputMuteCh1 = BIT(12), // added for FS1 + kRegMaskEmbeddedOutputSupressCh1 = BIT(13), // added for FS1 but available on other boards + kRegMaskOutputStartAtVBI = BIT(14), // New in 15.6 + kRegMaskEmbeddedOutputSupressCh2 = BIT(15), // added for FS1 but available on other boards + kRegMaskNumChannels = BIT(16), + kRegMaskEmbeddedOutputMuteCh2 = BIT(17), // added for FS1 + kRegMaskAudioRate = BIT(18), + kRegMaskEncodedAudioMode = BIT(19), // addded for FS1 but available on other boards + kRegMaskAudio16Channel = BIT(20), + kRegMaskMultiLinkAudio = BIT(23), + kRegMaskAudio8Channel = kRegMaskMultiLinkAudio, + kK2RegMaskKBoxAnalogMonitor = BIT(24) + BIT(25), + kK2RegMaskKBoxAudioInputSelect = BIT(26), + kK2RegMaskKBoxDetect = BIT(27), + kK2RegMaskBOCableDetect = BIT(28), + kK2RegMaskAudioLevel = BIT(29), + kFS1RegMaskAudioLevel = BIT(29)+BIT(30), + kK2RegResetAudioDAC = BIT(30), + kK2RegMaskAudioBufferSize = BIT(31), + kK2RegMaskAverageAudioLevel = 0xFFFFffff, // read the entire register + + kFS1RegMaskAudioBufferSize = BIT(31), + kLHRegMaskResetAudioDAC = BIT(31), + // FS1 output control "Freeze (last good frame) On Input Loss" + kRegMaskLossOfInput = BIT(11), + + // Audio Source Select + kRegMaskAudioSource = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kRegMaskEmbeddedAudioInput = BIT(16), + kRegMaskAudioAutoErase = BIT(19), + kRegMaskAnalogHDMIvsAES = BIT(20), + kRegMask3GbSelect = BIT(21), + kRegMaskEmbeddedAudioClock = BIT(22), + kRegMaskEmbeddedAudioInput2 = BIT(23), + kRegMaskAnalogAudioInGain = BIT(24), + kRegMaskAnalogAudioInJack = BIT(25), + + // Input Status + kRegMaskInput1FrameRate = BIT(0)+BIT(1)+BIT(2), + kRegMaskInput1Geometry = BIT(4)+BIT(5)+BIT(6), + kRegMaskInput1Progressive = BIT(7), + kRegMaskInput2FrameRate = BIT(8)+BIT(9)+BIT(10), + kRegMaskInput2Geometry = BIT(12)+BIT(13)+BIT(14), + kRegMaskInput2Progressive = BIT(15), + kRegMaskReferenceFrameRate = BIT(16)+BIT(17)+BIT(18)+BIT(19), + kRegMaskReferenceFrameLines = BIT(20)+BIT(21)+BIT(22), + kRegMaskReferenceProgessive = BIT(23), + kRegMaskAESCh12Present = BIT(24), + kRegMaskAESCh34Present = BIT(25), + kRegMaskAESCh56Present = BIT(26), + kRegMaskAESCh78Present = BIT(27), + kRegMaskInput1FrameRateHigh = BIT(28), + kRegMaskInput2FrameRateHigh = BIT(29), + kRegMaskInput1GeometryHigh = BIT(30), + kRegMaskInput2GeometryHigh = BIT(31), + + // RP-188 Source + kRegMaskRP188SourceSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskRP188DBB = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7), + + // DMA Control + kRegMaskForce64 = BIT(4), + kRegMaskAutodetect64 = BIT(5), + kRegMaskFirmWareRev = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kRegMaskDMAPauseDisable = BIT(16), + + // Color Correction Control - kRegCh1ColorCorrectionControl (68), kRegCh2ColorCorrectionControl (69) + kRegMaskSaturationValue = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9), + kRegMaskCCOutputBankSelect = BIT(16), + kRegMaskCCMode = BIT(17)+BIT(18), + kRegMaskCC5HostAccessBankSelect = BIT(20), + kRegMaskCC5OutputBankSelect = BIT(21), + kRegMaskLUT5Select = BIT(28), + kRegMaskLUTSelect = BIT(29), + kRegMaskCC3OutputBankSelect = BIT(30), + kRegMaskCC4OutputBankSelect = BIT(31), + + // kRegCanDoStatus + kRegMaskCanDoValidXptROM = BIT(0), + kRegMaskCanDoAudioWaitForVBI = BIT(1), + + // kRegLUTV2Control + kRegMaskLUT1Enable = BIT(0), + kRegMaskLUT2Enable = BIT(1), + kRegMaskLUT3Enable = BIT(2), + kRegMaskLUT4Enable = BIT(3), + kRegMaskLUT5Enable = BIT(4), + kRegMaskLUT6Enable = BIT(5), + kRegMaskLUT7Enable = BIT(6), + kRegMaskLUT8Enable = BIT(7), + kRegMaskLUT1HostAccessBankSelect = BIT(8), + kRegMaskLUT2HostAccessBankSelect = BIT(9), + kRegMaskLUT3HostAccessBankSelect = BIT(10), + kRegMaskLUT4HostAccessBankSelect = BIT(11), + kRegMaskLUT5HostAccessBankSelect = BIT(12), + kRegMaskLUT6HostAccessBankSelect = BIT(13), + kRegMaskLUT7HostAccessBankSelect = BIT(14), + kRegMaskLUT8HostAccessBankSelect = BIT(15), + kRegMaskLUT1OutputBankSelect = BIT(16), + kRegMaskLUT2OutputBankSelect = BIT(17), + kRegMaskLUT3OutputBankSelect = BIT(18), + kRegMaskLUT4OutputBankSelect = BIT(19), + kRegMaskLUT5OutputBankSelect = BIT(20), + kRegMaskLUT6OutputBankSelect = BIT(21), + kRegMaskLUT7OutputBankSelect = BIT(22), + kRegMaskLUT8OutputBankSelect = BIT(23), + kRegMask12BitLUTPlaneSelect = BIT(24)+BIT(25), + kRegMask12BitLUTSupport = BIT(28), + + + // RS422 Control + kRegMaskRS422TXEnable = BIT(0), + kRegMaskRS422TXFIFOEmpty = BIT(1), + kRegMaskRS422TXFIFOFull = BIT(2), + kRegMaskRS422RXEnable = BIT(3), + kRegMaskRS422RXFIFONotEmpty = BIT(4), + kRegMaskRS422RXFIFOFull = BIT(5), + kRegMaskRS422RXParityError = BIT(6), + kRegMaskRS422RXFIFOOverrun = BIT(7), + kRegMaskRS422Flush = BIT(6)+BIT(7), + kRegMaskRS422Present = BIT(8), + kRegMaskRS422TXInhibit = BIT(9), + kRegMaskRS422ParitySense = BIT(12), // 0 = Odd, 1 = Even + kRegMaskRS422ParityDisable = BIT(13), // 0 = Use bit 12 setting, 1 = No parity + kRegMaskRS422BaudRate = BIT(16)+BIT(17)+BIT(18), + + + // FS1 ProcAmp Control + kFS1RegMaskProcAmpC1Y = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11), + kFS1RegMaskProcAmpC1CB = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27), + kFS1RegMaskProcAmpC1CR = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11), + kFS1RegMaskProcAmpC2CB = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27), + kFS1RegMaskProcAmpC2CR = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11), + kFS1RegMaskProcAmpOffsetY = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27), + + + kRegMaskAudioInDelay = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12), + kRegMaskAudioOutDelay = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28), + + // FS1 Audio Delay + kFS1RegMaskAudioDelay = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12), + + // Borg Audio Delay + kBorgRegMaskPlaybackEEAudioDelay = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kBorgRegMaskCaputreAudioDelay = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + + // kRegOutputTimingControl + kBorgRegMaskOutTimingCtrlHorzOfs = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12), + kBorgRegMaskOutTimingCtrlVertOfs = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28), + + + // FS1 I2C + kFS1RegMaskI2C1ControlWrite = BIT(0), + kFS1RegMaskI2C1ControlRead = BIT(1), + kFS1RegMaskI2C1ControlBusy = BIT(2), + kFS1RegMaskI2C1ControlError = BIT(3), + kFS1RegMaskI2C2ControlWrite = BIT(4), + kFS1RegMaskI2C2ControlRead = BIT(5), + kFS1RegMaskI2C2ControlBusy = BIT(6), + kFS1RegMaskI2C2ControlError = BIT(7), + + kFS1RegMaskI2CAddress = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4) + BIT(5)+BIT(6)+BIT(7), + kFS1RegMaskI2CSubAddress = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kFS1RegMaskI2CWriteData = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4) + BIT(5)+BIT(6)+BIT(7), + kFS1RegMaskI2CReadData = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + // kRegFS1ReferenceSelect (in Reg 95) + kRegMaskLTCLoopback = BIT(10), + kFS1RefMaskLTCOnRefInSelect = BIT(4), + kRegMaskLTCOnRefInSelect = BIT(5), + kFS1RefMaskLTCEmbeddedOutEnable = BIT(8), + kFS1RegMaskReferenceInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3), + kFS1RegMaskColorFIDSubcarrierReset = BIT(14), + kFS1RegMaskFreezeOutput = BIT(15), + kFS1RegMaskProcAmpInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kFS1RegMaskSecondAnalogOutInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + // FS1 AFD Mode + kFS1RegMaskAFDReceived_Code = BIT(3)+BIT(2)+BIT(1)+BIT(0), + kFS1RegMaskAFDReceived_AR = BIT(4), + kFS1RegMaskAFDReceived_VANCPresent = BIT(7), + kFS1RegMaskUpconvertAutoAFDEnable = BIT(20), + kFS1RegMaskUpconvert2AFDDefaultHoldLast = BIT(21), + kFS1RegMaskDownconvertAutoAFDEnable = BIT(24), + kFS1RegMaskDownconvertAFDDefaultHoldLast = BIT(25), + kFS1RegMaskDownconvert2AutoAFDEnable = BIT(28), + kFS1RegMaskDownconvert2AFDDefaultHoldLast = BIT(29), + + // FS1 AFD Inserter + kFS1RegMaskAFDVANCInserter_Code = BIT(3)+BIT(2)+BIT(1)+BIT(0), + kFS1RegMaskAFDVANCInserter_AR = BIT(4), + kFS1RegMaskAFDVANCInserter_Mode = BIT(13)+BIT(12), + kFS1RegMaskAFDVANCInserter_Line = BIT(26)+BIT(25)+BIT(24)+BIT(23)+BIT(22)+BIT(21)+BIT(20)+BIT(19)+BIT(18)+BIT(17)+BIT(16), + + // FS1 Audio Channel Mapping + kFS1RegMaskAudioChannelMapping_Gain = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4) + BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9), + kFS1RegMaskAudioChannelMapping_Phase = BIT(15), + kFS1RegMaskAudioChannelMapping_Source = BIT(21)+BIT(20)+BIT(19)+BIT(18)+BIT(17)+BIT(16), + kFS1RegMaskAudioChannelMapping_Mute = BIT(31), + + // FS1 Output Timing Fine Phase Adjust + kRegMaskOutputTimingFinePhase = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4) + BIT(5)+BIT(6)+BIT(7)+BIT(8), + + //kRegAnalogInputStatus + kRegMaskAnalogInputSD = BIT(14), + kRegMaskAnalogInputIntegerRate = BIT(15), + kRegMaskAnalogCompositeLocked = BIT(16), + kRegMaskAnalogCompositeFormat625 = BIT(18), + + //kRegAnalogInputControl (Note - on some boards, ADC mode is set in Reg 128, kK2RegAnalogOutControl!) + kRegMaskAnalogInputADCMode = BIT(4)+BIT(3)+BIT(2)+BIT(1)+BIT(0), + + //kRegHDMIOut3DControl + kRegMaskHDMIOut3DPresent = BIT(3), + kRegMaskHDMIOut3DMode = BIT(4)+BIT(5)+BIT(6)+BIT(7), + + //kRegHDMIOutControl + kRegMaskHDMIOutVideoStd = BIT(2)+BIT(1)+BIT(0), + kRegMaskHDMIOutV2VideoStd = BIT(3)+BIT(2)+BIT(1)+BIT(0), + kRegMaskHDMIOut8ChGroupSelect = BIT(5), + kRegMaskHDMIV2TxBypass = BIT(7), + kLHIRegMaskHDMIOutColorSpace = BIT(8), + kLHIRegMaskHDMIOutFPS = BIT(12)+BIT(11)+BIT(10)+BIT(9), + kRegMaskHDMIOutProgressive = BIT(13), + kLHIRegMaskHDMIOutBitDepth = BIT(14), + kRegMaskHDMIV2YCColor = BIT(15), + kRegMaskHDMIOutAudioFormat = BIT(17)+BIT(16), + kRegMaskHDMISampling = BIT(19)+BIT(18), + kRegMaskHDMIVOBD = BIT(21)+BIT(20), + kRegMaskSourceIsRGB = BIT(23), + kRegMaskHDMIOutPowerDown = BIT(25), + kRegMaskHDMITxEnable = BIT(26), + kRegMaskHDMIRxEnable = BIT(27), + kRegMaskHDMIOutRange = BIT(28), + kRegMaskHDMIOutAudioCh = BIT(29), + kLHIRegMaskHDMIOutDVI = BIT(30), + + //kRegHDMIInputStatus + kRegMaskInputStatusLock = BIT(0), // rename to kRegMaskAnalogInputStatusLock + kRegMaskStable = BIT(1), + kLHIRegMaskHDMIInputColorSpace = BIT(2), + kLHIRegMaskHDMIInputBitDepth = BIT(3), + kRegMaskHDMIInV2VideoStd = BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9), + kLHIRegMaskHDMIOutputEDIDRGB = BIT(10), + kLHIRegMaskHDMIOutputEDID10Bit = BIT(11), + kLHIRegMaskHDMIInput2ChAudio = BIT(12), + kRegMaskHDMIInputProgressive = BIT(13), + kRegMaskVideoSD = BIT(14), + kLHIRegMaskHDMIOutputEDIDDVI = BIT(15), + kRegMaskHDMIInAudioRate = BIT(19)+BIT(18)+BIT(17)+BIT(16), + kRegMaskAudioWorkLength = BIT(23)+BIT(22)+BIT(21)+BIT(20), + kRegMaskInputStatusStd = BIT(24)+BIT(25)+BIT(26), + kLHIRegMaskHDMIInputProtocol = BIT(27), + kRegMaskInputStatusFPS = BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegHDMIInputControl + kRegMaskHDMIOutForceConfig = BIT(1), + kRegMaskHDMIAudioPairSelect = BIT(3)+BIT(2), + kRegMaskHDMISampleRateConverterEnable = BIT(4), + kRegMaskHDMISwapInputAudCh34 = BIT(5), + kRegMaskHDMISwapOutputAudCh34 = BIT(6), + kRegMaskHDMIOutPrefer420 = BIT(7), + kRegMaskHDMIInColorDepth = BIT(13)+BIT(12), + kRegMaskHDMIInColorSpace = BIT(15)+BIT(14), + kRegMaskHDMIOutAudioRate = BIT(17)+BIT(16), + kRegMaskHDMIOutSourceSelect = BIT(23)+BIT(22)+BIT(21)+BIT(20), + kRegMaskHDMIOutCropEnable = BIT(24), + kRegMaskHDMIOutForceHPD = BIT(25), + kRegMaskHDMIOut12Bit = BIT(26), + kRegMaskHDMIDebug = BIT(27), + kRegMaskHDMIInputRange = BIT(28), + kRegMaskHDMIOutAudio2ChannelSelect = BIT(30)+BIT(29), + kRegMaskHDMIInfoRange = BIT(31), + + //kRegHDMIInputControl / kRegHDMIOutControl + kRegMaskHDMIColorSpace = BIT(4)+BIT(5), + kRegMaskHDMIPolarity = BIT(16)+BIT(17)+BIT(18)+BIT(19), + + //kK2RegAnalogOutControl - (controls Analog Inputs also, for some boards) + kK2RegMaskVideoDACMode = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4), + kFS1RegMaskVideoDAC2Mode = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12), + kLHIRegMaskVideoDACStandard = BIT(13)+BIT(14)+BIT(15), + kLSRegMaskVideoADCMode = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20), + kLHIRegMaskVideoDACMode = BIT(21)+BIT(22)+BIT(23)+BIT(24), + kLHIRegMaskVideoDACSetup = BIT(21), // bitwise interpretation of kLHIRegMaskVideoDACMode + kLHIRegMaskVideoDACJapan = BIT(22), // bitwise interpretation of kLHIRegMaskVideoDACMode + kLHIRegMaskVideoDACRGB = BIT(23), // bitwise interpretation of kLHIRegMaskVideoDACMode + kLHIRegMaskVideoDACComponent = BIT(24), // bitwise interpretation of kLHIRegMaskVideoDACMode + kK2RegMaskOutHTiming = BIT(31)+BIT(30)+BIT(29)+BIT(28)+BIT(27)+BIT(26)+BIT(25)+BIT(24), + + //kK2RegSDIOut1Control + kK2RegSDIOut2Control + kK2RegSDIOut3Control + kK2RegSDIOut4Control + kK2RegAnalogOutControl + kK2RegMaskSDIOutStandard = BIT(0)+BIT(1)+BIT(2), + kK2RegMaskSDI1Out_2Kx1080Mode = BIT(3), + kLHRegMaskVideoOutputDigitalSelect = BIT(4) + BIT(5), + kK2RegMaskSDIOutHBlankRGBRange = BIT(7), + kLHRegMaskVideoOutputAnalogSelect = BIT(8) + BIT(9), + kRegMaskSDIOut6GbpsMode = BIT(16), + kRegMaskSDIOut12GbpsMode = BIT(17), + kRegMaskRGBLevelA = BIT(22), + kRegMaskSDIOutLevelAtoLevelB = BIT(23), + kLHIRegMaskSDIOut3GbpsMode = BIT(24), + kLHIRegMaskSDIOutSMPTELevelBMode = BIT(25), + kK2RegMaskVPIDInsertionEnable = BIT(26), + kK2RegMaskVPIDInsertionOverwrite = BIT(27), + kK2RegMaskSDIOutDS1AudioSelect = BIT(28)+BIT(30), + kK2RegMaskSDIOutDS2AudioSelect = BIT(29)+BIT(31), + + //kK2RegConversionControl and kK2Reg2ndConversionControl, + kK2RegMaskConverterOutStandard = BIT(12)+BIT(13)+BIT(14), + kK2RegMaskConverterOutRate = BIT(27)+BIT(28)+BIT(29)+BIT(30), + kK2RegMaskUpConvertMode = BIT(8)+BIT(9)+BIT(10), + kK2RegMaskDownConvertMode = BIT(4)+BIT(5), + kK2RegMaskConverterInStandard = BIT(0)+BIT(1)+BIT(2), + kK2RegMaskConverterInRate = BIT(23)+BIT(24)+BIT(25)+BIT(26), + kK2RegMaskConverterPulldown = BIT(6), + kK2RegMaskUCPassLine21 = BIT(16)+BIT(17), + kK2RegMaskIsoConvertMode = BIT(20)+BIT(21)+BIT(22), + kK2RegMaskDeinterlaceMode = BIT(15), + kK2RegMaskEnableConverter = BIT(31), + + //kK2RegFrameSync1Control and kK2RegFrameSync2Control + kK2RegMaskFrameSyncControlFrameDelay = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29), + kK2RegMaskFrameSyncControlStandard = BIT(8)+BIT(9)+BIT(10), + kK2RegMaskFrameSyncControlGeometry = BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskFrameSyncControlFrameFormat = BIT(0)+BIT(1)+BIT(2)+BIT(3), + + //kK2RegXptSelectGroup1 + kK2RegMaskCompressionModInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kK2RegMaskConversionModInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskColorSpaceConverterInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskXptLUTInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + + //kK2RegXptSelectGroup2 + kK2RegMaskDuallinkOutInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kK2RegMaskFrameSync2InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskFrameSync1InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskFrameBuffer1InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + + //kK2RegXptSelectGroup3 + kK2RegMaskCSC1KeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kK2RegMaskSDIOut2InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskSDIOut1InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskAnalogOutInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + + //kK2RegXptSelectGroup4 + kK2RegMaskMixerBGKeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kK2RegMaskMixerBGVidInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskMixerFGKeyInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskMixerFGVidInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + + //kK2RegXptSelectGroup5 + kK2RegMaskCSC2KeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kK2RegMaskCSC2VidInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskXptLUT2InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskFrameBuffer2InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + + //kK2RegXptSelectGroup6 + kK2RegMaskWaterMarkerInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskIICTInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskHDMIOutInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskSecondConverterInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kK2RegXptSelectGroup7 + kK2RegMaskWaterMarker2InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskIICT2InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskDuallinkOut2InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + + //kK2RegXptSelectGroup8 + kK2RegMaskSDIOut3InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskSDIOut4InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskSDIOut5InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + + //kRegCh1ControlExtended + //kRegCh2ControlExtended + kK2RegMaskPulldownMode = BIT(2), + + //kK2RegXptSelectGroup9 + kK2RegMaskMixer2FGVidInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskMixer2FGKeyInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskMixer2BGVidInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskMixer2BGKeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kK2RegXptSelectGroup10 + kK2RegMaskSDIOut1DS2InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskSDIOut2DS2InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + //kK2RegXptSelectGroup11 + kK2RegMaskDuallinkIn1InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskDuallinkIn1DSInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskDuallinkIn2InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskDuallinkIn2DSInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kK2RegXptSelectGroup12 + kK2RegMaskXptLUT3InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskXptLUT4InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskXptLUT5InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskXpt3DLUT1InputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kK2RegXptSelectGroup13 + kK2RegMaskFrameBuffer3InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskFrameBuffer4InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + + //kK2RegXptSelectGroup14 + kK2RegMaskSDIOut3DS2InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskSDIOut5DS2InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskSDIOut4DS2InputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegXptSelectGroup15 + kK2RegMaskDuallinkIn3InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskDuallinkIn3DSInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskDuallinkIn4InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskDuallinkIn4DSInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegXptSelectGroup16 + kK2RegMaskDuallinkOut3InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskDuallinkOut4InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskDuallinkOut5InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + + //kK2RegXptSelectGroup17 + kK2RegMaskCSC3VidInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskCSC3KeyInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskCSC4VidInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskCSC4KeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegXptSelectGroup18 + kK2RegMaskCSC5VidInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskCSC5KeyInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + + //kRegXptSelectGroup19 + kK2RegMask4KDCQ1InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMask4KDCQ2InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMask4KDCQ3InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMask4KDCQ4InputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegXptSelectGroup20 + kK2RegMaskHDMIOutV2Q1InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskHDMIOutV2Q2InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskHDMIOutV2Q3InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskHDMIOutV2Q4InputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegXptSelectGroup21 + kK2RegMaskFrameBuffer5InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskFrameBuffer6InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskFrameBuffer7InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskFrameBuffer8InputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegXptSelectGroup22 + kK2RegMaskSDIOut6InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskSDIOut6DS2InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskSDIOut7InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskSDIOut7DS2InputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegXptSelectGroup23 + kK2RegMaskCSC7VidInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskCSC7KeyInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskCSC8VidInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskCSC8KeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegXptSelectGroup24 + kK2RegMaskXptLUT6InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskXptLUT7InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskXptLUT8InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + + //kRegXptSelectGroup25 + kK2RegMaskDuallinkIn5InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskDuallinkIn5DSInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskDuallinkIn6InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskDuallinkIn6DSInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegXptSelectGroup26 + kK2RegMaskDuallinkIn7InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskDuallinkIn7DSInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskDuallinkIn8InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskDuallinkIn8DSInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegXptSelectGroup27 + kK2RegMaskDuallinkOut6InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskDuallinkOut7InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskDuallinkOut8InputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + + //kRegXptSelectGroup28 + kK2RegMaskMixer3FGVidInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskMixer3FGKeyInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskMixer3BGVidInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskMixer3BGKeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegXptSelectGroup29 + kK2RegMaskMixer4FGVidInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskMixer4FGKeyInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskMixer4BGVidInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskMixer4BGKeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegXptSelectGroup30 + kK2RegMaskSDIOut8InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskSDIOut8DS2InputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskCSC6VidInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskCSC6KeyInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegXptSelectGroup32 + kK2RegMask425Mux1AInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMask425Mux1BInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMask425Mux2AInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMask425Mux2BInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegXptSelectGroup33 + kK2RegMask425Mux3AInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMask425Mux3BInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMask425Mux4AInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMask425Mux4BInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegXptSelectGroup34 + kK2RegMaskFrameBuffer1BInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskFrameBuffer2BInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskFrameBuffer3BInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskFrameBuffer4BInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegXptSelectGroup35 + kK2RegMaskFrameBuffer5BInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskFrameBuffer6BInputSelect = BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15), + kK2RegMaskFrameBuffer7BInputSelect = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23), + kK2RegMaskFrameBuffer8BInputSelect = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + + //kRegXptSelectGroup36 + kK2RegMaskMultiLinkOutInputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + kK2RegMaskMultiLinkOutDS2InputSelect = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7), + + //kK2RegCSCoefficients1_2 + //kK2RegCSC2oefficients1_2, + //kK2RegCSC3oefficients1_2, + //kK2RegCSC4oefficients1_2, + //kK2RegCSC5Coefficients1_2, + //kK2RegCSC6Coefficients1_2, + //kK2RegCSC7Coefficients1_2, + //kK2RegCSC8Coefficients1_2, + kK2RegMaskVidKeySyncStatus = BIT(28), + kK2RegMaskMakeAlphaFromKeySelect = BIT(29), + kK2RegMaskColorSpaceMatrixSelect = BIT(30), + kK2RegMaskUseCustomCoefSelect = BIT(31), + + //kRegCSCoefficients3_4, + //kRegCS2Coefficients3_4, + //kRegCS3Coefficients3_4, + //kRegCS4Coefficients3_4, + //kRegCS5Coefficients3_4, + //kRegCS6Coefficients3_4, + //kRegCS7Coefficients3_4, + //kRegCS8Coefficients3_4, + kK2RegMaskXena2RGBRange = BIT(31), + + //kK2RegCSCoefficients5_6, + kK2RegMask2piCSC1 = BIT(28), + + //kK2RegCSCoefficients5_6, + kK2RegMask2piCSC5 = BIT(28), + + //custom coefficients + kK2RegMaskCustomCoefficientLow = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10), + kK2RegMaskCustomCoefficientHigh = BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26), + + // Enhanced Color Space Converter contol + kK2RegMaskEnhancedCSCInputPixelFormat = BIT(0)+BIT(1), + kK2RegMaskEnhancedCSCOutputPixelFormat = BIT(4)+BIT(5), + kK2RegMaskEnhancedCSCChromaEdgeControl = BIT(8)+BIT(9), + kK2RegMaskEnhancedCSCChromaFilterSelect = BIT(12)+BIT(13), + kK2RegMaskEnhancedCSCEnable = BIT(29), + kK2RegMaskEnhancedCSC4KMode = BIT(28), + + kK2RegMaskEnhancedCSCKeySource = BIT(0)+BIT(1), + kK2RegMaskEnhancedCSCKeyOutputRange = BIT(4), + + // Xena2K and Konax video processing + kK2RegMaskXena2FgVidProcInputControl = BIT(20)+BIT(21), + kK2RegMaskXena2BgVidProcInputControl = BIT(22)+BIT(23), + kK2RegMaskXena2VidProcMode = BIT(24)+BIT(25), + kK2RegMaskXena2VidProcSplitStd = BIT(28) + BIT(29) + BIT(30), + + // 12(13 with sign) bit custom coefficients - backwards compatible with the 10(11 with sign) bit soft and hardware - jac + kK2RegMaskCustomCoefficient12BitLow = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12), + kK2RegMaskCustomCoefficient12BitHigh = BIT(14)+BIT(15)+BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)+BIT(24)+BIT(25)+BIT(26), + + //kRegLTCStatusControl (see register 233 -- kRegLTCStatusControl) + kRegMaskLTC1InPresent = BIT(0), + kRegMaskLTC1InBypass = BIT(4), + kRegMaskLTC2InPresent = BIT(8), + kRegMaskLTC2InBypass = BIT(12), + + // kRegAudioOutputSourceMap + kRegMaskMonitorSource = BIT(21)+BIT(20)+BIT(19)+BIT(18)+BIT(17)+BIT(16), + kRegMaskHDMIOutAudioSource = BIT(31)+BIT(30)+BIT(29)+BIT(28)+BIT(27)+BIT(26)+BIT(25)+BIT(24), + + // kRegSDIInput3GStatus + kRegMaskSDIIn3GbpsMode = BIT(0), + kRegMaskSDIIn3GbpsSMPTELevelBMode = BIT(1), + kRegMaskSDIIn1LevelBtoLevelA = BIT(2), + kRegMaskSDIIn16GbpsMode = BIT(6), + kRegMaskSDIIn112GbpsMode = BIT(7), + kRegMaskSDIInVPIDLinkAValid = BIT(4), + kRegMaskSDIInVPIDLinkBValid = BIT(5), + kRegMaskSDIIn23GbpsMode = BIT(8), + kRegMaskSDIIn23GbpsSMPTELevelBMode = BIT(9), + kRegMaskSDIIn2LevelBtoLevelA = BIT(10), + kRegMaskSDIIn2VPIDLinkAValid = BIT(12), + kRegMaskSDIIn2VPIDLinkBValid = BIT(13), + kRegMaskSDIIn26GbpsMode = BIT(14), + kRegMaskSDIIn212GbpsMode = BIT(15), + kRegMaskSDIInTsiMuxSyncFail = BIT(16)+BIT(17)+BIT(18)+BIT(19), + + + // kRegSDIInput3GStatus2 + kRegMaskSDIIn33GbpsMode = BIT(0), + kRegMaskSDIIn33GbpsSMPTELevelBMode = BIT(1), + kRegMaskSDIIn3LevelBtoLevelA = BIT(2), + kRegMaskSDIIn3VPIDLinkAValid = BIT(4), + kRegMaskSDIIn3VPIDLinkBValid = BIT(5), + kRegMaskSDIIn36GbpsMode = BIT(6), + kRegMaskSDIIn312GbpsMode = BIT(7), + kRegMaskSDIIn43GbpsMode = BIT(8), + kRegMaskSDIIn43GbpsSMPTELevelBMode = BIT(9), + kRegMaskSDIIn4LevelBtoLevelA = BIT(10), + kRegMaskSDIIn4VPIDLinkAValid = BIT(12), + kRegMaskSDIIn4VPIDLinkBValid = BIT(13), + kRegMaskSDIIn46GbpsMode = BIT(14), + kRegMaskSDIIn412GbpsMode = BIT(15), + + // kRegSDI5678Input3GStatus + kRegMaskSDIIn53GbpsMode = BIT(0), + kRegMaskSDIIn53GbpsSMPTELevelBMode = BIT(1), + kRegMaskSDIIn5LevelBtoLevelA = BIT(2), + kRegMaskSDIIn5VPIDLinkAValid = BIT(4), + kRegMaskSDIIn5VPIDLinkBValid = BIT(5), + kRegMaskSDIIn56GbpsMode = BIT(6), + kRegMaskSDIIn512GbpsMode = BIT(7), + kRegMaskSDIIn63GbpsMode = BIT(8), + kRegMaskSDIIn63GbpsSMPTELevelBMode = BIT(9), + kRegMaskSDIIn6LevelBtoLevelA = BIT(10), + kRegMaskSDIIn6VPIDLinkAValid = BIT(12), + kRegMaskSDIIn6VPIDLinkBValid = BIT(13), + kRegMaskSDIIn66GbpsMode = BIT(14), + kRegMaskSDIIn612GbpsMode = BIT(15), + kRegMaskSDIIn73GbpsMode = BIT(16), + kRegMaskSDIIn73GbpsSMPTELevelBMode = BIT(17), + kRegMaskSDIIn7LevelBtoLevelA = BIT(18), + kRegMaskSDIIn7VPIDLinkAValid = BIT(20), + kRegMaskSDIIn7VPIDLinkBValid = BIT(21), + kRegMaskSDIIn76GbpsMode = BIT(22), + kRegMaskSDIIn712GbpsMode = BIT(23), + kRegMaskSDIIn83GbpsMode = BIT(24), + kRegMaskSDIIn83GbpsSMPTELevelBMode = BIT(25), + kRegMaskSDIIn8LevelBtoLevelA = BIT(26), + kRegMaskSDIIn8VPIDLinkAValid = BIT(28), + kRegMaskSDIIn8VPIDLinkBValid = BIT(29), + kRegMaskSDIIn86GbpsMode = BIT(30), + kRegMaskSDIIn812GbpsMode = BIT(31), + + // kRegVPID + kRegMaskVPIDBitDepth = BIT(1)+BIT(0), + kRegmaskVPIDLuminance = BIT(4), + kRegMaskVPIDChannel = BIT(7)+BIT(6), + kRegMaskVPIDDualLinkChannel = BIT(7)+BIT(6)+BIT(5), + kRegMaskVPIDSampling = BIT(11)+BIT(10)+BIT(9)+BIT(8), + kRegMaskVPIDColorimetry = BIT(12)+BIT(13), + kRegMaskVPIDColorimetryAltLow = BIT(12), + kRegMaskVPIDImageAspect16x9Alt = BIT(13), + kRegMaskVPIDHorizontalSampling = BIT(14), + kRegMaskVPIDColorimetryAltHigh = BIT(15), + kRegMaskVPIDImageAspect16x9 = BIT(15), + kRegMaskVPIDPictureRate = BIT(19)+BIT(18)+BIT(17)+BIT(16), + kRegMaskVPIDXferChars = BIT(20)+BIT(21), + kRegMaskVPIDProgressivePicture = BIT(22), + kRegMaskVPIDProgressiveTransport = BIT(23), + kRegMaskVPIDStandard = BIT(24)+BIT(25)+BIT(26)+BIT(27)+BIT(28)+BIT(29)+BIT(30)+BIT(31), + kRegMaskVPIDVersionID = BIT(31), +#if !defined (NTV2_DEPRECATE) + kRegMaskVPIDDynamicRange = BIT(4)+BIT(3), +#endif + + //Borg Test Pattern Generator + kRegMaskTPGChromaSample = BIT(9)+BIT(8)+BIT(7)+BIT(6)+BIT(5)+BIT(4)+BIT(3)+BIT(2)+BIT(1)+BIT(0), + kRegMaskTPGLineBuffer = BIT(11)+BIT(10), + kRegMaskTPGFrameRate = BIT(15)+BIT(14)+BIT(13)+BIT(12), + kRegMaskTPGLuma = BIT(25)+BIT(24)+BIT(23)+BIT(22)+BIT(21)+BIT(20)+BIT(19)+BIT(18)+BIT(17)+BIT(16), + kRegMaskTPGMulti = BIT(26), + kRegMaskTPGReset = BIT(27), + kRegMaskTPGStandard = BIT(30) + BIT(29) + BIT(28), + kRegMaskTPGWriteEnable = BIT(31), + + // Bones Actel Registers + kRegMaskCFS1 = BIT(0) + BIT(1), + kRegMaskCFS2 = BIT(2) + BIT(3) , + + // Audio Channel Control 2 or 8 channel playback mask + kRegAudControlMask = BIT(5), + + // Stereo Compressor Control + kRegMaskStereoCompressorOutputMode = BIT(3)+BIT(2)+BIT(1)+BIT(0), + kRegMaskStereoCompressorFlipMode = BIT(7)+BIT(6)+BIT(5)+BIT(4), + kRegMaskStereoCompressorFlipLeftHorz = BIT(4), + kRegMaskStereoCompressorFlipLeftVert = BIT(5), + kRegMaskStereoCompressorFlipRightHorz = BIT(6), + kRegMaskStereoCompressorFlipRightVert = BIT(7), + kRegMaskStereoCompressorFormat = BIT(10)+BIT(9)+BIT(8), + kRegMaskStereoCompressorLeftSource = BIT(23)+BIT(22)+BIT(21)+BIT(20)+BIT(19)+BIT(18)+BIT(17)+BIT(16), + kRegMaskStereoCompressorRightSource = BIT(31)+BIT(30)+BIT(29)+BIT(28)+BIT(27)+BIT(26)+BIT(25)+BIT(24), + + // SDI Direction Control + kRegMaskSDI5Transmit = BIT(24), + kRegMaskSDI6Transmit = BIT(25), + kRegMaskSDI7Transmit = BIT(26), + kRegMaskSDI8Transmit = BIT(27), + kRegMaskSDI1Transmit = BIT(28), + kRegMaskSDI2Transmit = BIT(29), + kRegMaskSDI3Transmit = BIT(30), + kRegMaskSDI4Transmit = BIT(31), + + // SDI watchdog control + kRegMaskSDIRelayControl12 = BIT(0), + kRegMaskSDIRelayControl34 = BIT(1), + kRegMaskSDIWatchdogEnable12 = BIT(4), + kRegMaskSDIWatchdogEnable34 = BIT(5), + kRegMaskSDIRelayPosition12 = BIT(8), + kRegMaskSDIRelayPosition34 = BIT(9), + kRegMaskSDIWatchdogStatus = BIT(12), + + // 4K Down Convert + kRegMask4KDCRGBMode = BIT(0), + kRegMask4KDCYCC444Mode = BIT(1), + kRegMask4KDCPSFInMode = BIT(2), + kRegMask4KDCPSFOutMode = BIT(3), + + // Quadrant Rasterizer Control + kRegMaskRasterMode = BIT(0)+BIT(1), + kRegMaskTsiIO = BIT(2), + kRegMaskRasterLevelB = BIT(4), + kRegMaskRasterDecimate = BIT(8), + + // kRegRXSDI1Status, kRegRXSDI2Status, etc + kRegMaskSDIInUnlockCount = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskSDIInLocked = BIT(16), + kRegMaskSDIInVpidValidA = BIT(20), + kRegMaskSDIInVpidValidB = BIT(21), + kRegMaskSDIInTRSError = BIT(24), + + kRegMaskSDIInCRCErrorCountA = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskSDIInCRCErrorCountB = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMask2MFrameSize = BIT(4)+BIT(3)+BIT(2)+BIT(1)+BIT(0), + kRegMaskChannelBar = BIT(24)+BIT(23)+BIT(22)+BIT(21)+BIT(20)+BIT(19)+BIT(18)+BIT(17)+BIT(16), + + kRegMaskPCMControlA1P1_2 = BIT(0), + kRegMaskPCMControlA1P3_4 = BIT(1), + kRegMaskPCMControlA1P5_6 = BIT(2), + kRegMaskPCMControlA1P7_8 = BIT(3), + kRegMaskPCMControlA1P9_10 = BIT(4), + kRegMaskPCMControlA1P11_12 = BIT(5), + kRegMaskPCMControlA1P13_14 = BIT(6), + kRegMaskPCMControlA1P15_16 = BIT(7), + + kRegMaskPCMControlA2P1_2 = BIT(8), + kRegMaskPCMControlA2P3_4 = BIT(9), + kRegMaskPCMControlA2P5_6 = BIT(10), + kRegMaskPCMControlA2P7_8 = BIT(11), + kRegMaskPCMControlA2P9_10 = BIT(12), + kRegMaskPCMControlA2P11_12 = BIT(13), + kRegMaskPCMControlA2P13_14 = BIT(14), + kRegMaskPCMControlA2P15_16 = BIT(15), + + kRegMaskPCMControlA3P1_2 = BIT(16), + kRegMaskPCMControlA3P3_4 = BIT(17), + kRegMaskPCMControlA3P5_6 = BIT(18), + kRegMaskPCMControlA3P7_8 = BIT(19), + kRegMaskPCMControlA3P9_10 = BIT(20), + kRegMaskPCMControlA3P11_12 = BIT(21), + kRegMaskPCMControlA3P13_14 = BIT(22), + kRegMaskPCMControlA3P15_16 = BIT(23), + + kRegMaskPCMControlA4P1_2 = BIT(24), + kRegMaskPCMControlA4P3_4 = BIT(25), + kRegMaskPCMControlA4P5_6 = BIT(26), + kRegMaskPCMControlA4P7_8 = BIT(27), + kRegMaskPCMControlA4P9_10 = BIT(28), + kRegMaskPCMControlA4P11_12 = BIT(29), + kRegMaskPCMControlA4P13_14 = BIT(30), + kRegMaskPCMControlA4P15_16 = BIT(31), + + kRegMaskPCMControlA5P1_2 = BIT(0), + kRegMaskPCMControlA5P3_4 = BIT(1), + kRegMaskPCMControlA5P5_6 = BIT(2), + kRegMaskPCMControlA5P7_8 = BIT(3), + kRegMaskPCMControlA5P9_10 = BIT(4), + kRegMaskPCMControlA5P11_12 = BIT(5), + kRegMaskPCMControlA5P13_14 = BIT(6), + kRegMaskPCMControlA5P15_16 = BIT(7), + + kRegMaskPCMControlA6P1_2 = BIT(8), + kRegMaskPCMControlA6P3_4 = BIT(9), + kRegMaskPCMControlA6P5_6 = BIT(10), + kRegMaskPCMControlA6P7_8 = BIT(11), + kRegMaskPCMControlA6P9_10 = BIT(12), + kRegMaskPCMControlA6P11_12 = BIT(13), + kRegMaskPCMControlA6P13_14 = BIT(14), + kRegMaskPCMControlA6P15_16 = BIT(15), + + kRegMaskPCMControlA7P1_2 = BIT(16), + kRegMaskPCMControlA7P3_4 = BIT(17), + kRegMaskPCMControlA7P5_6 = BIT(18), + kRegMaskPCMControlA7P7_8 = BIT(19), + kRegMaskPCMControlA7P9_10 = BIT(20), + kRegMaskPCMControlA7P11_12 = BIT(21), + kRegMaskPCMControlA7P13_14 = BIT(22), + kRegMaskPCMControlA7P15_16 = BIT(23), + + kRegMaskPCMControlA8P1_2 = BIT(24), + kRegMaskPCMControlA8P3_4 = BIT(25), + kRegMaskPCMControlA8P5_6 = BIT(26), + kRegMaskPCMControlA8P7_8 = BIT(27), + kRegMaskPCMControlA8P9_10 = BIT(28), + kRegMaskPCMControlA8P11_12 = BIT(29), + kRegMaskPCMControlA8P13_14 = BIT(30), + kRegMaskPCMControlA8P15_16 = BIT(31), + + kRegFanHiMask = BIT(16), + kRegThermalMask = BIT(17) + BIT(18) + BIT(19), + + //kRegHDMIHDR.... 330-336 + kRegMaskHDMIHDRGreenPrimaryX = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskHDMIHDRGreenPrimaryY = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMaskHDMIHDRBluePrimaryX = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskHDMIHDRBluePrimaryY = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMaskHDMIHDRRedPrimaryX = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskHDMIHDRRedPrimaryY = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMaskHDMIHDRWhitePointX = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskHDMIHDRWhitePointY = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMaskHDMIHDRMaxMasteringLuminance = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskHDMIHDRMinMasteringLuminance = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMaskHDMIHDRMaxContentLightLevel = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskHDMIHDRMaxFrameAverageLightLevel = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + + kRegMaskHDMIHDRNonContantLuminance = BIT(0), + kRegMaskHDMIHDRDolbyVisionEnable = BIT(6), + kRegMaskHDMIHDREnable = BIT(7), + kRegMaskElectroOpticalTransferFunction = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23), + kRegMaskHDRStaticMetadataDescriptorID = BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + + kRegMaskAudioMixerMainInputSelect = BIT(2) + BIT(1) + BIT(0), + kRegMaskAudioMixerAux1x2CHInput = BIT(6) + BIT(5) + BIT(4), + kRegMaskAudioMixerAux2x2CHInput = BIT(10) + BIT(9) + BIT(8), + kRegMaskAudioMixerChannelSelect = BIT(2) + BIT(1) + BIT(0), + kRegMaskAudioMixerOutputChannelsMute = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskAudioMixerOutputChannel1Mute = BIT(0), + kRegMaskAudioMixerOutputChannel2Mute = BIT(1), + kRegMaskAudioMixerOutputChannel3Mute = BIT(2), + kRegMaskAudioMixerOutputChannel4Mute = BIT(3), + kRegMaskAudioMixerOutputChannel5Mute = BIT(4), + kRegMaskAudioMixerOutputChannel6Mute = BIT(5), + kRegMaskAudioMixerOutputChannel7Mute = BIT(6), + kRegMaskAudioMixerOutputChannel8Mute = BIT(7), + kRegMaskAudioMixerOutputChannel9Mute = BIT(8), + kRegMaskAudioMixerOutputChannel10Mute = BIT(9), + kRegMaskAudioMixerOutputChannel11Mute = BIT(10), + kRegMaskAudioMixerOutputChannel12Mute = BIT(11), + kRegMaskAudioMixerOutputChannel13Mute = BIT(12), + kRegMaskAudioMixerOutputChannel14Mute = BIT(13), + kRegMaskAudioMixerOutputChannel15Mute = BIT(14), + kRegMaskAudioMixerOutputChannel16Mute = BIT(15), + kRegMaskAudioMixerMainInputEnable = BIT(16)+BIT(17), + kRegMaskAudioMixerAux1InputEnable = BIT(18)+BIT(19), + kRegMaskAudioMixerAux2InputEnable = BIT(20)+BIT(21), + kRegMaskAudioMixerAux1Channel1Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskAudioMixerAux1Channel2Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMaskAudioMixerAux2Channel1Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskAudioMixerAux2Channel2Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMaskAudioMixerMainChannel1Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskAudioMixerMainChannel2Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMaskAudioMixerMainChannel3Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskAudioMixerMainChannel4Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMaskAudioMixerMainChannel5Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskAudioMixerMainChannel6Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMaskAudioMixerMainChannel7Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskAudioMixerMainChannel8Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMaskAudioMixerMainChannel9Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskAudioMixerMainChannel10Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMaskAudioMixerMainChannel11Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskAudioMixerMainChannel12Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMaskAudioMixerMainChannel13Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskAudioMixerMainChannel14Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMaskAudioMixerMainChannel15Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskAudioMixerMainChannel16Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMaskAudioMixerMainMixedOutputChannel1Level = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskAudioMixerMainMixedOutputChannel2Level = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMaskAudioMixerInputLeftLevel = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kRegMaskAudioMixerInputRightLevel = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + kRegMaskAudioMixerLevelSampleCount = BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + + kRegMaskRotaryEncoderValue = BIT(7)+BIT(6)+BIT(5)+BIT(4)+BIT(3)+BIT(2)+BIT(1)+BIT(0), + kRegMaskRotaryEncoderGain = BIT(13)+BIT(12)+BIT(11)+BIT(10)+BIT(9)+BIT(8), + + kRegMaskLUTAddress = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15) + \ + BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29), + kRegMaskLUTLoad = BIT(31), + + kRegMaskMRStandard = BIT(3) + BIT(2) + BIT(1) + BIT(0), + kRegMaskMRFrameLocation = BIT(15) + BIT(14) + BIT(13) + BIT(12) + BIT(11) + BIT(10) + BIT(9) + BIT(8), + kRegMaskMRBypass = BIT(20), + kRegMaskMREnable = BIT(24), + kRegMaskMRSupport = BIT(2) + BIT(1) + BIT(0) + +#if !defined (NTV2_DEPRECATE) + , + // kRegSDIInput3GStatus + kLHIRegMaskSDIIn3GbpsMode = BIT(0), + kLHIRegMaskSDIIn3GbpsSMPTELevelBMode = BIT(1), + kLHIRegMaskSDIInVPIDLinkAValid = BIT(4), + kLHIRegMaskSDIInVPIDLinkBValid = BIT(5), + kLHIRegMaskSDIIn23GbpsMode = BIT(8), + kLHIRegMaskSDIIn23GbpsSMPTELevelBMode = BIT(9), + kLHIRegMaskSDIIn2VPIDLinkAValid = BIT(12), + kLHIRegMaskSDIIn2VPIDLinkBValid = BIT(13), + + // kRegSDIInput3GStatus2 + kLHIRegMaskSDIIn33GbpsMode = BIT(0), + kLHIRegMaskSDIIn33GbpsSMPTELevelBMode = BIT(1), + kLHIRegMaskSDIIn3VPIDLinkAValid = BIT(4), + kLHIRegMaskSDIIn3VPIDLinkBValid = BIT(5), + kLHIRegMaskSDIIn43GbpsMode = BIT(8), + kLHIRegMaskSDIIn43GbpsSMPTELevelBMode = BIT(9), + kLHIRegMaskSDIIn4VPIDLinkAValid = BIT(12), + kLHIRegMaskSDIIn4VPIDLinkBValid = BIT(13), + // + // Borg Fusion Registers + // + + // Boot FPGA and BoardID + kRegMaskBorgFusionBootFPGAVer = BIT(4)+BIT(5)+BIT(6)+BIT(7), + kRegMaskBorgFusionBoardID = BIT(0)+BIT(1)+BIT(2), + + // Codec and convert FPGA configuration control + kRegMaskBorgFusionCodecFPGAProgram = BIT(0), + kRegMaskBorgFusionCodecFPGAInit = BIT(1), + kRegMaskBorgFusionCodecFPGADone = BIT(2), + + kRegMaskBorgFusionConvertFPGAProgram = BIT(4), + kRegMaskBorgFusionConvertFPGAInit = BIT(5), + kRegMaskBorgFusionConvertFPGADone = BIT(6), + + // Panel Push buttons debounced and SATA drive present state + kRegMaskBorgFusionPushButtonSlotDebounced = BIT(0), + kRegMaskBorgFusionPushButtonAdjustDownDebounced = BIT(1), + kRegMaskBorgFusionPushButtonAdjustUpDebounced = BIT(2), + kRegMaskBorgFusionPushButtonDeleteClipDebounced = BIT(3), + kRegMaskBorgFusionPushButtonSelectDownDebounced = BIT(4), + kRegMaskBorgFusionPushButtonSelectUpDebounced = BIT(5), + kRegMaskBorgFusionPushButtonFastFwdDebounced = BIT(6), + kRegMaskBorgFusionPushButtonRecordDebounced = BIT(7), + kRegMaskBorgFusionPushButtonPlayDebounced = BIT(8), + kRegMaskBorgFusionPushButtonStopDebounced = BIT(9), + kRegMaskBorgFusionPushButtonRewindDebounced = BIT(10), + kRegMaskBorgFusionPushButtonMediaDebounced = BIT(11), + kRegMaskBorgFusionPushButtonConfigDebounced = BIT(12), + kRegMaskBorgFusionPushButtonStatusDebounced = BIT(13), + kRegMaskBorgFusionPushButtonSATADrivePresentDebounced = BIT(14), + kRegMaskBorgFusionPushButtonPowerDebounced = BIT(15), + + // Panel Push buttons and SATA drive present changes + kRegMaskBorgFusionPushButtonSlotChange = BIT(0), + kRegMaskBorgFusionPushButtonAdjustDownChange = BIT(1), + kRegMaskBorgFusionPushButtonAdjustUpChange = BIT(2), + kRegMaskBorgFusionPushButtonDeleteClipChange = BIT(3), + kRegMaskBorgFusionPushButtonSelectDownChange = BIT(4), + kRegMaskBorgFusionPushButtonSelectUpChange = BIT(5), + kRegMaskBorgFusionPushButtonFastFwdChange = BIT(6), + kRegMaskBorgFusionPushButtonRecordChange = BIT(7), + kRegMaskBorgFusionPushButtonPlayChange = BIT(8), + kRegMaskBorgFusionPushButtonStopChange = BIT(9), + kRegMaskBorgFusionPushButtonRewindChange = BIT(10), + kRegMaskBorgFusionPushButtonMediaChange = BIT(11), + kRegMaskBorgFusionPushButtonConfigChange = BIT(12), + kRegMaskBorgFusionPushButtonStatusChange = BIT(13), + kRegMaskBorgFusionPushButtonSATADrivePresentChange = BIT(14), + kRegMaskBorgFusionPushButtonPowerButtonChange = BIT(15), + + // LED Pulse Width Modulation Threshholds + kRegMaskBorgFusionPWMThreshExpressCard2 = BIT(0)+BIT(1)+BIT(2)+BIT(3), + kRegMaskBorgFusionPWMThreshExpressCard1 = BIT(4)+BIT(5)+BIT(6)+BIT(7), + kRegMaskBorgFusionPWMThreshPower = BIT(8)+BIT(9)+BIT(10)+BIT(11), + kRegMaskBonesFusionPWMThreshLCDBacklightLED = BIT(12)+BIT(13)+BIT(14)+BIT(15), + + // Power control - System + kRegMaskBorgFusionPowerCtrlWiFiReset = BIT(0), + kRegMaskBorgFusionPowerCtrlFirewirePower = BIT(1), + kRegMaskBorgFusionPowerCtrlGigEthReset = BIT(2), + kRegMaskBorgFusionPowerCtrlPCIExpClockStop = BIT(3), + + // Power control - Storage devices - Borg Fusion + kRegMaskBorgFusionPowerCtrlPCIExpCard1_3_3vPower = BIT(8), // Express Card 1 3.3v power + kRegMaskBorgFusionPowerCtrlPCIExpCard1_1_5vPower = BIT(9), // Express Card 1 1.5v power + kRegMaskBorgFusionPowerCtrlPCIExpCard2_3_3vPower = BIT(10), // Express Card 2 3.3v power + kRegMaskBorgFusionPowerCtrlPCIExpCard2_1_5vPower = BIT(11), // Express Card 2 1.5v power + kRegMaskBorgFusionPowerCtrlSata_12vPower = BIT(12), // SATA Drive 12v power + + // Power control - Storage devices - Bones Actel + kRegMaskBonesActelPowerCtrlCFSlot2_BridgeReset = BIT(8), // Bones Actel CF Slot 2 (CPU) Bridge Reset + kRegMaskBonesActelPowerCtrlCFSlot2_Power = BIT(9), // Bones Actel CF Slot 2 (CPU) Power + kRegMaskBonesActelPowerCtrlCFSlot1_Power = BIT(10), // Bones Actel CF Slot 1 (VIDeo) Power + kRegMaskBonesActelPowerCtrlCFSlot1_BridgeReset = BIT(11), // Bones Actel CF Slot 1 (VIDeo) Bridge Reset + + // Power control - Storage devices - Barclay Actel Fusion + kRegMaskBarclayFusionPowerCtrlPS1Active = BIT(6), // Barclay Fusion Power Supply 1 active bit + kRegMaskBarclayFusionPowerCtrlPS2Active = BIT(5), // Barclay Fusion Power Supply 2 active bit + + kRegMaskBarclayFusionIdentifyLEDCtrl = BIT(1), //Barclay Identify LED On/Off bit, Rear LED //RS + + // Power control - Pushbutton LEDs + kRegMaskBorgFusionPowerCtrlPCIExpCard2LED = BIT(13), + kRegMaskBorgFusionPowerCtrlPCIExpCard1LED = BIT(14), + kRegMaskBorgFusionPowerCtrlPowerButtonLED = BIT(15), + + // IRQ3n Interrupt control + kRegMaskBorgFusionIRQ3nIntCtrlPushButtonChangeEnable = BIT(0), + kRegMaskBorgFusionIRQ3nIntCtrlInputVoltageLow9vEnable = BIT(1), + kRegMaskBorgFusionIRQ3nIntCtrlDisplayFIFOFullEnable = BIT(2), + kRegMaskBorgFusionIRQ3nIntCtrlSATAPresentChangeEnable = BIT(3), + kRegMaskBorgFusionIRQ3nIntCtrlTemp1HighEnable = BIT(4), + kRegMaskBorgFusionIRQ3nIntCtrlTemp2HighEnable = BIT(5), + kRegMaskBorgFusionIRQ3nIntCtrlPowerButtonChangeEnable = BIT(6), + + // IRQ3n Interrupt source + kRegMaskBorgFusionIRQ3nIntSrcPushButtonChange= BIT(0), + kRegMaskBorgFusionIRQ3nIntSrcInputVoltageLow9v= BIT(1), + kRegMaskBorgFusionIRQ3nIntSrcDisplayFIFOFull= BIT(2), + kRegMaskBorgFusionIRQ3nIntSrcSATAPresentChange= BIT(3), + kRegMaskBorgFusionIRQ3nIntSrcTemp1High= BIT(4), + kRegMaskBorgFusionIRQ3nIntSrcTemp2High= BIT(5), + kRegMaskBorgFusionIRQ3nIntSrcPowerButtonChange= BIT(6), + + // Noritake Display Control/Status + kRegMaskBorgFusionDisplayCtrlReset = BIT (0), + kRegMaskBorgFusionDisplayStatusBusyRaw = BIT (1), // Not needed by CPU, used internally by FPGA + kRegMaskBorgFusionDisplayStatusInterfaceBusy = BIT (7), // FIFO full + + // Analog ADC flags - battery + kRegMaskBorgFusionAnalogFlagsPowerLTE9v = BIT(0), // +12 v supply <= 9.0 v battery critical + kRegMaskBorgFusionAnalogFlagsPowerLTE10v = BIT(1), // +12 v supply <= 10.0 v battery depleting + kRegMaskBorgFusionAnalogFlagsPowerLTE11v = BIT(2), // +12 v supply <= 11.0 v battery depleting + kRegMaskBorgFusionAnalogFlagsPowerGTE13v = BIT(3), // +12 v supply >= 13.0 v battery charging + + // Analog ADC flags - temperature sensor + kRegMaskBorgFusionAnalogFlagsPowerTemp1High = BIT(4), // Temp sensor 1 > 65 C + kRegMaskBorgFusionAnalogFlagsPowerTemp2High = BIT(5), // Temp sensor 2 > 65 C + + // Bones Actel Compact Flash Slot Debounced Card Present + kRegMaskBonesActelCFSlot1_Present = BIT(1)+BIT(0), + kRegMaskBonesActelCFSlot2_Present = BIT(3)+BIT(2), + + // Bones Actel Compact Flash Slot Changes Present + kRegMaskBonesActelCFSlot1_Changes = BIT(1)+BIT(0), + kRegMaskBonesActelCFSlot2_Changes = BIT(3)+BIT(2), + // Pan (2K crop) - Xena 2 + kRegMaskPanMode = BIT(30) + BIT(31), + kRegMaskPanOffsetH = BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)+BIT(8)+BIT(9)+BIT(10)+BIT(11), + kRegMaskPanOffsetV = BIT(12)+BIT(13)+BIT(14)+BIT(15)+BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23) +#endif // !defined (NTV2_DEPRECATE) + +} RegisterMask; + +typedef enum +{ + // Global Control + kRegShiftFrameRate = 0, + kRegShiftFrameRateHiBit = 22, + kRegShiftGeometry = 3, + kRegShiftStandard = 7, + kRegShiftRefSource = 10, + kRegShiftRefInputVoltage = 12, + kRegShiftSmpte372 = 15, + kRegShiftLED = 16, + kRegShiftRegClocking = 20, + kRegShiftDualLinkInput = 23, + kRegShiftQuadTsiEnable = 24, + kRegShiftBankSelect = 25, + kRegShiftDualLinKOutput = 27, + kRegShiftRP188ModeCh1 = 28, + kRegShiftRP188ModeCh2 = 29, + kRegShiftCCHostAccessBankSelect = 30, + + // Global Control 2 + kRegShiftRefSource2 = 0, + kRegShiftPCRReferenceEnable = 1, + kRegShiftQuadMode = 3, + kRegShiftAud1PlayCapMode = 4, + kRegShiftAud2PlayCapMode = 5, + kRegShiftAud3PlayCapMode = 6, + kRegShiftAud4PlayCapMode = 7, + kRegShiftAud5PlayCapMode = 8, + kRegShiftAud6PlayCapMode = 9, + kRegShiftAud7PlayCapMode = 10, + kRegShiftAud8PlayCapMode = 11, + kRegShiftQuadMode2 = 12, + kRegShiftSmpte372Enable4 = 13, + kRegShiftSmpte372Enable6 = 14, + kRegShiftSmpte372Enable8 = 15, + kRegShiftIndependentMode = 16, + kRegShift2MFrameSupport = 17, + kRegShiftAudioMixerPresent = 18, + kRegShiftIsDNXIV = 19, + kRegShift425FB12 = 20, + kRegShift425FB34 = 21, + kRegShift425FB56 = 22, + kRegShift425FB78 = 23, + kRegShiftRP188ModeCh3 = 28, + kRegShiftRP188ModeCh4 = 29, + kRegShiftRP188ModeCh5 = 30, + kRegShiftRP188ModeCh6 = 31, + kRegShiftRP188ModeCh7 = 26, + kRegShiftRP188ModeCh8 = 27, + + // kRegGlobalControl3 (reg 108) + kRegShiftAnalogIOControl = 0, + kRegShiftQuadQuadMode = 2, + kRegShiftQuadQuadMode2 = 3, + kRegShiftQuadQuadSquaresMode = 4, + kRegShiftVUMeterSelect = 5, + kRegShiftFramePulseEnable = 6, + kRegShiftFramePulseRefSelect = 8, + + // Audio Control 2 + kRegShiftAud1RateHigh = 0, + kRegShiftAud2RateHigh = 1, + kRegShiftAud3RateHigh = 2, + kRegShiftAud4RateHigh = 3, + kRegShiftAud5RateHigh = 4, + kRegShiftAud6RateHigh = 5, + kRegShiftAud7RateHigh = 6, + kRegShiftAud8RateHigh = 7, + + // Channel Control - kRegCh1Control, kRegCh2Control, kRegCh3Control, kRegCh4Control + kRegShiftMode = 0, + kRegShiftFrameFormat = 1, + kRegShiftFrameFormatHiBit = 6, // KAM + kRegShiftAlphaFromInput2 = 5, + kRegShiftChannelDisable = 7, + kRegShiftWriteBack = 8, + kRegShiftFrameOrientation = 10, + kRegShiftQuarterSizeMode = 11, + kRegShiftFrameBufferMode = 12, + kKHRegShiftDownconvertInput = 14, + kLSRegShiftVideoInputSelect = 15, + kRegShiftDitherOn8BitInput = 16, + kRegShiftQuality = 17, + kRegShiftEncodeAsPSF = 18, + kK2RegShiftFrameSize = 20, + kRegShiftChannelCompressed = 22, + kRegShiftRGB8b10bCvtMode = 23, + kRegShiftVBlankRGBRangeMode = 24, // Deprecated + kRegShiftVBlankRGBRange = 24, + kRegShiftQuality2 = 25, + kRegCh1BlackOutputShift = 27, // KiPro bit set results in black output video and muted audio in capture mode, black output video in playback + kRegShiftSonySRExpressBit = 28, + kRegShiftFrameSizeSetBySW = 29, + kRegShiftVidProcVANCShift = 31, + + // Video Crosspoint Control + kRegShiftVidXptFGVideo = 0, + kRegShiftVidXptBGVideo = 4, + kRegShiftVidXptFGKey = 8, + kRegShiftVidXptBGKey = 12, + kRegShiftVidXptSecVideo = 16, + + // Video Processing Control + kRegShiftVidProcMux1 = 0, + kRegShiftVidProcMux2 = 2, + kRegShiftVidProcMux3 = 4, + kRegShiftVidProcMux4 = 6, + kRegShiftVidProcMux5 = 8, + kRegShiftVidProcLimiting = 11, + kRegShiftVidProcVancSource = 13, + kRegShiftVidProcRGBRange = 14, + kRegShiftVidProcFGMatteEnable = 18, + kRegShiftVidProcBGMatteEnable = 19, + kRegShiftVidProcFGControl = 20, + kRegShiftVidProcBGControl = 22, + kRegShiftVidProcMode = 24, + kRegShiftVidProcRGBModeSupported = 26, + kRegShiftVidProcSyncFail = 27, + kRegShiftVidProcSplitStd = 28, + kRegShiftVidProcSubtitleEnable = 31, + + + // Note: See more bitfields for this register below, in the 'Xena2K and Konax Video Processing.' section + + // kRegStatus + kRegShiftHardwareVersion = 0, + kRegShiftFPGAVersion = 4, + kRegShiftLTCInPresent = 17, + + // Video Interrupt Control + kRegShiftIntEnableMask = 0, + + // Audio Control + kRegShiftCaptureEnable = 0, + kRegShiftNumBits = 1, // shouldn't this be 2? + kRegShiftOutputTone = 1, + kRegShift20BitMode = 2, + kRegShiftLoopBack = 3, + kRegShiftAudioTone = 7, + kRegShiftResetAudioInput = 8, + kRegShiftResetAudioOutput = 9, + kRegShiftInputStartAtVBI = 10, // New in 15.6 + kRegShiftPauseAudio = 11, + kRegShiftEmbeddedOutputMuteCh1 = 12, // added for FS1 + kRegShiftEmbeddedOutputSupressCh1 = 13, // added for FS1 but available on other boards + kRegShiftOutputStartAtVBI = 14, // New in 15.6 + kRegShiftEmbeddedOutputSupressCh2 = 15, // added for FS1 but available on other boards + kRegShiftNumChannels = 16, + kRegShiftEmbeddedOutputMuteCh2 = 17, // added for FS1 + kRegShiftAudioRate = 18, + kRegShiftEncodedAudioMode = 19, + kRegShiftAudio16Channel = 20, + kRegShiftMultiLinkAudio = 23, + kRegShiftAudio8Channel = kRegShiftMultiLinkAudio, + kK2RegShiftKBoxAnalogMonitor = 24, + kK2RegShiftKBoxAudioInputSelect = 26, + kK2RegShiftKBoxDetect = 27, + kK2RegShiftBOCableDetect = 28, + kK2RegShiftAudioLevel = 29, + kK2RegShiftAverageAudioLevel = 0, + kFS1RegShiftAudioLevel = 29, + kK2RegShiftAudioBufferSize = 31, + kLHRegShiftResetAudioDAC = 31, + + // Audio Source Select + kRegShiftAudioSource = 0, + kRegShiftEmbeddedAudioInput = 16, + kRegShiftAudioAutoErase = 19, + kRegShiftAnalogHDMIvsAES = 20, + kRegShift3GbSelect = 21, + kRegShiftEmbeddedAudioClock = 22, + kRegShiftEmbeddedAudioInput2 = 23, + kRegShiftAnalogAudioInGain = 24, + kRegShiftAnalogAudioInJack = 25, + + kRegShiftLossOfInput = 11, + + // Input Status + kRegShiftInput1FrameRate = 0, + kRegShiftInput1Geometry = 4, + kRegShiftInput1Progressive = 7, + kRegShiftInput2FrameRate = 8, + kRegShiftInput2Geometry = 12, + kRegShiftInput2Progressive = 15, + kRegShiftReferenceFrameRate = 16, + kRegShiftReferenceFrameLines = 20, + kRegShiftReferenceProgessive = 23, + kRegShiftAESCh12Present = 24, + kRegShiftAESCh34Present = 25, + kRegShiftAESCh56Present = 26, + kRegShiftAESCh78Present = 27, + kRegShiftInput1FrameRateHigh = 28, + kRegShiftInput2FrameRateHigh = 29, + kRegShiftInput1GeometryHigh = 30, + kRegShiftInput2GeometryHigh = 31, + + // RP-188 Source + kRegShiftRP188Source = 24, + kRegShiftRP188DBB = 0, + + // DMA Control + kRegShiftForce64 = 4, + kRegShiftAutodetect64 = 5, + kRegShiftFirmWareRev = 8, + kRegShiftDMAPauseDisable = 16, + + // Color Correction Control + kRegShiftSaturationValue = 0, + kRegShiftCCOutputBankSelect = 16, + kRegShiftCCMode = 17, + kRegShiftCC5HostAccessBankSelect = 20, + kRegShiftCC5OutputBankSelect = 21, + kRegShiftLUT5Select = 28, + kRegShiftLUTSelect = 29, + kRegShiftCC3OutputBankSelect = 30, + kRegShiftCC4OutputBankSelect = 31, + + // kRegCanDoStatus + kRegShiftCanDoValidXptROM = 0, + kRegShiftCanDoAudioWaitForVBI = 1, + + // kRegLUTV2Control + kRegShiftLUT1Enable = 0, + kRegShiftLUT2Enable = 1, + kRegShiftLUT3Enable = 2, + kRegShiftLUT4Enable = 3, + kRegShiftLUT5Enable = 4, + kRegShiftLUT6Enable = 5, + kRegShiftLUT7Enable = 6, + kRegShiftLUT8Enable = 7, + kRegShiftLUT1HostAccessBankSelect = 8, + kRegShiftLUT2HostAccessBankSelect = 9, + kRegShiftLUT3HostAccessBankSelect = 10, + kRegShiftLUT4HostAccessBankSelect = 11, + kRegShiftLUT5HostAccessBankSelect = 12, + kRegShiftLUT6HostAccessBankSelect = 13, + kRegShiftLUT7HostAccessBankSelect = 14, + kRegShiftLUT8HostAccessBankSelect = 15, + kRegShiftLUT1OutputBankSelect = 16, + kRegShiftLUT2OutputBankSelect = 17, + kRegShiftLUT3OutputBankSelect = 18, + kRegShiftLUT4OutputBankSelect = 19, + kRegShiftLUT5OutputBankSelect = 20, + kRegShiftLUT6OutputBankSelect = 21, + kRegShiftLUT7OutputBankSelect = 22, + kRegShiftLUT8OutputBankSelect = 23, + kRegShift12BitLUTPlaneSelect = 24, + kRegShift12BitLUTSupport = 28, + + // RS422 Control + kRegShiftRS422TXEnable = 0, + kRegShiftRS422TXFIFOEmpty = 1, + kRegShiftRS422TXFIFOFull = 2, + kRegShiftRS422RXEnable = 3, + kRegShiftRS422RXFIFONotEmpty = 4, + kRegShiftRS422RXFIFOFull = 5, + kRegShiftRS422RXParityError = 6, + kRegShiftRS422Flush = 6, + kRegShiftRS422RXFIFOOverrun = 7, + kRegShiftRS422Present = 8, + kRegShiftRS422TXInhibit = 9, + kRegShiftRS422ParitySense = 12, + kRegShiftRS422ParityDisable = 13, + kRegShiftRS422BaudRate = 16, + + + // FS1 ProcAmp Control + kFS1RegShiftProcAmpC1Y = 0, + kFS1RegShiftProcAmpC1CB = 16, + kFS1RegShiftProcAmpC1CR = 0, + kFS1RegShiftProcAmpC2CB = 16, + kFS1RegShiftProcAmpC2CR = 0, + kFS1RegShiftProcAmpOffsetY = 16, + + kRegShiftAudioInDelay = 0, + kRegShiftAudioOutDelay = 16, + + // FS1 Audio Delay + kFS1RegShiftAudioDelay = 0, + + // Borg Audio Delay + kBorgRegShiftPlaybackEEAudioDelay = 0, + kBorgRegShiftCaputreAudioDelay = 16, + + // kRegOutputTimingControl + kBorgRegShiftOutTimingCtrlHorzOfs = 0, + kBorgRegShiftOutTimingCtrlVertOfs = 16, + + // FS1 I2C + kFS1RegShiftI2C1ControlWrite = 0, + kFS1RegShiftI2C1ControlRead = 1, + kFS1RegShiftI2C1ControlBusy = 2, + kFS1RegShiftI2C1ControlError = 3, + kFS1RegShiftI2C2ControlWrite = 4, + kFS1RegShiftI2C2ControlRead = 5, + kFS1RegShiftI2C2ControlBusy = 6, + kFS1RegShiftI2C2ControlError = 7, + + kFS1RegShiftI2CAddress = 0, + kFS1RegShiftI2CSubAddress = 8, + kFS1RegShiftI2CWriteData = 0, + kFS1RegShiftI2CReadData = 8, + + //kRegFS1ReferenceSelect + kRegShiftLTCLoopback = 10, + kFS1RegShiftReferenceInputSelect = 0, + kFS1RefShiftLTCOnRefInSelect = 4, + kRegShiftLTCOnRefInSelect = 5, + kFS1RefShiftLTCEmbeddedOutEnable = 8, + kFS1RegShiftColorFIDSubcarrierReset = 14, + kFS1RegShiftFreezeOutput = 15, + kFS1RegShiftProcAmpInputSelect = 16, + kFS1RegShiftSecondAnalogOutInputSelect = 24, + + // FS1 AFD Mode + kFS1RegShiftAFDReceived_Code = 0, + kFS1RegShiftAFDReceived_AR = 4, + kFS1RegShiftAFDReceived_VANCPresent = 7, + kFS1RegShiftUpconvertAutoAFDEnable = 20, + kFS1RegShiftUpconvert2AFDDefaultHoldLast = 21, + kFS1RegShiftDownconvertAutoAFDEnable = 24, + kFS1RegShiftDownconvertAFDDefaultHoldLast = 25, + kFS1RegShiftDownconvert2AutoAFDEnable = 28, + kFS1RegShiftDownconvert2AFDDefaultHoldLast = 29, + + // FS1 AFD Inserter + kFS1RegShiftAFDVANCInserter_Code = 0, + kFS1RegShiftAFDVANCInserter_AR = 4, + kFS1RegShiftAFDVANCInserter_Mode = 12, + kFS1RegShiftAFDVANCInserter_Line = 16, + + // FS1 Audio Channel Mapping + kFS1RegShiftAudioChannelMapping_Gain = 0, + kFS1RegShiftAudioChannelMapping_Phase = 15, + kFS1RegShiftAudioChannelMapping_Source = 16, + kFS1RegShiftAudioChannelMapping_Mute = 31, + + // FS1 Output Timing Fine Phase Adjust + kRegShiftOutputTimingFinePhase = 0, + + //kRegAnalogInputStatus + kRegShiftAnalogInputSD = 14, + kRegShiftAnalogInputIntegerRate = 15, + kRegShiftAnalogCompositeLocked = 16, + kRegShiftAnalogCompositeFormat625 = 18, + + //kRegAnalogInputControl + kRegShiftAnalogInputADCMode = 0, + + //kRegHDMIOut3DControl + kRegShiftHDMIOut3DPresent = 3, + kRegShiftHDMIOut3DMode = 4, + + //kRegHDMIOutControl + kRegShiftHDMIOutVideoStd = 0, + kRegShiftHDMIOut8ChGroupSelect = 5, + kLHIRegShiftHDMIDownStreamDeviceYCbCrMode = 6, + kLHIRegShiftHDMIDownStreamDevice10BitMode = 7, + kRegShiftHDMIV2TxBypass = 7, + kLHIRegShiftHDMIOutColorSpace = 8, + kLHIRegShiftHDMIOutFPS = 9, + kRegShiftHDMIOutProgressive = 13, + kLHIRegShiftHDMIOutBitDepth = 14, + kRegShiftHDMISampling = 18, + kRegShiftHDMIVOBD = 20, + kRegShiftSourceIsRGB = 23, + kRegShiftHDMIOutPowerDown = 25, + kRegShiftHDMIOutRange = 28, + kRegShiftHDMIOutAudioCh = 29, + kLHIRegShiftHDMIOutDVI = 30, + + //kRegHDMIInputStatus + kRegShiftInputStatusLock = 0, + kRegShiftStable = 1, + kLHIRegShiftHDMIInputColorSpace = 2, + kLHIRegShiftHDMIInputBitDepth = 3, + kRegShiftHDMIInV2VideoStd = 4, + kLHIRegShiftHDMIOutputEDIDRGB = 10, + kLHIRegShiftHDMIOutputEDID10Bit = 11, + kLHIRegShiftHDMIInput2ChAudio = 12, + kRegShiftHDMIInputProgressive = 13, + kLHIRegShiftHDMIOutputEDIDDVI = 15, + kRegShiftHDMIInAudioRate = 16, + kRegShiftAudioWorkLength = 20, + kRegShiftInputStatusStd = 24, + kLHIRegShiftHDMIInputProtocol = 27, + kRegShiftInputStatusFPS = 28, + + //kRegHDMIInputControl + kRegShiftHDMIOutForceConfig = 1, + kRegShiftHDMIAudioPairSelect = 2, + kRegShiftHDMISampleRateConverterEnable = 4, + kRegShiftHDMISwapInputAudCh34 = 5, + kRegShiftHDMISwapOutputAudCh34 = 6, + kRegShiftHDMIOutPrefer420 = 7, + kRegShiftHDMIOutAudioFormat = 8, + kRegShiftHDMIInColorDepth = 12, + kRegShiftHDMIInColorSpace = 14, + kRegShiftHDMIOutAudioRate = 16, + kRegShiftHDMIOutSourceSelect = 20, + kRegShiftHDMIOutCropEnable = 24, + kRegShiftHDMIOutForceHPD = 25, + kRegShiftHDMIOut12Bit = 26, + kRegShiftHDMIDebug = 27, + kRegShiftHDMIInputRange = 28, + kRegShiftHDMIOutAudio2ChannelSelect = 29, + kRegShiftHDMIInfoRange = 31, + + //kRegHDMIInputControl / kRegHDMIOutControl ??? + kRegShiftHDMIColorSpace = 4, + kRegShiftHDMIPolarity = 16, + + //kK2RegAnalogOutControl, + kK2RegShiftVideoDACMode = 0, + kFS1RegShiftVideoDAC2Mode = 8, + kLHIRegShiftVideoDACStandard = 13, + kLSRegShiftVideoADCMode = 16, + kLHIRegShiftVideoDACMode = 21, // 4 bit enum equivalent of bit 21-24 + kLHIRegShiftVideoDACSetup = 21, + kLHIRegShiftVideoDACJapan = 22, + kLHIRegShiftVideoDACRGB = 23, + kLHIRegShiftVideoDACComponent = 24, + kK2RegShiftOutHTiming = 24, + + //kK2RegSDIOut1Control + kRegK2SDIOut2Control + kK2RegAnalogOutControl + kK2RegShiftSDIOutStandard = 0, + kK2RegShiftSDI1Out_2Kx1080Mode = 3, + kLHRegShiftVideoOutputDigitalSelect = 4, + kK2RegShiftSDIOutHBlankRGBRange = 7, + kLHRegShiftVideoOutputAnalogSelect = 8, + kRegShiftSDIOut6GbpsMode = 16, + kRegShiftSDIOut12GbpsMode = 17, + kRegShiftRGBLevelA = 22, + kRegShiftSDIOutLevelAtoLevelB = 23, + kLHIRegShiftSDIOut3GbpsMode = 24, + kLHIRegShiftSDIOutSMPTELevelBMode = 25, + kK2RegShiftVPIDInsertionEnable = 26, + kK2RegShiftVPIDInsertionOverwrite = 27, + kK2RegShiftSDIOutDS1AudioSelect = 28,//30, + kK2RegShiftSDIOutDS2AudioSelect = 29,//31, + + //kK2RegConversionControl, + kK2RegShiftConverterOutStandard = 12, + kK2RegShiftConverterOutRate = 27, + kK2RegShiftUpConvertMode = 8, + kK2RegShiftDownConvertMode = 4, + kK2RegShiftConverterInStandard = 0, + kK2RegShiftConverterInRate = 23, + kK2RegShiftConverterPulldown = 6, + kK2RegShiftUCPassLine21 = 16, + kK2RegShiftUCAutoLine21 = 17, + kK2RegShiftIsoConvertMode = 20, + kK2RegShiftDeinterlaceMode = 15, + kK2RegShiftEnableConverter = 31, + + //kK2RegFrameSync1Control and kK2RegFrameSync2Control + kK2RegShiftFrameSyncControlFrameDelay = 24, + kK2RegShiftFrameSyncControlStandard = 8, + kK2RegShiftFrameSyncControlGeometry = 4, + kK2RegShiftFrameSyncControlFrameFormat = 0, + + //kK2RegXptSelectGroup1 + kK2RegShiftCompressionModInputSelect = 24, + kK2RegShiftConversionModInputSelect = 16, + kK2RegShiftColorSpaceConverterInputSelect = 8, + kK2RegShiftXptLUTInputSelect = 0, + + //kK2RegXptSelectGroup2 + kK2RegShiftDuallinkOutInputSelect = 24, + kK2RegShiftFrameSync2InputSelect = 16, + kK2RegShiftFrameSync1InputSelect = 8, + kK2RegShiftFrameBuffer1InputSelect = 0, + + //kK2RegXptSelectGroup3 + kK2RegShiftCSC1KeyInputSelect = 24, + kK2RegShiftSDIOut2InputSelect = 16, + kK2RegShiftSDIOut1InputSelect = 8, + kK2RegShiftAnalogOutInputSelect = 0, + + //kK2RegXptSelectGroup4 + kK2RegShiftMixerBGKeyInputSelect = 24, + kK2RegShiftMixerBGVidInputSelect = 16, + kK2RegShiftMixerFGKeyInputSelect = 8, + kK2RegShiftMixerFGVidInputSelect = 0, + + //kK2RegXptSelectGroup5 + kK2RegShiftCSC2KeyInputSelect = 24, + kK2RegShiftCSC2VidInputSelect = 16, + kK2RegShiftXptLUT2InputSelect = 8, + kK2RegShiftFrameBuffer2InputSelect = 0, + + //kK2RegXptSelectGroup6 + kK2RegShiftSecondConverterInputSelect = 24, + kK2RegShiftHDMIOutInputSelect = 16, + kK2RegShiftIICTInputSelect = 8, + kK2RegShiftWaterMarkerInputSelect = 0, + + //kK2RegXptSelectGroup7 + kK2RegShiftDuallinkOut2InputSelect = 16, + kK2RegShiftIICT2InputSelect = 8, + kK2RegShiftWaterMarker2InputSelect = 0, + + //kK2RegXptSelectGroup8 + kK2RegShiftSDIOut5InputSelect = 16, + kK2RegShiftSDIOut4InputSelect = 8, + kK2RegShiftSDIOut3InputSelect = 0, + + //kRegCh1ControlExtended + //kRegCh2ControlExtended + kK2RegShiftPulldownMode = 2, + + //kK2RegXptSelectGroup9 + kK2RegShiftMixer2BGKeyInputSelect = 24, + kK2RegShiftMixer2BGVidInputSelect = 16, + kK2RegShiftMixer2FGKeyInputSelect = 8, + kK2RegShiftMixer2FGVidInputSelect = 0, + + //kK2RegXptSelectGroup10 + kK2RegShiftSDIOut2DS2InputSelect = 8, + kK2RegShiftSDIOut1DS2InputSelect = 0, + + //kK2RegXptSelectGroup11 + kK2RegShiftDuallinkIn1InputSelect = 0, + kK2RegShiftDuallinkIn1DSInputSelect = 8, + kK2RegShiftDuallinkIn2InputSelect = 16, + kK2RegShiftDuallinkIn2DSInputSelect = 24, + + //kK2RegXptSelectGroup12 + kK2RegShiftXptLUT3InputSelect = 0, + kK2RegShiftXptLUT4InputSelect = 8, + kK2RegShiftXptLUT5InputSelect = 16, + kK2RegShiftXpt3DLUT1InputSelect = 24, + + //kK2RegXptSelectGroup13 + kK2RegShiftFrameBuffer3InputSelect = 0, + kK2RegShiftFrameBuffer4InputSelect = 16, + + //kK2RegXptSelectGroup14 + kK2RegShiftSDIOut3DS2InputSelect = 8, + kK2RegShiftSDIOut5DS2InputSelect = 16, + kK2RegShiftSDIOut4DS2InputSelect = 24, + + //kRegXptSelectGroup15 + kK2RegShiftDuallinkIn3InputSelect = 0, + kK2RegShiftDuallinkIn3DSInputSelect = 8, + kK2RegShiftDuallinkIn4InputSelect = 16, + kK2RegShiftDuallinkIn4DSInputSelect = 24, + + //kRegXptSelectGroup16 + kK2RegShiftDuallinkOut3InputSelect = 0, + kK2RegShiftDuallinkOut4InputSelect = 8, + kK2RegShiftDuallinkOut5InputSelect = 16, + + //kK2RegXptSelectGroup17 + kK2RegShiftCSC3VidInputSelect = 0, + kK2RegShiftCSC3KeyInputSelect = 8, + kK2RegShiftCSC4VidInputSelect = 16, + kK2RegShiftCSC4KeyInputSelect = 24, + + //kRegXptSelectGroup18 + kK2RegShiftCSC5VidInputSelect = 0, + kK2RegShiftCSC5KeyInputSelect = 8, + + //kRegXptSelectGroup19 + kK2RegShift4KDCQ1InputSelect = 0, + kK2RegShift4KDCQ2InputSelect = 8, + kK2RegShift4KDCQ3InputSelect = 16, + kK2RegShift4KDCQ4InputSelect = 24, + + //kRegXptSelectGroup20 + kK2RegShiftHDMIOutV2Q1InputSelect = 0, + kK2RegShiftHDMIOutV2Q2InputSelect = 8, + kK2RegShiftHDMIOutV2Q3InputSelect = 16, + kK2RegShiftHDMIOutV2Q4InputSelect = 24, + + //kK2RegXptSelectGroup21 + kK2RegShiftFrameBuffer5InputSelect = 0, + kK2RegShiftFrameBuffer6InputSelect = 8, + kK2RegShiftFrameBuffer7InputSelect = 16, + kK2RegShiftFrameBuffer8InputSelect = 24, + + //kK2RegXptSelectGroup22 + kK2RegShiftSDIOut6InputSelect = 0, + kK2RegShiftSDIOut6DS2InputSelect = 8, + kK2RegShiftSDIOut7InputSelect = 16, + kK2RegShiftSDIOut7DS2InputSelect = 24, + + //kK2RegXptSelectGroup30 + kK2RegShiftSDIOut8InputSelect = 0, + kK2RegShiftSDIOut8DS2InputSelect = 8, + kK2RegShiftCSC6VidInputSelect = 16, + kK2RegShiftCSC6KeyInputSelect = 24, + + //kK2RegXptSelectGroup23 + kK2RegShiftCSC7VidInputSelect = 0, + kK2RegShiftCSC7KeyInputSelect = 8, + kK2RegShiftCSC8VidInputSelect = 16, + kK2RegShiftCSC8KeyInputSelect = 24, + + //kK2RegXptSelectGroup24 + kK2RegShiftXptLUT6InputSelect = 0, + kK2RegShiftXptLUT7InputSelect = 8, + kK2RegShiftXptLUT8InputSelect = 16, + + //kK2RegXptSelectGroup25 + kK2RegShiftDuallinkIn5InputSelect = 0, + kK2RegShiftDuallinkIn5DSInputSelect = 8, + kK2RegShiftDuallinkIn6InputSelect = 16, + kK2RegShiftDuallinkIn6DSInputSelect = 24, + + //kK2RegXptSelectGroup26 + kK2RegShiftDuallinkIn7InputSelect = 0, + kK2RegShiftDuallinkIn7DSInputSelect = 8, + kK2RegShiftDuallinkIn8InputSelect = 16, + kK2RegShiftDuallinkIn8DSInputSelect = 24, + + //kK2RegXptSelectGroup27 + kK2RegShiftDuallinkOut6InputSelect = 0, + kK2RegShiftDuallinkOut7InputSelect = 8, + kK2RegShiftDuallinkOut8InputSelect = 16, + + //kK2RegXptSelectGroup28 + kK2RegShiftMixer3FGVidInputSelect = 0, + kK2RegShiftMixer3FGKeyInputSelect = 8, + kK2RegShiftMixer3BGVidInputSelect = 16, + kK2RegShiftMixer3BGKeyInputSelect = 24, + + //kK2RegXptSelectGroup29 + kK2RegShiftMixer4FGVidInputSelect = 0, + kK2RegShiftMixer4FGKeyInputSelect = 8, + kK2RegShiftMixer4BGVidInputSelect = 16, + kK2RegShiftMixer4BGKeyInputSelect = 24, + + //kRegXptSelectGroup31 + kK2RegShift425Mux1AInputSelect = 0, + kK2RegShift425Mux1BInputSelect = 8, + kK2RegShift425Mux2AInputSelect = 16, + kK2RegShift425Mux2BInputSelect = 24, + + //kRegXptSelectGroup32 + kK2RegShift425Mux3AInputSelect = 0, + kK2RegShift425Mux3BInputSelect = 8, + kK2RegShift425Mux4AInputSelect = 16, + kK2RegShift425Mux4BInputSelect = 24, + + //kRegXptSelectGroup33 + kK2RegShiftFrameBuffer1BInputSelect = 0, + kK2RegShiftFrameBuffer2BInputSelect = 8, + kK2RegShiftFrameBuffer3BInputSelect = 16, + kK2RegShiftFrameBuffer4BInputSelect = 24, + + //kRegXptSelectGroup36 + kK2RegShiftMultiLinkOutInputSelect = 0, + kK2RegShiftMultiLinkOutDS2InputSelect = 8, + + //kRegXptSelectGroup34 + kK2RegShiftFrameBuffer5BInputSelect = 0, + kK2RegShiftFrameBuffer6BInputSelect = 8, + kK2RegShiftFrameBuffer7BInputSelect = 16, + kK2RegShiftFrameBuffer8BInputSelect = 24, + + //kK2RegCSCoefficients1_2 + kK2RegShiftVidKeySyncStatus = 28, + kK2RegShiftMakeAlphaFromKeySelect = 29, + kK2RegShiftColorSpaceMatrixSelect = 30, + kK2RegShiftUseCustomCoefSelect = 31, + //kK2RegCSCoefficients3_4 + kK2RegShiftXena2RGBRange = 31, + + //kK2RegCSCoefficients5_6, + kK2RegShift2piCSC1 = 28, + + //kK2RegCSCoefficients5_6, + kK2RegShift2piCSC5 = 28, + + kK2RegShiftCustomCoefficientLow = 0, + kK2RegShiftCustomCoefficientHigh = 16, + + // Enhanced Color Space Converter contol + kK2RegShiftEnhancedCSCInputPixelFormat = 0, + kK2RegShiftEnhancedCSCOutputPixelFormat = 4, + kK2RegShiftEnhancedCSCChromaEdgeControl = 8, + kK2RegShiftEnhancedCSCChromaFilterSelect = 12, + kK2RegShiftEnhancedCSCEnable = 29, + kK2RegShiftEnhancedCSC4KMode = 28, + + kK2RegShiftEnhancedCSCKeySource = 0, + kK2RegShiftEnhancedCSCKeyOutputRange = 4, + + // Xena2K and Konax Video Processing. + kK2RegShiftXena2FgVidProcInputControl = 20, + kK2RegShiftXena2BgVidProcInputControl = 22, + kK2RegShiftXena2VidProcMode = 24, + kK2RegShiftXena2VidProcSplitStd = 28, + kK2RegShiftVidProcSubtitleEnable = 31, + + // the newer 13(12) bit coefficients end on bit 14 unlike the + // 11(10) bit ones on 16 - jac + kK2RegShiftCustomCoefficient12BitLow = 0, + kK2RegShiftCustomCoefficient12BitHigh = 14, + + //kRegLTCStatusControl + kRegShiftLTC1InPresent = 0, + kRegShiftLTC1Bypass = 4, + kRegShiftLTC2InPresent = 8, + kRegShiftLTC2Bypass = 12, + + // kRegAudioOutputSourceMap + kRegShiftMonitorSource = 16, + kRegShiftHDMIOutAudioSource = 24, + + // kRegSDIInput3GStatus + kRegShiftSDIIn3GbpsMode = 0, + kRegShiftSDIIn3GbpsSMPTELevelBMode = 1, + kRegShiftSDIIn1LevelBtoLevelA = 2, + kRegShiftSDIInVPIDLinkAValid = 4, + kRegShiftSDIInVPIDLinkBValid = 5, + kRegShiftSDIIn16GbpsMode = 6, + kRegShiftSDIIn112GbpsMode = 7, + kRegShiftSDIIn23GbpsMode = 8, + kRegShiftSDIIn23GbpsSMPTELevelBMode = 9, + kRegShiftSDIIn2LevelBtoLevelA = 10, + kRegShiftSDIIn2VPIDLinkAValid = 12, + kRegShiftSDIIn2VPIDLinkBValid = 13, + kRegShiftSDIIn26GbpsMode = 14, + kRegShiftSDIIn212GbpsMode = 15, + kRegShiftSDIInTsiMuxSyncFail = 16, + + // kRegSDIInput3GStatus2 + kRegShiftSDIIn33GbpsMode = 0, + kRegShiftSDIIn33GbpsSMPTELevelBMode = 1, + kRegShiftSDIIn3LevelBtoLevelA = 2, + kRegShiftSDIIn3VPIDLinkAValid = 4, + kRegShiftSDIIn3VPIDLinkBValid = 5, + kRegShiftSDIIn36GbpsMode = 6, + kRegShiftSDIIn312GbpsMode = 7, + kRegShiftSDIIn43GbpsMode = 8, + kRegShiftSDIIn43GbpsSMPTELevelBMode = 9, + kRegShiftSDIIn4LevelBtoLevelA = 10, + kRegShiftSDIIn4VPIDLinkAValid = 12, + kRegShiftSDIIn4VPIDLinkBValid = 13, + kRegShiftSDIIn46GbpsMode = 14, + kRegShiftSDIIn412GbpsMode = 15, + + // kRegSDI5678Input3GStatus + kRegShiftSDIIn53GbpsMode = 0, + kRegShiftSDIIn53GbpsSMPTELevelBMode = 1, + kRegShiftSDIIn5LevelBtoLevelA = 2, + kRegShiftSDIIn5VPIDLinkAValid = 4, + kRegShiftSDIIn5VPIDLinkBValid = 5, + kRegShiftSDIIn56GbpsMode = 6, + kRegShiftSDIIn512GbpsMode = 7, + kRegShiftSDIIn63GbpsMode = 8, + kRegShiftSDIIn63GbpsSMPTELevelBMode = 9, + kRegShiftSDIIn6LevelBtoLevelA = 10, + kRegShiftSDIIn6VPIDLinkAValid = 12, + kRegShiftSDIIn6VPIDLinkBValid = 13, + kRegShiftSDIIn66GbpsMode = 14, + kRegShiftSDIIn612GbpsMode = 15, + kRegShiftSDIIn73GbpsMode = 16, + kRegShiftSDIIn73GbpsSMPTELevelBMode = 17, + kRegShiftSDIIn7LevelBtoLevelA = 18, + kRegShiftSDIIn7VPIDLinkAValid = 20, + kRegShiftSDIIn7VPIDLinkBValid = 21, + kRegShiftSDIIn76GbpsMode = 22, + kRegShiftSDIIn712GbpsMode = 23, + kRegShiftSDIIn83GbpsMode = 24, + kRegShiftSDIIn83GbpsSMPTELevelBMode = 25, + kRegShiftSDIIn8LevelBtoLevelA = 26, + kRegShiftSDIIn8VPIDLinkAValid = 28, + kRegShiftSDIIn8VPIDLinkBValid = 29, + kRegShiftSDIIn86GbpsMode = 30, + kRegShiftSDIIn812GbpsMode = 31, + + // kRegVPID + kRegShiftVPIDBitDepth = 0, + kRegShiftVPIDLuminance = 4, + kRegShiftVPIDDualLinkChannel = 5, + kRegShiftVPIDChannel = 6, + kRegShiftVPIDSampling = 8, + kRegShiftVPIDColorimetry = 12, + kRegShiftVPIDColorimetryAltLow = 12, + kRegShiftVPIDImageAspect16x9Alt = 13, + kRegShiftVPIDHorizontalSampling = 14, + kRegShiftVPIDColorimetryAltHigh = 15, + kRegShiftVPIDImageAspect16x9 = 15, + kRegShiftVPIDPictureRate = 16, + kRegShiftVPIDXferChars = 20, + kRegShiftVPIDProgressivePicture = 22, + kRegShiftVPIDProgressiveTransport = 23, + kRegShiftVPIDStandard = 24, + kRegShiftVPIDVersionID = 31, +#if !defined (NTV2_DEPRECATE) + kRegShiftVPIDDynamicRange = 3, +#endif + + // Borg Test Pattern Generator + kRegShiftTPGChromaSample = 0, + kRegShiftTPGLineBuffer = 10, + kRegShiftTPGFrameRate = 12, + kRegShiftTPGLuma = 16, + kRegShiftTPGMulti = 26, + kRegShiftTPGReset = 27, + kRegShiftTPGStandard = 28, + kRegShiftTPGWriteEnable = 31, + + // Audio Channel Control 2 or 8 channel playback shift + kRegAudControlShift = 5, + + // Stereo Compressor control shift + kRegShiftStereoCompressorOutputMode = 0, + kRegShiftStereoCompressorFlipMode = 4, + kRegShiftStereoCompressorFlipLeftHorz = 4, + kRegShiftStereoCompressorFlipLeftVert = 5, + kRegShiftStereoCompressorFlipRightHorz = 6, + kRegShiftStereoCompressorFlipRightVert = 7, + kRegShiftStereoCompressorFormat = 8, + kRegShiftStereoCompressorLeftSource = 16, + kRegShiftStereoCompressorRightSource = 24, + + // SDI Direction Control Shift + kRegShiftSDI5Transmit = 24, + kRegShiftSDI6Transmit = 25, + kRegShiftSDI7Transmit = 26, + kRegShiftSDI8Transmit = 27, + kRegShiftSDI1Transmit = 28, + kRegShiftSDI2Transmit = 29, + kRegShiftSDI3Transmit = 30, + kRegShiftSDI4Transmit = 31, + + // SDI watchdog control + kRegShiftSDIRelayControl12 = 0, + kRegShiftSDIRelayControl34 = 1, + kRegShiftSDIWatchdogEnable12 = 4, + kRegShiftSDIWatchdogEnable34 = 5, + kRegShiftSDIRelayPosition12 = 8, + kRegShiftSDIRelayPosition34 = 9, + kRegShiftSDIWatchdogStatus = 12, + + kShiftDisplayMode = 4, + + // 4K Down Convert + kRegShift4KDCRGBMode = 0, + kRegShift4KDCYCC444Mode = 1, + kRegShift4KDCPSFInMode = 2, + kRegShift4KDCPSFOutMode = 3, + + // Quadrant Rasterizer Control + kRegShiftRasterMode = 0, + kRegShiftTsiIO = 2, + kRegShiftRasterLevelB = 4, + kRegShiftRasterDecimate = 8, + + // kRegRXSDI1Status, kRegRXSDI2Status, etc + kRegShiftSDIInUnlockCount = 0, + kRegShiftSDIInLocked = 16, + kRegShiftSDIInVpidValidA = 20, + kRegShiftSDIInVpidValidB = 21, + kRegShiftSDIInTRSError = 24, + kRegShiftSDIInCRCErrorCountA = 0, + kRegShiftSDIInCRCErrorCountB = 16, + + kRegShift2MFrameSize = 0, + kRegShiftChannelBar = 16, + + kRegShiftPCMControlA1P1_2 = 0, + kRegShiftPCMControlA1P3_4 = 1, + kRegShiftPCMControlA1P5_6 = 2, + kRegShiftPCMControlA1P7_8 = 3, + kRegShiftPCMControlA1P9_10 = 4, + kRegShiftPCMControlA1P11_12 = 5, + kRegShiftPCMControlA1P13_14 = 6, + kRegShiftPCMControlA1P15_16 = 7, + + kRegShiftPCMControlA2P1_2 = 8, + kRegShiftPCMControlA2P3_4 = 9, + kRegShiftPCMControlA2P5_6 = 10, + kRegShiftPCMControlA2P7_8 = 11, + kRegShiftPCMControlA2P9_10 = 12, + kRegShiftPCMControlA2P11_12 = 13, + kRegShiftPCMControlA2P13_14 = 14, + kRegShiftPCMControlA2P15_16 = 15, + + kRegShiftPCMControlA3P1_2 = 16, + kRegShiftPCMControlA3P3_4 = 17, + kRegShiftPCMControlA3P5_6 = 18, + kRegShiftPCMControlA3P7_8 = 19, + kRegShiftPCMControlA3P9_10 = 20, + kRegShiftPCMControlA3P11_12 = 21, + kRegShiftPCMControlA3P13_14 = 22, + kRegShiftPCMControlA3P15_16 = 23, + + kRegShiftPCMControlA4P1_2 = 24, + kRegShiftPCMControlA4P3_4 = 25, + kRegShiftPCMControlA4P5_6 = 26, + kRegShiftPCMControlA4P7_8 = 27, + kRegShiftPCMControlA4P9_10 = 28, + kRegShiftPCMControlA4P11_12 = 29, + kRegShiftPCMControlA4P13_14 = 30, + kRegShiftPCMControlA4P15_16 = 31, + + kRegShiftPCMControlA5P1_2 = 0, + kRegShiftPCMControlA5P3_4 = 1, + kRegShiftPCMControlA5P5_6 = 2, + kRegShiftPCMControlA5P7_8 = 3, + kRegShiftPCMControlA5P9_10 = 4, + kRegShiftPCMControlA5P11_12 = 5, + kRegShiftPCMControlA5P13_14 = 6, + kRegShiftPCMControlA5P15_16 = 7, + + kRegShiftPCMControlA6P1_2 = 8, + kRegShiftPCMControlA6P3_4 = 9, + kRegShiftPCMControlA6P5_6 = 10, + kRegShiftPCMControlA6P7_8 = 11, + kRegShiftPCMControlA6P9_10 = 12, + kRegShiftPCMControlA6P11_12 = 13, + kRegShiftPCMControlA6P13_14 = 14, + kRegShiftPCMControlA6P15_16 = 15, + + kRegShiftPCMControlA7P1_2 = 16, + kRegShiftPCMControlA7P3_4 = 17, + kRegShiftPCMControlA7P5_6 = 18, + kRegShiftPCMControlA7P7_8 = 19, + kRegShiftPCMControlA7P9_10 = 20, + kRegShiftPCMControlA7P11_12 = 21, + kRegShiftPCMControlA7P13_14 = 22, + kRegShiftPCMControlA7P15_16 = 23, + + kRegShiftPCMControlA8P1_2 = 24, + kRegShiftPCMControlA8P3_4 = 25, + kRegShiftPCMControlA8P5_6 = 26, + kRegShiftPCMControlA8P7_8 = 27, + kRegShiftPCMControlA8P9_10 = 28, + kRegShiftPCMControlA8P11_12 = 29, + kRegShiftPCMControlA8P13_14 = 30, + kRegShiftPCMControlA8P15_16 = 31, + + kRegFanHiShift = 16, + kRegThermalShift = 17, + + //kRegHDMIHDR.... 330-336 + kRegShiftHDMIHDRGreenPrimaryX = 0, + kRegShiftHDMIHDRGreenPrimaryY = 16, + kRegShiftHDMIHDRBluePrimaryX = 0, + kRegShiftHDMIHDRBluePrimaryY = 16, + kRegShiftHDMIHDRRedPrimaryX = 0, + kRegShiftHDMIHDRRedPrimaryY = 16, + kRegShiftHDMIHDRWhitePointX = 0, + kRegShiftHDMIHDRWhitePointY = 16, + kRegShiftHDMIHDRMaxMasteringLuminance = 0, + kRegShiftHDMIHDRMinMasteringLuminance = 16, + kRegShiftHDMIHDRMaxContentLightLevel = 0, + kRegShiftHDMIHDRMaxFrameAverageLightLevel = 16, + + kRegShiftHDMIHDRNonContantLuminance = 0, + kRegShiftHDMIHDRDolbyVisionEnable = 6, + kRegShiftHDMIHDREnable = 7, + kRegShiftElectroOpticalTransferFunction = 16, + kRegShiftHDRStaticMetadataDescriptorID = 24, + + kRegShiftAudioMixerMainInputSelect = 0, + kRegShiftAudioMixerAux1x2CHInput = 4, + kRegShiftAudioMixerAux2x2CHInput = 8, + kRegShiftAudioMixerChannelSelect = 0, + kRegShiftAudioMixerOutputChannelsMute = 0, + kRegShiftAudioMixerOutputChannel1Mute = 0, + kRegShiftAudioMixerOutputChannel2Mute = 1, + kRegShiftAudioMixerOutputChannel3Mute = 2, + kRegShiftAudioMixerOutputChannel4Mute = 3, + kRegShiftAudioMixerOutputChannel5Mute = 4, + kRegShiftAudioMixerOutputChannel6Mute = 5, + kRegShiftAudioMixerOutputChannel7Mute = 6, + kRegShiftAudioMixerOutputChannel8Mute = 7, + kRegShiftAudioMixerOutputChannel9Mute = 8, + kRegShiftAudioMixerOutputChannel10Mute = 9, + kRegShiftAudioMixerOutputChannel11Mute = 10, + kRegShiftAudioMixerOutputChannel12Mute = 11, + kRegShiftAudioMixerOutputChannel13Mute = 12, + kRegShiftAudioMixerOutputChannel14Mute = 13, + kRegShiftAudioMixerOutputChannel15Mute = 14, + kRegShiftAudioMixerOutputChannel16Mute = 15, + kRegShiftAudioMixerMainInputEnable = 16, + kRegShiftAudioMixerAux1InputEnable = 18, + kRegShiftAudioMixerAux2InputEnable = 20, + kRegShiftAudioMixerAux1Channel1Level = 0, + kRegShiftAudioMixerAux1Channel2Level = 16, + kRegShiftAudioMixerAux2Channel1Level = 0, + kRegShiftAudioMixerAux2Channel2Level = 16, + kRegShiftAudioMixerMainChannel1Level = 0, + kRegShiftAudioMixerMainChannel2Level = 16, + kRegShiftAudioMixerMainChannel3Level = 0, + kRegShiftAudioMixerMainChannel4Level = 16, + kRegShiftAudioMixerMainChannel5Level = 0, + kRegShiftAudioMixerMainChannel6Level = 16, + kRegShiftAudioMixerMainChannel7Level = 0, + kRegShiftAudioMixerMainChannel8Level = 16, + kRegShiftAudioMixerMainChannel9Level = 0, + kRegShiftAudioMixerMainChannel10Level = 16, + kRegShiftAudioMixerMainChannel11Level = 0, + kRegShiftAudioMixerMainChannel12Level = 16, + kRegShiftAudioMixerMainChannel13Level = 0, + kRegShiftAudioMixerMainChannel14Level = 16, + kRegShiftAudioMixerMainChannel15Level = 0, + kRegShiftAudioMixerMainChannel16Level = 16, + kRegShiftAudioMixerMainMixedOutputChannel1Level = 0, + kRegShiftAudioMixerMainMixedOutputChannel2Level = 16, + kRegShiftAudioMixerInputLeftLevel = 0, + kRegShiftAudioMixerInputRightLevel = 16, + kRegShiftAudioMixerLevelSampleCount = 8, + + kRegShiftRotaryEncoderValue = 0, + kRegShiftRotaryEncoderGain = 8, + + kRegShiftLUTAddress = 0, + kRegShiftLUTLoad = 31, + + kRegShiftMRStandard = 0, + kRegShiftMRFrameLocation = 8, + kRegShiftMRBypass = 20, + kRegShiftMREnable = 24, + kRegShiftMRSupport = 0 + +#if !defined (NTV2_DEPRECATE) + , + // kRegSDIInput3GStatus + kLHIRegShiftSDIIn3GbpsMode = 0, + kLHIRegShiftSDIIn3GbpsSMPTELevelBMode = 1, + kLHIRegShiftSDIInVPIDLinkAValid = 4, + kLHIRegShiftSDIInVPIDLinkBValid = 5, + kLHIRegShiftSDIIn23GbpsMode = 8, + kLHIRegShiftSDIIn23GbpsSMPTELevelBMode = 9, + kLHIRegShiftSDIIn2VPIDLinkAValid = 12, + kLHIRegShiftSDIIn2VPIDLinkBValid = 13, + + // kRegSDIInput3GStatus2 + kLHIRegShiftSDIIn33GbpsMode = 0, + kLHIRegShiftSDIIn33GbpsSMPTELevelBMode = 1, + kLHIRegShiftSDIIn3VPIDLinkAValid = 4, + kLHIRegShiftSDIIn3VPIDLinkBValid = 5, + kLHIRegShiftSDIIn43GbpsMode = 8, + kLHIRegShiftSDIIn43GbpsSMPTELevelBMode = 9, + kLHIRegShiftSDIIn4VPIDLinkAValid = 12, + kLHIRegShiftSDIIn4VPIDLinkBValid = 13, + // + // Borg Fusion Registers + // + + // Boot FPGA and BoardID + kRegShiftBorgFusionBootFPGAVer = 4, + kRegShiftBorgFusionBoardID = 0, + + // Codec and convert FPGA configuration control + kRegShiftBorgFusionCodecFPGAProgram = 0, + kRegShiftBorgFusionCodecFPGAInit = 1, + kRegShiftBorgFusionCodecFPGADone = 2, + + kRegShiftBorgFusionConvertFPGAProgram = 4, + kRegShiftBorgFusionConvertFPGAInit = 5, + kRegShiftBorgFusionConvertFPGADone = 6, + + // Panel Push buttons debounced and SATA drive present state + kRegShiftBorgFusionPushButtonStatusDebounced = 0, + kRegShiftBorgFusionPushButtonConfigDebounced = 1, + kRegShiftBorgFusionPushButtonMediaDebounced = 2, + kRegShiftBorgFusionPushButtonRewindDebounced = 3, + kRegShiftBorgFusionPushButtonStopDebounced = 4, + kRegShiftBorgFusionPushButtonPlayDebounced = 5, + kRegShiftBorgFusionPushButtonRecordDebounced = 6, + kRegShiftBorgFusionPushButtonFastFwdDebounced = 7, + kRegShiftBorgFusionPushButtonSelectUpDebounced = 8, + kRegShiftBorgFusionPushButtonSelectDownDebounced = 9, + kRegShiftBorgFusionPushButtonDeleteClipDebounced = 10, + kRegShiftBorgFusionPushButtonAdjustUpDebounced = 11, + kRegShiftBorgFusionPushButtonAdjustDownDebounced = 12, + kRegShiftBorgFusionPushButtonSlotDebounced = 13, + kRegShiftBorgFusionPushButtonSATADrivePresentDebounced = 14, + + // Panel Push buttons and SATA drive present changes + kRegShiftBorgFusionPushButtonStatusChange = 0, + kRegShiftBorgFusionPushButtonConfigChange = 1, + kRegShiftBorgFusionPushButtonMediaChange = 2, + kRegShiftBorgFusionPushButtonRewindChange = 3, + kRegShiftBorgFusionPushButtonStopChange = 4, + kRegShiftBorgFusionPushButtonPlayChange = 5, + kRegShiftBorgFusionPushButtonRecordChange = 6, + kRegShiftBorgFusionPushButtonFastFwdChange = 7, + kRegShiftBorgFusionPushButtonSelectUpChange = 8, + kRegShiftBorgFusionPushButtonSelectDownChange = 9, + kRegShiftBorgFusionPushButtonDeleteClipChange = 10, + kRegShiftBorgFusionPushButtonAdjustUpChange = 11, + kRegShiftBorgFusionPushButtonAdjustDownChange = 12, + kRegShiftBorgFusionPushButtonSlotChange = 13, + kRegShiftBorgFusionPushButtonSATADrivePresentChange = 14, + + // LED Pulse Width Modulation Threshholds + kRegShiftBorgFusionPWMThreshExpressCard2 = 0, + kRegShiftBorgFusionPWMThreshExpressCard1 = 4, + kRegShiftBorgFusionPWMThreshPower = 8, + kRegShiftBorgFusionPWMThreshLCDBacklightLED = 12, + + + // Power control - System + kRegShiftBorgFusionPowerCtrlWiFiReset = 0, + kRegShiftBorgFusionPowerCtrlFirewirePower = 1, + kRegShiftBorgFusionPowerCtrlGigEthReset = 2, + kRegShiftBorgFusionPowerCtrlPCIExpClockStop = 3, + + // Power control - Storage devices + kRegShiftBorgFusionPowerCtrlPCIExpCard1_3_3vPower = 8, // Express Card 1 3.3v power + kRegShiftBorgFusionPowerCtrlPCIExpCard1_1_5vPower = 9, // Express Card 1 1.5v power + kRegShiftBorgFusionPowerCtrlPCIExpCard2_3_3vPower = 10, // Express Card 2 3.3v power + kRegShiftBorgFusionPowerCtrlPCIExpCard2_1_5vPower = 11, // Express Card 2 1.5v power + kRegShiftBorgFusionPowerCtrlSata_12vPower = 12, // SATA Drive 12v power + + kRegShiftBonesActelPowerCtrlCFSlot2_BridgeReset = 8, + kRegShiftBonesActelPowerCtrlCFSlot2_Power = 9, // Compact Flash S2 Power + kRegShiftBonesActelPowerCtrlCFSlot1_Power = 10, // Compact Flash S1 Power + kRegShiftBonesActelPowerCtrlCFSlot1_BridgeReset = 11, + + // Power control - Pushbutton LEDs + kRegShiftBorgFusionPowerCtrlPCIExpCard2LED = 13, + kRegShiftBorgFusionPowerCtrlPCIExpCard1LED = 14, + kRegShiftBorgFusionPowerCtrlPowerButtonLED = 15, + + // IRQ3n Interrupt control + kRegShiftBorgFusionIRQ3nIntCtrlPushButtonChangeEnable = 0, + kRegShiftBorgFusionIRQ3nIntCtrlInputVoltageLow9vEnable = 1, + kRegShiftBorgFusionIRQ3nIntCtrlDisplayFIFOFullEnable = 2, + kRegShiftBorgFusionIRQ3nIntCtrlSATAPresentChangeEnable = 3, + kRegShiftBorgFusionIRQ3nIntCtrlTemp1HighEnable = 4, + kRegShiftBorgFusionIRQ3nIntCtrlTemp2HighEnable = 5, + kRegShiftBorgFusionIRQ3nIntCtrlPowerButtonChangeEnable = 6, + + // IRQ3n Interrupt source + kRegShiftBorgFusionIRQ3nIntSrcPushButtonChange= 0, + kRegShiftBorgFusionIRQ3nIntSrcInputVoltageLow9v= 1, + kRegShiftBorgFusionIRQ3nIntSrcDisplayFIFOFull= 2, + kRegShiftBorgFusionIRQ3nIntSrcSATAPresentChange= 3, + kRegShiftBorgFusionIRQ3nIntSrcTemp1High= 4, + kRegShiftBorgFusionIRQ3nIntSrcTemp2High= 5, + kRegShiftBorgFusionIRQ3nIntSrcPowerButtonChange= 6, + + // Noritake Display Control/Status + kRegShiftBorgFusionDisplayCtrlReset = 0, + kRegShiftBorgFusionDisplayStatusBusyRaw = 1, // Not needed by CPU, used internally by FPGA + kRegShiftBorgFusionDisplayStatusInterfaceBusy = 7, // FIFO full + + // Analog ADC flags - battery + kRegShiftBorgFusionAnalogFlagsPowerLTE9v = 0, // +12 v supply <= 9.0 v battery critical + kRegShiftBorgFusionAnalogFlagsPowerLTE10v = 1, // +12 v supply <= 10.0 v battery depleting + kRegShiftBorgFusionAnalogFlagsPowerLTE11v = 2, // +12 v supply <= 11.0 v battery depleting + kRegShiftBorgFusionAnalogFlagsPowerGTE13v = 3, // +12 v supply >= 13.0 v battery charging + + // Analog ADC flags - temperature sensor + kRegShiftBorgFusionAnalogFlagsPowerTemp1High = 4, // Temp sensor 1 > 65 C + kRegShiftBorgFusionAnalogFlagsPowerTemp2High = 5, // Temp sensor 2 > 65 C + // Pan (2K crop) - Xena 2 + kRegShiftPanMode = 30, + kRegShiftPanOffsetV = 0, + kRegShiftPanOffsetH = 12 +#endif // !defined (NTV2_DEPRECATE) + +} RegisterShift; + + +// NWL Registers + +// For the Mac we define an offset. This is done so that read/write register can easily identify an NWL register from a VP register. +// This is necessary since the NWL registers lives in another PCI BAR and these offsets conflict with normal VP registers. With this +// offset the driver knows which mapped BAR to use. Windows maps individual registers at start so this isn't necessary for Windows. +#ifdef AJAMac + #define NWL_REG_START 18000 +#else + #define NWL_REG_START 0 +#endif + +typedef enum +{ + kRegNwlS2C1Capabilities = 0x0000+(NWL_REG_START), + kRegNwlS2C1ControlStatus = 0x0001+(NWL_REG_START), + kRegNwlS2C1ChainStartAddressLow = 0x0002+(NWL_REG_START), + kRegNwlS2C1ChainStartAddressHigh = 0x0003+(NWL_REG_START), + kRegNwlS2C1HardwareTime = 0x0004+(NWL_REG_START), + kRegNwlS2C1ChainCompleteByteCount = 0x0005+(NWL_REG_START), + + kRegNwlS2C2Capabilities = 0x0040+(NWL_REG_START), + kRegNwlS2C2ControlStatus = 0x0041+(NWL_REG_START), + kRegNwlS2C2ChainStartAddressLow = 0x0042+(NWL_REG_START), + kRegNwlS2C2ChainStartAddressHigh = 0x0043+(NWL_REG_START), + kRegNwlS2C2HardwareTime = 0x0044+(NWL_REG_START), + kRegNwlS2C2ChainCompleteByteCount = 0x0045+(NWL_REG_START), + + kRegNwlC2S1Capabilities = 0x0800+(NWL_REG_START), + kRegNwlC2S1ControlStatus = 0x0801+(NWL_REG_START), + kRegNwlC2S1ChainStartAddressLow = 0x0802+(NWL_REG_START), + kRegNwlC2S1ChainStartAddressHigh = 0x0803+(NWL_REG_START), + kRegNwlC2S1HardwareTime = 0x0804+(NWL_REG_START), + kRegNwlC2S1ChainCompleteByteCount = 0x0805+(NWL_REG_START), + + kRegNwlC2S2Capabilities = 0x0840+(NWL_REG_START), + kRegNwlC2S2ControlStatus = 0x0841+(NWL_REG_START), + kRegNwlC2S2ChainStartAddressLow = 0x0842+(NWL_REG_START), + kRegNwlC2S2ChainStartAddressHigh = 0x0843+(NWL_REG_START), + kRegNwlC2S2HardwareTime = 0x0844+(NWL_REG_START), + kRegNwlC2S2ChainCompleteByteCount = 0x0845+(NWL_REG_START), + + kRegNwlCommonControlStatus = 0x1000+(NWL_REG_START), + kRegNwlCommonBackEndCoreVersion = 0x1001+(NWL_REG_START), + kRegNwlCommonPCIExpressCoreVersion = 0x1002+(NWL_REG_START), + kRegNwlCommonUserVersion = 0x1003+(NWL_REG_START) + +} NwlRegisterNum; + +// This is an aid for utility routines that maintain tables indexed by a register number, like spinlocks +typedef enum +{ + kRegNwlS2C1CapabilitiesIndex, // 0 + kRegNwlS2C1ControlStatusIndex, // 1 + kRegNwlS2C1ChainStartAddressLowIndex, // 2 + kRegNwlS2C1ChainStartAddressHighIndex, // 3 + kRegNwlS2C1HardwareTimeIndex, // 4 + kRegNwlS2C1ChainCompleteByteCountIndex, // 5 + + kRegNwlS2C2CapabilitiesIndex, // 6 + kRegNwlS2C2ControlStatusIndex, // 7 + kRegNwlS2C2ChainStartAddressLowIndex, // 8 + kRegNwlS2C2ChainStartAddressHighIndex, // 9 + kRegNwlS2C2HardwareTimeIndex, // 10 + kRegNwlS2C2ChainCompleteByteCountIndex, // 11 + + kRegNwlC2S1CapabilitiesIndex, // 12 + kRegNwlC2S1ControlStatusIndex, // 13 + kRegNwlC2S1ChainStartAddressLowIndex, // 14 + kRegNwlC2S1ChainStartAddressHighIndex, // 15 + kRegNwlC2S1HardwareTimeIndex, // 16 + kRegNwlC2S1ChainCompleteByteCountIndex, // 17 + + kRegNwlC2S2CapabilitiesIndex, // 18 + kRegNwlC2S2ControlStatusIndex, // 19 + kRegNwlC2S2ChainStartAddressLowIndex, // 20 + kRegNwlC2S2ChainStartAddressHighIndex, // 21 + kRegNwlC2S2HardwareTimeIndex, // 22 + kRegNwlC2S2ChainCompleteByteCountIndex, // 23 + + kRegNwlCommonControlStatusIndex, // 24 + kRegNwlCommonBackEndCoreVersionIndex, // 25 + kRegNwlCommonPCIExpressCoreVersionIndex, // 26 + kRegNwlCommonUserVersionIndex, // 27 + + NUM_NWL_REGS +} NwlRegisterIndex; + +typedef enum +{ + kRegMaskNwlCapabilitiesPresent = BIT(0), + kRegMaskNwlCapabilitiesEngineDirection = BIT(1), + kRegMaskNwlCapabilitiesEngineType = (BIT(2)+BIT(3)), + kRegMaskNwlCapabilitiesEngineNumber = (BIT(8)+BIT(9)+BIT(10)+BIT(11)+BIT(12)+BIT(13)+BIT(14)+BIT(15)), + kRegMaskNwlCapabilitiesAddressSize = (BIT(16)+BIT(17)+BIT(18)+BIT(19)+BIT(20)+BIT(21)+BIT(22)+BIT(23)), + + kRegMaskNwlControlStatusInterruptEnable = BIT(0), + kRegMaskNwlControlStatusInterruptActive = BIT(1), + kRegMaskNwlControlStatusChainStart = BIT(8), + kRegMaskNwlControlStatusDmaResetRequest = BIT(9), + kRegMaskNwlControlStatusChainRunning = BIT(10), + kRegMaskNwlControlStatusChainComplete = BIT(11), + kRegMaskNwlControlStatusChainErrorShort = BIT(12), + kRegMaskNwlControlStatusChainSoftwareShort = BIT(13), + kRegMaskNwlControlStatusChainHardwareShort = BIT(14), + kRegMaskNwlControlStatusAlignmentError = BIT(15), + kRegMaskNwlControlStatusDmaReset = BIT(23), + + kRegMaskNwlCommonDmaInterruptEnable = BIT(0), + kRegMaskNwlCommonDmaInterruptActive = BIT(1), + kRegMaskNwlCommonDmaInterruptPending = BIT(2), + kRegMaskNwlCommonInterruptMode = BIT(3), + kRegMaskNwlCommonUserInterruptEnable = BIT(4), + kRegMaskNwlCommonUserInterruptActive = BIT(5), + kRegMaskNwlCommonMaxPayloadSize = (BIT(8)+BIT(9)+BIT(10)), + kRegMaskNwlCommonMaxReadRequestSize = (BIT(12)+BIT(13) +BIT(14)), + kRegMaskNwlCommonS2CInterruptStatus0 = BIT(16), + kRegMaskNwlCommonS2CInterruptStatus1 = BIT(17), + kRegMaskNwlCommonS2CInterruptStatus2 = BIT(18), + kRegMaskNwlCommonS2CInterruptStatus3 = BIT(19), + kRegMaskNwlCommonS2CInterruptStatus4 = BIT(20), + kRegMaskNwlCommonS2CInterruptStatus5 = BIT(21), + kRegMaskNwlCommonS2CInterruptStatus6 = BIT(22), + kRegMaskNwlCommonS2CInterruptStatus7 = BIT(23), + kRegMaskNwlCommonC2SInterruptStatus0 = BIT(24), + kRegMaskNwlCommonC2SInterruptStatus1 = BIT(25), + kRegMaskNwlCommonC2SInterruptStatus2 = BIT(26), + kRegMaskNwlCommonC2SInterruptStatus3 = BIT(27), + kRegMaskNwlCommonC2SInterruptStatus4 = BIT(28), + kRegMaskNwlCommonC2SInterruptStatus5 = BIT(29), + kRegMaskNwlCommonC2SInterruptStatus6 = BIT(30), + kRegMaskNwlCommonC2SInterruptStatus7 = BIT(31) + +} NwlRegisterMask; + +typedef enum +{ + kRegShiftNwlCapabilitiesPresent = 0, + kRegShiftNwlCapabilitiesEngineDirection = 1, + kRegShiftNwlCapabilitiesEngineType = 2, + kRegShiftNwlCapabilitiesEngineNumber = 8, + kRegShiftNwlCapabilitiesAddressSize = 16, + + kRegShiftNwlControlStatusInterruptEnable = 0, + kRegShiftNwlControlStatusInterruptActive = 1, + kRegShiftNwlControlStatusChainStart = 8, + kRegShiftNwlControlStatusDmaResetRequest = 9, + kRegShiftNwlControlStatusChainRunning = 10, + kRegShiftNwlControlStatusChainComplete = 11, + kRegShiftNwlControlStatusChainErrorShort = 12, + kRegShiftNwlControlStatusChainSoftwareShort = 13, + kRegShiftNwlControlStatusChainHardwareShort = 14, + kRegShiftNwlControlStatusAlignmentError = 15, + kRegShiftNwlControlStatusDmaReset = 23, + + kRegShiftNwlCommonDmaInterruptEnable = 0, + kRegShiftNwlCommonDmaInterruptActive = 1, + kRegShiftNwlCommonDmaInterruptPending = 2, + kRegShiftNwlCommonInterruptMode = 3, + kRegShiftNwlCommonUserInterruptEnable = 4, + kRegShiftNwlCommonUserInterruptActive = 5, + kRegShiftNwlCommonMaxPayloadSize = 8, + kRegShiftNwlCommonMaxReadRequestSize = 12, + kRegShiftNwlCommonS2CInterruptStatus0 = 16, + kRegShiftNwlCommonS2CInterruptStatus1 = 17, + kRegShiftNwlCommonS2CInterruptStatus2 = 18, + kRegShiftNwlCommonS2CInterruptStatus3 = 19, + kRegShiftNwlCommonS2CInterruptStatus4 = 20, + kRegShiftNwlCommonS2CInterruptStatus5 = 21, + kRegShiftNwlCommonS2CInterruptStatus6 = 22, + kRegShiftNwlCommonS2CInterruptStatus7 = 23, + kRegShiftNwlCommonC2SInterruptStatus0 = 24, + kRegShiftNwlCommonC2SInterruptStatus1 = 25, + kRegShiftNwlCommonC2SInterruptStatus2 = 26, + kRegShiftNwlCommonC2SInterruptStatus3 = 27, + kRegShiftNwlCommonC2SInterruptStatus4 = 28, + kRegShiftNwlCommonC2SInterruptStatus5 = 29, + kRegShiftNwlCommonC2SInterruptStatus6 = 30, + kRegShiftNwlCommonC2SInterruptStatus7 = 31 + +} NwlRegisterShift; + +// XLNX Registers +#define XLNX_MAX_CHANNELS 4 +#define XLNX_REG_TARGET_SIZE 0x400 +#define XLNX_REG_CHANNEL_SIZE 0x40 +#define XLNX_SUBSYSTEM_ID 0x1fc + +typedef enum +{ + kRegXlnxTargetChannelH2C = 0x0, + kRegXlnxTargetChannelC2H = 0x1, + kRegXlnxTargetIRQ = 0x2, + kRegXlnxTargetConfig = 0x3, + kRegXlnxTargetSgdmaH2C = 0x4, + kRegXlnxTargetSgdmaC2H = 0x5, + kRegXlnxTargetSgdmaCommon = 0x6, + kRegXlnxTargetMsiX = 0x8 +} XlnxRegisterTarget; + +typedef enum +{ + kRegXlnxChannelIdentifier = 0x00, + kRegXlnxChannelControl = 0x01, + kRegXlnxChannelControlW1S = 0x02, + kRegXlnxChannelControlW1C = 0x03, + kRegXlnxChannelStatus = 0x10, + kRegXlnxChannelStatusRC = 0x11, + kRegXlnxChannelDescCompleteCount = 0x12, + kRegXlnxChannelAlignments = 0x13, + kRegXlnxChannelPollModeAddressLow = 0x22, + kRegXlnxChannelPollModeAddressHigh = 0x23, + kRegXlnxChannelInterruptEnable = 0x24, + kRegXlnxChannelInterruptEnableW1S = 0x25, + kRegXlnxChannelInterruptEnableW1C = 0x26, + kRegXlnxChannelPerfControl = 0x30, + kRegXlnxChannelPerfCycleCountLow = 0x31, + kRegXlnxChannelPerfCycleCountHigh = 0x32, + kRegXlnxChannelPerfDataCountLow = 0x33, + kRegXlnxChannelPerfDataCountHigh = 0x34, + kRegXlnxChannelUserMaxReadRequestSize = 0x44, + + kRegXlnxIrqIdentifier = 0x00, + kRegXlnxIrqUserInterruptEnable = 0x01, + kRegXlnxIrqUserInterruptEnableW1S = 0x02, + kRegXlnxIrqUserInterruptEnableW1C = 0x03, + kRegXlnxIrqChannelInterruptEnable = 0x04, + kRegXlnxIrqChannelInterruptEnableW1S = 0x05, + kRegXlnxIrqChannelInterruptEnableW1C = 0x06, + kRegXlnxIrqUserInterruptRequest = 0x10, + kRegXlnxIrqChannelInterruptRequest = 0x11, + kRegXlnxIrqUserInterruptPending = 0x12, + kRegXlnxIrqChannelInterruptPending = 0x13, + + kRegXlnxSgdmaIdentifier = 0x00, + kRegXlnxSgdmaDescAddressLow = 0x20, + kRegXlnxSgdmaDescAddressHigh = 0x21, + kRegXlnxSgdmaDescAdjacent = 0x22, + kRegXlnxSgdmaDescCredits = 0x23 + +} XlnxRegisterNum; + +typedef enum +{ + kRegMaskXlnxSubsystemId = 0xfff00000, + kRegMaskXlnxTarget = 0x000f0000, + kRegMaskXlnxStreamInterface = 0x00008000, + kRegMaskXlnxIdTarget = 0x00000f00, + kRegMaskXlnxVersion = 0x000000ff, + + kRegMaskXlnxStreamWriteBackDisable = 0x08000000, + kRegMaskXlnxPollModeWriteBackEnable = 0x04000000, + kRegMaskXlnxNonIncAddressMode = 0x02000000, + kRegMaskXlnxRun = 0x00000001, + + kRegMaskXlnxAddressAlignment = 0x00ff0000, + kRegMaskXlnxTransferAlignment = 0x0000ff00, + kRegMaskXlnxAddressBits = 0x000000ff, + + kRegMaskXlnxIntDescError = 0x00f80000, + kRegMaskXlnxIntWriteError = 0x0007c000, + kRegMaskXlnxIntReadError = 0x00003e00, + kRegMaskXlnxIntIdleStop = 0x00000040, + kRegMaskXlnxIntInvalidLength = 0x00000020, + kRegMaskXlnxIntMagicStop = 0x00000010, + kRegMaskXlnxIntAlignMismatch = 0x00000008, + kRegMaskXlnxIntDescComplete = 0x00000004, + kRegMaskXlnxIntDescStop = 0x00000002, + + kRegMaskXlnxPerfRun = 0x00000004, + kRegMaskXlnxPerfClear = 0x00000002, + kRegMaskXlnxPerfAuto = 0x00000001, + + kRegMaskXlnxPerfCycleCountMax = 0x00010000, + kRegMaskXlnxPerfCycleCountHigh = 0x000003ff, + + kRegMaskXlnxPerfDataCountMax = 0x00010000, + kRegMaskXlnxPerfDataCountHigh = 0x000003ff, + + kRegMaskXlnxUserMaxReadRequestEff = 0x00000070, + kRegMaskXlnxUserMaxReadRequestPgm = 0x00000007 + +} XlnxRegisterMask; + +typedef enum +{ + kRegShiftXlnxSubsystemId = 20, + kRegShiftXlnxTarget = 16, + kRegShiftXlnxStreamInterface = 15, + kRegShiftXlnxIdTarget = 8, + kRegShiftXlnxVersion = 0, + + kRegShiftXlnxStreamWriteBackDisable = 27, + kRegShiftXlnxPollModeWriteBackEnable = 26, + kRegShiftXlnxNonIncAddressMode = 25, + kRegShiftXlnxRun = 0, + + kRegShiftXlnxAddressAlignment = 16, + kRegShiftXlnxTransferAlignment = 8, + kRegShiftXlnxAddressBits = 0, + + kRegShiftXlnxIntDescError = 19, + kRegShiftXlnxIntWriteError = 14, + kRegShiftXlnxIntReadError = 9, + kRegShiftXlnxIntIdleStop = 6, + kRegShiftXlnxIntInvalidLength = 5, + kRegShiftXlnxIntMagicStop = 4, + kRegShiftXlnxIntAlignMismatch = 3, + kRegShiftXlnxIntDescComplete = 2, + kRegShiftXlnxIntDescStop = 1, + + kRegShiftXlnxPerfRun = 2, + kRegShiftXlnxPerfClear = 1, + kRegShiftXlnxPerfAuto = 0, + + kRegShiftXlnxPerfCycleCountMax = 16, + kRegShiftXlnxPerfCycleCountHigh = 0, + + kRegShiftXlnxPerfDataCountMax = 16, + kRegShiftXlnxPerfDataCountHigh = 0, + + kRegShiftXlnxUserMaxReadRequestEff = 4, + kRegShiftXlnxUserMaxReadRequestPgm = 0 + +} XlnxRegisterShift; + +// P2P Registers + +typedef enum +{ + kRegMaskMessageInterruptStatusChannel1 = BIT(0), + kRegMaskMessageInterruptStatusChannel2 = BIT(1), + kRegMaskMessageInterruptStatusChannel3 = BIT(2), + kRegMaskMessageInterruptStatusChannel4 = BIT(3), + kRegMaskMessageInterruptControlEnable1 = BIT(0), + kRegMaskMessageInterruptControlEnable2 = BIT(1), + kRegMaskMessageInterruptControlEnable3 = BIT(2), + kRegMaskMessageInterruptControlEnable4 = BIT(3), + kRegMaskMessageInterruptControlEnable5 = BIT(4), + kRegMaskMessageInterruptControlEnable6 = BIT(5), + kRegMaskMessageInterruptControlEnable7 = BIT(6), + kRegMaskMessageInterruptControlEnable8 = BIT(7), + kRegMaskMessageInterruptControlClear1 = BIT(16), + kRegMaskMessageInterruptControlClear2 = BIT(17), + kRegMaskMessageInterruptControlClear3 = BIT(18), + kRegMaskMessageInterruptControlClear4 = BIT(19), + kRegMaskMessageInterruptControlClear5 = BIT(20), + kRegMaskMessageInterruptControlClear6 = BIT(21), + kRegMaskMessageInterruptControlClear7 = BIT(22), + kRegMaskMessageInterruptControlClear8 = BIT(23) +} MessageRegisterMask; + + +typedef enum +{ + kRegShiftMessageInterruptStatusChannel1 = 0, + kRegShiftMessageInterruptStatusChannel2 = 1, + kRegShiftMessageInterruptStatusChannel3 = 2, + kRegShiftMessageInterruptStatusChannel4 = 3, + kRegShiftMessageInterruptControlEnable1 = 0, + kRegShiftMessageInterruptControlEnable2 = 1, + kRegShiftMessageInterruptControlEnable3 = 2, + kRegShiftMessageInterruptControlEnable4 = 3, + kRegShiftMessageInterruptControlClear1 = 16, + kRegShiftMessageInterruptControlClear2 = 17, + kRegShiftMessageInterruptControlClear3 = 18, + kRegShiftMessageInterruptControlClear4 = 19 +} MessageRegisterShift; + + +#define kTransferFlagVideoDMA1 (BIT(0)) // use dma channel 1 for video transfer +#define kTransferFlagVideoDMA2 (BIT(1)) // use dma channel 2 for video transfer +#define kTransferFlagVideoDMA3 (BIT(2)) // use dma channel 3 for video tranfer +#define kTransferFlagVideoDMA4 (BIT(3)) // use dma channel 4 for video transfer +#define kTransferFlagVideoDMAAny (BIT(0)+BIT(1)+BIT(2)+BIT(3)) +#define kTransferFlagAudioDMA1 (BIT(4)) // use dma channel 1 for audio transfer +#define kTransferFlagAudioDMA2 (BIT(5)) // use dma channel 2 for audio transfer +#define kTransferFlagAudioDMA3 (BIT(6)) // use dma channel 3 for audio transfer +#define kTransferFlagAudioDMA4 (BIT(7)) // use dma channel 4 for audio transfer +#define kTransferFlagAudioDMAAny (BIT(4)+BIT(5)+BIT(6)+BIT(7)) +#define kTransferFlagDMAAny (BIT(0)+BIT(1)+BIT(2)+BIT(3)+BIT(4)+BIT(5)+BIT(6)+BIT(7)) +#define kTransferFlagQuadFrame (BIT(8)) // transfer a quad hd or 4k frame +#define kTransferFlagP2PPrepare (BIT(9)) // prepare p2p target for synchronous transfer (no message) +#define kTransferFlagP2PComplete (BIT(10)) // complete synchronous p2p transfer +#define kTransferFlagP2PTarget (BIT(11)) // prepare p2p target for asynchronous transfer (with message) +#define kTransferFlagP2PTransfer (BIT(12)) // transfer to p2p sync or async target + +#define MAX_FRAMEBUFFERS 512 // Max for Corvid88 + +#define KONAIP_REGS_START 0x40000 + +//////////////////////////////////////////////////////////////////////////////////// + +#if !defined (NTV2_DEPRECATE) + //----------------------- HDNTV --------------------------------- + + // Board-type-specific defines NOTE: Either KSD, KHD, or HDNTV needs to be defined. + #define HDNTV_NTV2_DEVICENAME ("hdntv") + + // Offset in Base Address 1 Space to Channel 2 Frame Buffer + #define HDNTV_CHANNEL2_OFFSET (0x2000000) // 32 MBytes + + // Size of each frame buffer + #define HDNTV_FRAMEBUFFER_SIZE (0x800000) // 8 MBytes + + #define HDNTV_NUM_FRAMEBUFFERS (8) + + #define HDNTV_NTV2_VERTICALINTERRUPT_GLOBAL_EVENT_NAME "_HDVerticalInterruptSignalEvent" + // the event name shared among all Windows NT + // This name to be appended to the actual Win32Name + #define HDNTV_NTV2_CHANGE_GLOBAL_EVENT_NAME "_HDChangeSignalEvent" + + + //----------------------- Xena KHD --------------------------------- + + // Offset in Base Address 1 Space to Channel 2 Frame Buffer + #define KHD_CHANNEL2_OFFSET (0x2000000) // 32 MBytes + + // Size of each frame buffer + #define KHD_FRAMEBUFFER_SIZE (0x800000) // 8 MBytes + + #define KHD_NUM_FRAMEBUFFERS (32) + + #define KHD_NTV2_VERTICALINTERRUPT_GLOBAL_EVENT_NAME "_HDVerticalInterruptSignalEvent" + // the event name shared among all Windows NT + // This name to be appended to the actual Win32Name + #define KHD_NTV2_CHANGE_GLOBAL_EVENT_NAME "_HDChangeSignalEvent" + + // + // 2K Specific....only on HD22(for now) boards when in 2K standard + // + #define XENA_FRAMEBUFFERSIZE_2K (0x1000000) + #define XENA_NUMFRAMEBUFFERS_2K (16) + + //----------------------- Xena KSD --------------------------------- + + // Offset in Base Address 1 Space to Channel 2 Frame Buffer + #define KSD_CHANNEL2_OFFSET (0x800000) // 8 MBytes + + // Size of each frame buffer + #define KSD_FRAMEBUFFER_SIZE (0x200000) // 2 MBytes + + #define KSD_NUM_FRAMEBUFFERS (64) + + #define KSD_NTV2_VERTICALINTERRUPT_GLOBAL_EVENT_NAME "_SDVerticalInterruptSignalEvent" + // the event name shared among all Windows NT + // This name to be appended to the actual Win32Name + #define KSD_NTV2_CHANGE_GLOBAL_EVENT_NAME "_SDChangeSignalEvent" + + + //----------------------- AJA KONA --------------------------------- + + // Offset in Base Address 1 Space to Channel 2 Frame Buffer + #define KONA_CHANNEL2_OFFSET (0x2000000) // 32 MBytes + + // Size of each frame buffer + #define KONA_FRAMEBUFFER_SIZE (0x800000) // 8 MBytes + + #define KONA_NUM_FRAMEBUFFERS (32) + + #define KHD_NTV2_VERTICALINTERRUPT_GLOBAL_EVENT_NAME "_HDVerticalInterruptSignalEvent" + // the event name shared among all Windows NT + // This name to be appended to the actual Win32Name + #define KHD_NTV2_CHANGE_GLOBAL_EVENT_NAME "_HDChangeSignalEvent" + + + //----------------------- AJA XENALS --------------------------------- + + // Offset in Base Address 1 Space to Channel 2 Frame Buffer + #define XENALS_CHANNEL2_OFFSET (0x2000000) // 32 MBytes..not applicable + + // Size of each frame buffer + #define XENALS_FRAMEBUFFER_SIZE (0x800000) // 8 MBytes + + // the event name shared among all Windows NT + // This name to be appended to the actual Win32Name + #define XENALS_NUM_FRAMEBUFFERS (32) + + //----------------------- AJA FS1 --------------------------------- + + // Offset in Base Address 1 Space to Channel 2 Frame Buffer + #define FS1_CHANNEL2_OFFSET (0x0) // Framebuffers not accessible to processor + + // Size of each frame buffer + #define FS1_FRAMEBUFFER_SIZE (0x0) // Framebuffers not accessible to processor + + // the event name shared among all Windows NT + // This name to be appended to the actual Win32Name + #define FS1_NUM_FRAMEBUFFERS (0) + #define FS1_NTV2_VERTICALINTERRUPT_GLOBAL_EVENT_NAME "_FS1VerticalInterruptSignalEvent" + + // the event name shared among all Windows NT + // This name to be appended to the actual Win32Name + #define FS1_NTV2_CHANGE_GLOBAL_EVENT_NAME "_FS1ChangeSignalEvent" + + //----------------------- AJA BORG --------------------------------- + + // Offset in Base Address 1 Space to Channel 2 Frame Buffer + // #define BORG_CHANNEL2_OFFSET (0) // not applicable + + //-------------------- Defines for 32 1MB frame buffers (28 1MB video frame buffers and 1 4MB audio buffer) + // Size of each frame buffer + //#define BORG_FRAMEBUFFER_SIZE (0x100000) // 1 MBytes + //#define BORG_NUM_FRAMEBUFFERS (32) + + //-------------------- Defines for 24 1.125MB frame buffers (24 1.125MB video frame buffers and 1 4MB audio buffer) + // this totals 27 MB video frame, 1 MB unused gap, and 1 4MB audio buffer based 4 MB below top of memory + + #define BORG_FRAMEBUFFER_SIZE (0x120000) // 1.125 MBytes + // this define is left at 32 for practical purposes to locate audio buffer at 4 MB below top of memory (32 - 4 = 28) + // in reality, there are only 24 video frame buffers, but if you look at usage of this define, it is best left at 32 + #define BORG_NUM_FRAMEBUFFERS (32) // 32 * 1.125 = 36 + #define BONES_NUM_FRAMEBUFFERS (99) // 99 * 1.125 = ~112 MB +#endif // NTV2_DEPRECATE + +//----------------------- AJA XENA2 --------------------------------- + + // Offset in Base Address 1 Space to Channel 2 Frame Buffer +#define XENA2_CHANNEL2_OFFSET (0x2000000) // 32 MBytes..not applicable + + // Size of each frame buffer +#define XENA2_FRAMEBUFFER_SIZE (0x800000) // 8 MBytes + + // the event name shared among all Windows NT + // This name to be appended to the actual Win32Name +#define XENA2_NUM_FRAMEBUFFERS (16) +#define XENA2_NTV2_VERTICALINTERRUPT_GLOBAL_EVENT_NAME "_Xena2VerticalInterruptSignalEvent" + + // the event name shared among all Windows NT + // This name to be appended to the actual Win32Name +#define KHD_NTV2_CHANGE_GLOBAL_EVENT_NAME "_HDChangeSignalEvent" + + +// +// Special defines +// +#define NTV2_MIN_FRAMEBUFFERSIZE KSD_FRAMEBUFFER_SIZE +#define NTV2_MAX_FRAMEBUFFERSIZE KHD_FRAMEBUFFER_SIZE +#define NTV2_MIN_FRAMEBUFFERS HDNTV_NUM_FRAMEBUFFERS +#if defined(XENA2) +#define NTV2_MAX_FRAMEBUFFERS MAX_FRAMEBUFFERS +#else +#define NTV2_MAX_FRAMEBUFFERS BONES_NUM_FRAMEBUFFERS +#endif + +#define NTV2_UART_FIFO_SIZE (127) + +#define NTV2_PROGRAM_READY_BIT ( BIT_8 ) +#define NTV2_PROGRAM_DONE_BIT ( BIT_9 ) +#define NTV2_PROGRAM_RESET_BIT ( BIT_10 ) + +/* PORT C(7) is output (default) */ +#define NTV2_FS1_FALLBACK_MODE_BIT ( BIT_11 ) + +/* PORT C(7) is input/3-state */ +#define NTV2_FS1_CPLD_ENH_MODE_BIT ( BIT_12 ) + +////////////////////////////////////////////////////////////////////////////////////// +// Enums used to specify Property actions with interrupts +////////////////////////////////////////////////////////////////////////////////////// + +typedef enum _INTERRUPT_ENUMS_ +{ + eVerticalInterrupt, // 0 + eOutput1 = eVerticalInterrupt, + eInterruptMask, // 1 + eInput1, // 2 + eInput2, // 3 + eAudio, // 4 + eAudioInWrap, // 5 + eAudioOutWrap, // 6 + eDMA1, // 7 + eDMA2, // 8 + eDMA3, // 9 + eDMA4, // 10 + eChangeEvent, // 11 + eGetIntCount, // 12 + eWrapRate, // 13 + eUartTx, // 14 + eUart1Tx = eUartTx, + eUartRx, // 15 + eUart1Rx = eUartRx, + eAuxVerticalInterrupt, // 16 + ePushButtonChange, // 17 + eLowPower, // 18 + eDisplayFIFO, // 19 + eSATAChange, // 20 + eTemp1High, // 21 + eTemp2High, // 22 + ePowerButtonChange, // 23 + eInput3, // 24 + eInput4, // 25 + eUartTx2, // 26 + eUart2Tx = eUartTx2, + eUartRx2, // 27 + eUart2Rx = eUartRx2, + eHDMIRxV2HotplugDetect, // 28 + eInput5, // 29 + eInput6, // 30 + eInput7, // 31 + eInput8, // 32 + eInterruptMask2, // 33 + eOutput2, // 34 + eOutput3, // 35 + eOutput4, // 36 + eOutput5, // 37 + eOutput6, // 38 + eOutput7, // 39 + eOutput8, // 40 + eNumInterruptTypes // This must be last // 41 +} INTERRUPT_ENUMS; + + +#define MAX_NUM_EVENT_CODES (eNumInterruptTypes) +#define NTV2_IS_VALID_INTERRUPT_ENUM(__e__) ((__e__) >= eOutput1 && (__e__) < eNumInterruptTypes) +#define NTV2_IS_INPUT_INTERRUPT(__e__) ( (__e__) == eInput1 \ + || (__e__) == eInput2 \ + || (__e__) == eInput3 \ + || (__e__) == eInput4 \ + || (__e__) == eInput5 \ + || (__e__) == eInput6 \ + || (__e__) == eInput7 \ + || (__e__) == eInput8 ) + +#define NTV2_IS_OUTPUT_INTERRUPT(__e__) ( (__e__) == eOutput1 \ + || (__e__) == eOutput2 \ + || (__e__) == eOutput3 \ + || (__e__) == eOutput4 \ + || (__e__) == eOutput5 \ + || (__e__) == eOutput6 \ + || (__e__) == eOutput7 \ + || (__e__) == eOutput8 ) + + +// Some Mac only ENUMS that had to be moved over to get Win/Linux code to compile, +// so these are only used by the Mac. +typedef enum +{ + kFreeRun, + kReferenceIn, + kVideoIn +} ReferenceSelect; + + +#if !defined (NTV2_BUILDING_DRIVER) + typedef std::vector NTV2ULWordVector; ///< @brief An ordered sequence of ULWords. + + /** + @brief Streams a human-readable dump of the given NTV2ULWordVector into the specified output stream. + @param[in] inObj Specifies the NTV2ULWordVector to be printed on the output stream. + @param inOutStream Specifies the output stream to receive the dump. Defaults to std::cout. + @return A non-constant reference to the given output stream. + **/ + AJAExport std::ostream & NTV2PrintULWordVector (const NTV2ULWordVector & inObj, std::ostream & inOutStream = std::cout); // New in SDK 16.0 + + typedef std::vector NTV2ChannelList; ///< @brief An ordered sequence of NTV2Channel values. + typedef NTV2ChannelList::const_iterator NTV2ChannelListConstIter; ///< @brief A handy const iterator into an NTV2ChannelList. + + /** + @brief Streams a human-readable dump of the given NTV2ChannelList into the specified output stream. + @param[in] inObj Specifies the NTV2ChannelList to be streamed to the output stream. + @param inCompact Use 'true' for a compact display (the default); otherwise use 'false' for a long-format. + @param inOutStream Specifies the output stream to receive the dump. Defaults to std::cout. + @return A non-constant reference to the given output stream. + **/ + AJAExport std::ostream & NTV2PrintChannelList (const NTV2ChannelList & inObj, const bool inCompact = true, std::ostream & inOutStream = std::cout); // New in SDK 16.0 + + /** + @return A human-readable string containing a dump of the channel list. + @param[in] inObj Specifies the NTV2ChannelList to be converted. + @param inCompact Use 'true' for a compact display (the default); otherwise use 'false' for a long-format. + **/ + AJAExport std::string NTV2ChannelListToStr (const NTV2ChannelList & inObj, const bool inCompact = true); // New in SDK 16.0 + + typedef std::set NTV2ChannelSet; ///< @brief A set of distinct NTV2Channel values. + typedef NTV2ChannelSet::const_iterator NTV2ChannelSetConstIter; ///< @brief A handy const iterator into an NTV2ChannelSet. + + /** + @brief Streams a human-readable dump of the given NTV2ChannelSet into the specified output stream. + @param[in] inObj Specifies the NTV2ChannelSet to be streamed to the output stream. + @param inCompact Use 'true' for a compact display (the default); otherwise use 'false' for a long-format. + @param inOutStream Specifies the output stream to receive the dump. Defaults to std::cout. + @return A non-constant reference to the given output stream. + **/ + AJAExport std::ostream & NTV2PrintChannelSet (const NTV2ChannelSet & inObj, const bool inCompact = true, std::ostream & inOutStream = std::cout); // New in SDK 16.0 + + /** + @return A human-readable string containing a dump of the channel set. + @param[in] inObj Specifies the NTV2ChannelSet to be converted. + @param inCompact Use 'true' for a compact display (the default); otherwise use 'false' for a long-format. + **/ + AJAExport std::string NTV2ChannelSetToStr (const NTV2ChannelSet & inObj, const bool inCompact = true); // New in SDK 16.0 + + /** + @param[in] inFirstChannel Specifies the first NTV2Channel. + @param inNumChannels Specifies the number of channels. + @return An NTV2ChannelSet having the specified contiguous range of channels. + **/ + AJAExport NTV2ChannelSet NTV2MakeChannelSet (const NTV2Channel inFirstChannel, const UWord inNumChannels = 1); // New in SDK 16.0 + + /** + @param[in] inChannels Specifies the NTV2Channels that should go into the NTV2ChannelSet. + @return An NTV2ChannelSet having the same channels as contained in the specified list. + **/ + AJAExport NTV2ChannelSet NTV2MakeChannelSet (const NTV2ChannelList inChannels); // New in SDK 16.0 + + /** + @param[in] inFirstChannel Specifies the first NTV2Channel. + @param inNumChannels Specifies the number of channels. + @return An NTV2ChannelList having the specified contiguous range of channels. + **/ + AJAExport NTV2ChannelList NTV2MakeChannelList (const NTV2Channel inFirstChannel, const UWord inNumChannels = 1); // New in SDK 16.0 + + /** + @param[in] inChannels Specifies the NTV2Channels that should go into the NTV2ChannelList. + @return An NTV2ChannelList having the same channels as contained in the specified set. + **/ + AJAExport NTV2ChannelList NTV2MakeChannelList (const NTV2ChannelSet inChannels); // New in SDK 16.0 + + + typedef std::set NTV2AudioSystemSet; ///< @brief A set of distinct NTV2AudioSystem values. New in SDK 16.2. + typedef NTV2AudioSystemSet::const_iterator NTV2AudioSystemSetConstIter; ///< @brief A handy const iterator into an NTV2AudioSystemSet. New in SDK 16.2. + + /** + @brief Streams a human-readable dump of the given NTV2AudioSystemSet into the specified output stream. + @param[in] inObj Specifies the NTV2AudioSystemSet to be streamed to the output stream. + @param inCompact Use 'true' for a compact display (the default); otherwise use 'false' for a long-format. + @param inOutStream Specifies the output stream to receive the dump. Defaults to std::cout. + @return A non-constant reference to the given output stream. + **/ + AJAExport std::ostream & NTV2PrintAudioSystemSet (const NTV2AudioSystemSet & inObj, const bool inCompact = true, std::ostream & inOutStream = std::cout); // New in SDK 16.2 + + /** + @return A human-readable string containing a dump of the NTV2AudioSystemSet. + @param[in] inObj Specifies the NTV2AudioSystemSet to be render. + @param inCompact Use 'true' for a compact display (the default); otherwise use 'false' for a long-format. + **/ + AJAExport std::string NTV2AudioSystemSetToStr (const NTV2AudioSystemSet & inObj, const bool inCompact = true); // New in SDK 16.2 + + /** + @param[in] inFirstAudioSystem Specifies the first NTV2AudioSystem. + @param inCount Specifies the number of audio systems. + @return An NTV2AudioSystemSet having the specified contiguous range of NTV2AudioSystems. + **/ + AJAExport NTV2AudioSystemSet NTV2MakeAudioSystemSet (const NTV2AudioSystem inFirstAudioSystem, const UWord inCount = 1); // New in SDK 16.2 +#endif // !defined (NTV2_BUILDING_DRIVER) + + +/** + @brief Everything needed to call CNTV2Card::ReadRegister or CNTV2Card::WriteRegister functions. +**/ +typedef struct NTV2RegInfo +{ + ULWord registerNumber; ///< @brief My register number to use in a ReadRegister or WriteRegister call. + ULWord registerValue; ///< @brief My register value to use in a ReadRegister or WriteRegister call. + ULWord registerMask; ///< @brief My register mask value to use in a ReadRegister or WriteRegister call. + ULWord registerShift; ///< @brief My register shift value to use in a ReadRegister or WriteRegister call. + + #if !defined(NTV2_BUILDING_DRIVER) + /** + @brief Constructs me from the given parameters. + @param[in] inRegNum Specifies the register number to use. If not specified, defaults to zero. + @param[in] inRegValue Specifies the register value to use. If not specified, defaults to zero. + @param[in] inRegMask Specifies the bit mask to use. If not specified, defaults to 0xFFFFFFFF. + @param[in] inRegShift Specifies the shift to use. If not specified, defaults to zero. + **/ + AJAExport NTV2RegInfo (const ULWord inRegNum = 0, const ULWord inRegValue = 0, const ULWord inRegMask = 0xFFFFFFFF, const ULWord inRegShift = 0) + : registerNumber (inRegNum), + registerValue (inRegValue), + registerMask (inRegMask), + registerShift (inRegShift) + { + } + + /** + @brief Sets me from the given parameters. + @param[in] inRegNum Specifies the register number to use. + @param[in] inRegValue Specifies the register value to use. + @param[in] inRegMask Specifies the bit mask to use. If not specified, defaults to 0xFFFFFFFF. + @param[in] inRegShift Specifies the shift to use. If not specified, defaults to zero. + **/ + AJAExport inline void Set (const ULWord inRegNum, const ULWord inRegValue, const ULWord inRegMask = 0xFFFFFFFF, const ULWord inRegShift = 0) + {registerNumber = inRegNum; registerValue = inRegValue; registerMask = inRegMask; registerShift = inRegShift;} + /** + @brief Invalidates me, setting my register number, value, mask and shift values to 0xFFFFFFFF. + **/ + AJAExport inline void MakeInvalid (void) {registerNumber = registerValue = registerMask = registerShift = 0xFFFFFFFF;} + + /** + @return True if I'm considered "valid", or false if my register number, value, mask and shift values are all 0xFFFFFFFF. + **/ + AJAExport inline bool IsValid (void) const {return registerNumber != 0xFFFFFFFF || registerValue != 0xFFFFFFFF || registerMask != 0xFFFFFFFF || registerShift != 0xFFFFFFFF;} + + /** + @return True if I'm identical to the right-hand-side NTV2RegInfo. + @param[in] inRHS Specifies the right-hand-side NTV2RegInfo that will be compared to me. + @note To synthesize the other comparison operators (!=, <=, >, >=), in client code, add "#include ", and "using namespace std::rel_ops;". + **/ + AJAExport inline bool operator == (const NTV2RegInfo & inRHS) const {return registerNumber == inRHS.registerNumber && registerValue == inRHS.registerValue + && registerMask == inRHS.registerMask && registerShift == inRHS.registerShift;} + /** + @return True if I'm less than the right-hand-side NTV2RegInfo. + @param[in] inRHS Specifies the right-hand-side NTV2RegInfo that will be compared to me. + @note To synthesize the other comparison operators (!=, <=, >, >=), in client code, add "#include ", and "using namespace std::rel_ops;". + **/ + AJAExport bool operator < (const NTV2RegInfo & inRHS) const; + + /** + @brief Renders me to the given output stream in a human-readable format. + @param outputStream Specifies the output stream in which to Print my contents. + @param inAsCode Deprecated as of SDK 16.0 -- use PrintCode instead. Defaults to false. + If true, renders me as source code. + @return The output stream. + **/ + AJAExport std::ostream & Print (std::ostream & outputStream, const bool inAsCode = false) const; + + /** + @brief Renders me to the given output stream as source code using a "WriteRegister" function call. + @param outputStream Specifies the output stream to write into. + @param[in] inRadix Optionally specifies the radix to use for the my register value. Defaults to hexadecimal (base 16). + @param[in] inDeviceID Optionally specifies the ::NTV2DeviceID for properly interpreting my register values. + @return The output stream. + **/ + AJAExport std::ostream & PrintCode (std::ostream & outputStream, const int inRadix = 16, const NTV2DeviceID inDeviceID = DEVICE_ID_INVALID) const; // New in SDK 16.0, added inDeviceID in 16.2 + #endif // not NTV2_BUILDING_DRIVER +} NTV2RegInfo; + + +typedef NTV2RegInfo NTV2ReadWriteRegisterSingle; ///< @brief This is an alias for NTV2RegInfo -- everything needed to make a future ReadRegister or WriteRegister call. + +#if !defined (NTV2_BUILDING_DRIVER) + typedef std::vector NTV2RegisterWrites, NTV2RegWrites; ///< @brief An ordered sequence of zero or more NTV2RegInfo structs intended for WriteRegister. + typedef NTV2RegWrites::const_iterator NTV2RegisterWritesConstIter, NTV2RegWritesConstIter; ///< @brief A handy const (read-only) iterator for iterating over the contents of an NTV2RegisterWrites instance. + typedef NTV2RegWrites::iterator NTV2RegisterWritesIter, NTV2RegWritesIter; ///< @brief A handy non-const iterator for iterating over the contents of an NTV2RegisterWrites instance. + typedef NTV2RegWrites NTV2RegisterReads, NTV2RegReads; ///< @brief An ordered sequence of zero or more NTV2RegInfo structs intended for ReadRegister. + typedef NTV2RegWritesConstIter NTV2RegisterReadsConstIter, NTV2RegReadsConstIter; ///< @brief A handy const (read-only) iterator for iterating over the contents of an NTV2RegisterReads instance. + typedef NTV2RegWritesIter NTV2RegisterReadsIter, NTV2RegReadsIter; ///< @brief A handy non-const iterator for iterating over the contents of an NTV2RegisterReads instance. + + /** + @brief Returns a const iterator to the first entry in the NTV2RegInfo collection with a matching register number. + @param[in] inRegNum Specifies the register number of interest. + @param[in] inRegInfos Specifies the NTV2RegInfo collection to search. + @return A const_iterator that references the entry in the NTV2RegInfo collection, or "end()" if not found. + **/ + AJAExport NTV2RegReadsConstIter FindFirstMatchingRegisterNumber (const uint32_t inRegNum, const NTV2RegReads & inRegInfos); + + /** + @brief Writes the given NTV2RegInfo to the specified output stream. + @param inOutStream Specifies the output stream to receive the human-readable representation of the NTV2RegInfo instance. + @param[in] inObj Specifies the NTV2RegInfo instance to print to the output stream. + @return A non-constant reference to the specified output stream. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2RegInfo & inObj); + + /** + @brief Writes the given NTV2RegisterWrites to the specified output stream. + @param inOutStream Specifies the output stream to receive the human-readable representation of the NTV2RegisterWrites instance. + @param[in] inObj Specifies the NTV2RegisterWrites instance to print to the output stream. + @return A non-constant reference to the specified output stream. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2RegisterWrites & inObj); +#endif // !defined (NTV2_BUILDING_DRIVER) + + +typedef struct NTV2RoutingEntry +{ + ULWord registerNum; + ULWord mask; + ULWord shift; + ULWord value; + #if !defined (NTV2_BUILDING_DRIVER) + NTV2RoutingEntry & operator = (const NTV2RegInfo & inRHS); ///< @brief Assigns an NTV2RegInfo to me. + #endif // !defined (NTV2_BUILDING_DRIVER) +} NTV2RoutingEntry; ///< @deprecated Formerly used by the CNTV2SignalRouter + +#define MAX_ROUTING_ENTRIES 32 + +typedef struct +{ + ULWord numEntries; + NTV2RoutingEntry routingEntry [MAX_ROUTING_ENTRIES]; +} NTV2RoutingTable; ///< @deprecated Formerly used by the CNTV2SignalRouter + +#if !defined (NTV2_DEPRECATE) + typedef NTV2RoutingEntry Xena2RoutingEntry; ///< @deprecated 'Xena' is obsolete. + typedef NTV2RoutingTable Xena2RoutingTable; ///< @deprecated 'Xena' is obsolete. +#endif // if !defined (NTV2_DEPRECATE) + + +// Color Space Convert Custom Coefficients +typedef struct +{ + ULWord Coefficient1; + ULWord Coefficient2; + ULWord Coefficient3; + ULWord Coefficient4; + ULWord Coefficient5; + ULWord Coefficient6; + ULWord Coefficient7; + ULWord Coefficient8; + ULWord Coefficient9; + ULWord Coefficient10; +} ColorSpaceConverterCustomCoefficients, NTV2CSCCustomCoeffs; + +///////////////////////////////////////////////////////////////////////////////////// +// RP188 data structure used in AutoCirculate +///////////////////////////////////////////////////////////////////////////////////// + +typedef struct RP188_STRUCT { + ULWord DBB; + ULWord Low; // | BG 4 | Secs10 | BG 3 | Secs 1 | BG 2 | Frms10 | BG 1 | Frms 1 | + ULWord High; // | BG 8 | Hrs 10 | BG 7 | Hrs 1 | BG 6 | Mins10 | BG 5 | Mins 1 | +} RP188_STRUCT; + + +#define RP188_STRUCT_SET(_struct_,_dbb_,_lo_,_hi_) do \ + { \ + (_struct_).DBB = (_dbb_); \ + (_struct_).Low = (_lo_); \ + (_struct_).High = (_hi_); \ + } while (false) + +#define RP188_PSTRUCT_SET(_pStruct_,_dbb_,_lo_,_hi_) do \ + { \ + (_pStruct_)->DBB = (_dbb_); \ + (_pStruct_)->Low = (_lo_); \ + (_pStruct_)->High = (_hi_); \ + } while (false) + + // convenience masks to extract fields in .Low and .High words +#define RP188_FRAMEUNITS_MASK 0x0000000F // Frames (units digit) in bits 3- 0 of .Low word +#define RP188_FRAMETENS_MASK 0x00000300 // Frames (tens digit) in bits 9- 8 of .Low word +#define RP188_SECONDUNITS_MASK 0x000F0000 // Seconds (units digit) in bits 19-16 of .Low word +#define RP188_SECONDTENS_MASK 0x07000000 // Seconds (tens digit) in bits 26-24 of .Low word +#define RP188_LOW_TIME_MASK (RP188_FRAMEUNITS_MASK | RP188_FRAMETENS_MASK | RP188_SECONDUNITS_MASK | RP188_SECONDTENS_MASK) + +#define RP188_MINUTESUNITS_MASK 0x0000000F // Minutes (units digit) in bits 3- 0 of .High word +#define RP188_MINUTESTENS_MASK 0x00000700 // Minutes (tens digit) in bits 10- 8 of .High word +#define RP188_HOURUNITS_MASK 0x000F0000 // Hours (units digit) in bits 19-16 of .High word +#define RP188_HOURTENS_MASK 0x03000000 // Hours (tens digit) in bits 25-24 of .High word +#define RP188_HIGH_TIME_MASK (RP188_MINUTESUNITS_MASK | RP188_MINUTESTENS_MASK | RP188_HOURUNITS_MASK | RP188_HOURTENS_MASK) + + // private bit flags added to the RP188 DBB word +#define NEW_RP188_RCVD 0x00010000 // new RP188 data was received on ANY of the channels (LTC, VITC, etc.) (capture only) +#define NEW_SELECT_RP188_RCVD 0x00020000 // new RP188 data was received on the selected channel (capture only) +#define RP188_720P_FRAMEID 0x00400000 // 720p FrameID (capture only - set by driver software) +#define RP188_CHANGED_FLAG 0x00800000 // RP188 data changed compared to last frame (capture only - set by driver software) + + +///////////////////////////////////////////////////////////////////////////////////// +// Color Correction data structure used in AutoCirculate +///////////////////////////////////////////////////////////////////////////////////// +// Color Corrector has 3 tables(usually R, G and B). Each table has 1024 entries +// with 2 entries per 32 bit word....therefore 512 32 bit words per table. +#define NTV2_COLORCORRECTOR_WORDSPERTABLE (512) // number of ULONG words in EACH color table +#define NTV2_COLORCORRECTOR_TOTALWORDS (NTV2_COLORCORRECTOR_WORDSPERTABLE * 3) // total number of ULONG words in all 3 tables +#define NTV2_COLORCORRECTOR_TABLESIZE (NTV2_COLORCORRECTOR_TOTALWORDS * 4) // total length in bytes of all 3 tables: numWords * numColors * bytes/word + +// 12 bit Color Corrector has 3 tables(usually R, G and B). Each table has 4096 entries +// with 2 entries per 32 bit word....therefore 2048 32 bit words per table. +#define NTV2_12BIT_COLORCORRECTOR_WORDSPERTABLE (2048) // number of ULONG words in EACH color table +#define NTV2_12BIT_COLORCORRECTOR_TOTALWORDS (NTV2_12BIT_COLORCORRECTOR_WORDSPERTABLE * 3) // total number of ULONG words in all 3 tables +#define NTV2_12BIT_COLORCORRECTOR_TABLESIZE (NTV2_12BIT_COLORCORRECTOR_TOTALWORDS * 4) // total length in bytes of all 3 tables: numWords * numColors * bytes/word + + +typedef struct NTV2ColorCorrectionInfo_64 { + NTV2ColorCorrectionMode mode; + UWord_ saturationValue; /// only used in 3way color correction mode. + Pointer64 ccLookupTables; /// R,G, and B lookup tables already formated for our hardware. + /// Buffer needs to be NTV2_COLORCORRECTOR_TABLESIZE. +} NTV2ColorCorrectionInfo_64; + + +typedef struct { + NTV2ColorCorrectionMode mode; + UWord_ saturationValue; /// only used in 3way color correction mode. + ULWord* ccLookupTables; /// R,G, and B lookup tables already formated for our hardware. + /// Buffer needs to be NTV2_COLORCORRECTOR_TABLESIZE. +} NTV2ColorCorrectionInfo; + +typedef struct { + NTV2ColorCorrectionMode mode; + UWord_ saturationValue; /// only used in 3way color correction mode. + ULWord* POINTER_32 ccLookupTables; /// R,G, and B lookup tables already formated for our hardware. + /// Buffer needs to be NTV2_COLORCORRECTOR_TABLESIZE. +} NTV2ColorCorrectionInfo_32; + +// within each 32-bit LUT word, bits <31:22> = LUT[2i+1], bits <15:6> = LUT[2i] +#define kRegColorCorrectionLUTOddShift 22 +#define kRegColorCorrectionLUTEvenShift 6 + +// the base BYTE offsets (from PCI Config Base Address 0) of the three Color Correction LUTs +// Note: if using these with GetRegisterBaseAddress() be sure to divide by 4 to get WORD offset! +#define kColorCorrectionLUTOffset_Red (0x0800) +#define kColorCorrectionLUTOffset_Green (0x1000) +#define kColorCorrectionLUTOffset_Blue (0x1800) + +// within each 32-bit LUT word, bits <31:22> = LUT[2i+1], bits <15:6> = LUT[2i] +#define kRegColorCorrection12BitLUTOddShift 16 +#define kRegColorCorrection12BitLUTEvenShift 0 + +#define kRegColorCorrection10To12BitLUTOddShift 18 +#define kRegColorCorrection10To12BitLUTEvenShift 2 + +// Note: there is code that assumes that the three LUTs are contiguous. So if this relationship +// changes (i.e. there are "gaps" between tables) then code will need to change! +#define kColorCorrectionLUTOffset_Base (0x0800) // BYTE offset +#define kColorCorrection12BitLUTOffset_Base (0xe000) // BYTE offset + + +///////////////////////////////////////////////////////////////////////////////////// +// VidProc data structure used in AutoCirculate +///////////////////////////////////////////////////////////////////////////////////// + +typedef enum +{ + AUTOCIRCVIDPROCMODE_MIX, + AUTOCIRCVIDPROCMODE_HORZWIPE, + AUTOCIRCVIDPROCMODE_VERTWIPE, + AUTOCIRCVIDPROCMODE_KEY, + AUTOCIRCVIDPROCMODE_INVALID +} AutoCircVidProcMode; + +#define NTV2_IS_VALID_AUTOCIRCVIDPROCMODE(__m__) ((__m__) >= AUTOCIRCVIDPROCMODE_MIX && (__m__) < AUTOCIRCVIDPROCMODE_INVALID) + + + +typedef struct AutoCircVidProcInfo +{ + AutoCircVidProcMode mode; + NTV2Crosspoint foregroundVideoCrosspoint; + NTV2Crosspoint backgroundVideoCrosspoint; + NTV2Crosspoint foregroundKeyCrosspoint; + NTV2Crosspoint backgroundKeyCrosspoint; + Fixed_ transitionCoefficient; // 0-0x10000 + Fixed_ transitionSoftness; // 0-0x10000 + + #if !defined (NTV2_BUILDING_DRIVER) + public: + AJAExport explicit AutoCircVidProcInfo (); + #endif // user-space clients only +} AutoCircVidProcInfo; + + +///////////////////////////////////////////////////////////////////////////////////// +// CustomAncData data structure used in AutoCirculate +///////////////////////////////////////////////////////////////////////////////////// +typedef struct +{ + ULWord Group1; + ULWord Group2; + ULWord Group3; + ULWord Group4; +} CUSTOM_ANC_STRUCT; + +#define OBSOLETE_ANC_STRUCT CUSTOM_ANC_STRUCT + + +//////////////////////////////////////////////////////////////////////////////////// +// Control +//////////////////////////////////////////////////////////////////////////////////// + +typedef enum _AutoCircCommand_ +{ + eInitAutoCirc, + eStartAutoCirc, + eStopAutoCirc, + ePauseAutoCirc, + eGetAutoCirc, + eGetFrameStamp, + eFlushAutoCirculate, + ePrerollAutoCirculate, + eTransferAutoCirculate, + eAbortAutoCirc, + eStartAutoCircAtTime, + eTransferAutoCirculateEx, + eTransferAutoCirculateEx2, + eGetFrameStampEx2, + eSetCaptureTask, + eSetActiveFrame, + AUTO_CIRC_NUM_COMMANDS, + AUTO_CIRC_COMMAND_INVALID = AUTO_CIRC_NUM_COMMANDS +} NTV2AutoCirculateCommand, NTV2AutoCircCmd, AUTO_CIRC_COMMAND; + + +/** + @brief Describes the state of an AutoCirculate channel. See ::AUTOCIRCULATE_STATUS. +**/ +typedef enum +{ + NTV2_AUTOCIRCULATE_DISABLED = 0, ///< @brief The AutoCirculate channel is stopped. + NTV2_AUTOCIRCULATE_INIT, ///< @brief The AutoCirculate channel is initializing, waiting for CNTV2Card::AutoCirculateStart to be called. + NTV2_AUTOCIRCULATE_STARTING, ///< @brief The AutoCirculate channel is starting, waiting for the first VBI and/or call to CNTV2Card::AutoCirculateTransfer. + NTV2_AUTOCIRCULATE_PAUSED, ///< @brief The AutoCirculate channel is paused. + NTV2_AUTOCIRCULATE_STOPPING, ///< @brief The AutoCirculate channel is stopping. + NTV2_AUTOCIRCULATE_RUNNING, ///< @brief The AutoCirculate channel is running. + NTV2_AUTOCIRCULATE_STARTING_AT_TIME, ///< @brief The AutoCirculate channel is starting, waiting for the start time specified in the call to CNTV2Card::AutoCirculateStart to arrive. + NTV2_AUTOCIRCULATE_INVALID +} NTV2AutoCirculateState; + +#define NTV2_IS_VALID_AUTO_CIRC_STATE(__m__) ((__m__) >= NTV2_AUTOCIRCULATE_DISABLED && (__m__) < NTV2_AUTOCIRCULATE_INVALID) + + +/** + @brief Describes the task mode state. See also: \ref devicesharing +**/ +typedef enum +{ + NTV2_DISABLE_TASKS, ///< @brief 0: Disabled: Device is completely configured by controlling application(s) -- no driver involvement. + NTV2_STANDARD_TASKS, ///< @brief 1: Standard/Retail: Device is completely controlled by AJA ControlPanel, service/daemon, and driver. + NTV2_OEM_TASKS, ///< @brief 2: OEM: Device is configured by controlling application(s), with minimal driver involvement. + NTV2_TASK_MODE_INVALID = 0xFF +} NTV2EveryFrameTaskMode, NTV2TaskMode; + +#define NTV2_IS_VALID_TASK_MODE(__m__) ((__m__) == NTV2_DISABLE_TASKS || (__m__) == NTV2_STANDARD_TASKS || (__m__) == NTV2_OEM_TASKS) +#define NTV2_IS_STANDARD_TASKS(__m__) ((__m__) == NTV2_STANDARD_TASKS) +#define NTV2_IS_DRIVER_ACTIVE_TASKS(__m__) ((__m__) == NTV2_STANDARD_TASKS || (__m__) == NTV2_OEM_TASKS) + + +typedef enum +{ + NTV2_FREEZE_BITFILE = BIT(30), + NTV2_DRIVER_TASKS = BIT(28) +} NTV2DebugReg; + + +#ifdef AJAMac + #pragma pack(4) // removes 64 bit alignment on non-64 bit fields +#endif + +// Structure used for GetAutoCirculate +typedef struct +{ + NTV2Crosspoint channelSpec; // Not used by Windows. + NTV2AutoCirculateState state; + LWord startFrame; + LWord endFrame; + LWord activeFrame; // Current Frame# actually being output (or input), -1, if not active + ULWord64 rdtscStartTime; // Performance Counter at start + ULWord64 audioClockStartTime; // Register 28 with Wrap Logic + ULWord64 rdtscCurrentTime; // Performance Counter at time of call + ULWord64 audioClockCurrentTime; // Register 28 with Wrap Logic + ULWord framesProcessed; + ULWord framesDropped; + ULWord bufferLevel; // how many buffers ready to record or playback in driver + BOOL_ bWithAudio; + BOOL_ bWithRP188; + BOOL_ bFbfChange; + BOOL_ bFboChange ; + BOOL_ bWithColorCorrection; + BOOL_ bWithVidProc; + BOOL_ bWithCustomAncData; +} AUTOCIRCULATE_STATUS_STRUCT; + + +typedef struct +{ + AUTO_CIRC_COMMAND eCommand; + NTV2Crosspoint channelSpec; + + LWord lVal1; + LWord lVal2; + LWord lVal3; + LWord lVal4; + LWord lVal5; + LWord lVal6; + + BOOL_ bVal1; + BOOL_ bVal2; + BOOL_ bVal3; + BOOL_ bVal4; + BOOL_ bVal5; + BOOL_ bVal6; + BOOL_ bVal7; + BOOL_ bVal8; + + Pointer64 pvVal1; + Pointer64 pvVal2; + Pointer64 pvVal3; + Pointer64 pvVal4; + +} AUTOCIRCULATE_DATA_64; + + +typedef struct AUTOCIRCULATE_DATA +{ + AUTO_CIRC_COMMAND eCommand; + NTV2Crosspoint channelSpec; + + LWord lVal1; + LWord lVal2; + LWord lVal3; + LWord lVal4; + LWord lVal5; + LWord lVal6; + + BOOL_ bVal1; + BOOL_ bVal2; + BOOL_ bVal3; + BOOL_ bVal4; + BOOL_ bVal5; + BOOL_ bVal6; + BOOL_ bVal7; + BOOL_ bVal8; + + void* pvVal1; + void* pvVal2; + void* pvVal3; + void* pvVal4; + + #if !defined (NTV2_BUILDING_DRIVER) + public: + AJAExport explicit AUTOCIRCULATE_DATA (const AUTO_CIRC_COMMAND inCommand = AUTO_CIRC_COMMAND_INVALID, const NTV2Crosspoint inCrosspoint = NTV2CROSSPOINT_INVALID); + #endif // user-space clients only +} AUTOCIRCULATE_DATA; + + +typedef struct +{ + AUTO_CIRC_COMMAND eCommand; + NTV2Crosspoint channelSpec; + + LWord lVal1; + LWord lVal2; + LWord lVal3; + LWord lVal4; + LWord lVal5; + LWord lVal6; + + BOOL_ bVal1; + BOOL_ bVal2; + BOOL_ bVal3; + BOOL_ bVal4; + BOOL_ bVal5; + BOOL_ bVal6; + BOOL_ bVal7; + BOOL_ bVal8; + + void* POINTER_32 pvVal1; + void* POINTER_32 pvVal2; + void* POINTER_32 pvVal3; + void* POINTER_32 pvVal4; + +} AUTOCIRCULATE_DATA_32; + + +///////////////////////////////////////////////////////////////////////////////////////// +// GetFrameStamp +///////////////////////////////////////////////////////////////////////////////////////// + +typedef struct +{ + NTV2Crosspoint channelSpec; // Ignored in Windows + + // + // Information from the requested frame (#FRAMESTAMP_CONTROL_STRUCT:frameNum + // + + // Clock (System PerformanceCounter under Windows) at time of play or record. + // audioClockTimeStamp is preferred, but not available on all boards. (See comments below at 'currentTime' member.) + LWord64 frameTime; + + //! The frame requested or -1 if not available + ULWord frame; + + //! 48kHz clock (in reg 28, extended to 64 bits) at time of play or record. + ULWord64 audioClockTimeStamp; // Register 28 with Wrap Logic + + //! The address that was used to transfer + ULWord audioExpectedAddress; + + //! For record - first position in buffer of audio (includes base offset) + ULWord audioInStartAddress; // AudioInAddress at the time this Frame was stamped. + + //! For record - end position (exclusive) in buffer of audio (includes base offset) + ULWord audioInStopAddress; // AudioInAddress at the Frame AFTER this Frame was stamped. + + //! For play - first position in buffer of audio + ULWord audioOutStopAddress; // AudioOutAddress at the time this Frame was stamped. + + //! For play - end position (exclusive) in buffer of audio + ULWord audioOutStartAddress; // AudioOutAddress at the Frame AFTER this Frame was stamped. + + //! Total audio and video bytes transfered + ULWord bytesRead; + + /** The actaul start sample when this frame was started in VBI + * This may be used to check sync against audioInStartAddress (Play) or + * audioOutStartAddress (Record). In record it will always be equal, but + * in playback if the clocks drift or the user supplies non aligned + * audio sizes, then this will give the current difference from expected + * vs actual position. To be useful, play audio must be clocked in at + * the correct rate. + */ + ULWord startSample; + + // + // Information from the current (active) frame + // + + //! Current processor time ... on Windows, this is derived from KeQueryPerformanceCounter. + // This is the finest-grained counter available from the OS. + // The granularity of this counter can vary depending on the PC's HAL. + // audioClockCurrentTime is the recommended time-stamp to use instead of this (but is not available on all boards)! + LWord64 currentTime; //! Last vertical blank frame for this channel's auto-circulate. (at the time of the IOCTL_NTV2_GET_FRAMESTAMP) + ULWord currentFrame; + + //! Last vertical blank timecode (RP-188) + RP188_STRUCT currentRP188; // ignored if withRP188 is false + + //! Vertical blank start of current frame + LWord64 currentFrameTime; + + //! 48kHz clock in reg 28 extended to 64 bits + ULWord64 audioClockCurrentTime; // Register 28 with Wrap Logic + // audioClockCurrentTime (from 48 kHz on-board clock) is consistent and accurate! + // but is not available on the XenaSD-22. + + //! As set by play + ULWord currentAudioExpectedAddress; + + //! As found by isr + ULWord currentAudioStartAddress; + + //! At Call Field0 or Field1 _currently_ being OUTPUT (at the time of the IOCTL_NTV2_GET_FRAMESTAMP) + ULWord currentFieldCount; + ULWord currentLineCount; //! At Call Line# _currently_ being OUTPUT (at the time of the IOCTL_NTV2_GET_FRAMESTAMP) + ULWord currentReps; //! Contains validCount (Play - reps remaining, Record - drops on frame) + ULWord currenthUser; //! User cookie at last vblank +} FRAME_STAMP_STRUCT; + + +typedef struct +{ + NTV2Crosspoint channelSpec; // specify Input or Output channel for desired Frame + NTV2AutoCirculateState state; // current state + LWord transferFrame; // framebuffer number the frame transferred to, -1 on error + ULWord bufferLevel; // how many buffers ready to record or playback + ULWord framesProcessed; + ULWord framesDropped; + FRAME_STAMP_STRUCT frameStamp; // record. framestramp for that frame,playback + ULWord audioBufferSize; + ULWord audioStartSample; +} AUTOCIRCULATE_TRANSFER_STATUS_STRUCT, *PAUTOCIRCULATE_TRANSFER_STATUS_STRUCT; + + +typedef struct +{ + NTV2Crosspoint channelSpec; // Specify Input or Output channel for desired Frame + Pointer64 videoBuffer; // Keep 64 bit aligned for performance reasons + ULWord videoBufferSize; + ULWord videoDmaOffset; // Must be initialized, 64 bit aligned + Pointer64 audioBuffer; // Keep 64 bit aligned for performance reasons + ULWord audioBufferSize; + ULWord audioStartSample; // To ensure correct alignment in audio buffer .. NOT USED in Windows... audio now always starts at sample zero. + ULWord audioNumChannels; // 1-6 NOTE!!! only 6 supported at this time + ULWord frameRepeatCount; // NOTE!!! not supported yet. + RP188_STRUCT rp188; // Ignored if withRP188 is false + LWord desiredFrame; // -1 if you want driver to find next available + ULWord hUser; // A user cookie returned by frame stamp + ULWord transferFlags; // disableAudioDMA is no longer used + BOOL_ bDisableExtraAudioInfo; // No 24 byte 0 at front or size info in buffer + NTV2FrameBufferFormat frameBufferFormat; // Should be initialized, but can be overridden + NTV2VideoFrameBufferOrientation frameBufferOrientation; + NTV2ColorCorrectionInfo_64 colorCorrectionInfo; + AutoCircVidProcInfo vidProcInfo; + CUSTOM_ANC_STRUCT customAncInfo; ///< @brief This field is obsolete. Do not use. + // The following params are for cases when you need to DMA multiple discontiguous "segments" of a video frame. One example + // would be when a frame in Host memory is not "packed", i.e. there are extra "padding" bytes at the end of each row. + // In this case you would set videoBufferSize to the number of active bytes per row, videoNumSegments to the number of rows, + // and videoSegmentHostPitch to the number of bytes from the beginning of one row to the next. In this example, + // videoSegmentCardPitch would be equal to videoBufferSize (i.e. the frame is packed in board memory). + // Another example would be DMAing a sub-section of a frame. In this case set videoBufferSize to the number of bytes in + // one row of the subsection, videoNumSegments to the number of rows in the subsection, videoSegmentHostPitch to the rowBytes + // of the entire frame in Host Memory, and videoSegmentCardPitch to the rowBytes of the entire frame in board memory. + // Note: setting videoNumSegments to 0 or 1 defaults to original behavior (i.e. DMA one complete packed frame) + ULWord videoNumSegments; // Number of segments of size videoBufferSize to DMA (i.e. numLines) + ULWord videoSegmentHostPitch; // Offset (in bytes) between the beginning of one host segment and the beginning of the next host segment (i.e. host rowBytes) + ULWord videoSegmentCardPitch; // Offset (in bytes) between the beginning of one board segment and the beginning of the next board segment (i.e. board memory rowBytes) + NTV2QuarterSizeExpandMode videoQuarterSizeExpand; // Turns on the "quarter-size expand" (2x H + 2x V) hardware + //ULWord * ancBuffer; // Host ANC data buffer. If NULL, none transferred. + //ULWord ancBufferSize; // Capture: before xfer: specifies max size of host ancBuffer; after xfer: actual number of ANC data bytes xferred + // Playout: specifies number of ANC data bytes to xfer from host ancBuffer to device + // If zero, none transferred. +} AUTOCIRCULATE_TRANSFER_STRUCT_64, *PAUTOCIRCULATE_TRANSFER_STRUCT_64; + + +typedef struct +{ + NTV2Crosspoint channelSpec; // specify Input or Output channel for desired Frame + ULWord * videoBuffer; // Keep 64 bit aligned for performance reasons + ULWord videoBufferSize; + ULWord videoDmaOffset; // must be initialized, 64 bit aligned + ULWord * audioBuffer; // Keep 64 bit aligned for performance reasons + ULWord audioBufferSize; + ULWord audioStartSample; // To ensure correct alignment in audio buffer .. NOT USED in Windows... audio now always starts at sample zero. + ULWord audioNumChannels; // 1-6 NOTE!!! only 6 supported at this time + ULWord frameRepeatCount; // NOTE!!! not supported yet. + RP188_STRUCT rp188; // Ignored if withRP188 is false + LWord desiredFrame; // -1 if you want driver to find next available + ULWord hUser; // A user cookie returned by frame stamp + ULWord transferFlags; // disableAudioDMA is no longer used + BOOL_ bDisableExtraAudioInfo; // No 24 byte 0 at front or size info in buffer + NTV2FrameBufferFormat frameBufferFormat; // Should be initialized, but can be overridden + NTV2VideoFrameBufferOrientation frameBufferOrientation; + NTV2ColorCorrectionInfo colorCorrectionInfo; + AutoCircVidProcInfo vidProcInfo; + CUSTOM_ANC_STRUCT customAncInfo; ///< @brief This field is obsolete. Do not use. + // The following params are for cases when you need to DMA multiple discontiguous "segments" of a video frame. One example + // would be when a frame in Host memory is not "packed", i.e. there are extra "padding" bytes at the end of each row. + // In this case you would set videoBufferSize to the number of active bytes per row, videoNumSegments to the number of rows, + // and videoSegmentHostPitch to the number of bytes from the beginning of one row to the next. In this example, + // videoSegmentCardPitch would be equal to videoBufferSize (i.e. the frame is packed in board memory). + // Another example would be DMAing a sub-section of a frame. In this case set videoBufferSize to the number of bytes in + // one row of the subsection, videoNumSegments to the number of rows in the subsection, videoSegmentHostPitch to the rowBytes + // of the entire frame in Host Memory, and videoSegmentCardPitch to the rowBytes of the entire frame in board memory. + // Note: setting videoNumSegments to 0 or 1 defaults to original behavior (i.e. DMA one complete packed frame) + ULWord videoNumSegments; // Number of segments of size videoBufferSize to DMA (i.e. numLines) + ULWord videoSegmentHostPitch; // Offset (in bytes) between the beginning of one host segment and the beginning of the next host segment (i.e. host rowBytes) + ULWord videoSegmentCardPitch; // Offset (in bytes) between the beginning of one board segment and the beginning of the next board segment (i.e. board memory rowBytes) + NTV2QuarterSizeExpandMode videoQuarterSizeExpand; // Turns on the "quarter-size expand" (2x H + 2x V) hardware + //ULWord * ancBuffer; // Host ANC data buffer. If NULL, none transferred. + //ULWord ancBufferSize; // Capture: before xfer: specifies max size of host ancBuffer; after xfer: actual number of ANC data bytes xferred + // Playout: specifies number of ANC data bytes to xfer from host ancBuffer to device + // If zero, none transferred. + +} AUTOCIRCULATE_TRANSFER_STRUCT, *PAUTOCIRCULATE_TRANSFER_STRUCT; + + +typedef struct +{ + NTV2Crosspoint channelSpec; // Specify Input or Output channel for desired Frame + ULWord * POINTER_32 videoBuffer; // Keep 64 bit aligned for performance reasons + ULWord videoBufferSize; + ULWord videoDmaOffset; // Must be initialized, 64 bit aligned + ULWord * POINTER_32 audioBuffer; // Keep 64 bit aligned for performance reasons + ULWord audioBufferSize; + ULWord audioStartSample; // To ensure correct alignment in audio buffer .. NOT USED in Windows... audio now always starts at sample zero. + ULWord audioNumChannels; // 1-6 NOTE!!! only 6 supported at this time + ULWord frameRepeatCount; // NOTE!!! not supported yet. + RP188_STRUCT rp188; // Ignored if withRP188 is false + LWord desiredFrame; // -1 if you want driver to find next available + ULWord hUser; // A user cookie returned by frame stamp + ULWord transferFlags; // disableAudioDMA is no longer used + BOOL_ bDisableExtraAudioInfo; // No 24 byte 0 at front or size info in buffer .. NOT USED in Windows, extra audio no longer supported + NTV2FrameBufferFormat frameBufferFormat; // Should be initialized, but can be overridden + NTV2VideoFrameBufferOrientation frameBufferOrientation; + NTV2ColorCorrectionInfo_32 colorCorrectionInfo; + AutoCircVidProcInfo vidProcInfo; + CUSTOM_ANC_STRUCT customAncInfo; ///< @brief This field is obsolete. Do not use. + // The following params are for cases when you need to DMA multiple discontiguous "segments" of a video frame. One example + // would be when a frame in Host memory is not "packed", i.e. there are extra "padding" bytes at the end of each row. + // In this case you would set videoBufferSize to the number of active bytes per row, videoNumSegments to the number of rows, + // and videoSegmentHostPitch to the number of bytes from the beginning of one row to the next. In this example, + // videoSegmentCardPitch would be equal to videoBufferSize (i.e. the frame is packed in board memory). + // Another example would be DMAing a sub-section of a frame. In this case set videoBufferSize to the number of bytes in + // one row of the subsection, videoNumSegments to the number of rows in the subsection, videoSegmentHostPitch to the rowBytes + // of the entire frame in Host Memory, and videoSegmentCardPitch to the rowBytes of the entire frame in board memory. + // Note: setting videoNumSegments to 0 or 1 defaults to original behavior (i.e. DMA one complete packed frame) + ULWord videoNumSegments; // Number of segments of size videoBufferSize to DMA (i.e. numLines) + ULWord videoSegmentHostPitch; // Offset (in bytes) between the beginning of one host segment and the beginning of the next host segment (i.e. host rowBytes) + ULWord videoSegmentCardPitch; // Offset (in bytes) between the beginning of one board segment and the beginning of the next board segment (i.e. board memory rowBytes) + NTV2QuarterSizeExpandMode videoQuarterSizeExpand; // Turns on the "quarter-size expand" (2x H + 2x V) hardware + //ULWord * POINTER_32 ancBuffer; // Host ANC data buffer. If NULL, none transferred. + //ULWord ancBufferSize; // Capture: before xfer: specifies max size of host ancBuffer; after xfer: actual number of ANC data bytes xferred + // Playout: specifies number of ANC data bytes to xfer from host ancBuffer to device + // If zero, none transferred. +} AUTOCIRCULATE_TRANSFER_STRUCT_32, *PAUTOCIRCULATE_TRANSFER_STRUCT_32; + + +// Structure for autocirculate peer to peer transfers. For p2p target specify kTransferFlagP2PPrepare +// for completion using kTransferFlagP2PComplete or kTransferFlagP2PTarget for completion with message transfer. +// Autocirculate will write an AUTOCIRCULATE_P2P_STRUCT to the video buffer specified to the target. Pass this +// buffer as the video buffer to the autocirculate p2p source (kTransferFlagP2PTransfer) to do the p2p transfer. +// For completion with kTransferFlagP2PComplete specify the transferFrame from the kTransferFlagP2PPrepare. +typedef struct +{ + ULWord p2pSize; // size of p2p structure + ULWord p2pflags; // p2p transfer flags + ULWord64 videoBusAddress; // frame buffer bus address + ULWord64 messageBusAddress; // message register bus address (0 if not required) + ULWord videoBusSize; // size of the video aperture (bytes) + ULWord messageData; // message data (write to message bus address to complete video transfer) +} AUTOCIRCULATE_P2P_STRUCT, *PAUTOCIRCULATE_P2P_STRUCT, CHANNEL_P2P_STRUCT, *PCHANNEL_P2P_STRUCT; + + +#define AUTOCIRCULATE_TASK_VERSION 0x00000001 +#define AUTOCIRCULATE_TASK_MAX_TASKS 128 + +/** + @brief These are the available AutoCirculate task types. +**/ +typedef enum +{ + eAutoCircTaskNone, + eAutoCircTaskRegisterWrite, // AutoCircRegisterTask + eAutoCircTaskRegisterRead, // AutoCircRegisterTask + eAutoCircTaskTimeCodeWrite, // AutoCircTimeCodeTask + eAutoCircTaskTimeCodeRead, // AutoCircTimeCodeTask + MAX_NUM_AutoCircTaskTypes +} AutoCircTaskType; + + +#define NTV2_IS_VALID_TASK_TYPE(_x_) ((_x_) > eAutoCircTaskNone && (_x_) < MAX_NUM_AutoCircTaskTypes) + +#define NTV2_IS_REGISTER_READ_TASK(_x_) ((_x_) == eAutoCircTaskRegisterRead) +#define NTV2_IS_REGISTER_WRITE_TASK(_x_) ((_x_) == eAutoCircTaskRegisterWrite) +#define NTV2_IS_REGISTER_TASK(_x_) (NTV2_IS_REGISTER_WRITE_TASK (_x_) || NTV2_IS_REGISTER_READ_TASK (_x_)) + +#define NTV2_IS_TIMECODE_READ_TASK(_x_) ((_x_) == eAutoCircTaskTimeCodeRead) +#define NTV2_IS_TIMECODE_WRITE_TASK(_x_) ((_x_) == eAutoCircTaskTimeCodeWrite) +#define NTV2_IS_TIMECODE_TASK(_x_) (NTV2_IS_TIMECODE_WRITE_TASK (_x_) || NTV2_IS_TIMECODE_READ_TASK (_x_)) + + +typedef struct +{ + ULWord regNum; + ULWord mask; + ULWord shift; + ULWord value; +} AutoCircRegisterTask; + +typedef struct +{ + RP188_STRUCT TCInOut1; + RP188_STRUCT TCInOut2; + RP188_STRUCT LTCEmbedded; + RP188_STRUCT LTCAnalog; + RP188_STRUCT LTCEmbedded2; + RP188_STRUCT LTCAnalog2; + RP188_STRUCT TCInOut3; + RP188_STRUCT TCInOut4; + RP188_STRUCT TCInOut5; + RP188_STRUCT TCInOut6; + RP188_STRUCT TCInOut7; + RP188_STRUCT TCInOut8; + RP188_STRUCT LTCEmbedded3; + RP188_STRUCT LTCEmbedded4; + RP188_STRUCT LTCEmbedded5; + RP188_STRUCT LTCEmbedded6; + RP188_STRUCT LTCEmbedded7; + RP188_STRUCT LTCEmbedded8; +} AutoCircTimeCodeTask; + +typedef struct AutoCircGenericTask +{ + AutoCircTaskType taskType; + union + { + AutoCircRegisterTask registerTask; + AutoCircTimeCodeTask timeCodeTask; + } u; + + #if !defined (NTV2_BUILDING_DRIVER) + public: + AJAExport explicit AutoCircGenericTask () {u.registerTask.regNum = u.registerTask.mask = u.registerTask.shift = u.registerTask.value = 0;} + #endif // user-space clients only +} AutoCircGenericTask; + +typedef struct +{ + ULWord taskVersion; + ULWord taskSize; + ULWord numTasks; + ULWord maxTasks; + Pointer64 taskArray; + ULWord reserved0; + ULWord reserved1; + ULWord reserved2; + ULWord reserved3; +} AUTOCIRCULATE_TASK_STRUCT_64, *PAUTOCIRCULATE_TASK_STRUCT_64; + +typedef struct +{ + ULWord taskVersion; + ULWord taskSize; + ULWord numTasks; + ULWord maxTasks; + AutoCircGenericTask* taskArray; + ULWord reserved0; + ULWord reserved1; + ULWord reserved2; + ULWord reserved3; +} AUTOCIRCULATE_TASK_STRUCT, *PAUTOCIRCULATE_TASK_STRUCT; + +typedef struct +{ + ULWord taskVersion; + ULWord taskSize; + ULWord numTasks; + ULWord maxTasks; + AutoCircGenericTask* POINTER_32 taskArray; + ULWord reserved0; + ULWord reserved1; + ULWord reserved2; + ULWord reserved3; +} AUTOCIRCULATE_TASK_STRUCT_32, *PAUTOCIRCULATE_TASK_STRUCT_32; + + +// Information about the currently programmed Xilinx .bit file +#define NTV2_BITFILE_DATETIME_STRINGLENGTH (16) +#define NTV2_BITFILE_DESIGNNAME_STRINGLENGTH (100) +#define NTV2_BITFILE_PARTNAME_STRINGLENGTH (16) +// Increment this when you change the bitfile information structure +// And be sure to update the driver so it can handle the new version. +#define NTV2_BITFILE_STRUCT_VERSION (4) + +// There is room for up to 4kbytes after the audio in the last frame, +// but a 4KB data struct overflows the stack in the ioctl routine in +// the driver under Linux. +//#define NTV2_BITFILE_RESERVED_ULWORDS (244) +//#define NTV2_BITFILE_RESERVED_ULWORDS (243) // added bitFileType +//#define NTV2_BITFILE_RESERVED_ULWORDS (239) // added designName +//#define NTV2_BITFILE_RESERVED_ULWORDS (235) // added partName +#define NTV2_BITFILE_RESERVED_ULWORDS (234) // added whichFPGA + +typedef struct { + ULWord checksum; // Platform-dependent. Deprecated on Linux. + ULWord structVersion; // Version of this structure + ULWord structSize; // Total size of this structure + + ULWord numBytes; // Xilinx bitfile bytecount + char dateStr[NTV2_BITFILE_DATETIME_STRINGLENGTH]; // Date Xilinx bitfile compiled + char timeStr[NTV2_BITFILE_DATETIME_STRINGLENGTH]; // Time Xilinx bitfile compiled + char designNameStr[NTV2_BITFILE_DESIGNNAME_STRINGLENGTH]; + + ULWord bitFileType; // NTV2BitfileType + + char partNameStr[NTV2_BITFILE_PARTNAME_STRINGLENGTH]; // Part name (v4) + NTV2XilinxFPGA whichFPGA; + + ULWord reserved[NTV2_BITFILE_RESERVED_ULWORDS]; + +} BITFILE_INFO_STRUCT,*PBITFILE_INFO_STRUCT; + + +typedef struct { + NTV2DMAEngine dmaEngine; + ULWord dmaFlags; // flags passed into DMA currently bit 1 is set for to indicate weird 4096 10bit YUV 4K frame + + Pointer64 dmaHostBuffer; // vitrual address of host buffer + ULWord dmaSize; // number of bytes to DMA + ULWord dmaCardFrameNumber; // card frame number + ULWord dmaCardFrameOffset; // offset (in bytes) into card frame to begin DMA + ULWord dmaNumberOfSegments; // number of segments of size videoBufferSize to DMA + ULWord dmaSegmentSize; // size of each segment (if videoNumSegments > 1) + ULWord dmaSegmentHostPitch; // offset (in bytes) between the beginning of one host-memory segment and the beginning of the next host-memory segment + ULWord dmaSegmentCardPitch; // offset (in bytes) between the beginning of one Kona-memory segment and the beginning of the next Kona-memory segment + + BOOL_ dmaToCard; // direction of DMA transfer + +} DMA_TRANSFER_STRUCT_64 ,*PDMA_TRANSFER_STRUCT_64; + + +// NOTE: Max bitfilestruct size was NTV2_AUDIO_READBUFFEROFFSET - NTV2_AUDIO_WRAPADDRESS +// but is now practically unlimited. + +// The following structure is used to retrieve the timestamp values of the last video +// interrupts. Use GetInterruptTimeStamps(& +typedef struct { + LWord64 lastOutputVerticalTimeStamp; + LWord64 lastInput1VerticalTimeStamp; + LWord64 lastInput2VerticalTimeStamp; +} INTERRUPT_TIMESTAMP_STRUCT,*PINTERRUPT_TIMESTAMP_STRUCT; + +// System status calls and structs associated with specific opcodes + +typedef enum +{ + SSC_GetFirmwareProgress, // return firmware progress informaiton + SSC_End // end of list +} SystemStatusCode; + +typedef enum +{ + kProgramStateEraseMainFlashBlock, + kProgramStateEraseSecondFlashBlock, + kProgramStateEraseFailSafeFlashBlock, + kProgramStateProgramFlash, + kProgramStateVerifyFlash, + kProgramStateFinished, + kProgramStateEraseBank3, + kProgramStateProgramBank3, + kProgramStateVerifyBank3, + kProgramStateEraseBank4, + kProgramStateProgramBank4, + kProgramStateVerifyBank4, + kProgramStateErasePackageInfo, + kProgramStateProgramPackageInfo, + kProgramStateVerifyPackageInfo, + kProgramStateCalculating +} ProgramState; + +typedef enum { + kProgramCommandReadID=0x9F, + kProgramCommandWriteEnable=0x06, + kProgramCommandWriteDisable=0x04, + kProgramCommandReadStatus=0x05, + kProgramCommandWriteStatus=0x01, + kProgramCommandReadFast=0x0B, + kProgramCommandPageProgram=0x02, + kProgramCommandSectorErase=0xD8, + kProgramCommandBankWrite=0x17 +} ProgramCommand; + +typedef struct { + ULWord programTotalSize; + ULWord programProgress; + ProgramState programState; +} SSC_GET_FIRMWARE_PROGRESS_STRUCT; + +// System control calls and structs associated with specific opcodes + +typedef enum +{ + SCC_Test, // just a test for now + SCC_End // end of list +} SystemControlCode; + +typedef struct { + ULWord param1; // test parameter 1 + ULWord param2; // test parameter 2 +} SCC_TEST_STRUCT; + + +// Build information +#define NTV2_BUILD_STRINGLENGTH (1024) +#define NTV2_BUILD_STRUCT_VERSION (0) + +#define NTV2_BUILD_RESERVED_BYTES (1016) + +typedef struct { + ULWord structVersion; // Version of this structure + ULWord structSize; // Total size of this structure + + char buildStr[NTV2_BUILD_STRINGLENGTH]; // User-defined build string + unsigned char reserved[NTV2_BUILD_RESERVED_BYTES]; + +} BUILD_INFO_STRUCT,*PBUILD_INFO_STRUCT; + + +#ifdef AJAMac +#pragma options align=reset +#endif + + // used to filter the vout menu display +typedef enum +{ + kUndefinedFilterFormats = 0, // Undefined + kDropFrameFormats = BIT(0), // 23.98 / 29.97 / 59.94 + kNonDropFrameFormats = BIT(1), // 24 / 30 / 60 + kEuropeanFormats = BIT(2), // 25 / 50 + k1080ProgressiveFormats = BIT(3), // 1080p 23.98/24/29.97/30 (exclude 1080psf) + kREDFormats = BIT(4), // RED's odd geometries + k2KFormats = BIT(5), // 2K formats + k4KFormats = BIT(6) // 4K formats + +} ActiveVideoOutSelect; + +// STUFF moved from ntv2macinterface.h that is now common +typedef enum DesktopFrameBuffStatus +{ + kDesktopFBIniting = 0, // waiting for Finder? Window Mgr? to discover us + kDesktopFBOff = 1, // Running - not in use + kDesktopFBOn = 2 // Running - in-use as Mac Desktop + +} DesktopFrameBuffStatus; + + +typedef enum SharedPrefsPermissions +{ + kSharedPrefsRead = 0, + kSharedPrefsReadWrite = 1 + +} SharedPrefsPermissions; + + +#if !defined(R2_DEPRECATED) + +typedef enum TimelapseUnits +{ + kTimelapseFrames = 0, // frames + kTimelapseSeconds = 1, // seconds + kTimelapseMinutes = 2, // minutes + kTimelapseHours = 3 // hours + +} TimelapseUnits; + +typedef enum +{ + kDefaultModeDesktop, // deprecated + kDefaultModeVideoIn, + kDefaultModeBlack, // deprecated + kDefaultModeHold, + kDefaultModeTestPattern, + kDefaultModeUnknown +} DefaultVideoOutMode; + +typedef enum +{ + kHDMIOutCSCAutoDetect, + kHDMIOutCSCAutoSet, + kHDMIOutCSCRGB8bit, + kHDMIOutCSCRGB10bit, + kHDMIOutCSCRGB12bit, + kHDMIOutCSCYCbCr8bit, // deprecated + kHDMIOutCSCYCbCr10bit +} HDMIOutColorSpaceMode; + +typedef enum +{ + kHDMIOutProtocolAutoDetect, + kHDMIOutProtocolAutoSet, + kHDMIOutProtocolHDMI, + kHDMIOutProtocolDVI +} HDMIOutProtocolMode; + +typedef enum +{ + kHDMIOutStereoOff, + kHDMIOutStereoAuto, + kHDMIOutStereoSideBySide, + kHDMIOutStereoTopBottom, + kHDMIOutStereoFramePacked + +} HDMIOutStereoSelect; + +enum TestPatternFormat +{ + kPatternFormatAuto, + kPatternFormatYUV10b, + kPatternFormatRGB10b, + kPatternFormatYUV8b, + kPatternFormatRGB8b, + kPatternFormatRGB12b +}; + +// deprecated - NTV2TestPatternSelect +// note: this order mimics (somewhat) that of NTV2TestPatternSelect in "ntv2testpatterngen.h" +typedef enum +{ + kTestPatternColorBar100, // 100% Bars + kTestPatternColorBar75, // 75% Bars + kTestPatternRamp, // Ramp + kTestPatternMultiburst, // Mulitburst + kTestPatternLinesweep, // Line Sweep + kTestPatternPathological, // Pathological + kTestPatternFlatField, // Flat Field (50%) + kTestPatternMultiPattern, // a swath of everything + kTestPatternBlack, // Black + kTestPatternBorder, // Border + kTestPatternCustom // Custom ("Load File...") + +} TestPatternSelect; + + +#endif //R2_DEPRECATED + + + +typedef enum +{ + kRP188SourceEmbeddedLTC = 0x0, // NOTE these values are same as RP188 DBB channel select + kRP188SourceEmbeddedVITC1 = 0x1, + kRP188SourceEmbeddedVITC2 = 0x2, + kRP188SourceLTCPort = 0xFE +} RP188SourceFilterSelect; + +#if !defined(NTV2_DEPRECATE_15_2) + typedef RP188SourceFilterSelect RP188SourceSelect; +#endif // !defined(NTV2_DEPRECATE_15_2) + + +// Masks +enum +{ + // kRegUserState1 + kMaskInputFormatSelect = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7), + kMaskPrimaryFormatSelect = BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + kMaskSecondaryFormatSelect = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23), + kMaskAnalogInBlackLevel = BIT(24), + kMaskAnalogInputType = BIT(28) + BIT(29) + BIT(30) + BIT(31), + + //kRegIoHDGlobalStatus + kMaskStandBusyStatus = BIT(2), + + // kRegIoHDGlobalControl + kMaskStandAloneMode = BIT(0) + BIT(1) + BIT(2), + kMaskDisplayMode = BIT(4) + BIT(5) + BIT(6) + BIT(7), + kMaskDisplayModeTCType = BIT(8) + BIT(9) + BIT(10) + BIT(11), // TimecodeFormat - when set to zero, Timecode type follows primary format + + // kVRegStartupStatusFlags + kMaskStartComplete = BIT(0), + kMaskDesktopDisplayReady = BIT(1), + kMaskDaemonInitialized = BIT(2) +}; + +// isoch streams (channels) +enum DriverStartPhase +{ + kStartPhase1 = 1, // These start out at 1 because they become a bit setting + kStartPhase2 = 2 +}; + +typedef enum +{ + kPrimarySecondaryDisplayMode, + kPrimaryTimecodeDisplayMode +} IoHDDisplayMode; + +#define KONA_DEBUGFILTER_STRINGLENGTH 128 +typedef struct +{ + char includeString[KONA_DEBUGFILTER_STRINGLENGTH]; + char excludeString[KONA_DEBUGFILTER_STRINGLENGTH]; +} KonaDebugFilterStringInfo; + + +#if !defined(NTV2_DEPRECATE_15_6) + typedef struct + { + NTV2RelayState manualControl12; + NTV2RelayState manualControl34; + NTV2RelayState relayPosition12; + NTV2RelayState relayPosition34; + NTV2RelayState watchdogStatus; + bool watchdogEnable12; + bool watchdogEnable34; + ULWord watchdogTimeout; + } NTV2SDIWatchdogState; +#endif // !defined(NTV2_DEPRECATE_15_6) + +typedef enum +{ + maskEnableHancY = BIT(0), + shiftEnableHancY = 0, + maskEnableVancY = BIT(4), + shiftEnableVancY = 4, + maskEnableHancC = BIT(8), + shiftEnableHancC = 8, + maskEnableVancC = BIT(12), + shiftEnableVancC = 12, + maskSetProgressive = BIT(16), + shiftSetProgressive = 16, + maskSyncro = BIT(24) + BIT(25), + shiftSyncro = 24, + maskDisableExtractor = BIT(28), + shiftDisableExtractor = 28, + maskEnableSDMux = BIT(30), + shiftEnableSDMux = 30, + maskGrabLSBs = BIT(31), + shiftGrabLSBs = 31, + maskField1CutoffLine = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10), + shiftField1CutoffLine = 0, + maskField2CutoffLine = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26), + shiftField2CutoffLine = 16, + maskTotalBytesIn = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15) + + BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23), + shiftTotalBytesIn = 0, + maskTotalOverrun = BIT(28), + shiftTotalOverrun = 28, + maskField1BytesIn = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15) + + BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23), + shiftField1BytesIn = 0, + maskField1Overrun = BIT(28), + shiftField1Overrun = 28, + maskField2BytesIn = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15) + + BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23), + shiftField2BytesIn = 0, + maskField2Overrun = BIT(28), + shiftField2Overrun = 28, + maskField1StartLine = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10), + shiftField1StartLine = 0, + maskField2StartLine = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26), + shiftField2StartLine = 16, + maskTotalFrameLines = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10), + shiftTotalFrameLines = 0, + maskFIDHi = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10), + shiftFIDHi = 0, + maskFIDLow = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26), + shiftFIDLow = 16, + maskPktIgnore_1_5_9_13_17 = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7), + shiftPktIgnore_1_5_9_13_17 = 0, + maskPktIgnore_2_6_10_14_18 = BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + shiftPktIgnore_2_6_10_14_18 = 8, + maskPktIgnore_3_7_11_15_19 = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23), + shiftPktIgnore_3_7_11_15_19 = 16, + maskPktIgnore_4_8_12_16_20 = BIT(24) + BIT(25) + BIT(26) + BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + shiftPktIgnore_4_8_12_16_20 = 24, + maskField1AnalogStartLine = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10), + shiftField1AnalogStartLine = 0, + maskField2AnalogStartLine = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26), + shiftField2AnalogStartLine = 16 +} ANCExtMaskShift; + +typedef enum +{ + regAncExt_FIRST, + regAncExtControl = regAncExt_FIRST, // Reg 0 - Control register + regAncExtField1StartAddress, // Reg 1 - f1_start_address[31:0] + regAncExtField1EndAddress, // Reg 2 - f1_end_address[31:0] + regAncExtField2StartAddress, // Reg 3 - f2_start_addr[31:0] + regAncExtField2EndAddress, // Reg 4 - f2_end_address[31:0] + regAncExtFieldCutoffLine, // Reg 5 - f2_cutoff_line[10:0], f1_cutoff_line[10:0] + regAncExtTotalStatus, // Reg 6 - mem_sz_overrun, total_bytes[15:0] + regAncExtField1Status, // Reg 7 - mem_sz_overrun_f1, total_bytes_f1[15:0] + regAncExtField2Status, // Reg 8 - mem_sz_overrun_f2, total_bytes_f2[15:0] + regAncExtFieldVBLStartLine, // Reg 9 - f2_vbl_start[10:0], f1_vbl_start[10:0] + regAncExtTotalFrameLines, // Reg 10 - total_lines[10:0] + regAncExtFID, // Reg 11 - fid_low[10:0], fid_hi[10:0] + regAncExtIgnorePacketReg_1_2_3_4, // Reg 12 - Packet Ignore bytes + regAncExtIgnorePktsReg_First = regAncExtIgnorePacketReg_1_2_3_4, + regAncExtIgnorePacketReg_5_6_7_8, // Reg 13 - Packet Ignore bytes + regAncExtIgnorePacketReg_9_10_11_12, // Reg 14 - Packet Ignore bytes + regAncExtIgnorePacketReg_13_14_15_16, // Reg 15 - Packet Ignore bytes + regAncExtIgnorePacketReg_17_18_19_20, // Reg 16 - Packet Ignore bytes + regAncExtIgnorePktsReg_Last = regAncExtIgnorePacketReg_17_18_19_20, + regAncExtAnalogStartLine, // Reg 17 - analog_start_line[10:0] + regAncExtField1AnalogYFilter, // Reg 18 - analog_line_y_f1[31:0] - one bit per F1 line past analog_start_line, 1=captureAnalogY, 0=normal + regAncExtField2AnalogYFilter, // Reg 19 - analog_line_y_f2[31:0] - one bit per F2 line past analog_start_line, 1=captureAnalogY, 0=normal + regAncExtField1AnalogCFilter, // Reg 20 - analog_line_c_f1[31:0] - one bit per F1 line past analog_start_line, 1=captureAnalogC, 0=normal + regAncExtField2AnalogCFilter, // Reg 21 - analog_line_c_f2[31:0] - one bit per F2 line past analog_start_line, 1=captureAnalogC, 0=normal + regAncExtTwoFrameCadenceDetect, // Reg 22 - not used in NTV2 + regAncExtRP188Type, // Reg 23 - not used in NTV2 + regAncExtTimecodeStatus0_31, // Reg 24 - not used in NTV2 + regAncExtTimecodeStatus32_63, // Reg 25 - not used in NTV2 + regAncExtTimecodeStatusDBB, // Reg 26 - not used in NTV2 + regAncExtAnalogActiveLineLength, // Reg 27 - analog active line length + regAncExt_LAST +} ANCExtRegisters; + +typedef enum +{ + regAncIns_FIRST, + regAncInsFieldBytes = regAncIns_FIRST, + regAncInsControl, + regAncInsField1StartAddr, + regAncInsField2StartAddr, + regAncInsPixelDelay, + regAncInsActiveStart, + regAncInsLinePixels, + regAncInsFrameLines, + regAncInsFieldIDLines, + regAncInsPayloadIDControl, + regAncInsPayloadID, + regAncInsBlankCStartLine, + regAncInsBlankField1CLines, + regAncInsBlankField2CLines, + regAncInsFieldBytesHigh, + regAncInsReserved15, + regAncInsRtpPayloadID, + regAncInsRtpSSRC, + regAncInsIpChannel, + regAncIns_LAST +} ANCInsRegisters; + +typedef enum +{ + maskInsField1Bytes = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10) + BIT(11) + BIT(12) + BIT(13) + BIT(14) + BIT(15), + shiftInsField1Bytes = 0, + maskInsField2Bytes = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + +BIT(27) + BIT(28) + BIT(29) + BIT(30) + BIT(31), + shiftInsField2Bytes = 16, + maskInsEnableHancY = BIT(0), + shiftInsEnableHancY = 0, + maskInsEnableVancY = BIT(4), + shiftInsEnableVancY = 4, + maskInsEnableHancC = BIT(8), + shiftInsEnableHancC = 8, + maskInsEnableVancC = BIT(12), + shiftInsEnableVancC = 12, + maskInsSetProgressive = BIT(24), + shiftInsSetProgressive = 24, + maskInsDisableInserter = BIT(28), + shiftInsDisableInserter = 28, + maskInsExtendedMode = BIT(29), + shiftInsExtendedMode = 29, + maskInsEnablePktSplitSD = BIT(31), + shiftInsEnablePktSplitSD = 31, + maskInsHancDelay = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9), + shiftINsHancDelay = 0, + maskInsVancDelay = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26), + shiftInsVancDelay = 16, + maskInsField1FirstActive = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10), + shiftInsField1FirstActive = 0, + maskInsField2FirstActive = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26), + shiftInsField2FirstActive = 16, + maskInsActivePixelsInLine = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10), + shiftInsActivePixelsInLine = 0, + maskInsTotalPixelsInLine = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26) + BIT(27), + shiftInsTotalPixelsInLine = 16, + maskInsTotalLinesPerFrame = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10), + shiftInsTotalLinesPerFrame = 0, + maskInsFieldIDHigh = BIT(0) + BIT(1) + BIT(2) + BIT(3) + BIT(4) + BIT(5) + BIT(6) + BIT(7) + BIT(8) + BIT(9) + BIT(10), + shiftInsFieldIDHigh = 0, + maskInsFieldIDLow = BIT(16) + BIT(17) + BIT(18) + BIT(19) + BIT(20) + BIT(21) + BIT(22) + BIT(23) + BIT(24) + BIT(25) + BIT(26), + shiftInsFieldIDLow = 16 + +} ANCInsMaskShift; + + +// Driver Version ULWord encode/decode macros +// Introduced in SDK 15.0 +// Common ULWord format on all platforms: +// +// 3 2 1 +// 10987654321098765432109876543210 +// TTXMMMMMMMmmmmmmPPPPPPbbbbbbbbbb +// +// MMMMMMM: [28:22] major version number (7 bits, 0-127) +// mmmmmm: [21:16] minor version number (6 bits, 0-63) +// PPPPPP: [15:10] point release number (6 bits, 0-63) +// bbbbbbbbbb: [9:0] build number (10 bits, 0-1023) +// TT: [31:30] build type (0=release, 1=beta, 2=alpha, 3=dev) +#if defined(__CPLUSPLUS__) || defined(__cplusplus) + #define NTV2DriverVersionEncode(__maj__, __min__, __pt__, __bld__) ((ULWord(__maj__) & 0x0000007F) << 22) \ + | ((ULWord(__min__) & 0x0000003F) << 16) \ + | ((ULWord(__pt__ ) & 0x0000003F) << 10) \ + | ((ULWord(__bld__) & 0x000003FF) << 0) + #define NTV2DriverVersionDecode_Major(__vers__) ((ULWord(__vers__) >> 22) & 0x0000007F) + #define NTV2DriverVersionDecode_Minor(__vers__) ((ULWord(__vers__) >> 16) & 0x0000003F) + #define NTV2DriverVersionDecode_Point(__vers__) ((ULWord(__vers__) >> 10) & 0x0000003F) + #define NTV2DriverVersionDecode_Build(__vers__) ((ULWord(__vers__) >> 0) & 0x000003FF) +#else + #define NTV2DriverVersionEncode(__maj__, __min__, __pt__, __bld__) (((ULWord)(__maj__) & 0x0000007F) << 22) \ + | (((ULWord)(__min__) & 0x0000003F) << 16) \ + | (((ULWord)(__pt__ ) & 0x0000003F) << 10) \ + | (((ULWord)(__bld__) & 0x000003FF) << 0) + #define NTV2DriverVersionDecode_Major(__vers__) (((ULWord)(__vers__) >> 22) & 0x0000007F) + #define NTV2DriverVersionDecode_Minor(__vers__) (((ULWord)(__vers__) >> 16) & 0x0000003F) + #define NTV2DriverVersionDecode_Point(__vers__) (((ULWord)(__vers__) >> 10) & 0x0000003F) + #define NTV2DriverVersionDecode_Build(__vers__) (((ULWord)(__vers__) >> 0) & 0x000003FF) +#endif +#define NTV2DriverVersionBuildTypeToOrdinal(__ch__) ((__ch__) == 'd' ? 3UL : ((__ch__) == 'a' ? 2UL : ((__ch__) == 'b' ? 1UL : 0UL))) +#define NTV2DriverVersionEncodedBuildType (NTV2DriverVersionBuildTypeToOrdinal(AJA_NTV2_SDK_BUILD_TYPE[0]) << 30) + +// Pack/Unpack SDK version in & out of ULWord: +#define NTV2SDKVersionEncode NTV2DriverVersionEncode +#define NTV2SDKVersionDecode_Major NTV2DriverVersionDecode_Major +#define NTV2SDKVersionDecode_Minor NTV2DriverVersionDecode_Minor +#define NTV2SDKVersionDecode_Point NTV2DriverVersionDecode_Point +#define NTV2SDKVersionDecode_Build NTV2DriverVersionDecode_Build + + +////////////////////////////////////////////////////////////////////////////////////////////// BEGIN NEW AUTOCIRCULATE API + + #if AJATargetBigEndian + #if defined(__CPLUSPLUS__) || defined(__cplusplus) + #define NTV2_4CC(_str_) ( (uint32_t((UByte*(_str_))[0]) << 0) | \ + (uint32_t((UByte*(_str_))[1]) << 8) | \ + (uint32_t((UByte*(_str_))[2]) << 16) | \ + (uint32_t((UByte*(_str_))[3]) << 24)) + + #define NTV2_FOURCC(_a_,_b_,_c_,_d_) ( ((uint32_t(_a_)) << 0) | \ + ((uint32_t(_b_)) << 8) | \ + ((uint32_t(_c_)) << 16) | \ + ((uint32_t(_d_)) << 24)) + #if !defined (NTV2_BUILDING_DRIVER) + #define NTV2_4CC_AS_STRING(_x_) std::string (1, ((_x_) & 0x000000FF) >> 0) + \ + std::string (1, ((_x_) & 0x0000FF00) >> 8) + \ + std::string (1, ((_x_) & 0x00FF0000) >> 16) + \ + std::string (1, ((_x_) & 0xFF000000) >> 24) + #endif // !defined (NTV2_BUILDING_DRIVER) + #else + #define NTV2_4CC(_str_) ( ((uint32_t)(((UByte *)(_str_))[0]) << 0) | \ + ((uint32_t)(((UByte *)(_str_))[1]) << 8) | \ + ((uint32_t)(((UByte *)(_str_))[2]) << 16) | \ + ((uint32_t)(((UByte *)(_str_))[3]) << 24)) + + #define NTV2_FOURCC(_a_,_b_,_c_,_d_) ( (((uint32_t)(_a_)) << 0) | \ + (((uint32_t)(_b_)) << 8) | \ + (((uint32_t)(_c_)) << 16) | \ + (((uint32_t)(_d_)) << 24)) + #endif // C + #else + #if defined(__CPLUSPLUS__) || defined(__cplusplus) + #define NTV2_4CC(_str_) ( (uint32_t((UByte*(_str_))[3]) << 0) | \ + (uint32_t((UByte*(_str_))[2]) << 8) | \ + (uint32_t((UByte*(_str_))[1]) << 16) | \ + (uint32_t((UByte*(_str_))[0]) << 24)) + + #define NTV2_FOURCC(_a_,_b_,_c_,_d_) ( ((uint32_t(_a_)) << 24) | \ + ((uint32_t(_b_)) << 16) | \ + ((uint32_t(_c_)) << 8) | \ + ((uint32_t(_d_)) << 0) ) + #if !defined (NTV2_BUILDING_DRIVER) + #define NTV2_4CC_AS_STRING(_x_) std::string(1, char((uint32_t(_x_) & 0xFF000000) >> 24)) + \ + std::string(1, char((uint32_t(_x_) & 0x00FF0000) >> 16)) + \ + std::string(1, char((uint32_t(_x_) & 0x0000FF00) >> 8)) + \ + std::string(1, char((uint32_t(_x_) & 0x000000FF) >> 0)) + #endif // !defined (NTV2_BUILDING_DRIVER) + #else + #define NTV2_4CC(_str_) ( ((uint32_t)(((UByte *)(_str_))[3]) << 0) | \ + ((uint32_t)(((UByte *)(_str_))[2]) << 8) | \ + ((uint32_t)(((UByte *)(_str_))[1]) << 16) | \ + ((uint32_t)(((UByte *)(_str_))[0]) << 24)) + + #define NTV2_FOURCC(_a_,_b_,_c_,_d_) ( (((uint32_t)(_a_)) << 24) | \ + (((uint32_t)(_b_)) << 16) | \ + (((uint32_t)(_c_)) << 8) | \ + (((uint32_t)(_d_)) << 0) ) + #endif // C + #endif // else Little-Endian + + + /** + @brief 32-bit host addresses go into the upper 4 bytes of the ULWord64, while the lower 4 bytes contain 0xBAADF00D. + 64-bit host addresses consume the entire ULWord64. + **/ + #define NTV2_POINTER_TO_ULWORD64(__p__) ((sizeof (int *) == 4) ? (ULWord64 (ULWord64 (__p__) << 32) | 0x00000000BAADF00D) : ULWord64 (__p__)) + + #define NTV2_CURRENT_HEADER_VERSION 0 ///< @brief Current version of NTV2_HEADER struct, originally 0 + #define NTV2_CURRENT_TRAILER_VERSION 0 ///< @brief Current version of NTV2_TRAILER struct, originally 0 + + #define AUTOCIRCULATE_STRUCT_VERSION 0 ///< @brief Version number of AutoCirculate structures, originally 0 + + #define NTV2_HEADER_TAG NTV2_FOURCC ('N', 'T', 'V', '2') ///< @brief Identifies the struct header + #define NTV2_TRAILER_TAG NTV2_FOURCC ('n', 't', 'v', '2') ///< @brief Identifies the struct trailer + + #define NTV2_IS_VALID_HEADER_TAG(_x_) ((_x_) == NTV2_HEADER_TAG) + #define NTV2_IS_VALID_TRAILER_TAG(_x_) ((_x_) == NTV2_TRAILER_TAG) + + #define NTV2_TYPE_VIRTUAL_DATA_RW NTV2_FOURCC ('v', 'd', 'a', 't') ///< @brief Identifies NTV2VirtualData struct + #define NTV2_TYPE_BANKGETSET NTV2_FOURCC ('b', 'n', 'k', 'S') ///< @brief Identifies NTV2BankSelGetSetRegs struct + #define AUTOCIRCULATE_TYPE_STATUS NTV2_FOURCC ('s', 't', 'a', 't') ///< @brief Identifies AUTOCIRCULATE_STATUS struct + #define AUTOCIRCULATE_TYPE_XFER NTV2_FOURCC ('x', 'f', 'e', 'r') ///< @brief Identifies AUTOCIRCULATE_TRANSFER struct + #define AUTOCIRCULATE_TYPE_XFERSTATUS NTV2_FOURCC ('x', 'f', 's', 't') ///< @brief Identifies AUTOCIRCULATE_TRANSFER_STATUS struct + #define AUTOCIRCULATE_TYPE_TASK NTV2_FOURCC ('t', 'a', 's', 'k') ///< @brief Identifies AUTOCIRCULATE_TASK struct + #define AUTOCIRCULATE_TYPE_FRAMESTAMP NTV2_FOURCC ('s', 't', 'm', 'p') ///< @brief Identifies FRAME_STAMP struct + #define AUTOCIRCULATE_TYPE_GETREGS NTV2_FOURCC ('r', 'e', 'g', 'R') ///< @brief Identifies NTV2GetRegisters struct + #define AUTOCIRCULATE_TYPE_SETREGS NTV2_FOURCC ('r', 'e', 'g', 'W') ///< @brief Identifies NTV2SetRegisters struct + #define AUTOCIRCULATE_TYPE_SDISTATS NTV2_FOURCC ('s', 'd', 'i', 'S') ///< @brief Identifies NTV2SDIStatus struct + #define NTV2_TYPE_AJADEBUGLOGGING NTV2_FOURCC ('d', 'b', 'l', 'g') ///< @brief Identifies NTV2DebugLogging struct + #define NTV2_TYPE_AJABUFFERLOCK NTV2_FOURCC ('b', 'f', 'l', 'k') ///< @brief Identifies NTV2BufferLock struct + #define NTV2_TYPE_AJABITSTREAM NTV2_FOURCC ('b', 't', 's', 't') ///< @brief Identifies NTV2Bitstream struct + + #define NTV2_IS_VALID_STRUCT_TYPE(_x_) ( (_x_) == AUTOCIRCULATE_TYPE_STATUS || \ + (_x_) == AUTOCIRCULATE_TYPE_XFER || \ + (_x_) == AUTOCIRCULATE_TYPE_XFERSTATUS || \ + (_x_) == AUTOCIRCULATE_TYPE_TASK || \ + (_x_) == AUTOCIRCULATE_TYPE_FRAMESTAMP || \ + (_x_) == AUTOCIRCULATE_TYPE_GETREGS || \ + (_x_) == AUTOCIRCULATE_TYPE_SETREGS || \ + (_x_) == AUTOCIRCULATE_TYPE_SDISTATS || \ + (_x_) == NTV2_TYPE_BANKGETSET || \ + (_x_) == NTV2_TYPE_VIRTUAL_DATA_RW || \ + (_x_) == NTV2_TYPE_AJADEBUGLOGGING || \ + (_x_) == NTV2_TYPE_AJABUFFERLOCK || \ + (_x_) == NTV2_TYPE_AJABITSTREAM ) + + + // NTV2_POINTER FLAGS + #define NTV2_POINTER_ALLOCATED BIT(0) ///< @brief Allocated using Allocate function? + #define NTV2_POINTER_PAGE_ALIGNED BIT(1) ///< @brief Allocated page-aligned? + + + // AUTOCIRCULATE OPTION FLAGS + #define AUTOCIRCULATE_WITH_RP188 BIT(0) ///< @brief Use this to AutoCirculate with RP188 + #define AUTOCIRCULATE_WITH_LTC BIT(1) ///< @brief Use this to AutoCirculate with analog LTC + #define AUTOCIRCULATE_WITH_FBFCHANGE BIT(2) ///< @brief Use this to AutoCirculate with the possibility of frame buffer format changes + #define AUTOCIRCULATE_WITH_FBOCHANGE BIT(3) ///< @brief Use this to AutoCirculate with the possibility of frame buffer orientation changes + #define AUTOCIRCULATE_WITH_COLORCORRECT BIT(4) ///< @brief Use this to AutoCirculate with color correction + #define AUTOCIRCULATE_WITH_VIDPROC BIT(5) ///< @brief Use this to AutoCirculate with video processing + #define AUTOCIRCULATE_WITH_ANC BIT(6) ///< @brief Use this to AutoCirculate with ancillary data + #define AUTOCIRCULATE_WITH_AUDIO_CONTROL BIT(7) ///< @brief Use this to AutoCirculate with no audio but with audio control + #define AUTOCIRCULATE_WITH_FIELDS BIT(8) ///< @brief Use this to AutoCirculate with fields as frames for interlaced formats + #define AUTOCIRCULATE_WITH_HDMIAUX BIT(9) ///< @brief Use this to AutoCirculate with HDMI auxiliary data + #define AUTOCIRCULATE_WITH_MULTILINK_AUDIO1 BIT(10) ///< @brief Use this to AutoCirculate with base audiosystem controlling base AudioSystem + 1 + #define AUTOCIRCULATE_WITH_MULTILINK_AUDIO2 BIT(11) ///< @brief Use this to AutoCirculate with base audiosystem controlling base AudioSystem + 2 + #define AUTOCIRCULATE_WITH_MULTILINK_AUDIO3 BIT(12) ///< @brief Use this to AutoCirculate with base audiosystem controlling base AudioSystem + 3 + + #define AUTOCIRCULATE_FRAME_FULL BIT(20) ///< @brief Frame contains a full image + #define AUTOCIRCULATE_FRAME_FIELD0 BIT(21) ///< @brief Frame contains field 0 of an interlaced image (first field in time) + #define AUTOCIRCULATE_FRAME_FIELD1 BIT(22) ///< @brief Frame contains field 1 of an interlaced image (second field in time) + + #define AUTOCIRCULATE_P2P_PREPARE BIT(28) ///< @brief prepare p2p target for synchronous transfer (no message) + #define AUTOCIRCULATE_P2P_COMPLETE BIT(29) ///< @brief complete synchronous p2p transfer + #define AUTOCIRCULATE_P2P_TARGET BIT(30) ///< @brief prepare p2p target for asynchronous transfer (with message) + #define AUTOCIRCULATE_P2P_TRANSFER BIT(31) ///< @brief transfer to p2p sync or async target + + #define DMABUFFERLOCK_LOCK BIT(0) ///< @brief Used in ::NTV2BufferLock to page lock a buffer. + #define DMABUFFERLOCK_UNLOCK_ALL BIT(1) ///< @brief Used in ::NTV2BufferLock to unlock all locked buffers. + #define DMABUFFERLOCK_MAP BIT(2) ///< @brief Used in ::NTV2BufferLock to IO map a buffer. + #define DMABUFFERLOCK_UNLOCK BIT(3) ///< @brief Used in ::NTV2BufferLock to unlock a buffer. + #define DMABUFFERLOCK_AUTO BIT(4) ///< @brief Used in ::NTV2BufferLock to auto page lock buffers. + #define DMABUFFERLOCK_MANUAL BIT(5) ///< @brief Used in ::NTV2BufferLock to manual page lock buffers. + #define DMABUFFERLOCK_MAX_SIZE BIT(6) ///< @brief Used in ::NTV2BufferLock to set max locked size. + #define DMABUFFERLOCK_RDMA BIT(7) ///< @brief Used in ::NTV2BufferLock to page lock a rdma buffer + + // Bitstream flags + #define BITSTREAM_WRITE BIT(0) ///< @brief Used in ::NTV2Bitstream to write a bitstream + #define BITSTREAM_FRAGMENT BIT(1) ///< @brief Used in ::NTV2Bitstream to indicate bitstream is a fragment + #define BITSTREAM_SWAP BIT(2) ///< @brief Used in ::NTV2Bitstream to byte swap bitstream data + #define BITSTREAM_RESET_CONFIG BIT(3) ///< @brief Used in ::NTV2Bitstream to reset config + #define BITSTREAM_RESET_MODULE BIT(4) ///< @brief Used in ::NTV2Bitstream to reset module + #define BITSTREAM_READ_REGISTERS BIT(5) ///< @brief Used in ::NTV2Bitstream to get status registers + + // Bitstream registers + #define BITSTREAM_EXT_CAP 0 ///< @brief Extended capability register + #define BITSTREAM_VENDOR_HEADER 1 ///< @brief Vendor-specific register + #define BITSTREAM_JTAG_ID 2 ///< @brief JTAG ID register + #define BITSTREAM_VERSION 3 ///< @brief Bitstream version register + #define BITSTREAM_MCAP_STATUS 4 ///< @brief MCAP status register + #define BITSTREAM_MCAP_CONTROL 5 ///< @brief MCAP control register + #define BITSTREAM_MCAP_DATA 6 ///< @brief MCAP data register + #define BITSTREAM_NUM_REGISTERS 7 ///< @brief Number of MCAP registes + + #if !defined (NTV2_BUILDING_DRIVER) + /** + Convenience macros that delimit the new structs. + For driver builds, the structs are simply structs. + For client builds, the structs are classes with the appropriate __declspec(dllexport) or __declspec(dllimport) decorations. + **/ + #define NTV2_STRUCT_BEGIN(__struct_name__) class AJAExport __struct_name__ {public: + #define NTV2_STRUCT_END(__struct_name__) }; + #define NTV2_BEGIN_PRIVATE private: + #define NTV2_END_PRIVATE public: + + #if defined (_DEBUG) + #define NTV2_IS_STRUCT_VALID_IMPL(__hr__,__tr__) bool NTV2_IS_STRUCT_VALID (void) const {return __hr__.IsValid() && __tr__.IsValid();} + #define NTV2_ASSERT_STRUCT_VALID do {NTV2_ASSERT (NTV2_IS_STRUCT_VALID ());} while (false) + #else + #define NTV2_IS_STRUCT_VALID_IMPL(__hr__,__tr__) + #define NTV2_ASSERT_STRUCT_VALID + #endif + + // Convenience macros for compactly formatting ostream output... + #define Hex(__x__) std::hex << (__x__) << std::dec + #define xHex(__x__) "0x" << Hex(__x__) + #define HexN(__x__,__n__) std::hex << std::setw(int(__n__)) << (__x__) << std::dec + #define xHexN(__x__,__n__) "0x" << HexN((__x__),(__n__)) + #define Hex0N(__x__,__n__) std::hex << std::setw(int(__n__)) << std::setfill('0') << (__x__) << std::dec << std::setfill(' ') + #define xHex0N(__x__,__n__) "0x" << Hex0N((__x__),(__n__)) + #define HEX(__x__) std::hex << std::uppercase << (__x__) << std::dec << std::nouppercase + #define xHEX(__x__) "0x" << HEX(__x__) + #define HEXN(__x__,__n__) std::hex << std::uppercase << std::setw(int(__n__)) << (__x__) << std::dec << std::nouppercase + #define xHEXN(__x__,__n__) "0x" << HEXN((__x__),(__n__)) + #define HEX0N(__x__,__n__) std::hex << std::uppercase << std::setw(int(__n__)) << std::setfill('0') << (__x__) << std::dec << std::setfill(' ') << std::nouppercase + #define xHEX0N(__x__,__n__) "0x" << HEX0N((__x__),(__n__)) + #define DEC(__x__) std::dec << std::right << (__x__) + #define DECN(__x__,__n__) std::dec << std::setw(int(__n__)) << std::right << (__x__) + #define DEC0N(__x__,__n__) std::dec << std::setw(int(__n__)) << std::setfill('0') << std::right << (__x__) << std::dec << std::setfill(' ') + #define OCT(__x__) std::oct << (__x__) << std::dec + #define OCT0N(__x__,__n__) std::oct << std::setw(int(__n__)) << std::setfill('0') << (__x__) << std::dec << std::setfill(' ') + #define oOCT(__x__) "o" << std::oct << (__x__) << std::dec + #define oOCT0N(__x__,__n__) "o" << std::oct << std::setw(int(__n__)) << std::setfill('0') << (__x__) << std::dec << std::setfill(' ') + #define BIN064(__x__) std::bitset<8>((uint64_t(__x__)&0xFF00000000000000)>>56) << "." \ + << std::bitset<8>((uint64_t(__x__)&0x00FF000000000000)>>48) << "." \ + << std::bitset<8>((uint64_t(__x__)&0x0000FF0000000000)>>40) << "." \ + << std::bitset<8>((uint64_t(__x__)&0x000000FF00000000)>>32) << "." \ + << std::bitset<8>((uint64_t(__x__)&0x00000000FF000000)>>24) << "." \ + << std::bitset<8>((uint64_t(__x__)&0x0000000000FF0000)>>16) << "." \ + << std::bitset<8>((uint64_t(__x__)&0x000000000000FF00)>>8) << "." \ + << std::bitset<8>( uint64_t(__x__)&0x00000000000000FF) + #define BIN032(__x__) std::bitset<8>((uint32_t(__x__)&0xFF000000)>>24) << "." \ + << std::bitset<8>((uint32_t(__x__)&0x00FF0000)>>16) << "." \ + << std::bitset<8>((uint32_t(__x__)&0x0000FF00)>>8) << "." \ + << std::bitset<8>( uint32_t(__x__)&0x000000FF) + #define BIN016(__x__) std::bitset<8>((uint16_t(__x__)&0xFF00)>>8) << "." \ + << std::bitset<8>( uint16_t(__x__)&0x00FF) + #define BIN012(__x__) std::bitset<12>((uint16_t(__x__)&0x0FFF)) + #define BIN010(__x__) std::bitset<10>((uint16_t(__x__)&0x03FF)) + #define BIN08(__x__) std::bitset<8>(uint8_t(__x__)) + #define BIN04(__x__) std::bitset<4>(uint8_t(__x__)) + #define BIN0N(__x__,__n__) std::bitset<__n__>(uint8_t(__x__)) + #define bBIN064(__x__) "b" << BIN064(__x__) + #define bBIN032(__x__) "b" << BIN032(__x__) + #define bBIN016(__x__) "b" << BIN016(__x__) + #define bBIN012(__x__) "b" << BIN012(__x__) + #define bBIN010(__x__) "b" << BIN010(__x__) + #define bBIN08(__x__) "b" << BIN08(__x__) + #define bBIN04(__x__) "b" << BIN04(__x__) + #define bBIN0N(__x__,__n__) "b" << BIN0N(__x__,__n__) + #define fDEC(__x__,__w__,__p__) std::dec << std::fixed << std::setw(__w__) << std::setprecision(__p__) << (__x__) + #else + #define NTV2_STRUCT_BEGIN(__struct_name__) typedef struct __struct_name__ { + #define NTV2_STRUCT_END(__struct_name__) } __struct_name__; + #define NTV2_BEGIN_PRIVATE + #define NTV2_END_PRIVATE + #define NTV2_IS_STRUCT_VALID_IMPL(__hr__,__tr__) + #define NTV2_ASSERT_STRUCT_VALID + #endif + + #if !defined (NTV2_BUILDING_DRIVER) + typedef std::vector UByteSequence; ///< @brief An ordered sequence of UByte (uint8_t) values. + typedef UByteSequence::const_iterator UByteSequenceConstIter; ///< @brief A handy const iterator for iterating over a UByteSequence. + typedef UByteSequence::iterator UByteSequenceIter; ///< @brief A handy non-const iterator for iterating over a UByteSequence. + + typedef std::vector UWordSequence; ///< @brief An ordered sequence of UWord (uint16_t) values. + typedef UWordSequence::const_iterator UWordSequenceConstIter; ///< @brief A handy const iterator for iterating over a UWordSequence. + typedef UWordSequence::iterator UWordSequenceIter; ///< @brief A handy non-const iterator for iterating over a UWordSequence. + + typedef std::vector ULWordSequence; ///< @brief An ordered sequence of ULWord (uint32_t) values. + typedef ULWordSequence::const_iterator ULWordSequenceConstIter; ///< @brief A handy const iterator for iterating over a ULWordSequence. + typedef ULWordSequence::iterator ULWordSequenceIter; ///< @brief A handy non-const iterator for iterating over a ULWordSequence. + + typedef std::vector ULWord64Sequence; ///< @brief An ordered sequence of ULWord64 (uint64_t) values. + typedef ULWord64Sequence::const_iterator ULWord64SequenceConstIter; ///< @brief A handy const iterator for iterating over a ULWord64Sequence. + typedef ULWord64Sequence::iterator ULWord64SequenceIter; ///< @brief A handy non-const iterator for iterating over a ULWord64Sequence. + #endif // NTV2_BUILDING_DRIVER + + + #if defined (AJAMac) + #pragma pack (push, 4) + #endif // defined (AJAMac) + + + #if !defined (NTV2_BUILDING_DRIVER) + /** + @brief Describes a segmented data transfer (copy or move) from a source memory location to a destination location, + with independent pitch and direction attributes for source and destination. + The simplest transfer, of course, has a single segment. + @details A segmented transfer is described by these attributes: + - A starting source and destination offset, in elements; + - A source and destination pitch (span between segments, in elements); + - A segment length, in elements; + - A segment count. + The element size defaults to 1 byte per element, must be power-of-2, and cannot be larger than 8 bytes. + There are also some optional attributes: + - Optional "source vertical flip" flag to indicate that the source offset is interpreted as an offset, + in elements, from the bottom of the source buffer, and during the transfer, the source pitch is + subtracted instead of added. Defaults to normal "from top" source offset reference. + - Optional "destination vertical flip" flag to indicate that the destination offset is interpreted as + an offset, in elements, from the bottom of the destination buffer, and during the transfer, the + destination pitch is subtracted instead of added. Defaults to normal "from top" destination offset + reference. + **/ + class AJAExport NTV2SegmentedXferInfo + { + public: + /** + @brief Constructs me as empty/invalid. + **/ + NTV2SegmentedXferInfo() + : mFlags (0), + mNumSegments (0), + mElementsPerSegment (0), + mInitialSrcOffset (0), + mInitialDstOffset (0), + mSrcElementsPerRow (0), + mDstElementsPerRow (0) {setElementLength(1);} + + /** + @name Inquiry -- Essentials + **/ + ///@{ + inline bool isValid (void) const {return getSegmentCount() && getSegmentLength() ? true : false;} ///< @return True if valid (i.e. a non-zero segment count and segment length); otherwise false. + inline ULWord getSegmentCount (void) const {return mNumSegments;} ///< @return The number of segments. + inline ULWord getSegmentLength (void) const {return mElementsPerSegment;} ///< @return The segment length, in elements. + inline ULWord getSourceOffset (void) const {return mInitialSrcOffset;} ///< @return The offset, in elements, to the start of the first source segment. + inline ULWord getDestOffset (void) const {return mInitialDstOffset;} ///< @return The offset, in elements, to the start of the first destination segment. + inline ULWord getSourcePitch (void) const {return mSrcElementsPerRow;} ///< @return The number of elements between each source row. + inline ULWord getDestPitch (void) const {return mDstElementsPerRow;} ///< @return The number of elements between each destination row. + ///@} + + /** + @name Inquiry + **/ + ///@{ + inline ULWord getElementLength (void) const {return ULWord(1 << (mFlags & 3));} ///< @return The size of each element, in bytes. + inline bool isSourceBottomUp (void) const {return mFlags & BIT(8) ? true : false;} ///< @return True if source rows should be traversed bottom-to-top; otherwise false. + inline bool isSourceTopDown (void) const {return mFlags & BIT(8) ? false : true;} ///< @return True if source rows should be traversed top-to-bottom; otherwise false. + inline bool isDestBottomUp (void) const {return mFlags & BIT(9) ? true : false;} ///< @return True if destination rows should be traversed bottom-to-top; otherwise false. + inline bool isDestTopDown (void) const {return mFlags & BIT(9) ? false : true;} ///< @return True if destination rows should be traversed top-to-bottom; otherwise false. + inline ULWord getTotalElements (void) const {return getSegmentCount() * getSegmentLength();} ///< @return The total number of elements (i.e. the product of the segment count and length). + inline ULWord getTotalBytes (void) const {return getTotalElements() * getElementLength();} ///< @return The total number of bytes. + + /** + @return The offset to the first element immediately past the last source segment. + **/ + inline ULWord getSourceEndOffset (void) const // New in SDK 16.0 + {return getSourceOffset() + getSourcePitch() * getSegmentCount() + getSegmentLength();} + + /** + @return The offset to the first element immediately past the last destination segment. + **/ + inline ULWord getDestEndOffset (void) const // New in SDK 16.0 + {return getDestOffset() + getDestPitch() * getSegmentCount() + getSegmentLength();} + + /** + @brief Writes a human-readable description of me into a given output stream. + @param inStrm A non-constant reference to the output stream that will receive the description. + @param[in] inDumpSegments If true, also dumps a description of each segment. Defaults to false. + @return A reference to the output stream. + **/ + std::ostream & Print (std::ostream & inStrm, const bool inDumpSegments = false) const; + + /** + @param[in] inInclDecl If true, the default, include a declaration statement in the source code. + @return A string containing C++ source code that, when compiled, will result in a NTV2SegmentedXferInfo + instance that will perfectly match me. + **/ + std::string getSourceCode (const bool inInclDecl = true) const; // New in SDK 16.0 + + /** + @param[in] inElementOffset Specifies the element offset of interest. + @return True if the element is contained within me. + **/ + bool containsElementAtOffset (const ULWord inElementOffset) const; // New in SDK 16.0 + + /** + @param[in] inRHS Specifies the NTV2SegmentedXferInfo to compare with me. + @return True if not equal. + @note The element sizes must match (though this ought to be compensated for in the comparison). + **/ + bool operator != (const NTV2SegmentedXferInfo & inRHS) const; // New in SDK 16.0 + + /** + @param[in] inRHS Specifies the NTV2SegmentedXferInfo to compare with me. + @return True if equal. + @note The element sizes must match (though this ought to be compensated for in the comparison). + **/ + inline bool operator == (const NTV2SegmentedXferInfo & inRHS) const {return !(*this != inRHS);} // New in SDK 16.0 + ///@} + + /** + @name Changing + **/ + ///@{ + + NTV2SegmentedXferInfo & reset (void); ///< @brief Resets me to an invalid (all zero) state. + + /** + @brief Sets both my segment count and length. + @param[in] inNumSegs My new segment count. + @param[in] inSegLength My new segment length, in elements. + @return A reference to me. + **/ + inline NTV2SegmentedXferInfo & setSegmentInfo (const ULWord inNumSegs, const ULWord inSegLength) + {return setSegmentCount(inNumSegs).setSegmentLength(inSegLength);} + + /** + @brief Sets my segment count. + @param[in] inNumSegments My new segment count. + @return A reference to me. + **/ + inline NTV2SegmentedXferInfo & setSegmentCount (const ULWord inNumSegments) + {mNumSegments = inNumSegments; return *this;} + + /** + @brief Sets my segment length. + @param[in] inNumElements My new segment length, in elements. + @return A reference to me. + **/ + inline NTV2SegmentedXferInfo & setSegmentLength (const ULWord inNumElements) + {mElementsPerSegment = inNumElements; return *this;} + + /** + @brief A convenience function that sets both my source offset and pitch. + @param[in] inOffset The new offset, in elements, to the start of the first source segment. + @param[in] inPitch The new number of elements between each source row. + @return A reference to me. + **/ + inline NTV2SegmentedXferInfo & setSourceInfo (const ULWord inOffset, const ULWord inPitch) + {return setSourceOffset(inOffset).setSourcePitch(inPitch);} + + /** + @brief Sets my source offset. + @param[in] inOffset The new offset, in elements, to the start of the first source segment. + @return A reference to me. + **/ + inline NTV2SegmentedXferInfo & setSourceOffset (const ULWord inOffset) + {mInitialSrcOffset = inOffset; return *this;} + + /** + @brief Sets my source pitch. + @param[in] inPitch The new number of elements between each source row. + @return A reference to me. + **/ + inline NTV2SegmentedXferInfo & setSourcePitch (const ULWord inPitch) + {mSrcElementsPerRow = inPitch; return *this;} + + /** + @brief Sets my source direction. + @param[in] inTopDown Specify true to traverse the source segments top-to-bottom; otherwise specify false for bottom-to-top. + @return A reference to me. + **/ + inline NTV2SegmentedXferInfo & setSourceDirection (const bool inTopDown) + { mFlags &= (0xFFFFFFFF - BIT(8)); + if (!inTopDown) + mFlags |= BIT(8); + return *this; + } + + /** + @brief A convenience function that sets both my destination offset and pitch. + @param[in] inOffset The new offset, in elements, to the start of the first destination segment. + @param[in] inPitch The new number of elements between each destination row. + @return A reference to me. + **/ + inline NTV2SegmentedXferInfo & setDestInfo (const ULWord inOffset, const ULWord inPitch) + {return setDestOffset(inOffset).setDestPitch(inPitch);} + + /** + @brief Sets my destination offset. + @param[in] inOffset The new offset, in elements, to the start of the first destination segment. + @return A reference to me. + **/ + inline NTV2SegmentedXferInfo & setDestOffset (const ULWord inOffset) {mInitialDstOffset = inOffset; return *this;} + + /** + @brief Sets my destination pitch. + @param[in] inPitch The new number of elements between each destination row. + @return A reference to me. + **/ + inline NTV2SegmentedXferInfo & setDestPitch (const ULWord inPitch) {mDstElementsPerRow = inPitch; return *this;} + + /** + @brief Sets my destination scan direction. + @param[in] inTopDown Specify true to traverse the destination segments top-to-bottom; otherwise specify false for bottom-to-top. + @return A reference to me. + **/ + inline NTV2SegmentedXferInfo & setDestDirection (const bool inTopDown) {mFlags = (0xFFFFFFFF - BIT(9)); if (!inTopDown) mFlags |= BIT(9); return *this;} + + /** + @brief Sets my element length. + @param[in] inBytesPerElement The new element size, in bytes. Must be a power of two (1, 2, 4, or 8). + @note This function does not transform any of my offsets, pitches or lengths. + @return A reference to me. + **/ + inline NTV2SegmentedXferInfo & setElementLength (const ULWord inBytesPerElement) + { + if (inBytesPerElement && inBytesPerElement < 9) + if (!(inBytesPerElement & (inBytesPerElement - 1))) // Power of 2? + { + ULWord num(inBytesPerElement), lengthBits(0); + while (num >>= 1) + lengthBits++; + mFlags = (mFlags & ~3UL) | (lengthBits & 3UL); + } + return *this; + } + /** + @brief Swaps my source and destination offsets and pitches. + @return A reference to me. + **/ + NTV2SegmentedXferInfo & swapSourceAndDestination (void); // New in SDK 16.0 + ///@} + + private: + ULWord mFlags; ///< @brief Lowest 2 bits determines element size, kRegMaskFrameOrientation is bit 10 + ULWord mNumSegments; ///< @brief Number of segments to transfer (i.e. row count). + ULWord mElementsPerSegment; ///< @brief Size of each segment, in elements. + ULWord mInitialSrcOffset; ///< @brief Initial source offset, in elements. + ULWord mInitialDstOffset; ///< @brief Initial destination offset, in elements. + ULWord mSrcElementsPerRow; ///< @brief Source pitch (i.e. the span, in elements, between the starting elements of adjacent segments on the source). + ULWord mDstElementsPerRow; ///< @brief Destination pitch (i.e. the span, in elements, between the starting elements of adjacent segments on the destination). + }; + #endif // !defined (NTV2_BUILDING_DRIVER) + + /** + @brief A generic user-space buffer object that has an address and a length. + Used most often to share an arbitrary-sized chunk of host memory with the NTV2 kernel driver + through a CNTV2DriverInterface::NTV2Message call. + + - For a static or global buffer, simply construct from the variable: + @code + static ULWord pFoo [1000]; + { + NTV2_POINTER foo (pFoo, sizeof (pFoo)); + . . . + } // When foo goes out of scope, it won't try to free pFoo + @endcode + - For stack-based buffers, simply construct from the variable: + @code + { + ULWord pFoo [100]; + NTV2_POINTER foo (pFoo, sizeof (pFoo)); + . . . + } // No need to do anything, as both foo and pFoo are automatically freed when they go out of scope + @endcode + - For a buffer you allocate and free yourself: + @code + NTV2_POINTER foo (new Bar [1], sizeof (Bar)); + . . . + delete [] (Bar*) foo.GetHostPointer (); // You must free the memory yourself + @endcode + - For a 2K-byte buffer that's allocated and freed automatically by the SDK: + @code + { + NTV2_POINTER foo (2048); + ::memset (foo.GetHostPointer(), 0, foo.GetByteCount()); + . . . + } // The memory is freed automatically when foo goes out of scope + @endcode + @note This struct uses a constructor to properly initialize itself. + Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (NTV2_POINTER) + NTV2_BEGIN_PRIVATE + ULWord64 fUserSpacePtr; ///< @brief User space pointer. Do not set directly. Use constructor or Set method. + ULWord fByteCount; ///< @brief The (maximum) size of the buffer pointed to by fUserSpacePtr, in bytes. + /// Do not set directly. Instead, use the constructor or the Set method. + ULWord fFlags; ///< @brief Reserved for future use + #if defined (AJAMac) + ULWord64 fKernelSpacePtr; ///< @brief Reserved -- Mac driver use only + ULWord64 fIOMemoryDesc; ///< @brief Reserved -- Mac driver use only + ULWord64 fIOMemoryMap; ///< @brief Reserved -- Mac driver use only + #else + ULWord64 fKernelHandle; ///< @brief Reserved -- driver use only + #endif + NTV2_END_PRIVATE + + #if !defined (NTV2_BUILDING_DRIVER) + /** + @name Construction & Destruction + **/ + ///@{ + /** + @brief Constructs me from a client-supplied address and size. + @param[in] pInUserPointer Specifies the user-space virtual memory address. The client is entirely responsible for it. + Ignored if inByteCount is zero. + @param[in] inByteCount Specifies the byte count. Ignored if pInUserPointer is NULL. + **/ + explicit NTV2_POINTER (const void * pInUserPointer, const size_t inByteCount); + + /** + @brief Constructs me from a client-specified byte count. + In this case, I assume full responsibility for automatically freeing the memory I allocate. + @param[in] inByteCount Optionally specifies the size of the allocated buffer, in bytes. Defaults to zero. + If non-zero, causes Allocate to be called, and if successful, automatically zeroes the buffer. + If zero (the default), I don't allocate anything, and my host pointer will be NULL. + **/ + NTV2_POINTER (const size_t inByteCount = 0); + + /** + @brief Constructs me from another NTV2_POINTER instance. + @param[in] inObj NTV2_POINTER instance to "deep" copy into me. + **/ + explicit NTV2_POINTER (const NTV2_POINTER & inObj); + + /** + @brief My destructor. If I'm responsible for the memory, I free it here. + **/ + ~NTV2_POINTER (); + ///@} + + /** + @name Inquiry + **/ + ///@{ + /** + @return My user-space host virtual address, as seen by the host process. + **/ + inline void * GetHostPointer (void) const + { + if (sizeof(int*) == 4) + return reinterpret_cast ((fUserSpacePtr & 0xFFFFFFFF00000000) >> 32); + else + return reinterpret_cast (fUserSpacePtr); + } + + /** + @return My "raw" user-space host virtual address. + @note On 32-bit platforms, the true address is found in the most significant 4 bytes of the ULWord64 value. + **/ + inline ULWord64 GetRawHostPointer (void) const {return fUserSpacePtr;} + + /** + @return My size, in bytes. + **/ + inline ULWord GetByteCount (void) const {return fByteCount;} + + /** + @return True if my host storage was allocated by my Allocate function; otherwise false if my host storage + address and size was provided by the client application. + **/ + inline bool IsAllocatedBySDK (void) const {return fFlags & NTV2_POINTER_ALLOCATED ? true : false;} + + /** + @return True if my host storage was provided by the client application; otherwise false if it was allocated + by my Allocate function. + **/ + inline bool IsProvidedByClient (void) const {return fFlags & NTV2_POINTER_ALLOCATED ? false : true;} + + /** + @return True if my user-space pointer is NULL, or my size is zero. + **/ + inline bool IsNULL (void) const {return GetHostPointer() == AJA_NULL || GetByteCount() == 0;} + + /** + @return True if my host pointer is non-NULL and my byte count is non-zero; otherwise false. + **/ + inline operator bool() const {return !IsNULL();} + + /** + @return My size, in bytes, as a size_t. + **/ + inline operator size_t() const {return size_t(GetByteCount());} // New in SDK 16.0 + + /** + @param[in] inByteOffset Specifies the offset from the start (or end) of my memory buffer. + Must be less than my size (see GetByteCount). + @param[in] inFromEnd Specify 'true' to reference the end of my buffer. + Specify 'false' (the default) to reference the start of my buffer. + @return The host address of the given byte. Returns NULL upon failure. + **/ + void * GetHostAddress (const ULWord inByteOffset, const bool inFromEnd = false) const; + + /** + @brief Searches me for the given scalar value of type T starting at a given index position. + @param[in] inValue Specifies the scalar value to be searched for. + @param inOutIndex On entry, specifies where searching begins. + On exit, receives the index of the matching value. + Negative indexes search backward from the end of the buffer, where -1 + is the last T in the buffer (with the highest physical memory address). + @return True if successfully found; otherwise false. + **/ + template bool Find (const T & inValue, int & inOutIndex) const // New in SDK 16.0 + { + const bool isAscending(inOutIndex >= 0); + if (isAscending && inOutIndex >= int(GetByteCount())) + return false; // Past end + if (!isAscending && (1 - inOutIndex) >= int(GetByteCount())) + return false; // Before start + const T * pValues(*this); + const int maxNdx(int(GetByteCount()) / sizeof(T)); + if (isAscending) + { + for (int ndx(inOutIndex); ndx < maxNdx; ndx++) + if (pValues[ndx] == inValue) + {inOutIndex = ndx; return true;} + } + else + { + const int minNdx(0 - maxNdx); + for (int ndx(inOutIndex); ndx >= minNdx; ndx++) + if (pValues[maxNdx + ndx] == inValue) + {inOutIndex = ndx; return true;} + } + inOutIndex = 0; + return false; // Not found + } + + /** + @return True if the given memory buffer's contents are identical to my own. + @param[in] inBuffer Specifies the memory buffer whose contents are to be compared with mine. + @param[in] inByteOffset Specifies the byte offset to start comparing. Defaults to the first byte. + @param[in] inByteCount Specifies the maximum number of bytes to compare. Defaults to 0xFFFFFFFF (entire buffer). + **/ + bool IsContentEqual (const NTV2_POINTER & inBuffer, const ULWord inByteOffset = 0, const ULWord inByteCount = 0xFFFFFFFF) const; + + /** + @brief Assuming my contents and the contents of the given buffer comprise ring buffers that periodically get overwritten + in contiguous variable-length chunks, answers with the contiguous byte range that differs between the two. + @param[in] inBuffer Specifies the memory buffer whose contents are to be compared with mine. Contents are + assumed to comprise a ring buffer, where data periodically gets overwritten in chunks. + @param[out] outByteOffsetFirst Receives the offset, in bytes, from the start of the buffer, of the first byte of the contiguous + range that's different. + Zero indicates the first byte in the buffer. + If equal to NTV2_POINTER::GetByteCount(), then both buffers are identical. + If greater than 'outByteOffsetLast', then a wrap condition exists (see Note). + @param[out] outByteOffsetLast Receives the offset, in bytes, from the start of the buffer, of the last byte of the contiguous + range that's different. + Zero indicates the first byte in the buffer. + If equal to NTV2_POINTER::GetByteCount(), then both buffers are identical. + If less than 'outByteOffsetFirst', a wrap condition exists (see Note). + @note If a wrap condition exists -- i.e., the contiguous byte range that differs starts near the end and wraps around + to near the front -- then 'outByteOffsetFirst' will be greater than 'outByteOffsetLast'. + @return True if successful; otherwise false. + **/ + bool GetRingChangedByteRange (const NTV2_POINTER & inBuffer, ULWord & outByteOffsetFirst, ULWord & outByteOffsetLast) const; + ///@} + + /** + @name Changing + **/ + ///@{ + /** + @brief Allocates (or re-allocates) my user-space storage using the given byte count. + I assume full responsibility for any memory that I allocate. + @param[in] inByteCount Specifies the number of bytes to allocate. + Specifying zero is the same as calling Set(NULL, 0). + @param[in] inPageAligned Optionally specifies page alignment. If true, allocates a + page-aligned block. If false (default), uses operator new. + @return True if successful; otherwise false. + @note Any memory that I was referencing prior to this call that I was responsible for will automatically be freed. + **/ + bool Allocate (const size_t inByteCount, const bool inPageAligned = false); + + /** + @brief Deallocates my user-space storage (if I own it -- i.e. from a prior call to Allocate). + @return True if successful; otherwise false. + **/ + bool Deallocate (void); + + /** + @brief Fills me with the given scalar value. + @param[in] inValue The scalar value to fill me with. + @return True if I'm currently allocated; otherwise false. + **/ + template bool Fill (const T & inValue) + { + T * pT (reinterpret_cast(GetHostPointer())); + const size_t loopCount(GetByteCount() / sizeof(T)); + if (pT) + for (size_t n(0); n < loopCount; n++) + pT[n] = inValue; + return pT ? true : false; + } + + /** + @brief Fills a portion of me with the given scalar value. + @param[in] inValue The scalar value. + @param[in] inXferInfo Describes the (destination) portion of me to be filled. + @return True if successful; otherwise false. + @note Offsets and lengths are checked. The function will return false for any overflow or underflow. + **/ + template bool Fill (const T & inValue, const NTV2SegmentedXferInfo & inXferInfo) + { + if (!inXferInfo.isValid()) + return false; + // Fill a temporary buffer to hold all the segment data... + NTV2_POINTER segData(inXferInfo.getElementLength() * inXferInfo.getSegmentCount() * inXferInfo.getSegmentLength()); + if (!segData.Fill(inValue)) + return false; // Fill failed + + // Copy the segment data into me... + ULWord srcOffset (0); + ULWord dstOffset (inXferInfo.getDestOffset() * inXferInfo.getElementLength()); + const ULWord dstPitch (inXferInfo.getDestPitch() * inXferInfo.getElementLength()); + const ULWord bytesPerSeg (inXferInfo.getSegmentLength() * inXferInfo.getElementLength()); + for (ULWord segNdx(0); segNdx < inXferInfo.getSegmentCount(); segNdx++) + { + const void * pSrc (segData.GetHostAddress(srcOffset)); + void * pDst (GetHostAddress(dstOffset)); + if (!pSrc) return false; + if (!pDst) return false; + if (dstOffset + bytesPerSeg > GetByteCount()) + return false; // memcpy will write past end + ::memcpy (pDst, pSrc, bytesPerSeg); + srcOffset += bytesPerSeg; // Bump src offset + dstOffset += dstPitch; // Bump dst offset + } // for each segment + return true; + } + + /** + @brief Assigns me from another NTV2_POINTER instance. + @param[in] inRHS Specifies the NTV2_POINTER instance to assign ("deep" copy) to me. + **/ + NTV2_POINTER & operator = (const NTV2_POINTER & inRHS); + + /** + @brief Sets (or resets) me from a client-supplied address and size. + @param[in] pInUserPointer Specifies the user-space virtual memory address. The client is entirely responsible for it. + Ignored if inByteCount is zero. + @param[in] inByteCount Specifies the byte count. Ignored if pInUserPointer is NULL. + @return True if both pInUserPointer and inByteCount agree (i.e. if pInUserPointer + and inByteCount are both zero, or if they're both non-zero); otherwise false + if they don't agree (i.e. one is non-zero and the other is zero, or vice-versa). + @note Any memory that I was referencing prior to this call that I was responsible for will automatically be freed. + **/ + bool Set (const void * pInUserPointer, const size_t inByteCount); + + /** + @brief Sets (or resets) me from a client-supplied address and size. + @param[in] pInUserPointer Specifies the user-space virtual memory address. The client is entirely responsible for it. + Ignored if inByteCount is zero. + @param[in] inByteCount Specifies the byte count. Ignored if pInUserPointer is NULL. + @param[in] inValue Specifies the value to fill the buffer with. + @return True if both pInUserPointer and inByteCount agree (i.e. if pInUserPointer and inByteCount + are both zero, or if they're both non-zero); otherwise false if they don't agree (i.e. one + is non-zero and the other is zero, or vice-versa). + @note Any memory that I was referencing prior to this call that I was responsible for will automatically be freed. + **/ + bool SetAndFill (const void * pInUserPointer, const size_t inByteCount, const UByte inValue); + + /** + @brief Replaces my contents from the given memory buffer without resizing me. + @param[in] inBuffer Specifies the memory buffer whose contents are to be copied into my own. + If this buffer is larger than I am, I am not resized; instead, only + those bytes that fit in me will be copied. + @return True if successful; otherwise false. + **/ + bool SetFrom (const NTV2_POINTER & inBuffer); + + /** + @brief Replaces my contents from the given memory buffer, resizing me to the new byte count. + @param[in] pInSrcBuffer Specifies the memory buffer whose contents are to be copied into my own. + @param[in] inByteCount Specifies the number of bytes to be copied. + @return True if successful; otherwise false. + **/ + bool CopyFrom (const void * pInSrcBuffer, const ULWord inByteCount); + + /** + @brief Copies bytes from the given memory buffer into me. + @param[in] inSrcBuffer Specifies the source memory buffer to be copied into me. + @param[in] inSrcByteOffset Specifies the offset, in bytes, at which reading will commence in the source buffer. + @param[in] inDstByteOffset Specifies the offset, in bytes, at which writing will commence in me. + @param[in] inByteCount Specifies the total number of bytes to copy. + @return True if successful; otherwise false. + @note The offsets and byte counts are checked against the existing sizes of the two buffers. + The function will return false for any overflow. + **/ + bool CopyFrom (const NTV2_POINTER & inSrcBuffer, const ULWord inSrcByteOffset, const ULWord inDstByteOffset, const ULWord inByteCount); + + /** + @brief Copies data segments from a given buffer into me. + @param[in] inSrcBuffer Specifies the source memory buffer to be copied into me. + @param[in] inXferInfo The segmented transfer info. + @return True if successful; otherwise false. + @note Offsets and lengths are checked. The function will return false for any overflow or underflow. + **/ + bool CopyFrom (const NTV2_POINTER & inSrcBuffer, const NTV2SegmentedXferInfo & inXferInfo); + + /** + @brief Swaps my underlying buffer with another's. + @param[in] inBuffer Specifies the NTV2_POINTER I'll swap buffers with. + @return True if successful; otherwise false. + @note The buffers must have identical sizes, and must have equal ownership attributes. + @note AJA recommends not using this function to swap NTV2_POINTERs that were allocated in different + executable modules (e.g., on Windows, an NTV2_POINTER that was allocated in a DLL with another + that was allocated in an EXE). + **/ + bool SwapWith (NTV2_POINTER & inBuffer); + + /** + @brief Byte-swaps my contents 64-bits at a time. + @return True if successful; otherwise false. + @note If my size (in bytes) is not evenly divisible by 8, the very last byte(s) won't get swapped. + **/ + bool ByteSwap64 (void); // New in SDK 16.0 + + /** + @brief Byte-swaps my contents 32-bits at a time. + @return True if successful; otherwise false. + @note If my size (in bytes) is not evenly divisible by 4, the very last byte(s) won't get swapped. + **/ + bool ByteSwap32 (void); // New in SDK 16.0 + + /** + @brief Byte-swaps my contents 16-bits at a time. + @return True if successful; otherwise false. + @note If my size (in bytes) is not evenly divisible by 2, the very last byte won't get swapped. + **/ + bool ByteSwap16 (void); // New in SDK 16.0 + ///@} + + /** + @name Debugging/Printing + **/ + ///@{ + /** + @brief Prints a human-readable representation of me into the given output stream. + @param inOutStream The output stream to receive my human-readable representation. + @return A reference to the given output stream. + **/ + std::ostream & Print (std::ostream & inOutStream) const; + + /** + @param inDumpMaxBytes If non-zero, includes a hex dump of my contents up to the number of specified bytes (64 maximum). + @return A string containing a human-readable representation of me. + **/ + std::string AsString (UWord inDumpMaxBytes = 0) const; + + /** + @brief Dumps me in hex/octal/decimal, with/without Ascii, to the given output stream. + @param inOutputStream Output stream that will receive the dump. Defaults to std::cout. + @param inStartByteOffset The starting offset, in bytes, where the dump will start. + @param inByteCount The number of bytes to be dumped. If zero, all bytes will be dumped. + @param inRadix Specifies the radix of the dumped memory values. + 16=hex, 10=decimal, 8=octal, 2=binary -- all others disallowed. + @param inBytesPerGroup Number of bytes to dump per contiguous group of numbers. Defaults to 4. + @param inGroupsPerLine Number of contiguous groups of numbers to dump per output line. + If zero, no grouping is done, and address & ASCII display is suppressed. + Defaults to 8. + @param inAddressRadix Specifies the radix of the address column. + 0=omit, 2=binary, 8=octal, 10=decimal, 16=hex -- all others disallowed. + Defaults to 0. + @param inShowAscii If True, show ASCII characters; otherwise no ASCII characters. + Overridden to false if inGroupsPerLine is zero. Defaults to false. + @param inAddrOffset Specifies a value to be added to the addresses that appear in the dump. + Ignored if inGroupsPerLine is zero. + @return A non-constant reference to the output stream that received the dump. + **/ + std::ostream & Dump ( std::ostream & inOutputStream = std::cout, + const size_t inStartByteOffset = 0, + const size_t inByteCount = 0, + const size_t inRadix = 16, + const size_t inBytesPerGroup = 4, + const size_t inGroupsPerLine = 8, + const size_t inAddressRadix = 0, + const bool inShowAscii = false, + const size_t inAddrOffset = 0) const; + + /** + @brief Dumps me in hex/octal/decimal, with/without Ascii, into the given string. + @param inOutputString String that will receive the dump. Appends the dump to the end of + whatever is already in the string. + @param inStartByteOffset The starting offset, in bytes, where the dump will start. + @param inByteCount The number of bytes to be dumped. If zero, all bytes will be dumped. + @param inRadix Specifies the radix of the dumped memory values. + 16=hex, 10=decimal, 8=octal, 2=binary -- all others disallowed. + @param inBytesPerGroup Number of bytes to dump per contiguous group of numbers. Defaults to 4. + @param inGroupsPerLine Number of contiguous groups of numbers to dump per output line. + If zero, no grouping is done, and address & ASCII display is suppressed. + Defaults to 8. + @param inAddressRadix Specifies the radix of the address column. + 0=omit, 2=binary, 8=octal, 10=decimal, 16=hex -- all others disallowed. + Defaults to 0. + @param inShowAscii If True, show ASCII characters; otherwise no ASCII characters. + Overridden to false if inGroupsPerLine is zero. Defaults to false. + @param inAddrOffset Specifies a value to be added to the addresses that appear in the dump. + Ignored if inGroupsPerLine is zero. + @return A reference to the output string that received the dump. + **/ + std::string & Dump ( std::string & inOutputString, + const size_t inStartByteOffset = 0, + const size_t inByteCount = 0, + const size_t inRadix = 16, + const size_t inBytesPerGroup = 4, + const size_t inGroupsPerLine = 8, + const size_t inAddressRadix = 0, + const bool inShowAscii = false, + const size_t inAddrOffset = 0) const; + ///@} + + /** + @name Data Access + **/ + ///@{ + /** + @return My host address casted to a const T pointer. + **/ + template operator const T*() const {return reinterpret_cast(GetHostPointer());} // New in SDK 16.0 + + /** + @return My host address casted to a non-const T pointer. + **/ + template operator T*() const {return reinterpret_cast(GetHostPointer());} // New in SDK 16.0 + + /** + @brief Resets an NTV2_POINTER instance to reference a contiguous segment of my memory buffer. + @param[out] outPtr The NTV2_POINTER to be reset to my sub-segment. + @param[in] inByteOffset Specifies the offset, in bytes, where the segment starts. + @param[in] inByteCount Specifies the segment length, in bytes. + @return The specified NTV2_POINTER. It will be set to null/empty upon failure. + @note The offset and byte count are both checked against my buffer size. + **/ + NTV2_POINTER & Segment (NTV2_POINTER & outPtr, const ULWord inByteOffset, const ULWord inByteCount) const; + + /** + @return A copy of the value at the given zero-based index position. + @param[in] inIndex Specifies the zero-based index position (e.g. 0 is first value at start of my memory). + If negative, indexes from the end of my memory (e.g. -1 is last value). + @warning Bad index values will result in access violation exceptions. + **/ + inline uint8_t U8 (const int inIndex) const {const uint8_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()) + inIndex : inIndex];} // New in SDK 16.0 + + /** + @return A writeable (non-const) reference to the value at the given zero-based index position. + @param[in] inIndex Specifies the zero-based index position (e.g. 0 is first value at start of my memory). + If negative, indexes from the end of my memory (e.g. -1 is last value). + @warning Bad index values will result in access violation exceptions. + **/ + inline uint8_t & U8 (const int inIndex) {uint8_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()) + inIndex : inIndex];} // New in SDK 16.0 + + inline int8_t I8 (const int inIndex) const {const int8_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()) + inIndex : inIndex];} // New in SDK 16.0 + inline int8_t & I8 (const int inIndex) {int8_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()) + inIndex : inIndex];} // New in SDK 16.0 + inline uint16_t U16 (const int inIndex) const {const uint16_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/2) + inIndex : inIndex];} // New in SDK 16.0 + inline uint16_t & U16 (const int inIndex) {uint16_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/2) + inIndex : inIndex];} // New in SDK 16.0 + inline int16_t I16 (const int inIndex) const {const int16_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/2) + inIndex : inIndex];} // New in SDK 16.0 + inline int16_t & I16 (const int inIndex) {int16_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/2) + inIndex : inIndex];} // New in SDK 16.0 + inline uint32_t U32 (const int inIndex) const {const uint32_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/4) + inIndex : inIndex];} // New in SDK 16.0 + inline uint32_t & U32 (const int inIndex) {uint32_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/4) + inIndex : inIndex];} // New in SDK 16.0 + inline int32_t I32 (const int inIndex) const {const int32_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/4) + inIndex : inIndex];} // New in SDK 16.0 + inline int32_t & I32 (const int inIndex) {int32_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/4) + inIndex : inIndex];} // New in SDK 16.0 + inline uint64_t U64 (const int inIndex) const {const uint64_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/8) + inIndex : inIndex];} // New in SDK 16.0 + inline uint64_t & U64 (const int inIndex) {uint64_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/8) + inIndex : inIndex];} // New in SDK 16.0 + inline int64_t I64 (const int inIndex) const {const int64_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/8) + inIndex : inIndex];} // New in SDK 16.0 + inline int64_t & I64 (const int inIndex) {int64_t* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/8) + inIndex : inIndex];} // New in SDK 16.0 + inline float FL (const int inIndex) const {const float* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/sizeof(float)) + inIndex : inIndex];} // New in SDK 16.0 + inline float & FL (const int inIndex) {float* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/sizeof(float)) + inIndex : inIndex];} // New in SDK 16.0 + inline double DBL (const int inIndex) const {const double* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/sizeof(double)) + inIndex : inIndex];} // New in SDK 16.0 + inline double & DBL (const int inIndex) {double* pVal(*this); return pVal[inIndex < 0 ? int(GetByteCount()/sizeof(double)) + inIndex : inIndex];} // New in SDK 16.0 + ///@} + + /** + @name Vector Conversion + **/ + ///@{ + /** + @brief Answers with my contents as a vector of unsigned 16-bit values. + @param[out] outU64s Receives my contents as a vector of unsigned 64-bit values. + @param[in] inU64Offset The starting offset, in 64-bit words, where copying will commence. + @param[in] inMaxSize Specifies the maximum number of 64-bit values to be returned. + Use zero for unlimited. + The actual number of returned 64-bit values may be less than this, depending on my size. + Defaults to 16. + @param[in] inByteSwap Specifies if the resulting values will be byte-swapped or not. + Specify 'true' to byte-swap; specify 'false' to return the normal, unswapped values. + Defaults to 'false'. + @return True if successful; otherwise false. + @note If my length is not evenly divisible by 8, my last bytes won't appear in the resulting vector. + **/ + bool GetU64s (ULWord64Sequence & outU64s, const size_t inU64Offset = 0, const size_t inMaxSize = 16, const bool inByteSwap = false) const; + + /** + @return My contents as a vector of unsigned 64-bit values. + @param[in] inU64Offset The starting offset, in 64-bit words, where copying will commence. + @param[in] inMaxSize Specifies the maximum number of 64-bit values to be returned. + Use zero for unlimited. + The actual number of returned 64-bit values may be less than this, depending on my size. + Defaults to 16. + @param[in] inByteSwap Specifies if the resulting values will be byte-swapped or not. + Specify 'true' to byte-swap; specify 'false' to return the normal, unswapped values. + Defaults to 'false'. + @note If my length is not evenly divisible by 8, my last bytes won't appear in the resulting vector. + **/ + inline ULWord64Sequence GetU64s (const size_t inU64Offset = 0, const size_t inMaxSize = 16, const bool inByteSwap = false) const {ULWord64Sequence result; GetU64s(result, inU64Offset, inMaxSize, inByteSwap); return result;} + + /** + @brief Answers with my contents as a vector of unsigned 32-bit values. + @param[out] outU32s Receives my contents as a vector of unsigned 32-bit values. + @param[in] inU32Offset The starting offset, in 32-bit words, where copying will commence. + @param[in] inMaxSize Specifies the maximum number of 32-bit values to be returned. + Use zero for unlimited. + The actual number of returned 32-bit values may be less than this, depending on my size. + Defaults to 32. + @param[in] inByteSwap Specifies if the resulting values will be byte-swapped or not. + Specify 'true' to byte-swap; specify 'false' to return the normal, unswapped values. + Defaults to 'false'. + @return True if successful; otherwise false. + @note If my length is not evenly divisible by 4, my last bytes won't appear in the resulting vector. + **/ + bool GetU32s (ULWordSequence & outU32s, const size_t inU32Offset = 0, const size_t inMaxSize = 32, const bool inByteSwap = false) const; + + /** + @return My contents as a vector of unsigned 32-bit values. + @param[in] inU32Offset The starting offset, in 32-bit words, where copying will commence. + @param[in] inMaxSize Specifies the maximum number of 32-bit values to be returned. + Use zero for unlimited. + The actual number of returned 32-bit values may be less than this, depending on my size. + Defaults to 32. + @param[in] inByteSwap Specifies if the resulting values will be byte-swapped or not. + Specify 'true' to byte-swap; specify 'false' to return the normal, unswapped values. + Defaults to 'false'. + @note If my length is not evenly divisible by 4, my last bytes won't appear in the resulting vector. + **/ + inline ULWordSequence GetU32s (const size_t inU32Offset = 0, const size_t inMaxSize = 32, const bool inByteSwap = false) const {ULWordSequence result; GetU32s(result, inU32Offset, inMaxSize, inByteSwap); return result;} + + /** + @brief Answers with my contents as a vector of unsigned 16-bit values. + @param[out] outU16s Receives my contents as a vector of unsigned 16-bit values. + @param[in] inU16Offset The starting offset, in 16-bit words, where copying will commence. + @param[in] inMaxSize Specifies the maximum number of 16-bit values to be returned. + Use zero for unlimited. + The actual number of returned 16-bit values may be less than this, depending on my size. + Defaults to 64. + @param[in] inByteSwap Specifies if the resulting values will be byte-swapped or not. + Specify 'true' to byte-swap; specify 'false' to return the normal, unswapped values. + Defaults to 'false'. + @return True if successful; otherwise false. + @note If my length is not evenly divisible by 2, my last byte won't appear in the resulting vector. + **/ + bool GetU16s (UWordSequence & outU16s, const size_t inU16Offset = 0, const size_t inMaxSize = 64, const bool inByteSwap = false) const; + + /** + @return My contents as a vector of unsigned 16-bit values. + @param[in] inU16Offset The starting offset, in 16-bit words, where copying will commence. + @param[in] inMaxSize Specifies the maximum number of 16-bit values to be returned. + Use zero for unlimited. + The actual number of returned 16-bit values may be less than this, depending on my size. + Defaults to 64. + @param[in] inByteSwap Specifies if the resulting values will be byte-swapped or not. + Specify 'true' to byte-swap; specify 'false' to return the normal, unswapped values. + Defaults to 'false'. + @note If my length is not evenly divisible by 2, my last byte won't appear in the resulting vector. + **/ + inline UWordSequence GetU16s (const size_t inU16Offset = 0, const size_t inMaxSize = 64, const bool inByteSwap = false) const {UWordSequence result; GetU16s(result, inU16Offset, inMaxSize, inByteSwap); return result;} + + /** + @brief Answers with my contents as a vector of unsigned 8-bit values. + @param[out] outU8s Receives my contents as a vector of unsigned 8-bit values. + @param[in] inU8Offset The starting offset, in bytes, where copying will commence. + @param[in] inMaxSize Specifies the maximum number of 8-bit values to be returned. + Use zero for unlimited. + The actual number of returned 8-bit values may be less than this, depending on my size. + Defaults to 128. + @return True if successful; otherwise false. + **/ + bool GetU8s (UByteSequence & outU8s, const size_t inU8Offset = 0, const size_t inMaxSize = 128) const; + + /** + @return My contents as a vector of unsigned 8-bit values. + @param[in] inU8Offset The starting offset, in bytes, where copying will commence. + @param[in] inMaxSize Specifies the maximum number of 8-bit values to be returned. + Use zero for unlimited. + The actual number of returned 8-bit values may be less than this, depending on my size. + Defaults to 128. + **/ + inline UByteSequence GetU8s (const size_t inU8Offset = 0, const size_t inMaxSize = 128) const {UByteSequence result; GetU8s(result, inU8Offset, inMaxSize); return result;} + + /** + @brief Answers with my contents as a character string. + @param[out] outString Receives the character string copied verbatim from my contents. + @param[in] inU8Offset The starting offset, in bytes, where copying will commence. + @param[in] inMaxSize Specifies the maximum number of 8-bit values to be returned. + Use zero for unlimited. + The actual number of returned 8-bit values may be less than this, depending on my size. + Defaults to 128. + @return True if successful; otherwise false. + @note This function blindly copies my contents into the outgoing string, without checking for validity. + **/ + bool GetString (std::string & outString, const size_t inU8Offset = 0, const size_t inMaxSize = 128) const; + + /** + @return My contents as a character string. + @param[in] inU8Offset The starting offset, in bytes, where copying will commence. + @param[in] inMaxSize Specifies the maximum number of 8-bit values to be returned. + Use zero for unlimited. + The actual number of returned 8-bit values may be less than this, depending on my size. + Defaults to 128. + @note This function blindly copies my contents into the outgoing string, without checking for validity. + **/ + inline std::string GetString (const size_t inU8Offset = 0, const size_t inMaxSize = 128) const {std::string result; GetString(result, inU8Offset, inMaxSize); return result;} + + /** + @brief Copies a vector of unsigned 64-bit values into me. + @param[in] inU64s The vector of unsigned 64-bit values to be copied into me. + @param[in] inU64Offset Specifies my starting offset (of 64-bit values) at which the vector values will be written. + Defaults to zero. + @param[in] inByteSwap Specifies if the 64-bit values will be byte-swapped or not before being written into me. + Specify 'true' to byte-swap; otherwise specify 'false'. Defaults to 'false'. + @return True if successful; otherwise false. + **/ + bool PutU64s (const ULWord64Sequence & inU64s, const size_t inU64Offset = 0, const bool inByteSwap = false); + + /** + @brief Copies a vector of unsigned 32-bit values into me. + @param[in] inU32s The vector of unsigned 32-bit values to be copied into me. + @param[in] inU32Offset Specifies my starting offset (of 32-bit values) at which the vector values will be written. + Defaults to zero. + @param[in] inByteSwap Specifies if the 32-bit values will be byte-swapped or not before being written into me. + Specify 'true' to byte-swap; otherwise specify 'false'. Defaults to 'false'. + @return True if successful; otherwise false. + **/ + bool PutU32s (const ULWordSequence & inU32s, const size_t inU32Offset = 0, const bool inByteSwap = false); + + /** + @brief Copies a vector of unsigned 16-bit values into me. + @param[in] inU16s The vector of unsigned 16-bit values to be copied into me. + @param[in] inU16Offset Specifies my starting offset (of 16-bit values) at which the vector values will be written. + Defaults to zero. + @param[in] inByteSwap Specifies if the 16-bit values will be byte-swapped or not before being written into me. + Specify 'true' to byte-swap; otherwise specify 'false'. Defaults to 'false'. + @return True if successful; otherwise false. + **/ + bool PutU16s (const UWordSequence & inU16s, const size_t inU16Offset = 0, const bool inByteSwap = false); + + /** + @brief Copies a vector of unsigned 8-bit values into me. + @param[in] inU8s The vector of unsigned 8-bit values to be copied into me. + @param[in] inU8Offset Specifies my starting byte offset at which the vector values will be written. + Defaults to zero. + @return True if successful; otherwise false. + **/ + bool PutU8s (const UByteSequence & inU8s, const size_t inU8Offset = 0); + ///@} + + /** + @name Default Page Size + **/ + ///@{ + /** + @return Default page size, in bytes. + **/ + static size_t DefaultPageSize (void); + + /** + @brief Changes the default page size for use in future page-aligned allocations. + @param[in] inNewSize The new page size value, in bytes. Must be a power of 2. + @return True if successful; otherwise false. + **/ + static bool SetDefaultPageSize (const size_t inNewSize); + ///@} + #endif // user-space clients only + NTV2_STRUCT_END (NTV2_POINTER) + + + /** + @brief This struct replaces the old RP188_STRUCT. + **/ + NTV2_STRUCT_BEGIN (NTV2_RP188) + ULWord fDBB; + ULWord fLo; ///< @brief | BG 4 | Secs10 | BG 3 | Secs 1 | BG 2 | Frms10 | BG 1 | Frms 1 | + ULWord fHi; ///< @brief | BG 8 | Hrs 10 | BG 7 | Hrs 1 | BG 6 | Mins10 | BG 5 | Mins 1 | + + #if defined (NTV2_BUILDING_DRIVER) + #define NTV2_RP188_from_RP188_STRUCT(_n_,_r_) { (_n_).fDBB = (_r_).DBB; \ + (_n_).fLo = (_r_).Low; \ + (_n_).fHi = (_r_).High; } + + #define NTV2_RP188P_from_RP188_STRUCT(_np_,_r_) { (_np_)->fDBB = (_r_).DBB; \ + (_np_)->fLo = (_r_).Low; \ + (_np_)->fHi = (_r_).High; } + + #define RP188_STRUCT_from_NTV2_RP188(_r_,_n_) { (_r_).DBB = (_n_).fDBB; \ + (_r_).Low = (_n_).fLo; \ + (_r_).High = (_n_).fHi; } + + #define RP188_STRUCT_from_NTV2_RP188P(_r_,_np_) { (_r_).DBB = (_np_)->fDBB; \ + (_r_).Low = (_np_)->fLo; \ + (_r_).High = (_np_)->fHi; } + + #define NTV2_RP188_IS_VALID(_n_) ((_n_).fDBB != 0xFFFFFFFF || (_n_).fLo != 0xFFFFFFFF || (_n_).fHi != 0xFFFFFFFF) + #else + /** + @brief Constructs an NTV2_RP188 from each of its DBB, low and high ULWord components. + @param[in] inDBB Specifies the DBB field. + @param[in] inLow Specifies the "low" field, which contains seconds and frames. + @param[in] inHigh Specifies the "high" field, which contains hours and minutes. + @note If no parameters are specified, a default "invalid" structure is created. + **/ + inline explicit NTV2_RP188 (const ULWord inDBB = 0xFFFFFFFF, const ULWord inLow = 0xFFFFFFFF, const ULWord inHigh = 0xFFFFFFFF) : fDBB (inDBB), fLo (inLow), fHi (inHigh) {} + + /** + @brief Constructs an NTV2_RP188 from the given RP188_STRUCT. + @param[in] inOldRP188 Specifies the RP188_STRUCT to copy. + **/ + inline explicit NTV2_RP188 (const RP188_STRUCT & inOldRP188) : fDBB (inOldRP188.DBB), fLo (inOldRP188.Low), fHi (inOldRP188.High) {} + + /** + @brief Answers true if I'm valid, or false if I'm not valid. + **/ + inline bool IsValid (void) const {return fDBB != 0xFFFFFFFF || fLo != 0xFFFFFFFF || fHi != 0xFFFFFFFF;} + + /** + @brief Assigns a given RP188_STRUCT to me. + @param[in] inRHS The RP188_STRUCT to assign to me. + @return A non-constant reference to myself. + **/ + inline NTV2_RP188 & operator = (const RP188_STRUCT & inRHS) {fDBB = inRHS.DBB; fLo = inRHS.Low; fHi = inRHS.High; return *this;} + + /** + @param[in] inRHS The RP188_STRUCT to compare with me. + @return True if the right-hand-size argument is not equal to me. + **/ + inline bool operator != (const RP188_STRUCT & inRHS) const {return fDBB != inRHS.DBB || fLo != inRHS.Low || fHi != inRHS.High;} + + /** + @brief Sets my fields from the given DBB, low and high ULWord components. + @param[in] inDBB Specifies the DBB field. + @param[in] inLow Specifies the "low" field, which contains seconds and frames. + @param[in] inHigh Specifies the "high" field, which contains hours and minutes. + **/ + inline void Set (const ULWord inDBB = 0xFFFFFFFF, const ULWord inLow = 0xFFFFFFFF, const ULWord inHigh = 0xFFFFFFFF) {fDBB = inDBB; fLo = inLow; fHi = inHigh;} + + /** + @brief Converts me into an RP188_STRUCT. + @return An equivalent RP188_STRUCT. + **/ + inline operator RP188_STRUCT () const {RP188_STRUCT result; result.DBB = fDBB; result.Low = fLo; result.High = fHi; return result;} + + /** + @return True if I'm valid. + **/ + inline operator bool () const {return IsValid();} + #endif // user-space clients only + NTV2_STRUCT_END (NTV2_RP188) + + #if !defined (NTV2_BUILDING_DRIVER) + typedef std::vector NTV2TimeCodeList; ///< @brief An ordered sequence of zero or more NTV2_RP188 structures. + /// An NTV2TCIndex enum value can be used as an index into the list + /// (the list size should equal NTV2_MAX_NUM_TIMECODE_INDEXES). + typedef NTV2TimeCodeList::const_iterator NTV2TimeCodeListConstIter; ///< @brief A handy const interator for iterating over an NTV2TimeCodeList. + //typedef NTV2TimeCodeList::iterator NTV2TimeCodeListIter; + typedef std::map NTV2TimeCodes; ///< @brief A mapping of NTV2TCIndex enum values to NTV2_RP188 structures. + typedef NTV2TimeCodes::const_iterator NTV2TimeCodesConstIter; ///< @brief A handy const interator for iterating over NTV2TCIndex/NTV2TimeCodeList pairs. + + typedef std::set NTV2TCIndexes; ///< @brief A set of distinct NTV2TCIndex values. + typedef NTV2TCIndexes::const_iterator NTV2TCIndexesConstIter; ///< @brief A handy const interator for iterating over an NTV2TCIndexes set. + + /** + @brief Appends the given NTV2_RP188 struct to the specified NTV2TimeCodeList. + @param inOutList Specifies the NTV2TimeCodeList to be appended to. + @param[in] inRP188 Specifies the NTV2_RP188 to append to the list. + @return A non-constant reference to the specified NTV2TimeCodeList. + **/ + NTV2TimeCodeList & operator << (NTV2TimeCodeList & inOutList, const NTV2_RP188 & inRP188); + #endif // !defined (NTV2_BUILDING_DRIVER) + + + /** + @brief For devices that support it (see ::NTV2DeviceCanDoSDIErrorChecks ), this struct reports SDI input error status information. + @note This struct uses a constructor to properly initialize itself. Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (NTV2SDIInputStatus) + UWord mCRCTallyA; ///< @brief The number of lines having a CRC error was detected in the "B" stream of the SDI link + /// since this tally was last reset. + UWord mCRCTallyB; ///< @brief The number of lines having a CRC error was detected in the "A" stream of the SDI link + /// since this tally was last reset. + ULWord mUnlockTally; ///< @brief The number of times "RX Locked" went inactive since this tally was last reset. + //ULWord64 mFrameTally; ///< @brief The number of frames that have been detected on the SDI input since this tally was last reset. + ULWord64 mFrameRefClockCount; ///< @brief This count is incremented on each 148.xx reference clock, and latched at EAV for each frame. + ULWord64 mGlobalClockCount; ///< @brief This count is incremented on each 148.xx reference clock. + bool mFrameTRSError; ///< @brief If true, SAV/EAV was missing, or the SDI framer had to realign, or "RX Locked" went + /// inactive. This is updated once per frame (unless vertical timing is absent on the input). + bool mLocked; ///< @brief If true, a valid SDI transport was detected in the received data stream. + /// If false, at least 15 consecutive lines in the received stream had TRS errors. + bool mVPIDValidA; ///< @brief If true, at least one valid SMPTE 352 packet was received over the last four VBI periods. + bool mVPIDValidB; ///< @brief If true, at least one valid SMPTE 352 packet was received over the last four VBI periods. + #if !defined (NTV2_BUILDING_DRIVER) + /** + @brief Constructs a default NTV2SDIInputStatus. + **/ + explicit NTV2SDIInputStatus (); + + /** + @brief Constructs a default NTV2SDIInputStatus. + **/ + void Clear (void); + + /** + @brief Prints a human-readable representation of me into the given output stream. + @param inOutStream The output stream to receive my human-readable representation. + @return A reference to the given output stream. + **/ + std::ostream & Print (std::ostream & inOutStream) const; + #endif // !defined (NTV2_BUILDING_DRIVER) + NTV2_STRUCT_END (NTV2SDIInputStatus) + + + /** + @brief Reports HDMI output status information. + @note This struct uses a constructor to properly initialize itself. + Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (NTV2HDMIOutputStatus) + bool mEnabled; ///< @brief The output is enabled + bool mPixel420; ///< @brief The output pixels are 420 format + NTV2HDMIColorSpace mColorSpace; ///< @brief The output color space (RGB or YCbCr) + NTV2HDMIRange mRGBRange; ///< @brief The RGB output range (SMPTE or full) + NTV2HDMIProtocol mProtocol; ///< @brief The output protocol (HDMI vs DVI) + NTV2Standard mVideoStandard; ///< @brief The output standard + NTV2FrameRate mVideoRate; ///< @brief The output frame rate + NTV2HDMIBitDepth mVideoBitDepth; ///< @brief The output bit depth + NTV2AudioFormat mAudioFormat; ///< @brief The output audio format + NTV2AudioRate mAudioRate; ///< @brief The output audio rate + NTV2HDMIAudioChannels mAudioChannels; ///< @brief Number of output audio channels + #if !defined (NTV2_BUILDING_DRIVER) + /** + @brief Constructs a default NTV2HDMIOutputStatus. + **/ + explicit NTV2HDMIOutputStatus () {Clear();} + + /** + @brief Constructs a NTV2HDMIOutputStatus from a register data value. + @param[in] inData The status register value. + **/ + explicit NTV2HDMIOutputStatus (const ULWord inData) {Clear(); SetFromRegValue(inData);} + + void Clear (void); ///< @brief Resets me to an invalid state. + + /** + @brief Sets my fields from the given status register value. + @param[in] inData The status register value. + @return True if successful; otherwise false. + **/ + bool SetFromRegValue (const ULWord inData); + + /** + @brief Prints a human-readable representation of me into the given output stream. + @param inOutStream The output stream to receive my human-readable representation. + @return A reference to the given output stream. + **/ + std::ostream & Print (std::ostream & inOutStream) const; + #endif // !defined (NTV2_BUILDING_DRIVER) + NTV2_STRUCT_END (NTV2HMDIOutputStatus) + + + /** + @brief All new NTV2 structs start with this common header. + @note This struct uses a constructor to properly initialize itself. Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (NTV2_HEADER) + NTV2_BEGIN_PRIVATE + ULWord fHeaderTag; ///< @brief A special FourCC to identify a structure header & detect endianness, set when created + ULWord fType; ///< @brief A special FourCC to identify a structure type ('stat', 'xfer', 'task', etc.), set when created + ULWord fHeaderVersion; ///< @brief The version of this header structure, set when created, originally zero + ULWord fVersion; ///< @brief The version of the structure that follows this header, set when created, originally zero + ULWord fSizeInBytes; ///< @brief The total size of the struct, in bytes, including header, body and trailer, set when created + ULWord fPointerSize; ///< @brief The size, in bytes, of a pointer on the host, set when created + ULWord fOperation; ///< @brief An operation to perform -- currently unused -- reserved for future use -- set when created + ULWord fResultStatus; ///< @brief The result status of the operation (zero if success or non-zero failure code), cleared when created, set by driver + NTV2_END_PRIVATE + + #if !defined (NTV2_BUILDING_DRIVER) + /** + @brief Constructs a default NTV2_HEADER having the proper tag, version, and the given type and size. + @param[in] inStructureType Specifies the structure type. + @param[in] inSizeInBytes Specifies the total size of the structure. + **/ + explicit NTV2_HEADER (const ULWord inStructureType, const ULWord inSizeInBytes); + + /** + @brief Returns my total size, in bytes, including header, body, and trailer. + @return My size, in bytes. + **/ + inline ULWord GetSizeInBytes (void) const {return fSizeInBytes;} + + /** + @brief Prints a human-readable representation of me into the given output stream. + @param inOutStream The output stream to receive my human-readable representation. + @return A reference to the given output stream. + **/ + std::ostream & Print (std::ostream & inOutStream) const; + + /** + @return True if my tag and type fields are valid; otherwise false. + **/ + inline bool IsValid (void) const {return NTV2_IS_VALID_HEADER_TAG (fHeaderTag) && NTV2_IS_VALID_STRUCT_TYPE (fType);} + #endif // user-space clients only + NTV2_STRUCT_END (NTV2_HEADER) + + + /** + @brief All new NTV2 structs end with this common trailer. + @note This struct uses a constructor to properly initialize itself. Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (NTV2_TRAILER) + ULWord fTrailerVersion; ///< @brief Trailer version, set when created. Before SDK 15.1: always zero; 15.1 or later: set to calling SDK version (packed). + ULWord fTrailerTag; ///< @brief A special FourCC to identify the tail end of an NTV2 structure + + #if !defined (NTV2_BUILDING_DRIVER) + explicit NTV2_TRAILER (); ///< @brief Constructs a default NTV2_TRAILER having the proper version and tag. + + /** + @return True if my tag is valid; otherwise false. + **/ + inline bool IsValid (void) const {return NTV2_IS_VALID_TRAILER_TAG (fTrailerTag);} + #endif // user-space clients only + NTV2_STRUCT_END (NTV2_TRAILER) + + + /** + @brief This struct is used to augment the default full-frame AutoCirculate DMA transfer to accommodate multiple discontiguous + "segments" of a video frame. The \ref ntv2fieldburn demo app shows how this can be used. Other examples: + - An in-host-memory frame has extra "padding" bytes at the end of each row. + In this case, set NTV2SegmentedDMAInfo::acNumActiveBytesPerRow to the number of active bytes per row, + NTV2SegmentedDMAInfo::acNumSegments to the number of rows, NTV2SegmentedDMAInfo::acSegmentHostPitch + to the number of bytes from the beginning of one row to the next. In this example, + NTV2SegmentedDMAInfo::acSegmentDevicePitch would equal NTV2SegmentedDMAInfo::acNumActiveBytesPerRow + (i.e. the frame is packed in device memory). + - To DMA a sub-section of a frame, set NTV2SegmentedDMAInfo::acNumActiveBytesPerRow to the number of bytes + that comprise one row of the subsection, then NTV2SegmentedDMAInfo::acNumSegments to the number of rows + in the subsection, NTV2SegmentedDMAInfo::acSegmentHostPitch to the bytes-per-row of the entire frame in host + memory, and NTV2SegmentedDMAInfo::acSegmentDevicePitch to the bytes-per-row of the entire frame in device memory. + @note IMPORTANT: For segmented DMAs, the ::AUTOCIRCULATE_TRANSFER::acVideoBuffer.fByteCount field holds the segment + byte count (i.e., the number of bytes to transfer per segment. + + @note This struct uses a constructor to properly initialize itself. Do not use memset or bzero to initialize or "clear" it. + @todo Create a new field in the ::NTV2SegmentedDMAInfo structure to eliminate the necessity of setting + ::AUTOCIRCULATE_TRANSFER::acVideoBuffer.fByteCount to store the segmented transfer's bytes-per-segment value. + + @note Setting NTV2SegmentedDMAInfo::acNumSegments to 0 or 1 defaults to normal non-segmented DMA behavior + (i.e. DMA one complete, packed frame). + **/ + NTV2_STRUCT_BEGIN (NTV2SegmentedDMAInfo) + ULWord acNumSegments; ///< @brief Number of segments of size ::AUTOCIRCULATE_TRANSFER::acVideoBuffer.fByteCount + /// to transfer. Zero or 1 means normal (unsegmented) transfer. + ULWord acNumActiveBytesPerRow; ///< @brief Number of active bytes in a row of video. + ULWord acSegmentHostPitch; ///< @brief Offset, in bytes, between the start of one host segment and the start of + /// the next host segment (i.e. host memory bytes-per-row). + ULWord acSegmentDevicePitch; ///< @brief Offset, in bytes, between the start of one device segment and the start of + /// the next device segment (i.e. device memory bytes-per-row). + + #if !defined (NTV2_BUILDING_DRIVER) + /** + @brief Constructs a disabled NTV2SegmentedDMAInfo struct. + **/ + explicit NTV2SegmentedDMAInfo (); + + /** + @brief Constructs an NTV2SegmentedDMAInfo struct from a segment count, a host pitch, and device pitch value. + @param[in] inNumSegments Specifies the number of segments (lines) to DMA. + @param[in] inNumActiveBytesPerRow Specifies the number of active bytes in a row of video. + @param[in] inHostBytesPerRow Specifies the offset, in bytes, between two adjacent segments on the host. + @param[in] inDeviceBytesPerRow Specifies the offset, in bytes, between two adjacent segments on the device. + **/ + explicit NTV2SegmentedDMAInfo (const ULWord inNumSegments, const ULWord inNumActiveBytesPerRow, const ULWord inHostBytesPerRow, const ULWord inDeviceBytesPerRow); + + /** + @brief Sets the NTV2SegmentedDMAInfo struct members. + @param[in] inNumSegments Specifies the number of segments (lines) to DMA. + If 1 or zero, performs a Reset, and the remaining parameters are ignored. + @param[in] inNumActiveBytesPerRow Specifies the number of active bytes in a row of video. + @param[in] inHostBytesPerRow Specifies the offset, in bytes, between two adjacent segments on the host. + @param[in] inDeviceBytesPerRow Specifies the offset, in bytes, between two adjacent segments on the device. + **/ + void Set (const ULWord inNumSegments, const ULWord inNumActiveBytesPerRow, const ULWord inHostBytesPerRow, const ULWord inDeviceBytesPerRow); + + /** + @brief Resets the NTV2SegmentedDMAInfo struct members to their default values (normal, non-segmented AutoCirculate DMA transfers). + **/ + void Reset (void); + + /** + @return My segment count. + **/ + inline ULWord GetSegmentCount (void) const {return acNumSegments;} + + /** + @return True if I'm currently active (i.e., I have more than one segment; otherwise false. + **/ + inline bool IsSegmented (void) const {return GetSegmentCount() > 1;} + #endif // user-space clients only + NTV2_STRUCT_END (NTV2SegmentedDMAInfo) + + + /** + @brief Color correction data used with AUTOCIRCULATE_WITH_COLORCORRECT option. + @note This struct uses a constructor to properly initialize itself. Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (NTV2ColorCorrectionData) + NTV2ColorCorrectionMode ccMode; ///< @brief My mode (off, RGB, YCbCr, or 3-way) + ULWord ccSaturationValue; ///< @brief My saturation value, used only in 3-way color correction mode. + + /** + @brief RGB lookup tables pre-formatted for AJA hardware as a contiguous block of NTV2_COLORCORRECTOR_TABLESIZE bytes. + This field is owned by the SDK, which is wholly responsible for allocating and/or freeing it. If empty, no color + correction tables will be transferred. Use the Getter/Setter methods to get/set this field. + **/ + NTV2_POINTER ccLookupTables; + + #if !defined (NTV2_BUILDING_DRIVER) + /** + @brief Constructs a default NTV2ColorCorrectionData struct. + **/ + explicit NTV2ColorCorrectionData (); + + /** + @brief My destructor, which frees my private color correction table buffer. + **/ + ~NTV2ColorCorrectionData (); + + /** + @brief Frees my private color correction table buffer and resets my mode to "invalid". + **/ + void Clear (void); + + /** + @return True if my mode is valid and not "Off", and my color correction tables are allocated. + **/ + inline bool IsActive (void) const {return NTV2_IS_ACTIVE_COLOR_CORRECTION_MODE (ccMode) && ccLookupTables.GetHostPointer ();} + + /** + @brief Sets this struct from the given mode, saturation and table data, replacing any existing mode, saturation and table data. + @param[in] inMode Specifies the color correction mode. + @param[in] inSaturation Specifies the saturation value (valid only for 3-way color correction mode). + @param[in] pInTableData Specifies a valid, non-NULL pointer to a buffer that's at least NTV2_COLORCORRECTOR_TABLESIZE + bytes long, that contains the table data to copy into my private buffer. + @return True if successful; otherwise false. + **/ + bool Set (const NTV2ColorCorrectionMode inMode, const ULWord inSaturation, const void * pInTableData); + + NTV2_BEGIN_PRIVATE + inline explicit NTV2ColorCorrectionData (const NTV2ColorCorrectionData & inObj) : ccLookupTables (0) {(void) inObj;} ///< @brief You can't construct an NTV2ColorCorrectionData from another. + inline NTV2ColorCorrectionData & operator = (const NTV2ColorCorrectionData & inRHS) {(void) inRHS; return *this;} ///< @brief You cannot assign NTV2ColorCorrectionData instances. + NTV2_END_PRIVATE + #endif // user-space clients only + NTV2_STRUCT_END (NTV2ColorCorrectionData) + + + /** + @brief This is returned from the CNTV2Card::AutoCirculateGetStatus function. + @note This struct uses a constructor to properly initialize itself. Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (AUTOCIRCULATE_STATUS) + NTV2_HEADER acHeader; ///< @brief The common structure header -- ALWAYS FIRST! + NTV2Crosspoint acCrosspoint; ///< @brief The crosspoint (channel number with direction) + NTV2AutoCirculateState acState; ///< @brief Current AutoCirculate state. + LWord acStartFrame; ///< @brief First frame to circulate. FIXFIXFIX Why is this signed? CHANGE TO ULWord?? + LWord acEndFrame; ///< @brief Last frame to circulate. FIXFIXFIX Why is this signed? CHANGE TO ULWord?? + LWord acActiveFrame; ///< @brief Current frame actually being captured/played when CNTV2Card::AutoCirculateGetStatus called. FIXFIXFIX CHANGE TO ULWord?? + ULWord64 acRDTSCStartTime; ///< @brief Timestamp of the first VBI received after CNTV2Card::AutoCirculateStart called, using host OS system clock. + ULWord64 acAudioClockStartTime; ///< @brief Timestamp of the first VBI received after CNTV2Card::AutoCirculateStart called, using "64-bit clean" value of the device's 48kHz audio clock (::kRegAud1Counter register). + ULWord64 acRDTSCCurrentTime; ///< @brief Timestamp when CNTV2Card::AutoCirculateGetStatus called, using the host OS system clock. + ULWord64 acAudioClockCurrentTime; ///< @brief Timestamp when CNTV2Card::AutoCirculateGetStatus called, using "64-bit clean" value of the device's 48kHz audio clock (::kRegAud1Counter register). + ULWord acFramesProcessed; ///< @brief Total number of frames successfully processed since CNTV2Card::AutoCirculateStart called. + ULWord acFramesDropped; ///< @brief Total number of frames dropped since CNTV2Card::AutoCirculateStart called + ULWord acBufferLevel; ///< @brief Number of buffered frames in driver ready to capture or play + ULWord acOptionFlags; ///< @brief AutoCirculate options used when CNTV2Card::AutoCirculateInitForInput or CNTV2Card::AutoCirculateInitForOutput called (e.g., AUTOCIRCULATE_WITH_RP188, etc.). + NTV2AudioSystem acAudioSystem; ///< @brief The audio system being used for this channel (NTV2_AUDIOSYSTEM_INVALID if none) + NTV2_TRAILER acTrailer; ///< @brief The common structure trailer -- ALWAYS LAST! + + #if !defined (NTV2_BUILDING_DRIVER) + /** + @brief Constructs a default AUTOCIRCULATE_STATUS struct for the given NTV2Crosspoint. + **/ + explicit AUTOCIRCULATE_STATUS (const NTV2Crosspoint inCrosspoint = NTV2CROSSPOINT_CHANNEL1); + + /** + @brief Copies my data into the given AUTOCIRCULATE_STATUS_STRUCT. + @param[out] outOldStruct Specifies the old AUTOCIRCULATE_STATUS_STRUCT that is to receive the copied data. + @return True if successful; otherwise false. + **/ + bool CopyTo (AUTOCIRCULATE_STATUS_STRUCT & outOldStruct); + + /** + @brief Copies the given AUTOCIRCULATE_STATUS_STRUCT into me. + @param[in] inOldStruct Specifies the old AUTOCIRCULATE_STATUS_STRUCT that is to supply the copied data. + @return True if successful; otherwise false. + **/ + bool CopyFrom (const AUTOCIRCULATE_STATUS_STRUCT & inOldStruct); + + /** + @brief Clears my data. + **/ + void Clear (void); + + /** + @return The number of frames being auto-circulated. + **/ + inline ULWord GetFrameCount (void) const {return IsStopped() ? 0 : ULWord (acEndFrame - acStartFrame + 1);} + + /** + @return The total number of frames dropped since AutoCirculateStart called. + **/ + inline ULWord GetDroppedFrameCount (void) const {return acFramesDropped;} + + /** + @return The total number of frames successfully processed (not dropped) since AutoCirculateStart called. + **/ + inline ULWord GetProcessedFrameCount (void) const {return acFramesProcessed;} + + /** + @return The number of buffered frames in the driver ready to capture or play. + **/ + inline ULWord GetBufferLevel (void) const {return acBufferLevel;} + + /** + @return The number of "unoccupied" output (playout) frames the device's AutoCirculate channel can currently accommodate. + **/ + inline ULWord GetNumAvailableOutputFrames (void) const {return GetFrameCount () > acBufferLevel ? GetFrameCount () - acBufferLevel : 0;} + + /** + @return True if the device's AutoCirculate channel is ready to accept at least one more output frame. + **/ + inline bool CanAcceptMoreOutputFrames (void) const {return GetNumAvailableOutputFrames () > 1;} + + /** + @return True if there's at least one captured frame that's ready to transfer from the device to the host; otherwise false. + **/ + inline bool HasAvailableInputFrame (void) const {return acBufferLevel > 1;} + + /** + @return The current active frame number. + **/ + inline LWord GetActiveFrame (void) const {return acActiveFrame;} + + /** + @return The first frame number. + **/ + inline uint16_t GetStartFrame (void) const {return uint16_t(acStartFrame);} + + /** + @return The last frame number. + **/ + inline uint16_t GetEndFrame (void) const {return uint16_t(acEndFrame);} + + /** + @return My current state. + **/ + inline NTV2AutoCirculateState GetState (void) const {return acState;} + + /** + @return My audio system. If NTV2_AUDIOSYSTEM_INVALID, then no audio is being captured/played. + **/ + inline NTV2AudioSystem GetAudioSystem (void) const {return acAudioSystem;} + + /** + @return True if my state is currently NTV2_AUTOCIRCULATE_RUNNING; otherwise false. + **/ + inline bool IsRunning (void) const {return GetState () == NTV2_AUTOCIRCULATE_RUNNING;} + + /** + @return True if my state is currently NTV2_AUTOCIRCULATE_STARTING or NTV2_AUTOCIRCULATE_STARTING_AT_TIME; otherwise false. + **/ + inline bool IsStarting (void) const {return GetState () == NTV2_AUTOCIRCULATE_STARTING || GetState () == NTV2_AUTOCIRCULATE_STARTING_AT_TIME;} + + /** + @return True if my state is currently NTV2_AUTOCIRCULATE_DISABLED; otherwise false. + **/ + inline bool IsStopped (void) const {return GetState () == NTV2_AUTOCIRCULATE_DISABLED;} + + /** + @return True if my state is currently NTV2_AUTOCIRCULATE_STOPPING; otherwise false. + **/ + inline bool IsStopping (void) const {return GetState () == NTV2_AUTOCIRCULATE_STOPPING;} + + /** + @return True if my state is currently NTV2_AUTOCIRCULATE_PAUSED; otherwise false. + **/ + inline bool IsPaused (void) const {return GetState () == NTV2_AUTOCIRCULATE_PAUSED;} + + /** + @return True if circulating with audio; otherwise false. + **/ + inline bool WithAudio (void) const {return NTV2_IS_VALID_AUDIO_SYSTEM (GetAudioSystem ());} + + /** + @return The option flags. + **/ + inline ULWord OptionFlags (void) const {return acOptionFlags;} // New in SDK 16.0 + + /** + @return True if operating the custom Anc inserter/extractor; otherwise false. + **/ + inline bool WithCustomAnc (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_ANC;} // New in SDK 16.0 + + /** + @return True if capturing/playing RP188 timecode; otherwise false. + **/ + inline bool WithRP188 (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_RP188;} // New in SDK 16.0 + + /** + @return True if capturing/playing analog LTC timecode; otherwise false. + **/ + inline bool WithLTC (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_LTC;} // New in SDK 16.0 + + /** + @return True if AUTOCIRCULATE_WITH_FBFCHANGE enabled; otherwise false. + **/ + inline bool WithFBFChange (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_FBFCHANGE;} // New in SDK 16.0 + + /** + @return True if AUTOCIRCULATE_WITH_FBOCHANGE enabled; otherwise false. + **/ + inline bool WithFBOChange (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_FBOCHANGE;} // New in SDK 16.0 + + /** + @return True if AUTOCIRCULATE_WITH_COLORCORRECT enabled; otherwise false. + **/ + inline bool WithColorCorrect (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_COLORCORRECT;} // New in SDK 16.0 + + /** + @return True if AUTOCIRCULATE_WITH_VIDPROC enabled; otherwise false. + **/ + inline bool WithVidProc (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_VIDPROC;} // New in SDK 16.0 + + /** + @return True if running in field mode; otherwise false. + **/ + inline bool IsFieldMode (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_FIELDS;} // New in SDK 16.0 + + /** + @return True if capturing/playing with HDMI auxiliary data; otherwise false. + **/ + inline bool WithHDMIAuxData (void) const {return OptionFlags() & AUTOCIRCULATE_WITH_HDMIAUX;} // New in SDK 16.0 + + /** + @return True if capturing; otherwise false. + **/ + inline bool IsInput (void) const {return NTV2_IS_INPUT_CROSSPOINT(acCrosspoint);} + + /** + @return True if playing out; otherwise false. + **/ + inline bool IsOutput (void) const {return NTV2_IS_OUTPUT_CROSSPOINT(acCrosspoint);} + + /** + @return The NTV2Mode, whether NTV2_MODE_OUTPUT, NTV2_MODE_INPUT or NTV2_MODE_INVALID (if stopped). + **/ + inline NTV2Mode GetMode (void) const {return IsStopped() ? NTV2_MODE_INVALID : (IsInput() ? NTV2_MODE_INPUT : NTV2_MODE_OUTPUT);} // New in SDK 15.5 + + /** + @return My channel. + **/ + NTV2Channel GetChannel (void) const; + + /** + @return A string containing the human-readable data for the given zero-based index value. + @param[in] inIndexNum A zero-based index number that specifies which member data value to return. + **/ + std::string operator [] (const unsigned inIndexNum) const; + + NTV2_IS_STRUCT_VALID_IMPL(acHeader,acTrailer) + #endif // user-space clients only + NTV2_STRUCT_END (AUTOCIRCULATE_STATUS) + + + #if !defined (NTV2_BUILDING_DRIVER) + typedef std::set NTV2RegisterNumberSet; ///< @brief A set of distinct ULWord values. + typedef NTV2RegisterNumberSet NTV2RegNumSet; ///< @brief A set of distinct NTV2RegisterNumbers. + typedef NTV2RegNumSet::const_iterator NTV2RegNumSetConstIter; ///< @brief A const iterator that iterates over a set of distinct NTV2RegisterNumbers. + typedef NTV2RegNumSet::iterator NTV2RegNumSetIter; ///< @brief A non-constant iterator that iterates over a set of distinct NTV2RegisterNumbers. + + /** + @brief Adds the given register number to the specified NTV2RegisterNumberSet. + @param inOutSet Specifies the NTV2RegisterNumberSet to be added to. + @param[in] inRegisterNumber Specifies the NTV2RegisterNumber to add to the set. + @return A non-constant reference to the specified NTV2RegisterNumberSet. + **/ + NTV2RegisterNumberSet & operator << (NTV2RegisterNumberSet & inOutSet, const ULWord inRegisterNumber); + + typedef std::map NTV2RegisterValueMap; ///< @brief A mapping of distinct NTV2RegisterNumbers to their corresponding ULWord values. + typedef NTV2RegisterValueMap::const_iterator NTV2RegValueMapConstIter; ///< @brief A const iterator that iterates over NTV2RegisterValueMap entries. + typedef NTV2RegisterValueMap::iterator NTV2RegValueMapIter; ///< @brief A non-constant iterator that iterates over NTV2RegisterValueMap entries. + #endif // !defined (NTV2_BUILDING_DRIVER) + + + /** + @brief This is used by the CNTV2Card::ReadRegisters function. + @note There is no need to access any of this structure's fields directly. Simply call the CNTV2Card instance's ReadRegisters function. + @note This struct uses a constructor to properly initialize itself. Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (NTV2GetRegisters) // AUTOCIRCULATE_TYPE_GETREGS + NTV2_BEGIN_PRIVATE + NTV2_HEADER mHeader; ///< @brief The common structure header -- ALWAYS FIRST! + ULWord mInNumRegisters; ///< @brief The number of registers to read in one batch. + NTV2_POINTER mInRegisters; ///< @brief Array of register numbers to be read in one batch. The SDK owns this memory. + ULWord mOutNumRegisters; ///< @brief The number of registers successfully read. + NTV2_POINTER mOutGoodRegisters; ///< @brief Array of register numbers that were read successfully. The SDK owns this memory. + NTV2_POINTER mOutValues; ///< @brief Array of register values that were read successfully. The SDK owns this memory. + NTV2_TRAILER mTrailer; ///< @brief The common structure trailer -- ALWAYS LAST! + NTV2_END_PRIVATE + + #if !defined (NTV2_BUILDING_DRIVER) + /** + @brief Constructs an NTV2GetRegisters struct from the given NTV2RegisterNumberSet. + @param[in] inRegisterNumbers A set of distinct NTV2RegisterNumbers to copy into the mRegisters field. + If omitted, defaults to an empty set. + **/ + explicit NTV2GetRegisters (const NTV2RegNumSet & inRegisterNumbers = NTV2RegNumSet ()); + + explicit NTV2GetRegisters (NTV2RegisterReads & inRegReads); + + /** + @brief Resets me, starting over, now using the given NTV2RegisterNumberSet. + @param[in] inRegisterNumbers A set of distinct NTV2RegisterNumbers to copy into my mInRegisters field. + **/ + bool ResetUsing (const NTV2RegNumSet & inRegisterNumbers); + + /** + @brief Resets me, starting over, using the given NTV2RegisterReads vector. + @param[in] inRegReads A vector of NTV2RegInfo values to use for my mInRegisters field. + @note The mask and shift fields of the NTV2RegInfo values are ignored. + **/ + bool ResetUsing (const NTV2RegisterReads & inRegReads); + + /** + @brief Returns an NTV2RegNumSet built from my mOutGoodRegisters field. + @param[out] outGoodRegNums Receives the set of "good" registers. + @return True if successful; otherwise false. + **/ + bool GetGoodRegisters (NTV2RegNumSet & outGoodRegNums) const; + + /** + @brief Returns an NTV2RegisterValueMap built from my mOutGoodRegisters and mOutValues fields. + @param[out] outValues Receives the register/value map. + @return True if successful; otherwise false. + **/ + bool GetRegisterValues (NTV2RegisterValueMap & outValues) const; + + /** + @brief Returns a vector of NTV2RegInfo values built from my mOutGoodRegisters and mOutValues fields. + @param[out] outValues Receives the register values. + @return True if successful; otherwise false. + **/ + bool GetRegisterValues (NTV2RegisterReads & outValues) const; + + /** + @brief Prints a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream to use. + @return A reference to the output stream. + **/ + std::ostream & Print (std::ostream & inOutStream) const; + + NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer) + + NTV2_BEGIN_PRIVATE + inline explicit NTV2GetRegisters (const NTV2GetRegisters & inObj) : mHeader(0xFEFEFEFE, 0), mInRegisters(0), mOutGoodRegisters(0), mOutValues(0) + {(void) inObj;} ///< @brief You cannot construct an NTV2GetRegisters from another. + inline NTV2GetRegisters & operator = (const NTV2GetRegisters & inRHS) {(void) inRHS; return *this;} ///< @brief You cannot assign NTV2GetRegisters. + NTV2_END_PRIVATE + + #endif // !defined (NTV2_BUILDING_DRIVER) + NTV2_STRUCT_END (NTV2GetRegisters) + + + /** + @brief This is used by the CNTV2Card::WriteRegisters function. + @note There is no need to access any of this structure's fields directly. Simply call the CNTV2Card instance's WriteRegisters function. + @note This struct uses a constructor to properly initialize itself. Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (NTV2SetRegisters) // AUTOCIRCULATE_TYPE_SETREGS + NTV2_HEADER mHeader; ///< @brief The common structure header -- ALWAYS FIRST! + ULWord mInNumRegisters; ///< @brief The number of NTV2RegInfo's to be set. + NTV2_POINTER mInRegInfos; ///< @brief Read-only array of NTV2RegInfo structs to be set. The SDK owns this memory. + ULWord mOutNumFailures; ///< @brief The number of registers unsuccessfully written. + NTV2_POINTER mOutBadRegIndexes; ///< @brief Array of UWords containing index numbers of the register writes that failed. The SDK owns this memory. + NTV2_TRAILER mTrailer; ///< @brief The common structure trailer -- ALWAYS LAST! + + #if !defined (NTV2_BUILDING_DRIVER) + /** + @brief Constructs an NTV2SetRegisters struct from the given NTV2RegisterWrites collection. + @param[in] inRegWrites An ordered collection of NTV2ReadWriteRegisterSingle structs to be copied into my mInRegInfos field. + If omitted, defaults to an empty collection. + **/ + NTV2SetRegisters (const NTV2RegisterWrites & inRegWrites = NTV2RegisterWrites ()); + + /** + @brief Resets me, starting over, now using the given NTV2RegisterNumberSet. + @param[in] inRegWrites An ordered collection of NTV2ReadWriteRegisterSingle structs to be copied into my mInRegInfos field. + If omitted, defaults to an empty collection. + **/ + bool ResetUsing (const NTV2RegisterWrites & inRegWrites); + + /** + @brief Returns an NTV2RegisterWrites built from my mOutBadRegInfos field. + @param[out] outFailedRegWrites Receives the list of failed writes. + @return True if successful; otherwise false. + **/ + bool GetFailedRegisterWrites (NTV2RegisterWrites & outFailedRegWrites) const; + + /** + @brief Prints a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream to use. + @return A reference to the output stream. + **/ + std::ostream & Print (std::ostream & inOutStream) const; + + NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer) + + NTV2_BEGIN_PRIVATE + inline explicit NTV2SetRegisters (const NTV2SetRegisters & inObj) : mHeader(0xFEFEFEFE, 0), mInNumRegisters(0), mInRegInfos(0), mOutNumFailures(0), mOutBadRegIndexes(0) + {(void) inObj;} ///< @brief You cannot construct an NTV2SetRegisters from another. + inline NTV2SetRegisters & operator = (const NTV2SetRegisters & inRHS) {(void) inRHS; return *this;} ///< @brief You cannot assign NTV2SetRegisters. + NTV2_END_PRIVATE + + #endif // !defined (NTV2_BUILDING_DRIVER) + NTV2_STRUCT_END (NTV2SetRegisters) + + + /** + @brief This is used to atomically perform bank-selected register reads or writes. + @note This struct uses a constructor to properly initialize itself. Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (NTV2BankSelGetSetRegs) // NTV2_TYPE_BANKGETSET + NTV2_HEADER mHeader; ///< @brief The common structure header -- ALWAYS FIRST! + ULWord mIsWriting; ///< @brief If non-zero, register(s) will be written; otherwise, register(s) will be read. + NTV2_POINTER mInBankInfos; ///< @brief Bank select NTV2RegInfo. The SDK owns this memory. + NTV2_POINTER mInRegInfos; ///< @brief NTV2RegInfo array of registers be read/written. The SDK owns this memory. + NTV2_TRAILER mTrailer; ///< @brief The common structure trailer -- ALWAYS LAST! + + #if !defined (NTV2_BUILDING_DRIVER) + /** + @brief Constructs an NTV2BankSelGetSetRegs struct for atomically reading or writing the given bank-selected register. + @param[in] inBankSelect The bank select register info. + @param[in] inRegInfo The register info of the register to be read or written. + @param[in] inDoWrite Specify 'true' to write the register value; otherwise use 'false'. Defaults to 'false'. + **/ + explicit NTV2BankSelGetSetRegs (const NTV2RegInfo & inBankSelect, const NTV2RegInfo & inRegInfo, const bool inDoWrite = false); + + /** + @return The NTV2RegInfo at the given zero-based index position. + @param inIndex0 Specifies the zero-based index of the NTV2RegInfo to retrieve from my array. + **/ + NTV2RegInfo GetRegInfo (const UWord inIndex0 = 0) const; + + /** + @brief Prints a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream to use. + @return A reference to the output stream. + **/ + std::ostream & Print (std::ostream & inOutStream) const; + + NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer) + + NTV2_BEGIN_PRIVATE + inline explicit NTV2BankSelGetSetRegs (const NTV2BankSelGetSetRegs & inObj) : mHeader(0xFEFEFEFE, 0), mIsWriting(false), mInBankInfos(0), mInRegInfos(0) + {(void) inObj;} ///< @brief You cannot construct an NTV2BankSelGetSetRegs from another. + inline NTV2BankSelGetSetRegs & operator = (const NTV2BankSelGetSetRegs & inRHS) {(void) inRHS; return *this;} ///< @brief You cannot assign NTV2BankSelGetSetRegs. + NTV2_END_PRIVATE + #endif // !defined (NTV2_BUILDING_DRIVER) + NTV2_STRUCT_END (NTV2BankSelGetSetRegs) + + + /** + @brief This is used to perform virtual data reads or writes. + @note This struct uses a constructor to properly initialize itself. Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (NTV2VirtualData) // NTV2_TYPE_VIRTUAL_DATA_RW + NTV2_HEADER mHeader; ///< @brief The common structure header -- ALWAYS FIRST! + ULWord mTag; ///< @brief Tag for virtual data. This value is used to recal saved data by tag. + ULWord mIsWriting; ///< @brief If non-zero, virtual data will be written; otherwise, virtual data will be read. + NTV2_POINTER mVirtualData; ///< @brief Pointer object to virtual data. The SDK owns this memory. + NTV2_TRAILER mTrailer; ///< @brief The common structure trailer -- ALWAYS LAST! + + #if !defined (NTV2_BUILDING_DRIVER) + /** + @brief Constructs an NTV2VirtualData struct for reading or writing virtual data. + @param[in] inTag The tag to use. + @param[in] inVirtualData Pointer to vitrual data. + @param[in] inVirtualDataSize The size of the virtual data. + @param[in] inDoWrite True if writing, false if reading. + **/ + explicit NTV2VirtualData (const ULWord inTag, const void* inVirtualData, const size_t inVirtualDataSize, const bool inDoWrite = false); + + /** + @brief Prints a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream to use. + @return A reference to the output stream. + **/ + std::ostream & Print (std::ostream & inOutStream) const; + + NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer) + + #endif // !defined (NTV2_BUILDING_DRIVER) + NTV2_STRUCT_END (NTV2VirtualData) + + + /** + @brief This is used by the CNTV2Card::ReadSDIStatistics function. + @note There is no need to access any of this structure's fields directly. Simply call the CNTV2Card instance's ReadSDIStatistics function. + @note This struct uses a constructor to properly initialize itself. Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (NTV2SDIInStatistics) // AUTOCIRCULATE_TYPE_SDISTATS + NTV2_BEGIN_PRIVATE + NTV2_HEADER mHeader; ///< @brief The common structure header -- ALWAYS FIRST! + NTV2_POINTER mInStatistics; ///< @brief Array of NTV2SDIStatus s to be read in one batch. The SDK owns this memory. + NTV2_TRAILER mTrailer; ///< @brief The common structure trailer -- ALWAYS LAST! + NTV2_END_PRIVATE + + #if !defined (NTV2_BUILDING_DRIVER) + /** + @brief Constructs an NTV2GetSDIStatistics struct and initializes it to its default state. + **/ + NTV2SDIInStatistics (); + + /** + @brief Resets the struct to its initialized state. + **/ + void Clear (void); + + /** + @brief Answers with the NTV2SDIInputStatus for the given SDI input spigot. + @param[out] outStatus Receives the NTV2SDIInputStatus for the given SDI input. + @param[in] inSDIInputIndex0 Specifies the zero-based index of the SDI input of interest. + @return True if successful; otherwise false. + **/ + bool GetSDIInputStatus (NTV2SDIInputStatus & outStatus, const UWord inSDIInputIndex0 = 0); + + /** + @return A non-const reference to the NTV2SDIInputStatus record for the given SDI input. + @param[in] inSDIInputIndex0 Specifies the zero-based index of the SDI input of interest. + **/ + NTV2SDIInputStatus & operator [] (const size_t inSDIInputIndex0); // New in SDK 16.0 + + /** + @brief Prints a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream to use. + @return A reference to the output stream. + **/ + std::ostream & Print (std::ostream & inOutStream) const; + + NTV2_IS_STRUCT_VALID_IMPL(mHeader,mTrailer) + #endif // !defined (NTV2_BUILDING_DRIVER) + NTV2_STRUCT_END (NTV2SDIInStatistics) + + + /** + @brief This is returned by the CNTV2Card::AutoCirculateGetFrameStamp function, and is also embedded in the AUTOCIRCULATE_TRANSFER struct + returned from CNTV2Card::AutoCirculateTransfer. If used as its own CNTV2DriverInterface::NTV2Message (the new API version of the old CNTV2Card::GetFrameStamp call), + pass the NTV2Channel in the least significant byte of FRAME_STAMP::acFrameTime, and the requested frame in FRAME_STAMP::acRequestedFrame. + @note This struct uses a constructor to properly initialize itself. Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (FRAME_STAMP) // AUTOCIRCULATE_TYPE_FRAMESTAMP + NTV2_HEADER acHeader; ///< @brief The common structure header -- ALWAYS FIRST! + LWord64 acFrameTime; ///< @brief On exit, contains host OS clock at time of capture/play. + ///< On entry, contains ::NTV2Channel of interest, but only for new API ::FRAME_STAMP message. + ULWord acRequestedFrame; ///< @brief The frame requested (0xFFFFFFFF == "not available"), including for new API (::FRAME_STAMP message). + ULWord64 acAudioClockTimeStamp; ///< @brief Number of 10MHz ticks at moment of play or record, based on 48kHz clock (from register 28). + ULWord acAudioExpectedAddress; ///< @brief The address that was used to transfer + ULWord acAudioInStartAddress; ///< @brief For record - first position in buffer of audio (includes base offset) -- AudioInAddress at the time this Frame was stamped + ULWord acAudioInStopAddress; ///< @brief For record - end position (exclusive) in buffer of audio (includes base offset) -- AudioInAddress at the Frame AFTER this Frame was stamped + ULWord acAudioOutStopAddress; ///< @brief For play - first position in buffer of audio -- AudioOutAddress at the time this Frame was stamped + ULWord acAudioOutStartAddress; ///< @brief For play - end position (exclusive) in buffer of audio -- AudioOutAddress at the Frame AFTER it was stamped + ULWord acTotalBytesTransferred; ///< @brief Total audio and video bytes transferred + ULWord acStartSample; ///< @brief The actual start sample when this frame was started in VBI, which may be used to check sync against + ///< acAudioInStartAddress (Play) or acAudioOutStartAddress (Record). In record it will always be equal, + ///< but in playback if the clocks drift or the user supplies non aligned audio sizes, then this will + ///< give the current difference from expected versus actual position. To be useful, playback audio must + ///< be clocked in at the correct rate. + /** + @name Current (Active) Frame Information + **/ + ///@{ + + /** + @brief Intended for capture, this is a sequence of ::NTV2_RP188 values received from the device (in ::NTV2TCIndex order). + If empty, no timecodes will be transferred. This field is ignored if ::AUTOCIRCULATE_WITH_RP188 option is not set. + @note This field is owned by the SDK, which is responsible for allocating and/or freeing it. + Call FRAME_STAMP::GetInputTimeCodes or FRAME_STAMP::GetInputTimeCode to retrieve the timecodes stored in this field. + **/ + NTV2_POINTER acTimeCodes; + LWord64 acCurrentTime; ///< @brief Current processor time, derived from the finest-grained counter available on the host OS. + ///< Granularity can vary depending on the HAL. FRAME_STAMP::acAudioClockCurrentTime is the recommended time-stamp to use instead of this. + ULWord acCurrentFrame; ///< @brief Last vertical blank frame for this autocirculate channel (when CNTV2Card::AutoCirculateGetFrameStamp was called) + LWord64 acCurrentFrameTime; ///< @brief Vertical blank start of current frame + ULWord64 acAudioClockCurrentTime; ///< @brief Current time expressed as a count of 10MHz ticks, based on 48kHz clock (from register 28). + ULWord acCurrentAudioExpectedAddress; // FIXFIXFIX Document What is this?! + ULWord acCurrentAudioStartAddress; ///< @brief As set by play + ULWord acCurrentFieldCount; ///< @brief As found by ISR at Call Field0 or Field1 _currently_ being OUTPUT (when CNTV2Card::AutoCirculateGetFrameStamp was called) + ULWord acCurrentLineCount; ///< @brief At Call Line# _currently_ being OUTPUT (at the time of the IOCTL_NTV2_GET_FRAMESTAMP) + ULWord acCurrentReps; ///< @brief Contains validCount (Playout: on repeated frames, number of reps remaining; Record: drops on frame) + ULWord64 acCurrentUserCookie; ///< @brief The frame's AUTOCIRCULATE_TRANSFER::acInUserCookie value that was set when CNTV2Card::AutoCirculateTransfer was called. + /// This can tell clients which frame was on-air at the last VBI. + ULWord acFrame; ///< @brief Record/capture -- current frame number + NTV2_SHOULD_BE_DEPRECATED (NTV2_RP188 acRP188); ///< @brief Deprecated -- call FRAME_STAMP::GetInputTimeCode instead. + + ///@} + NTV2_TRAILER acTrailer; ///< @brief The common structure trailer -- ALWAYS LAST! + + #if !defined (NTV2_BUILDING_DRIVER) + /** + @brief Constructs a default FRAME_STAMP structure. + **/ + explicit FRAME_STAMP (); + + /** + @brief Constructs me from another FRAME_STAMP. + @param[in] inObj Specifies the FRAME_STAMP to be copied. + **/ + FRAME_STAMP (const FRAME_STAMP & inObj); + + /** + @brief My destructor. + **/ + ~FRAME_STAMP (); + + /** + @brief Sets my fields from the given FRAME_STAMP_STRUCT. + @param[in] inOldStruct Specifies the FRAME_STAMP_STRUCT that is to be copied into me. + **/ + bool SetFrom (const FRAME_STAMP_STRUCT & inOldStruct); + + /** + @brief Copies my fields into the given FRAME_STAMP_STRUCT. + @param[out] outOldStruct Specifies the FRAME_STAMP_STRUCT that is to be copied from me. + **/ + bool CopyTo (FRAME_STAMP_STRUCT & outOldStruct) const; + + /** + @brief Returns all RP188 timecodes associated with the frame in NTV2TCIndex order. + @param[out] outValues Receives the NTV2TimeCodeList that was transferred from the device. + An NTV2TCIndex enum value can be used to index into the list to fetch the desired timecode of interest. + @return True if successful; otherwise false. + **/ + bool GetInputTimeCodes (NTV2TimeCodeList & outValues) const; + + /** + @brief Returns only those timecodes from the frame that are associated with a given SDI input. + @param[out] outTimeCodes Receives the timecode values. + @param[in] inSDIInput Specifies the SDI input of interest, expressed as an ::NTV2Channel. + @param[in] inValidOnly Optionally specifies if only valid timecodes should be returned. Defaults to true. + Specify false to return all timecode values associated with the channel of interest, + even if they're not valid. + @return True if successful; otherwise false. + **/ + bool GetInputTimeCodes (NTV2TimeCodes & outTimeCodes, const NTV2Channel inSDIInput, const bool inValidOnly = true) const; + + /** + @brief Answers with a specific timecode captured in my acTimeCodes member. + @param[out] outTimeCode Receives the requested timecode value. + @param[in] inTCIndex Specifies which NTV2TCIndex to use. Defaults to NTV2_TCINDEX_SDI1. + @note Note that specifying an SDI input source that's not connected to the framestore associated with the + channel being AutoCirculated will likely result in a timecode that's not frame-accurate. + @return True if successful; otherwise false. + **/ + bool GetInputTimeCode (NTV2_RP188 & outTimeCode, const NTV2TCIndex inTCIndex = NTV2_TCINDEX_SDI1) const; + + /** + @brief Answers with the NTV2SDIInputStatus for the given SDI input spigot. + @param[out] outStatus Receives the NTV2SDIInputStatus for the given SDI input. + @param[in] inSDIInputIndex0 Specifies the zero-based index of the SDI input of interest. + @return True if successful; otherwise false. + **/ + bool GetSDIInputStatus (NTV2SDIInputStatus & outStatus, const UWord inSDIInputIndex0 = 0) const; + + /** + @brief Sets one of my input timecodes. + @param[in] inTCNdx Specifies which timecode (slot) to set. + @param[in] inTimecode Specifies the timecode data to write. + @return True if successful; otherwise false. + @note This function is provided for internal SDK use only. + **/ + bool SetInputTimecode (const NTV2TCIndex inTCNdx, const NTV2_RP188 & inTimecode); + + /** + @param[in] inRHS The FRAME_STAMP to be assigned (copied) into me. + @return A reference to me. + **/ + FRAME_STAMP & operator = (const FRAME_STAMP & inRHS); + + /** + @return A string containing the human-readable data for the given zero-based index value. + @param[in] inIndexNum A zero-based index number that specifies which member data value to return. + **/ + std::string operator [] (const unsigned inIndexNum) const; + + NTV2_IS_STRUCT_VALID_IMPL(acHeader,acTrailer) + + #endif // !defined (NTV2_BUILDING_DRIVER) + NTV2_STRUCT_END (FRAME_STAMP) + + + /** + @brief This object is embedded in the AUTOCIRCULATE_TRANSFER struct that's returned from the CNTV2Card::AutoCirculateTransfer function, + and contains status information about the transfer and the state of AutoCirculate. + @note This struct uses a constructor to properly initialize itself. Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (AUTOCIRCULATE_TRANSFER_STATUS) // AUTOCIRCULATE_TYPE_XFERSTATUS + NTV2_HEADER acHeader; ///< @brief The common structure header -- ALWAYS FIRST! + NTV2AutoCirculateState acState; ///< @brief Current AutoCirculate state after the transfer + LWord acTransferFrame; ///< @brief Frame buffer number the frame was transferred to/from. (-1 if failed) + ULWord acBufferLevel; ///< @brief The number of frames ready to record/play after the transfer. + ULWord acFramesProcessed; ///< @brief Total number of frames successfully processed since AutoCirculateStart. + ULWord acFramesDropped; ///< @brief Total number of frames dropped since AutoCirculateStart. + FRAME_STAMP acFrameStamp; ///< @brief Frame stamp for the transferred frame. + ULWord acAudioTransferSize; ///< @brief Number of bytes captured into the audio buffer. + ULWord acAudioStartSample; ///< @brief Starting audio sample (valid for capture only). + ULWord acAncTransferSize; ///< @brief Total ancillary data bytes for field 1 transferred (capture only). + ULWord acAncField2TransferSize;///< @brief Total ancillary data bytes for field 2 transferred (capture only). + NTV2_TRAILER acTrailer; ///< @brief The common structure trailer -- ALWAYS LAST! + + #if !defined (NTV2_BUILDING_DRIVER) + /** + @brief Constructs a default AUTOCIRCULATE_TRANSFER_STATUS structure. + **/ + explicit AUTOCIRCULATE_TRANSFER_STATUS (); + + /** + @return My FRAME_STAMP member. + **/ + inline const FRAME_STAMP & GetFrameStamp (void) const {return acFrameStamp;} + + /** + @return The frame buffer number the frame was transferred to or from (or -1 if the transfer failed). + **/ + inline LWord GetTransferFrame (void) const {return acTransferFrame;} + + /** + @return My state after the transfer. + **/ + inline NTV2AutoCirculateState GetState (void) const {return acState;} + + /** + @return My buffer level after the transfer. + **/ + inline ULWord GetBufferLevel (void) const {return acBufferLevel;} + + /** + @return The total number of frames successfully processed (not dropped) since AutoCirculateStart called. + **/ + inline ULWord GetProcessedFrameCount (void) const {return acFramesProcessed;} + + /** + @return The total number of frames dropped since AutoCirculateStart called. + **/ + inline ULWord GetDroppedFrameCount (void) const {return acFramesDropped;} + + /** + @return The number of audio bytes deposited/transferred into the host audio buffer after + the last successful CNTV2Card::AutoCirculateTransfer. + **/ + inline ULWord GetCapturedAudioByteCount (void) const {return acAudioTransferSize;} + + /** + @return The number of ancillary data bytes deposited/transferred into the host anc buffer after + the last successful CNTV2Card::AutoCirculateTransfer. + @param[in] inField2 Specify \c true for Field 2; otherwise \c false (the default) for Field 1 (or progessive). + **/ + inline ULWord GetCapturedAncByteCount (const bool inField2 = false) const {return inField2 ? acAncField2TransferSize : acAncTransferSize;} + + NTV2_IS_STRUCT_VALID_IMPL(acHeader,acTrailer) + + NTV2_BEGIN_PRIVATE + inline explicit AUTOCIRCULATE_TRANSFER_STATUS (const AUTOCIRCULATE_TRANSFER_STATUS & inObj) : acHeader(0xFEFEFEFE, 0) {(void) inObj;} ///< @brief You cannot construct an AUTOCIRCULATE_TRANSFER_STATUS from another. + inline AUTOCIRCULATE_TRANSFER_STATUS & operator = (const AUTOCIRCULATE_TRANSFER_STATUS & inRHS) {(void) inRHS; return *this;} ///< @brief You cannot assign AUTOCIRCULATE_TRANSFER_STATUSs. + NTV2_END_PRIVATE + #endif // !defined (NTV2_BUILDING_DRIVER) + NTV2_STRUCT_END (AUTOCIRCULATE_TRANSFER_STATUS) + + + /** + @brief This object specifies the information that will be transferred to or from the AJA device in the CNTV2Card::AutoCirculateTransfer + function call. It will be used by the device driver only if the AUTOCIRCULATE_WITH_ANC option was used in the call to + CNTV2Card::AutoCirculateInitForInput or CNTV2Card::AutoCirculateInitForOutput. + @note This struct uses a constructor to properly initialize itself. Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (AUTOCIRCULATE_TRANSFER) + NTV2_HEADER acHeader; ///< @brief The common structure header -- ALWAYS FIRST! + + /** + @brief The host video buffer. This field is owned by the client application, and thus is responsible for allocating and/or freeing it. + If the pointer is NULL or the size is zero, no video will be transferred. AJA recommends keeping this buffer 64-bit aligned + and page-aligned for best performance. Use the AUTOCIRCULATE_TRANSFER::SetVideoBuffer method to set or reset this field. + **/ + NTV2_POINTER acVideoBuffer; + + /** + @brief The host audio buffer. This field is owned by the client application, and thus is responsible for allocating and/or freeing it. + If the pointer is NULL or the size is zero, no audio will be transferred. AJA recommends keeping this buffer 64-bit aligned + and page-aligned for best performance. Use the AUTOCIRCULATE_TRANSFER::SetAudioBuffer method to set or reset this field. + **/ + NTV2_POINTER acAudioBuffer; + + /** + @brief The host ancillary data buffer. This field is owned by the client application, and thus is responsible for allocating and/or + freeing it. If the pointer is NULL or the size is zero, no ancillary data will be transferred. + Use the AUTOCIRCULATE_TRANSFER::SetAncBuffers method to set or reset this field. + @note If non-empty (i.e., non-NULL), be sure that the pointer address is aligned to the nearest 8-byte boundary. AJA recommends + using a full 2048-byte buffer. For playout, its content should be compatible with what's documented in \ref ancillarydata + and all subsequent bytes in the buffer should be zero. For capture, AJA recommends clearing (zeroing) the buffer prior to + each transfer. + **/ + NTV2_POINTER acANCBuffer; + + /** + @brief The host "Field 2" ancillary data buffer. This field is owned by the client application, and thus is responsible for allocating + and/or freeing it. If the pointer is NULL or the size is zero, no "Field 2" ancillary data will be transferred. + Use the AUTOCIRCULATE_TRANSFER::SetAncBuffers method to set or reset this field. + @note If non-empty (i.e., non-NULL), be sure that the pointer address is aligned to the nearest 8-byte boundary. AJA recommends + using a full 2048-byte buffer. For playout, its content should be compatible with what's documented in \ref ancillarydata + and all subsequent bytes in the buffer should be zero. For capture, AJA recommends clearing (zeroing) the buffer prior to + each transfer. + **/ + NTV2_POINTER acANCField2Buffer; + + /** + @brief Intended for playout, this is an ordered sequence of NTV2_RP188 values to send to the device. If empty, no timecodes will + be transferred. This field is ignored if AUTOCIRCULATE_WITH_RP188 option is not set. + @note This field is owned by the SDK, which is responsible for allocating and/or freeing it. + Use my AUTOCIRCULATE_TRANSFER::SetOutputTimeCodes or AUTOCIRCULATE_TRANSFER::SetOutputTimeCode methods to change this field. + **/ + NTV2_POINTER acOutputTimeCodes; + + /** + @brief Contains status information that's valid after CNTV2Card::AutoCirculateTransfer returns, including the driver buffer level, number of + frames processed or dropped, audio and anc transfer byte counts, and a complete FRAME_STAMP that has even more detailed + clocking information. + **/ + AUTOCIRCULATE_TRANSFER_STATUS acTransferStatus; + + /** + @brief Intended for playout, an optional app-specific cookie value that tags this frame, such that if this same tag appears in + acTransferStatus.acFrameStamp.acCurrentUserCookie after AutoCirculateTransfer returns, or if it appears in the FRAME_STAMP's + acCurrentUserCookie field after CNTV2Card::AutoCirculateGetFrameStamp returns, identifies when the frame was on-the-air. + **/ + ULWord64 acInUserCookie; + + /** + @brief Optional byte offset into the device frame buffer. Defaults to zero. If non-zero, should be a multiple of the line length, + or else bad video will likely result. On capture, this specifies where the first byte in the device video buffer will be + read from (and that byte will end up in the first byte position in the host video buffer. Conversely, on playout, this + specifies where the first byte from the host video buffer will end up in the device video buffer. + **/ + ULWord acInVideoDMAOffset; + + NTV2SegmentedDMAInfo acInSegmentedDMAInfo; ///< @brief Optional segmented DMA info, for use with specialized data transfers. + NTV2ColorCorrectionData acColorCorrection; ///< @brief Color correction data. This field is ignored if AUTOCIRCULATE_WITH_COLORCORRECT option is not set. + NTV2FrameBufferFormat acFrameBufferFormat; ///< @brief Specifies the frame buffer format to change to. Ignored if AUTOCIRCULATE_WITH_FBFCHANGE option is not set. + NTV2VideoFrameBufferOrientation acFrameBufferOrientation; ///< @brief Specifies the frame buffer orientation to change to. Ignored if AUTOCIRCULATE_WITH_FBOCHANGE option is not set. + AutoCircVidProcInfo acVidProcInfo; ///< @brief Specifies the mixer/keyer transition to make. Ignored if AUTOCIRCULATE_WITH_VIDPROC option is not set. + NTV2QuarterSizeExpandMode acVideoQuarterSizeExpand; ///< @brief Turns on the "quarter-size expand" (2x H + 2x V) hardware. Defaults to off (1:1). + + NTV2_POINTER acHDMIAuxData; + + /** + @name Lesser-used and Deprecated Members + **/ + ///@{ + ULWord acPeerToPeerFlags; //// @brief Used to control P2P transfers. + ULWord acFrameRepeatCount; ///< @brief Intended for playout. The number of times to repeat the frame being transferred. + LWord acDesiredFrame; ///< @brief Used to specify a different frame in the circulate ring to transfer to/from. + NTV2_SHOULD_BE_DEPRECATED(NTV2_RP188 acRP188); ///< @brief Will be deprecated -- use AUTOCIRCULATE_TRANSFER::SetOutputTimeCode instead. + NTV2_SHOULD_BE_DEPRECATED(NTV2Crosspoint acCrosspoint); ///< @brief Will be deprecated -- used internally by the SDK. Will be removed when the driver changes to use NTV2Channel/NTV2Mode. + ///@} + NTV2_TRAILER acTrailer; ///< @brief The common structure trailer -- ALWAYS LAST! + + #if !defined (NTV2_BUILDING_DRIVER) + /** + @name Construction & Destruction + **/ + ///@{ + explicit AUTOCIRCULATE_TRANSFER (); ///< @brief Constructs a default AUTOCIRCULATE_TRANSFER struct. + ~AUTOCIRCULATE_TRANSFER (); ///< @brief My default destructor, which frees all allocatable fields that I own. + + /** + @brief Constructs an AUTOCIRCULATE_TRANSFER object to use in a CNTV2Card::AutoCirculateTransfer call. + @param pInVideoBuffer Specifies a pointer to the host video buffer. On capture, this buffer will be written during the DMA operation. + On playout, this buffer will be read during the DMA operation. If NULL, no video will be transferred. + @param inVideoByteCount On capture, specifies the maximum capacity of the host video buffer, in bytes. + On playout, specifies the number of video bytes to transfer from the host buffer. + If zero, no video will be transferred. + @param pInAudioBuffer Optionally specifies a pointer to the host audio buffer. On capture, audio data will be DMA'd to this buffer. + On playout, audio data will be read from this buffer. If NULL, no audio will be transferred. + Defaults to NULL. + @param inAudioByteCount Optionally specifies the maximum capacity of the host audio buffer, in bytes. If zero, no audio will be transferred. + Defaults to zero. + @param pInANCBuffer Optionally specifies a pointer to the host ancillary data buffer. On capture, ancillary data will be DMA'd into this buffer. + On playout, ancillary data will be read from this buffer. If NULL, no Field 1 ancillary data will be transferred. + Defaults to NULL. + @param inANCByteCount Optionally specifies the maximum capacity of the Field 1 host ancillary data buffer, in bytes. + If zero, no ancillary data (progressive or interlaced F1) will be transferred. Defaults to zero. + @param pInANCF2Buffer Optionally specifies a pointer to the Field 2 host ancillary data buffer. On capture, ancillary data will be DMA'd into this buffer. + On playout, ancillary data will be read from this buffer. If NULL, no ancillary data will be transferred. + Defaults to NULL. + @param inANCF2ByteCount Optionally specifies the maximum capacity of the Field 2 host ancillary data buffer, in bytes. + If zero, no ancillary data (interlaced F2) will be transferred. Defaults to zero. + **/ + explicit AUTOCIRCULATE_TRANSFER (ULWord * pInVideoBuffer, const ULWord inVideoByteCount, ULWord * pInAudioBuffer = AJA_NULL, + const ULWord inAudioByteCount = 0, ULWord * pInANCBuffer = AJA_NULL, const ULWord inANCByteCount = 0, + ULWord * pInANCF2Buffer = AJA_NULL, const ULWord inANCF2ByteCount = 0); + /** + @brief Resets the struct to its initialized state, with timecode capture disabled, freeing all buffers that were allocated by the SDK. + (Buffers set by the client application are zeroed but not freed.) + **/ + void Clear (void); + + NTV2_BEGIN_PRIVATE + inline explicit AUTOCIRCULATE_TRANSFER (const AUTOCIRCULATE_TRANSFER & inObj) + : acHeader(0xFEFEFEFE, 0), acVideoBuffer(0), acAudioBuffer(0), + acANCBuffer(0), acANCField2Buffer(0), acOutputTimeCodes(0), acHDMIAuxData(0) + {(void) inObj;} ///< @brief You cannot construct an AUTOCIRCULATE_TRANSFER from another. + inline AUTOCIRCULATE_TRANSFER & operator = (const AUTOCIRCULATE_TRANSFER & inRHS) {(void) inRHS; return *this;} ///< @brief You cannot assign AUTOCIRCULATE_TRANSFERs. + NTV2_END_PRIVATE + ///@} + + /** + @name Buffer Management + **/ + ///@{ + /** + @brief Sets my buffers for use in a subsequent call to CNTV2Card::AutoCirculateTransfer. + @param pInVideoBuffer Specifies a pointer to the host video buffer. On capture, this buffer will be written during the DMA operation. + On playout, this buffer will be read during the DMA operation. If NULL, no video will be transferred. + @param inVideoByteCount On capture, specifies the maximum capacity of the host video buffer, in bytes. + On playout, specifies the number of video bytes to transfer from the host buffer. + If zero, no video will be transferred. + @param pInAudioBuffer Specifies a pointer to the host audio buffer. On capture, audio data will be DMA'd to this buffer. + On playout, audio data will be read from this buffer. If NULL, no audio will be transferred. + @param inAudioByteCount On capture, specifies the maximum capacity of the host audio buffer, in bytes. + On playout, specifies the number of audio bytes (and therefore audio samples) to transfer from the host buffer. + If zero, no audio will be transferred. + @param pInANCBuffer Specifies a pointer to the host ancillary data buffer. On capture, ancillary data will be DMA'd into this buffer. + On playout, ancillary data will be read from this buffer. If NULL, no ancillary data will be transferred. + @param inANCByteCount On capture, specifies the maximum capacity of the host ancillary data buffer, in bytes. After the transfer, + it will contain the actual number of bytes transferred. + On playout, specifies the number of ancillary data bytes to transfer from the host buffer. + If zero, no ancillary data will be transferred. + @param pInANCF2Buffer Optionally specifies a pointer to the Field 2 host ancillary data buffer. On capture, ancillary data for Field 2 + (interlaced video formats only) will be DMA'd into this buffer. + On playout, ancillary data for Field 2 (interlaced video formats only) will be read from this buffer. + If NULL, no Field 2 ancillary data will be transferred. Defaults to NULL. + @param inANCF2ByteCount Optionally specifies the maximum capacity of the Field 2 host ancillary data buffer, in bytes. + If zero, no ancillary data (interlaced F2) will be transferred. Defaults to zero. + **/ + bool SetBuffers (ULWord * pInVideoBuffer, const ULWord inVideoByteCount, + ULWord * pInAudioBuffer, const ULWord inAudioByteCount, + ULWord * pInANCBuffer, const ULWord inANCByteCount, + ULWord * pInANCF2Buffer = AJA_NULL, const ULWord inANCF2ByteCount = 0); + + /** + @brief Sets my video buffer for use in a subsequent call to CNTV2Card::AutoCirculateTransfer. + @param pInVideoBuffer Specifies a pointer to the host video buffer. On capture, this buffer will be written during the DMA operation. + On playout, this buffer will be read during the DMA operation. If NULL, no video data will be transferred. + @param inVideoByteCount Specifies the maximum capacity of the host video buffer, in bytes, or the maximum number of video data bytes to transfer. + If zero, no video data will be transferred. + @return True if successful; otherwise false. + @note Having the \c pInAudioBuffer address start on at least an 8-byte boundary or even better, on a page boundary, + and the \c inAudioByteCount be a multiple of 8-bytes (or optimally a multiple of a page) increases PCIe DMA + efficiency on most modern operating systems. + **/ + bool SetVideoBuffer (ULWord * pInVideoBuffer, const ULWord inVideoByteCount); + + /** + @brief Sets my audio buffer for use in a subsequent call to CNTV2Card::AutoCirculateTransfer. + @param pInAudioBuffer Specifies a pointer to the host audio buffer. On capture, audio data will be DMA'd into this buffer. + On playout, audio data will be DMA'd from this buffer. If NULL, no audio data will be transferred. + @param inAudioByteCount On capture, specifies the maximum capacity of the host audio buffer, in bytes; on playout, specifies + the number of audio bytes (and therefore audio samples) to transfer. If zero, no audio data will be transferred. + @return True if successful; otherwise false. + @note Having the \c pInAudioBuffer address start on at least an 8-byte boundary or even better, on a page boundary, increases PCIe + DMA efficiency on most modern operating systems. + **/ + bool SetAudioBuffer (ULWord * pInAudioBuffer, const ULWord inAudioByteCount); + + /** + @brief Sets my ancillary data buffers for use in a subsequent call to CNTV2Card::AutoCirculateTransfer. + @param pInANCBuffer Specifies a pointer to the host ancillary data buffer. On capture, ancillary data will be DMA'd into this buffer. + On playout, ancillary data will be read from this buffer. If NULL, no ancillary data will be transferred. + @param inANCByteCount On capture, specifies the maximum capacity of the host ancillary data buffer, in bytes. After the transfer, + it will contain the actual number of bytes transferred. + On playout, specifies the number of ancillary data bytes to transfer from the host buffer. + If zero, no ancillary data will be transferred. + @param pInANCF2Buffer Optionally specifies a pointer to the Field 2 host ancillary data buffer. On capture, ancillary data for Field 2 + (interlaced video formats only) will be DMA'd into this buffer. + On playout, ancillary data for Field 2 (interlaced video formats only) will be read from this buffer. + If NULL, no Field 2 ancillary data will be transferred. Defaults to NULL. + @param inANCF2ByteCount Optionally specifies the maximum capacity of the Field 2 host ancillary data buffer, in bytes, or the maximum + number of Field 2 ancillary data bytes to transfer. If zero, no F2 ancillary data will be transferred. + Defaults to zero. + @note If using a non-NULL pointer address for either \c pInANCBuffer or \c pInANCF2Buffer, be sure they're aligned to the nearest 8-byte boundary. + @note If using a non-zero byte count, AJA recommends using a 2048-byte buffer (per field). There's no need to fill the entire buffer, + but the data it contains should be compatible with what's documented in \ref anccapture or \ref ancplayout (as appropriate). + @return True if successful; otherwise false. + **/ + bool SetAncBuffers (ULWord * pInANCBuffer, const ULWord inANCByteCount, + ULWord * pInANCF2Buffer = AJA_NULL, const ULWord inANCF2ByteCount = 0); + /** + @return My video buffer. + **/ + inline const NTV2_POINTER & GetVideoBuffer (void) const {return acVideoBuffer;} + + /** + @return My audio buffer. + **/ + inline const NTV2_POINTER & GetAudioBuffer (void) const {return acAudioBuffer;} + + /** + @param[in] inField2 Specify true for Field2. Defaults to false (Field1). + @return My ancillary data buffer. + **/ + inline const NTV2_POINTER & GetAncBuffer (const bool inField2 = false) const {return inField2 ? acANCField2Buffer : acANCBuffer;} + ///@} + + /** + @name Timecode + **/ + ///@{ + + /** + @brief Intended for playout, replaces the contents of my acOutputTimeCodes member. + @param[in] inValues Specifies the NTV2TimeCodes map to transfer to the device. + @return True if successful; otherwise false. + @note The NTV2TimeCodes map should be populated only with timecodes that make sense for the AutoCirculate + channel that's in use, otherwise the timecode output of other channels may be affected. + @note To work right, CNTV2Card::AutoCirculateInitForOutput must have been initialized with the AUTOCIRCULATE_WITH_RP188 option. + **/ + bool SetOutputTimeCodes (const NTV2TimeCodes & inValues); + + /** + @brief Intended for playout, sets one element of my acOutputTimeCodes member. + @param[in] inTimecode Specifies the timecode value. + @param[in] inTCIndex Specifies which NTV2TCIndex to use. Defaults to NTV2_TCINDEX_SDI1. + @note Note that specifying an SDI output destination that's not connected to the framestore associated with the + channel being AutoCirculated can result in the wrong timecode being transmitted from another AutoCirculate + channel's SDI output(s). + @note To work right, CNTV2Card::AutoCirculateInitForOutput must have been initialized with the AUTOCIRCULATE_WITH_RP188 option. + @return True if successful; otherwise false. + **/ + bool SetOutputTimeCode (const NTV2_RP188 & inTimecode, const NTV2TCIndex inTCIndex = NTV2_TCINDEX_SDI1); + + /** + @brief Intended for playout, replaces all elements of my acOutputTimeCodes member with the given timecode value. + @param[in] inTimecode Specifies the timecode value to use for all possible embedded (VITC, ATC-LTC) and analog timecode outputs for the device. + @param[in] inIncludeF2 Specify true to include Field2 timecode values (VITC2), or false to exclude them. Defaults to true. + @note Note that specifying an SDI output destination that's not connected to the framestore associated with the + AutoCirculate channel can result in the wrong timecode being transmitted from another channel's SDI output(s). + @return True if successful; otherwise false. + **/ + bool SetAllOutputTimeCodes (const NTV2_RP188 & inTimecode, const bool inIncludeF2 = true); + + /** + @brief Intended for capture, answers with the timecodes captured in my acTransferStatus member's acFrameStamp member. + @param[out] outValues Receives the NTV2TimeCodeList that was transferred from the device. + (An NTV2TCIndex value can be used as in index in the list.) + @return True if successful; otherwise false. + @note To work right, CNTV2Card::AutoCirculateInitForInput must have been initialized with the AUTOCIRCULATE_WITH_RP188 option. + **/ + bool GetInputTimeCodes (NTV2TimeCodeList & outValues) const; + + /** + @brief Intended for capture, answers with a specific timecode captured in my acTransferStatus member's + acFrameStamp member's acTimeCodes member. + @param[out] outTimeCode Receives the requested timecode value. + @param[in] inTCIndex Specifies which NTV2TCIndex to use. Defaults to NTV2_TCINDEX_SDI1. + @note Note that specifying an SDI input source that's not connected to the framestore associated with the + channel being AutoCirculated will likely result in a timecode that's not frame-accurate. + @note To work right, CNTV2Card::AutoCirculateInitForInput must have been initialized with the AUTOCIRCULATE_WITH_RP188 option. + @return True if successful; otherwise false. + **/ + bool GetInputTimeCode (NTV2_RP188 & outTimeCode, const NTV2TCIndex inTCIndex = NTV2_TCINDEX_SDI1) const; + + /** + @brief Retrieves the timecodes from the captured frame that are associated with the given SDI input. + @param[out] outTimeCodes Receives the timecode values as a mapping of ::NTV2TCIndex values to ::NTV2_RP188 objects. + @param[in] inSDIInput Specifies the SDI input of interest as an ::NTV2Channel. Defaults to ::NTV2_CHANNEL1 (SDI In 1). + @param[in] inValidOnly Optionally specifies if only valid timecodes should be returned. Defaults to true. + Specify false to return all timecode values associated with the SDI input of interest, + even if they're not valid. + @note Note that specifying an SDI input source that's not connected to the framestore associated with the + channel being AutoCirculated will likely result in a timecode that's not frame-accurate. + @note To work right, CNTV2Card::AutoCirculateInitForInput must have been initialized with the AUTOCIRCULATE_WITH_RP188 option. + @return True if successful; otherwise false. + **/ + bool GetInputTimeCodes (NTV2TimeCodes & outTimeCodes, const NTV2Channel inSDIInput = NTV2_CHANNEL1, const bool inValidOnly = true) const; + ///@} + + /** + @name Miscellaneous + **/ + ///@{ + + /** + @brief Intended for playout, replaces my current acUserCookie value with the new value. + @param[in] inUserCookie Specifies the new cookie value. + @return True if successful; otherwise false. + @note This is useful in playout applications that need to know when a specific frame was actually transmitted on-air. + By calling this method with a unique tag (or application-specific pointer address), and monitoring the FRAME_STAMP + after calling CNTV2Card::AutoCirculateTransfer or CNTV2Card::AutoCirculateGetFrameStamp, you can tell if/when the + frame went on-the-air. + **/ + inline bool SetFrameUserCookie (const ULWord64 & inUserCookie) {acInUserCookie = inUserCookie; return true;} + + /** + @brief Sets my acFrameBufferFormat value to the given new value (if valid and circulating with AUTOCIRCULATE_WITH_FBFCHANGE option). + @param[in] inNewFormat Specifies the new frame buffer format value to change to. Must be a valid format for the device. + @return True if successful; otherwise false. + @note This function call is ignored if CNTV2Card::AutoCirculateInitForInput or CNTV2Card::AutoCirculateInitForOutput were + called without the AUTOCIRCULATE_WITH_FBFCHANGE option set. + **/ + bool SetFrameBufferFormat (const NTV2FrameBufferFormat inNewFormat); + + /** + @brief Enables quarter-size expansion mode. + **/ + inline void EnableQuarterSizeExpandMode (void) {acVideoQuarterSizeExpand = NTV2_QuarterSizeExpandOn;} + + /** + @brief Enables quarter-size expansion mode. + **/ + inline void DisableQuarterSizeExpandMode (void) {acVideoQuarterSizeExpand = NTV2_QuarterSizeExpandOff;} + + /** + @return True if quarter-size expansion mode is enabled. + **/ + inline bool IsQuarterSizeExpandModeEnabled (void) const {return acVideoQuarterSizeExpand == NTV2_QuarterSizeExpandOn;} + + /** + @brief Returns a constant reference to my AUTOCIRCULATE_TRANSFER_STATUS. + @return A constant reference to my AUTOCIRCULATE_TRANSFER_STATUS. + **/ + inline const AUTOCIRCULATE_TRANSFER_STATUS & GetTransferStatus (void) const {return acTransferStatus;} + + /** + @brief Returns a constant reference to my FRAME_STAMP. + @return A constant reference to my FRAME_STAMP. + **/ + inline const FRAME_STAMP & GetFrameInfo (void) const {return acTransferStatus.acFrameStamp;} + + /** + @return The number of audio bytes deposited/transferred into the host audio buffer after + the last successful CNTV2Card::AutoCirculateTransfer. + **/ + inline ULWord GetCapturedAudioByteCount (void) const {return acTransferStatus.GetCapturedAudioByteCount();} + + inline NTV2_DEPRECATED_f(ULWord GetAudioByteCount (void) const) {return GetCapturedAudioByteCount ();} ///< @deprecated Use GetCapturedAudioByteCount instead. + + /** + @return The number of ancillary data bytes deposited/transferred into the host anc buffer after + the last successful CNTV2Card::AutoCirculateTransfer. + @param[in] inField2 Specify true to obtain the Field 2 ancillary byte count. + Specify false (the default) to return the Field 1 (or progessive) ancillary byte count. + **/ + inline ULWord GetCapturedAncByteCount (const bool inField2 = false) const {return acTransferStatus.GetCapturedAncByteCount(inField2);} + inline NTV2_SHOULD_BE_DEPRECATED(ULWord GetAncByteCount (const bool inField2 = false) const) {return GetCapturedAncByteCount(inField2);} ///< @deprecated Use GetCapturedAncByteCount instead. + + /** + @return My current frame buffer format. + **/ + inline NTV2FrameBufferFormat GetFrameBufferFormat (void) const {return acFrameBufferFormat;} + + /** + @return The frame number that was transferred (or -1 if failed). + **/ + inline LWord GetTransferFrameNumber (void) const {return acTransferStatus.GetTransferFrame();} + ///@} + + /** + @name Segmented DMAs + **/ + ///@{ + /** + @brief Enables segmented DMAs given a segment count, a host pitch, and device pitch value. + @param[in] inNumSegments Specifies the number of segments (lines) to DMA. If zero or 1, this actually disables segmented DMAs, + and the remaining parameters are ignored. + @param[in] inNumActiveBytesPerLine Specifies the number of active bytes in a line of video. + @param[in] inHostBytesPerLine Specifies the offset, in bytes, between two adjacent segments on the host. + @param[in] inDeviceBytesPerLine Specifies the offset, in bytes, between two adjacent segments on the device. + @return True if successful; otherwise false. + @note IMPORTANT: For segmented DMAs, the AUTOCIRCULATE_TRANSFER::acVideoBuffer.fByteCount field holds the segment byte count (i.e., + the number of bytes to transfer per segment. + @todo Add a new \c inNumBytesPerSegment parameter to eliminate the necessity of setting AUTOCIRCULATE_TRANSFER::acVideoBuffer.fByteCount + to store the bytes-per-segment value. + **/ + bool EnableSegmentedDMAs (const ULWord inNumSegments, const ULWord inNumActiveBytesPerLine, + const ULWord inHostBytesPerLine, const ULWord inDeviceBytesPerLine); + /** + @brief Disables segmented DMAs, performing a Reset on my acInSegmentedDMAInfo. + @return True if successful; otherwise false. + **/ + bool DisableSegmentedDMAs (void); + + /** + @return True if segmented DMAs are currently enabled; otherwise false. + **/ + bool SegmentedDMAsEnabled (void) const; + ///@} + + NTV2_IS_STRUCT_VALID_IMPL(acHeader,acTrailer) + #endif // user-space clients only + NTV2_STRUCT_END (AUTOCIRCULATE_TRANSFER) + + + /** + @brief This is used to enable or disable AJADebug logging in the driver. + @note This struct uses a constructor to properly initialize itself. Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (NTV2DebugLogging) + NTV2_HEADER mHeader; ///< @brief The common structure header -- ALWAYS FIRST! + NTV2_POINTER mSharedMemory; ///< @brief Virtual address of AJADebug shared memory in calling process' context, + // and its length. The AJADebug logging facility owns and manages this memory. + // If NULL or zero length, debug logging will be disabled in the driver. + // If non-NULL and zero length, debug logging will be enabled in the driver. + ULWord mReserved[32]; ///< @brief Reserved for future expansion. + NTV2_TRAILER mTrailer; ///< @brief The common structure trailer -- ALWAYS LAST! + + #if !defined (NTV2_BUILDING_DRIVER) + /** + @brief Constructs an NTV2DebugLogging struct. + @param[in] inEnable False to disable (the default), or True to enable. + **/ + explicit NTV2DebugLogging (const bool inEnable = false); + + /** + @brief Prints a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream to use. + @return A reference to the output stream. + **/ + std::ostream & Print (std::ostream & inOutStream) const; + + NTV2_IS_STRUCT_VALID_IMPL(mHeader, mTrailer) + + #endif // !defined (NTV2_BUILDING_DRIVER) + NTV2_STRUCT_END (NTV2DebugLogging) + + + /** + @brief This is used to prelock a video/audio/anc buffer used as the source or target of DMA transfers. + The driver will page-lock the buffer immediately, so it won't have to be done for each DMA transfer. + This will reduce transfer time and CPU overhead at the cost of locking physical memory. + @note This struct uses a constructor to properly initialize itself. + Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (NTV2BufferLock) + NTV2_HEADER mHeader; ///< @brief The common structure header -- ALWAYS FIRST! + NTV2_POINTER mBuffer; ///< @brief Virtual address of a buffer to prelock, and its length. + // A NULL buffer (or zero length) releases all locked buffers. + ULWord mFlags; ///< @brief Action flags (lock, unlock, etc) + ULWord64 mMaxLockSize; ///< @brief Max locked bytes. + ULWord mReserved[30]; ///< @brief Reserved for future expansion. + NTV2_TRAILER mTrailer; ///< @brief The common structure trailer -- ALWAYS LAST! + + #if !defined (NTV2_BUILDING_DRIVER) + /** + @name Construction & Destruction + **/ + ///@{ + explicit NTV2BufferLock (); ///< @brief Constructs a default NTV2BufferLock struct. + inline ~NTV2BufferLock () {} ///< @brief My default destructor, which frees all allocatable fields that I own. + + /** + @brief Constructs an NTV2BufferLock object to use in a CNTV2Card::DMABufferLock call. + @param inBuffer Specifies the memory to be locked for DMA operations. + @param inFlags Specifies action flags (e.g. ::DMABUFFERLOCK_LOCK, etc.). + **/ + explicit NTV2BufferLock (const NTV2_POINTER & inBuffer, const ULWord inFlags); + + /** + @brief Constructs an NTV2BufferLock object to use in a CNTV2Card::DMABufferLock call. + @param pInBuffer Specifies a pointer to the host buffer. This buffer will be locked for DMA operations. + @param inByteCount Specifies a the length of the buffer to lock in bytes. + @param inFlags Specifies action flags (lock, unlock, etc) + **/ + explicit NTV2BufferLock (const ULWord * pInBuffer, const ULWord inByteCount, const ULWord inFlags); + + /** + @brief Constructs an NTV2BufferLock object to use in a CNTV2Card::DMABufferLock call. + @param inMaxLockSize Specifies the maximum lock size in bytes + @param inFlags Specifies action flags (lock, unlock, etc) + **/ + explicit NTV2BufferLock (const ULWord64 inMaxLockSize, const ULWord inFlags); // New in SDK 16.0 +///@} + + /** + @name Changing + **/ + ///@{ + /** + @brief Sets the buffer to lock for use in a subsequent call to CNTV2Card::DMABufferLock. + @param inBuffer Specifies the memory to be locked for DMA operations. + @return True if successful; otherwise false. + **/ + bool SetBuffer (const NTV2_POINTER & inBuffer); + + /** + @brief Sets the buffer to lock for use in a subsequent call to CNTV2Card::DMABufferLock. + @param pInBuffer Specifies a pointer to the host buffer. This buffer will be locked for DMA operations. + @param inByteCount Specifies a the length of the buffer to lock in bytes. + @return True if successful; otherwise false. + **/ + inline bool SetBuffer (const ULWord * pInBuffer, const ULWord inByteCount) + { + return SetBuffer(NTV2_POINTER(pInBuffer, inByteCount)); + } + + /** + @brief Sets the action flags for use in a subsequent call to CNTV2Card::DMABufferLock. + @param inFlags Specifies action flags (lock, unlock, etc) + **/ + inline void SetFlags (const ULWord inFlags) {NTV2_ASSERT_STRUCT_VALID; mFlags = inFlags;} + + /** + @brief Sets the maximum lock size for use in a subsequent call to CNTV2Card::DMABufferLock. + @param inNumBytes Specifies maximum lock size, in bytes. + **/ + inline void SetMaxLockSize (const ULWord64 inNumBytes) {NTV2_ASSERT_STRUCT_VALID; mMaxLockSize = inNumBytes;} // New in SDK 16.0 + + /** + @brief Resets the struct to its initialized state. + @note This does not release locked buffers. + **/ + inline void Clear (void) + { + SetBuffer(NTV2_POINTER()); + SetFlags(0); + SetMaxLockSize(0); + } + ///@} + + /** + @brief Prints a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream to use. + @return A reference to the output stream. + **/ + std::ostream & Print (std::ostream & inOutStream) const; + + NTV2_IS_STRUCT_VALID_IMPL(mHeader, mTrailer) + + #endif // !defined (NTV2_BUILDING_DRIVER) + NTV2_STRUCT_END (NTV2BufferLock) + + + /** + @brief This is used for bitstream maintainance. (New in SDK 16.0) + @note This struct uses a constructor to properly initialize itself. + Do not use memset or bzero to initialize or "clear" it. + **/ + NTV2_STRUCT_BEGIN (NTV2Bitstream) + NTV2_HEADER mHeader; ///< @brief The common structure header -- ALWAYS FIRST! + NTV2_POINTER mBuffer; ///< @brief Virtual address of a bitstream buffer and its length. + ULWord mFlags; ///< @brief Action flags (lock, unlock, etc) + ULWord mStatus; ///< @brief Action status + ULWord mRegisters[16]; ///< @brief Register data + ULWord mReserved[32]; ///< @brief Reserved for future expansion. + NTV2_TRAILER mTrailer; ///< @brief The common structure trailer -- ALWAYS LAST! + + #if !defined (NTV2_BUILDING_DRIVER) + /** + @name Construction & Destruction + **/ + ///@{ + explicit NTV2Bitstream (); ///< @brief Constructs a default NTV2Bitstream struct. + inline ~NTV2Bitstream () {} ///< @brief My default destructor, which frees all allocatable fields that I own. + + /** + @brief Constructs an NTV2Bitstream object to use in a CNTV2Card::LoadBitstream call. + @param inBuffer Specifies the memory containing the bitstream to load. + @param inFlags Specifies action flags (fragment swap, etc.). + **/ + explicit NTV2Bitstream (const NTV2_POINTER & inBuffer, const ULWord inFlags); + + /** + @brief Constructs an NTV2Bitstream object to use in a CNTV2Card::LoadBitstream call. + @param pInBuffer Specifies a pointer to the host buffer containing the bitstream to load. + @param inByteCount Specifies a the length of the bitstream in bytes. + @param inFlags Specifies action flags (fragment, swap, etc) + **/ + explicit NTV2Bitstream (const ULWord * pInBuffer, const ULWord inByteCount, const ULWord inFlags); + ///@} + + /** + @name Changing + **/ + ///@{ + /** + @brief Sets the buffer to lock for use in a subsequent call to CNTV2Card::LoadBitstream. + @param inBuffer Specifies the memory containing the bitstream to load. + @return True if successful; otherwise false. + **/ + bool SetBuffer (const NTV2_POINTER & inBuffer); + + /** + @brief Sets the buffer to lock for use in a subsequent call to CNTV2Card::LoadBitstream. + @param pInBuffer Specifies a pointer to the host buffer contiaining the bitstread to load. + @param inByteCount Specifies a the length of the buffer to load in bytes. + @return True if successful; otherwise false. + **/ + inline bool SetBuffer (const ULWord * pInBuffer, const ULWord inByteCount) {return SetBuffer(NTV2_POINTER(pInBuffer, inByteCount));} + + /** + @brief Sets the action flags for use in a subsequent call to CNTV2Card::LoadBitstream. + @param inFlags Specifies action flags (fragment, swap, etc) + **/ + inline void SetFlags (const ULWord inFlags) {NTV2_ASSERT_STRUCT_VALID; mFlags = inFlags;} + + /** + @brief Resets the struct to its initialized state. + **/ + inline void Clear (void) {SetBuffer(NTV2_POINTER());} + ///@} + + /** + @brief Prints a human-readable representation of me to the given output stream. + @param inOutStream Specifies the output stream to use. + @return A reference to the output stream. + **/ + std::ostream & Print (std::ostream & inOutStream) const; + + NTV2_IS_STRUCT_VALID_IMPL(mHeader, mTrailer) + + #endif // !defined (NTV2_BUILDING_DRIVER) + NTV2_STRUCT_END (NTV2Bitstream) + + + #if !defined (NTV2_BUILDING_DRIVER) + typedef std::set NTV2VideoFormatSet; ///< @brief A set of distinct NTV2VideoFormat values. + typedef NTV2VideoFormatSet::const_iterator NTV2VideoFormatSetConstIter; ///< @brief A handy const iterator for iterating over an NTV2VideoFormatSet. + + typedef std::set NTV2FrameBufferFormatSet; ///< @brief A set of distinct NTV2FrameBufferFormat values. + typedef NTV2FrameBufferFormatSet::const_iterator NTV2FrameBufferFormatSetConstIter; ///< @brief A handy const iterator for iterating over an NTV2FrameBufferFormatSet. + + typedef std::set NTV2GeometrySet; ///< @brief A set of distinct NTV2FrameGeometry values. + typedef NTV2GeometrySet::const_iterator NTV2GeometrySetConstIter; ///< @brief A handy const iterator for iterating over an NTV2GeometrySet. + + typedef std::set NTV2StandardSet; ///< @brief A set of distinct NTV2Standard values. + typedef NTV2StandardSet::const_iterator NTV2StandardSetConstIter; ///< @brief A handy const iterator for iterating over an NTV2StandardSet. + + typedef std::set NTV2InputSourceSet; ///< @brief A set of distinct NTV2InputSource values. + typedef NTV2InputSourceSet::const_iterator NTV2InputSourceSetConstIter; ///< @brief A handy const iterator for iterating over an NTV2InputSourceSet. + + typedef std::set NTV2OutputDestinations; ///< @brief A set of distinct NTV2OutputDestination values. + typedef NTV2OutputDestinations::const_iterator NTV2OutputDestinationsConstIter; ///< @brief A handy const iterator for iterating over an NTV2OutputDestinations. + + /** + @brief Prints the given ::UWordSequence contents into the given output stream. + @param inOutStream The stream into which the given ::UWordSequence will be printed. + @param[in] inData Specifies the ::UWordSequence to be streamed. + @return The "inOStream" that was specified. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const UWordSequence & inData); + + /** + @brief Prints the given ::ULWordSequence contents into the given output stream. + @param inOutStream The stream into which the given ::ULWordSequence will be printed. + @param[in] inData Specifies the ::ULWordSequence to be streamed. + @return The "inOStream" that was specified. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const ULWordSequence & inData); + + /** + @brief Prints the given ::ULWord64Sequence contents into the given output stream. + @param inOutStream The stream into which the given ::ULWord64Sequence will be printed. + @param[in] inData Specifies the ::ULWord64Sequence to be streamed. + @return The "inOStream" that was specified. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const ULWord64Sequence & inData); + + /** + @return A string that contains the human-readable representation of the given ::NTV2AutoCirculateState value. + @param[in] inState Specifies the ::NTV2AutoCirculateState of interest. + **/ + AJAExport std::string NTV2AutoCirculateStateToString (const NTV2AutoCirculateState inState); + + /** + @brief Returns a set of distinct ::NTV2VideoFormat values supported on the given device. + @param[in] inDeviceID Specifies the ::NTV2DeviceID of the device of interest. + @param[out] outFormats Receives the set of distinct ::NTV2VideoFormat values supported by the device. + @return True if successful; otherwise false. + @todo This needs to be moved to a C++ compatible "device features" module. + **/ + AJAExport bool NTV2DeviceGetSupportedVideoFormats (const NTV2DeviceID inDeviceID, NTV2VideoFormatSet & outFormats); + + /** + @brief Prints the given ::NTV2VideoFormatSet contents into the given output stream. + @param inOStream The stream into which the human-readable list will be written. + @param[in] inFormats Specifies the set of video formats to be streamed. + @return The "inOStream" that was specified. + **/ + AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2VideoFormatSet & inFormats); + + /** + @brief Returns a set of distinct ::NTV2FrameBufferFormat values supported on the given device. + @param[in] inDeviceID Specifies the ::NTV2DeviceID of the device of interest. + @param[out] outFormats Receives the set of distinct ::NTV2FrameBufferFormat values supported by the device. + @return True if successful; otherwise false. + @todo This needs to be moved to a C++ compatible "device features" module. + **/ + AJAExport bool NTV2DeviceGetSupportedPixelFormats (const NTV2DeviceID inDeviceID, NTV2FrameBufferFormatSet & outFormats); + + /** + @brief Prints the given ::NTV2FrameBufferFormatSet contents into the given output stream. + @param inOStream The stream into which the human-readable list will be written. + @param[in] inFormats Specifies the set of pixel formats to be streamed. + @return The "inOStream" that was specified. + **/ + AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2FrameBufferFormatSet & inFormats); + + /** + @brief Appends the given ::NTV2FrameBufferFormatSet contents into the given set. + @param inOutSet The set to which the other set will be appended. + @param[in] inSet Specifies the set whose contents will be appended. + @return A reference to the modified set. + **/ + AJAExport NTV2FrameBufferFormatSet & operator += (NTV2FrameBufferFormatSet & inOutSet, const NTV2FrameBufferFormatSet inSet); + + /** + @brief Returns a set of distinct ::NTV2Standard values supported on the given device. + @param[in] inDeviceID Specifies the ::NTV2DeviceID of the device of interest. + @param[out] outStandards Receives the set of distinct ::NTV2Standard values supported by the device. + @return True if successful; otherwise false. + @todo This needs to be moved to a C++ compatible "device features" module. + **/ + AJAExport bool NTV2DeviceGetSupportedStandards (const NTV2DeviceID inDeviceID, NTV2StandardSet & outStandards); + + /** + @brief Prints the given ::NTV2StandardSet contents into the given output stream. + @param inOStream The stream into which the human-readable list will be written. + @param[in] inStandards Specifies the set of ::NTV2Standard values to be streamed. + @return The "inOStream" that was specified. + **/ + AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2StandardSet & inStandards); + + /** + @brief Appends the given ::NTV2StandardSet contents into the given set. + @param inOutSet The set to which the other set will be appended. + @param[in] inSet Specifies the set whose contents will be appended. + @return A reference to the modified set. + **/ + AJAExport NTV2StandardSet & operator += (NTV2StandardSet & inOutSet, const NTV2StandardSet inSet); + + /** + @brief Returns a set of distinct ::NTV2FrameGeometry values supported on the given device. + @param[in] inDeviceID Specifies the ::NTV2DeviceID of the device of interest. + @param[out] outGeometries Receives the set of distinct ::NTV2FrameGeometry values supported by the device. + @return True if successful; otherwise false. + @todo Needs to be moved to a C++ compatible "device features" module. + **/ + AJAExport bool NTV2DeviceGetSupportedGeometries (const NTV2DeviceID inDeviceID, NTV2GeometrySet & outGeometries); + + /** + @brief Prints the given ::NTV2GeometrySet contents into the given output stream. + @param inOStream The stream into which the human-readable list will be written. + @param[in] inGeometries Specifies the set of ::NTV2FrameGeometry values to be streamed. + @return The "inOStream" that was specified. + **/ + AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2GeometrySet & inGeometries); + + /** + @brief Appends the given ::NTV2GeometrySet contents into the given set. + @param inOutSet The set to which the other set will be appended. + @param[in] inSet Specifies the set whose contents will be appended. + @return A reference to the modified set. + **/ + AJAExport NTV2GeometrySet & operator += (NTV2GeometrySet & inOutSet, const NTV2GeometrySet inSet); + + /** + @brief Prints the given ::NTV2InputSourceSet contents into the given output stream. + @param inOStream The stream into which the human-readable list will be written. + @param[in] inSet Specifies the set to be streamed. + @return The "inOStream" that was specified. + **/ + AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2InputSourceSet & inSet); + + /** + @brief Appends the given ::NTV2InputSourceSet's contents into the given set. + @param inOutSet The set to which the other set will be appended. + @param[in] inSet Specifies the set whose contents will be appended. + @return A reference to the modified set. + **/ + AJAExport NTV2InputSourceSet & operator += (NTV2InputSourceSet & inOutSet, const NTV2InputSourceSet & inSet); + + /** + @brief Prints the given ::NTV2OutputDestinations' contents into the given output stream. + @param inOStream The stream into which the human-readable list will be written. + @param[in] inSet Specifies the set to be streamed. + @return The "inOStream" that was specified. + **/ + AJAExport std::ostream & operator << (std::ostream & inOStream, const NTV2OutputDestinations & inSet); // New in SDK 16.0 + + /** + @brief Appends the given ::NTV2OutputDestinations' contents into the given set. + @param inOutSet The set to which the other set will be appended. + @param[in] inSet Specifies the set whose contents will be appended. + @return A reference to the modified set. + **/ + AJAExport NTV2OutputDestinations & operator += (NTV2OutputDestinations & inOutSet, const NTV2OutputDestinations & inSet); // New in SDK 16.0 + + + /** + @brief Streams the given ::NTV2_HEADER to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::NTV2_HEADER to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2_HEADER & inObj); + + /** + @brief Streams the given ::NTV2_TRAILER to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::NTV2_TRAILER to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2_TRAILER & inObj); + + /** + @brief Streams the given ::NTV2_POINTER to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::NTV2_POINTER to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2_POINTER & inObj); + + /** + @brief Streams the given ::NTV2_RP188 struct to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::NTV2_RP188 struct to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2_RP188 & inObj); + + /** + @brief Streams the given ::NTV2TimeCodeList to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::NTV2TimeCodeList to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2TimeCodeList & inObj); + + /** + @brief Streams the given ::NTV2TimeCodes map to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::NTV2TimeCodes map to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2TimeCodes & inObj); + + /** + @brief Streams the given ::NTV2TCIndexes to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::NTV2TCIndexes set to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2TCIndexes & inObj); + + /** + @brief Appends the given ::NTV2TCIndexes contents into the given set. + @param inOutSet The set to which the other set will be appended. + @param[in] inSet Specifies the set whose contents will be appended. + @return A reference to the modified set. + **/ + AJAExport NTV2TCIndexes & operator += (NTV2TCIndexes & inOutSet, const NTV2TCIndexes & inSet); + + /** + @brief Streams the given ::FRAME_STAMP to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::FRAME_STAMP to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const FRAME_STAMP & inObj); + + /** + @brief Streams the given ::AUTOCIRCULATE_STATUS to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::AUTOCIRCULATE_STATUS to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const AUTOCIRCULATE_STATUS & inObj); + + /** + @brief Streams the given ::NTV2SegmentedDMAInfo to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::NTV2SegmentedDMAInfo to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2SegmentedDMAInfo & inObj); + + /** + @brief Streams the given ::AUTOCIRCULATE_TRANSFER to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::AUTOCIRCULATE_TRANSFER to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const AUTOCIRCULATE_TRANSFER & inObj); + + /** + @brief Streams the given ::FRAME_STAMP to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::FRAME_STAMP to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const FRAME_STAMP & inObj); + + /** + @brief Streams the given ::AUTOCIRCULATE_TRANSFER_STATUS to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::AUTOCIRCULATE_TRANSFER_STATUS to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const AUTOCIRCULATE_TRANSFER_STATUS & inObj); + + /** + @brief Streams the given ::NTV2RegisterNumberSet to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::NTV2RegisterNumberSet to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2RegisterNumberSet & inObj); + + /** + @brief Streams the given ::NTV2RegisterValueMap to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::NTV2RegisterValueMap to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2RegisterValueMap & inObj); + + /** + @brief Streams the given ::AutoCircVidProcInfo to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::AutoCircVidProcInfo to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const AutoCircVidProcInfo & inObj); + + /** + @brief Streams the given ::NTV2ColorCorrectionData to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::NTV2ColorCorrectionData to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2ColorCorrectionData & inObj); + + /** + @brief Streams the given ::NTV2GetRegisters to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::NTV2GetRegisters to be streamed. + @return The ostream being used. + **/ + AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2GetRegisters & inObj) {return inObj.Print (inOutStream);} + + /** + @brief Streams the given ::NTV2SetRegisters to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::NTV2SetRegisters to be streamed. + @return The ostream being used. + **/ + AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2SetRegisters & inObj) {return inObj.Print (inOutStream);} + + /** + @brief Streams the given ::NTV2BankSelGetSetRegs to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::NTV2BankSelGetSetRegs to be streamed. + @return The ostream being used. + **/ + AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2BankSelGetSetRegs & inObj) {return inObj.Print (inOutStream);} + + /** + @brief Streams the given ::NTV2SDIInStatistics to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::NTV2SDIInStatistics to be streamed. + @return The ostream being used. + **/ + AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2SDIInStatistics & inObj) {return inObj.Print (inOutStream);} + + /** + @brief Streams the given ::NTV2SDIInputStatus to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the ::NTV2SDIInputStatus to be streamed. + @return The ostream being used. + **/ + AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2SDIInputStatus & inObj) {return inObj.Print (inOutStream);} + + /** + @brief Streams the given ::NTV2SegmentedXferInfo to the specified ostream in a human-readable format. + @param inOutStrm Specifies the ostream to use. + @param[in] inXferInfo Specifies the ::NTV2SegmentedXferInfo to be streamed. + @return The ostream being used. + **/ + AJAExport std::ostream & operator << (std::ostream & inOutStrm, const NTV2SegmentedXferInfo & inXferInfo); + + /** + @brief Streams the given NTV2DebugLogging struct to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the NTV2DebugLogging to be streamed. + @return The ostream being used. + **/ + AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2DebugLogging & inObj) {return inObj.Print (inOutStream);} + + /** + @brief Streams the given NTV2BufferLock struct to the specified ostream in a human-readable format. + @param inOutStream Specifies the ostream to use. + @param[in] inObj Specifies the NTV2BufferLock to be streamed. + @return The ostream being used. + **/ + AJAExport inline std::ostream & operator << (std::ostream & inOutStream, const NTV2BufferLock & inObj) {return inObj.Print (inOutStream);} + #endif // !defined (NTV2_BUILDING_DRIVER) + + #if defined (AJAMac) + #pragma pack (pop) + #endif // defined (AJAMac) +////////////////////////////////////////////////////////////////////////////////////////////// END NEW AUTOCIRCULATE API + + +// maximum number of hevc streams +#define HEVC_STREAM_MAX 4 + +// maximum number of gpio ports +#define HEVC_GPIO_MAX 64 + +// version string maximum size (bytes) +#define HEVC_VERSION_STRING_SIZE 64 + +// picture and encoded information additional data size (bytes) +#define HEVC_ADDITIONAL_DATA_SIZE ((4 + 4 + 256) * 16) + +// codec state flags +#define HEVC_STATE_FLAG_VIDEO_STARTED 0x00000001U // codec video input capture started + +// transfer flags +#define HEVC_TRANSFER_FLAG_IS_LAST_FRAME 0x00000001U // last stream frame + +// driver io status codes +#define HEVC_STATUS_SUCCESS 0x00000001U + +// fatal error registers +#define HEVC_FATAL_ERROR_INFO_REG 0x08000100U // codec error register base +#define HEVC_FATAL_ERROR_INFO_COUNT 64 // number of codec error registers + +// driver debug register output enable bits +#define HEVC_DEBUG_DRIVER_REGISTER 0x080000FCU // register address of debug bits +#define HEVC_DEBUG_MASK_INFO 0x00000001 // general probe and cleanup +#define HEVC_DEBUG_MASK_WARNING 0x00000002 // general warinings +#define HEVC_DEBUG_MASK_ERROR 0x00000004 // general erros +#define HEVC_DEBUG_MASK_INT_PRIMARY 0x00000008 // primary interrupt info +#define HEVC_DEBUG_MASK_INT_COMMAND 0x00000010 // command tasklet info +#define HEVC_DEBUG_MASK_INT_VEI 0x00000020 // raw stream tasklet info +#define HEVC_DEBUG_MASK_INT_SEO 0x00000040 // encoded stream tasklet info +#define HEVC_DEBUG_MASK_INT_ERROR 0x00000080 // interrupt errors +#define HEVC_DEBUG_MASK_REGISTER_INFO 0x00000100 // register read/write info +#define HEVC_DEBUG_MASK_REGISTER_STATE 0x00000200 // detailed register access info +#define HEVC_DEBUG_MASK_REGISTER_ERROR 0x00000400 // register access errors +#define HEVC_DEBUG_MASK_COMMAND_INFO 0x00000800 // command queue info +#define HEVC_DEBUG_MASK_COMMAND_STATE 0x00001000 // detailed command processing info +#define HEVC_DEBUG_MASK_COMMAND_ERROR 0x00002000 // command queue errors +#define HEVC_DEBUG_MASK_STREAM_INFO 0x00004000 // stream (dma) queue info +#define HEVC_DEBUG_MASK_STREAM_STATE 0x00008000 // detailed stream processing info +#define HEVC_DEBUG_MASK_STREAM_COPY 0x00010000 // stream data copy info +#define HEVC_DEBUG_MASK_STREAM_SEGMENT 0x00020000 // stream data segment info +#define HEVC_DEBUG_MASK_STREAM_FRAME 0x00040000 // stream vif frame info +#define HEVC_DEBUG_MASK_STREAM_ERROR 0x00080000 // stream queue errors +#define HEVC_DEBUG_MASK_MEMORY_ALLOC 0x00100000 // buffer memory allocation info +#define HEVC_DEBUG_MASK_MEMORY_ERROR 0x00200000 // buffer memory allocation errors +#define HEVC_DEBUG_MASK_DMA_INFO 0x00400000 // dma send info +#define HEVC_DEBUG_MASK_DMA_DESCRIPTOR 0x00800000 // dma descriptor dump +#define HEVC_DEBUG_MASK_DMA_ERROR 0x01000000 // dma errors +#define HEVC_DEBUG_MASK_STATUS_INFO 0x02000000 // status info requests +#define HEVC_DEBUG_MASK_RESERVED_0 0x04000000 +#define HEVC_DEBUG_MASK_RESERVED_1 0x08000000 +#define HEVC_DEBUG_MASK_RESERVED_2 0x10000000 +#define HEVC_DEBUG_MASK_RESERVED_3 0x20000000 +#define HEVC_DEBUG_MASK_RESERVED_4 0x40000000 +#define HEVC_DEBUG_MASK_RESERVED_5 0x80000000 + +// ntv2 gpio input registers +#define HEVC_NTV2_GPIO_REGISTER_LOW 510 +#define HEVC_NTV2_GPIO_REGISTER_HIGH 511 + + +// hevc version information +typedef struct HevcVersion +{ + ULWord major; + ULWord minor; + ULWord point; + ULWord build; +} HevcVersion; + +// pci id information +typedef struct HevcPciId +{ + ULWord vendor; + ULWord device; + ULWord subVendor; + ULWord subDevice; +} HevcPciId; + +// hevc device mode +typedef enum HevcDeviceMode +{ + Hevc_DeviceMode_Unknown, + Hevc_DeviceMode_Codec, // codec mode + Hevc_DeviceMode_Maintenance, // maintenance mode + Hevc_DeviceMode_Size +} HevcDeviceMode; + +// hevc device information message +typedef struct HevcDeviceInfo +{ + HevcVersion driverVersion; // driver version + HevcVersion mcpuVersion; // firmware versions + char systemFirmware[HEVC_VERSION_STRING_SIZE]; + char standardFirmwareSingle[HEVC_VERSION_STRING_SIZE]; + char standardFirmwareMultiple[HEVC_VERSION_STRING_SIZE]; + char userFirmwareSingle[HEVC_VERSION_STRING_SIZE]; + char userFirmwareMultiple[HEVC_VERSION_STRING_SIZE]; + HevcPciId pciId; // pci ids + HevcDeviceMode deviceMode; // hardware device mode + bool mcpuVersionCheck; // mcpu version supported + bool systemVersionCheck; // system version supported + bool standardSingleCheck; // standard firmware single version supported + bool standardMultipleCheck; // standard fimwrare multiple version supported + bool pciIdCheck; // pci id supported +} HevcDeviceInfo; + +// hevc register +typedef struct HevcDeviceRegister +{ + ULWord address; // register address + ULWord writeValue; // register write value + ULWord readValue; // register read value + ULWord mask; // register value mask + ULWord shift; // register value shift + bool write; // write flag + bool read; // read flag + bool forceBar4; // force bar4 access +} HevcDeviceRegister; + +// hevc main state +typedef enum HevcMainState +{ + Hevc_MainState_Unknown, + Hevc_MainState_Boot, // codec has booted + Hevc_MainState_Init, // initialize codec + Hevc_MainState_Encode, // configure encoding (load firmware?) + Hevc_MainState_Error, // codec must be reset + Hevc_MainState_Size +} HevcMainState; + +// encoder mode +typedef enum HevcEncodeMode +{ + Hevc_EncodeMode_Unknown, + Hevc_EncodeMode_Single, // encode a sigle stream + Hevc_EncodeMode_Multiple, // encode multiple streams + Hevc_EncodeMode_Size +} HevcEncodeMode; + +// encoder firmware type +typedef enum HevcFirmwareType +{ + Hevc_FirmwareType_Unknown, + Hevc_FirmwareType_Standard, // encode firmware standard + Hevc_FirmwareType_User, // encode firmware user + Hevc_FirmwareType_Size +} HevcFirmwareType; + +// hevc video interface state +typedef enum HevcVifState +{ + Hevc_VifState_Unknown, + Hevc_VifState_Stop, // video interface stop + Hevc_VifState_Start, // video interface start + Hevc_VifState_Size +} HevcVifState; + +// hevc video input state +typedef enum HevcVinState +{ + Hevc_VinState_Unknown, + Hevc_VinState_Stop, // video input stop + Hevc_VinState_Start, // video input start + Hevc_VinState_Size +} HevcVinState; + +// hevc encoder state +typedef enum HevcEhState +{ + Hevc_EhState_Unknown, + Hevc_EhState_Stop, // encoder stop + Hevc_EhState_Start, // encoder start + Hevc_EhState_ReadyToStop, // encoder ready to stop + Hevc_EhState_Size +} HevcEhState; + +// hevc gpio control +typedef enum HevcGpioControl +{ + Hevc_GpioControl_Unknown, + Hevc_GpioControl_Function, // configure gpio port function + Hevc_GpioControl_Direction, // configure gpio port direction + Hevc_GpioControl_Set, // set gpio port value + Hevc_GpioControl_Get, // get pgio port value + Hevc_GpioControl_Size +} HevcGpioControl; + +// hevc gpio function +typedef enum HevcGpioFunction +{ + Hevc_GpioFunction_Unknown, + Hevc_GpioFunction_Gpio, // gpio function is gpio + Hevc_GpioFunction_Peripheral, // gpio function is peripheral + Hevc_GpioFunction_Size +} HevcGpioFunction; + +// hevc gpio direction +typedef enum HevcGpioDirection +{ + Hevc_GpioDirection_Unknown, + Hevc_GpioDirection_Input, // gpio direction is input + Hevc_GpioDirection_Output, // gpio direction is output + Hevc_GpioDirection_Size +} HevcGpioDirection; + +// hevc gpio value +typedef enum HevcGpioValue +{ + Hevc_GpioValue_Unknown, + Hevc_GpioValue_Low, // gpio direction is input + Hevc_GpioValue_High, // gpio direction is output + Hevc_GpioValue_Size +} HevcGpioValue; + +typedef enum HevcChangeSequence +{ + Hevc_ChangeSequence_Unknown, + Hevc_ChangeSequence_Enabled, + Hevc_ChangeSequence_Disabled, + Hevc_ChangeSequence_Size +} HevcChangeSequence; + +// hevc change param target +#define Hevc_ParamTarget_None 0x00000000 +#define Hevc_ParamTarget_Vbr 0x00000001 // change variable bitrate +#define Hevc_ParamTarget_Cbr 0x00000002 // change constant bitrate +#define Hevc_ParamTarget_Resolution 0x00000004 // change size, crop, pan, etc. +#define Hevc_ParamTarget_Frame_Rate 0x00000008 // change frame rate +#define Hevc_ParamTarget_All 0x0000000f + +// hevc commands +typedef enum HevcCommand +{ + Hevc_Command_Unknown, + Hevc_Command_MainState, // set main state + Hevc_Command_VinState, // set video input state + Hevc_Command_EhState, // set encoder state + Hevc_Command_Gpio, // control gpio + Hevc_Command_Reset, // reset codec + Hevc_Command_ChangeParam, // change dynamic params during encode + Hevc_Command_ChangePicture, // change picture type + Hevc_Command_Size +} HevcCommand; + +// hevc command information +typedef struct HevcDeviceCommand +{ + HevcCommand command; // command type + // main state command info + HevcMainState mainState; // set main state + HevcEncodeMode encodeMode; // set encoder mode + HevcFirmwareType firmwareType; // set encode firmware type + // vin/eh state command info + HevcVinState vinState; // set video input state + HevcEhState ehState; // set encoder state + ULWord streamBits; // command applies to each stream bit + // gpio command info + HevcGpioControl gpioControl; // gpio control type + ULWord gpioNumber; // gpio port number (function, direction, set, get) + HevcGpioFunction gpioFunction; // gpio port function (function) + HevcGpioDirection gpioDirection; // gpio port direction (direction) + HevcGpioValue gpioValue; // gpio port value (set, get) + // change encode params + ULWord paramTarget; // parameters to change + ULWord paramStreamId; // stream id + HevcChangeSequence changeSequence; // start new sequence (vbr) + ULWord maxBitRate; // maximum bitrate (vbr) + ULWord aveBitRate; // average bitrate (vbr and cbr) + ULWord minBitRate; // minimum bitrate (vbr) + ULWord seqEndPicNumber; // last picture number of sequence (resolution and frame rate) + ULWord hSizeEh; // resolution parameters + ULWord vSizeEh; + ULWord cropLeft; + ULWord cropRight; + ULWord cropTop; + ULWord cropBottom; + ULWord panScanRectLeft; + ULWord panScanRectRight; + ULWord panScanRectTop; + ULWord panScanRectBottom; + ULWord videoSignalType; + ULWord videoFormat; + ULWord videoFullRangeFlag; + ULWord colourDescriptionPresentFlag; + ULWord colourPrimaries; + ULWord transferCharacteristics; + ULWord matrixCoeffs; + ULWord aspectRatioIdc; + ULWord sarWidth; + ULWord sarHeight; + ULWord frameRateCode; // frame rate parameter + // change picture type + ULWord picType; // picture type + ULWord picStreamId; // stream id + ULWord gopEndPicNumber; // last picture number of gop + // general command flags + ULWord flags; // command flags +} HevcDeviceCommand; + +// hevc stream types +typedef enum HevcStream +{ + Hevc_Stream_Unknown, + Hevc_Stream_VideoRaw, // raw data stream + Hevc_Stream_VideoEnc, // encoded data stream + Hevc_Stream_Size +} HevcStream; + +// hevc picture data (raw streams) +typedef struct HevcPictureData +{ + ULWord serialNumber; // serial number (application data) + ULWord ptsValueLow; // presentation time stamp (90kHz) + ULWord ptsValueHigh; // pts high bit only (33 bit roll over) + ULWord pictureNumber; // start with 1 and increment for each picture + ULWord numAdditionalData; // number of additional data entries +} HevcPictureData; + +// hevc picture information (raw streams) +typedef struct HevcPictureInfo +{ + HevcPictureData pictureData; // raw stream picture data +// +// additional data format +// u32 additional_data_type +// u32 additional_data_size (256 bytes max) +// u8... additional_data_payload +// ... more additional data +// +// additional data types +// 1 = sei data +// 2 = passthrough data (to encoded additional data of encoded frame) +// 4 = cancel sei on every gop (set additional size to 0) +// +// sei data format +// u8 user_sei_location +// u8 user_sei_type +// u8 user_sei_length +// u8... user_sei_payload +// +// user sei location +// 2 = every gop head picture +// 3 = this picture only +// +// passthrough data format +// u8... passthrough_data_payload +// + UByte additionalData[HEVC_ADDITIONAL_DATA_SIZE]; +} HevcPictureInfo; + +// hevc encoded stream data (encoded streams) +typedef struct HevcEncodedData +{ + ULWord serialNumber; // serial number (from picture information) + ULWord esOffsetLow; // encoded stream frame location (?) + ULWord esOffsetHigh; // es frame location high 32 bits + ULWord esSize; // encoded stream frame size (?) + ULWord ptsValueLow; // presentation time stamp (picture information) + ULWord ptsValueHigh; // pts high bit (33 bit roll over) + ULWord dtsValueLow; // decoding time stamp (90 kHz) + ULWord dtsValueHigh; // dts high bit (33 bit roll over) + ULWord itcValueLow; // internal time clock (90 kHz) + ULWord itcValueHigh; // itc high bit (33 bit roll over) + ULWord itcExtension; // internal time extension (27 MHz) + ULWord temporalId; // temporal ID + ULWord esIdrType; // 0 = not IDR, 1 = IDR, 3 = IDR command + ULWord pictureType; // 0 = I-frame, 1 = P-frame, 2 = B-frame + ULWord nalOffset; // offset to the nal top of the idr/i picture + ULWord cpbValue; // codec picture buffer occupancy value + ULWord esHSize; // horizontal resolution + ULWord esVSize; // vertical resolution + ULWord esUnitsInTick; // frame duration (2x eh param value for half rate) + ULWord esBitRate; // bit rate (Kbps) + ULWord esEndFlag; // 0 = not end of sequence, 1 = end of sequence + ULWord esLastFrame; // 0xffffffff = last frame + ULWord reserved0; + ULWord reserved1; + ULWord reserved2; + ULWord reserved3; + ULWord reserved4; + ULWord reserved5; + ULWord reserved6; + ULWord reserved7; + ULWord numAdditionalData; // number of additional data entries +} HevcEncodedData; + +// hevc encode stream information (encoded streams) +typedef struct HevcEncodedInfo +{ + HevcEncodedData encodedData; // encoded stream data + UByte additionalData[HEVC_ADDITIONAL_DATA_SIZE]; +} HevcEncodedInfo; + +// hevc stream transfer information +typedef struct HevcDeviceTransfer +{ + HevcStream streamType; // transfer stream type + ULWord streamId; // transfer stream id + + UByte* pVideoBuffer; // video buffer + ULWord videoBufferSize; // total video buffer size + ULWord videoDataSize; // video data size in buffer + + ULWord segVideoPitch; // video segment pitch + ULWord segCodecPitch; // codec segment pitch + ULWord segSize; // segment size + ULWord segCount; // number of segments + + UByte* pInfoBuffer; // information buffer (picture or encoded) + ULWord infoBufferSize; // total information buffer size + ULWord infoDataSize; // information size in buffer + + LWord64 encodeTime; // frame encode time (100ns host system clock) + ULWord flags; // transfer flags (see above for last frame flag) +} HevcDeviceTransfer; + +// hevc gpio port status +typedef struct hevc_gpio_state +{ + HevcGpioFunction function; // gpio last set port function + HevcGpioDirection direction; // gpio last set port direction + HevcGpioValue setValue; // gpio last set value + HevcGpioValue getValue; // gpio last get value +} HevcGpioState; + +// hevc stream statistics (nsec, bytes) +typedef struct hevc_stream_statistics +{ + LWord64 transferCount; // number of transfers queued + LWord64 minTransferTime; // minimum time between transfers + LWord64 avrTransferTime; // average time between transfers + LWord64 maxTransferTime; // maximum time between transfers + LWord64 minTransferSize; // minimum transfer size + LWord64 maxTransferSize; // maximum transfer size + LWord64 avrTransferSize; // average transfer size + LWord64 minCopyDuration; // time for io thread to copy frames + LWord64 maxCopyDuration; // to/from bounce buffer + LWord64 avrCopyDuration; + LWord64 minEnqueueDuration; // time from io thread enqueue + LWord64 maxEnqueueDuration; // to send to codec + LWord64 avrEnqueueDuration; + LWord64 minSendDuration; // time from send to codec + LWord64 maxSendDuration; // to codec acknowledge + LWord64 avrSendDuration; + LWord64 minDmaDuration; // time from codec acknowledge + LWord64 maxDmaDuration; // to codec dma completion + LWord64 avrDmaDuration; + LWord64 minDequeueDuration; // time from io thread enqueue + LWord64 maxDequeueDuration; // to io thread dequeue + LWord64 avrDequeueDuration; +} HevcStreamStatistics; + +// hevc status information +typedef struct HevcDeviceStatus +{ + HevcMainState mainState; // codec main state + HevcEncodeMode encodeMode; // codec encode mode + HevcFirmwareType firmwareType; // codec firmware type + + HevcVifState vifState[HEVC_STREAM_MAX]; // video interface state + HevcVinState vinState[HEVC_STREAM_MAX]; // video input state + HevcEhState ehState[HEVC_STREAM_MAX]; // encoder state + HevcGpioState gpioState[HEVC_GPIO_MAX]; // gpio state + + LWord64 commandCount; // number of commands processed + LWord64 rawTransferCount; // number of raw transfers processed + LWord64 encTransferCount; // number of encoded transfers processed + + ULWord commandQueueLevel; // number of commands in command queue + ULWord rawTransferQueueLevel; // number of transfers in raw transfer queue + ULWord encTransferQueueLevel; // number of transfers in encoded transfer queue +} HevcDeviceStatus; + +// hevc debug information +typedef struct HevcDeviceDebug +{ + HevcDeviceStatus deviceStatus; // device status structure + + HevcStreamStatistics rawStats[HEVC_STREAM_MAX]; // raw stream statistics + HevcStreamStatistics encStats[HEVC_STREAM_MAX]; // encoded stream statistics + ULWord queueLevel[HEVC_STREAM_MAX]; // stream queue level + ULWord clearRawStatsBits; // stream bits to clear raw stream statistics + ULWord clearEncStatsBits; // stream bits to clear encodec stream statistics + + ULWord cmdContCount; // codec command continuity count + ULWord cmdAckContCount; // codec command acknowledge count + ULWord cmdMsgContCount; // codec command message count + ULWord rawContCount; // raw dma continuity count + ULWord rawAckContCount; // raw dma acknowledge count + ULWord rawMsgContCount; // raw dma message count + ULWord encContCount; // encoded dma continuity count + ULWord encAckContCount; // encoded dma acnowledge count + ULWord encMsgContCount; // encoded dma message count +} HevcDeviceDebug; + +// hevc driver ioctl message types +typedef enum HevcMessageId +{ + Hevc_MessageId_Unknown, + Hevc_MessageId_Info, // get device information + Hevc_MessageId_Register, // write/read codec register + Hevc_MessageId_Command, // send a codec command + Hevc_MessageId_Transfer, // transfer codec stream data + Hevc_MessageId_Status, // get codec status + Hevc_MessageId_Debug, // get debug information + Hevc_MessageId_Size +} HevcMessageId; + +// hevc common driver ioctl message header +typedef struct hevcMessageHeader +{ + HevcMessageId type; + ULWord size; + ULWord status; + ULWord reverved0; + ULWord reverved1; + ULWord reverved2; +} HevcMessageHeader; + +// hevc stream transfer data +typedef struct HevcTransferData +{ + HevcStream streamType; + ULWord streamId; + ULWord64 videoBuffer; + ULWord videoBufferSize; + ULWord videoDataSize; + ULWord segVideoPitch; + ULWord segCodecPitch; + ULWord segSize; + ULWord segCount; + ULWord64 infoBuffer; + ULWord infoBufferSize; + ULWord infoDataSize; + LWord64 encodeTime; + ULWord flags; +} HevcTransferData; + +// hevc driver device information message +typedef struct HevcMessageInfo +{ + HevcMessageHeader header; + HevcDeviceInfo data; +} HevcMessageInfo; + +// hevc driver register message +typedef struct HevcMessageRegister +{ + HevcMessageHeader header; + HevcDeviceRegister data; +} HevcMessageRegister; + +// hevc driver command message +typedef struct HevcMessageCommand +{ + HevcMessageHeader header; + HevcDeviceCommand data; +} HevcMessageCommand; + +// hevc driver transfer message +typedef struct HevcMessageTransfer +{ + HevcMessageHeader header; + HevcTransferData data; +} HevcMessageTransfer; + +// hevc driver status message +typedef struct HevcMessageStatus +{ + HevcMessageHeader header; + HevcDeviceStatus data; +} HevcMessageStatus; + +// hevc driver debug message +typedef struct HevcMessageDebug +{ + HevcMessageHeader header; + HevcDeviceDebug data; +} HevcMessageDebug; + +typedef struct HDRRegValues{ + uint16_t greenPrimaryX; + uint16_t greenPrimaryY; + uint16_t bluePrimaryX; + uint16_t bluePrimaryY; + uint16_t redPrimaryX; + uint16_t redPrimaryY; + uint16_t whitePointX; + uint16_t whitePointY; + uint16_t maxMasteringLuminance; + uint16_t minMasteringLuminance; + uint16_t maxContentLightLevel; + uint16_t maxFrameAverageLightLevel; + uint8_t electroOpticalTransferFunction; + uint8_t staticMetadataDescriptorID; +}HDRRegValues; + +typedef struct HDRFloatValues{ + float greenPrimaryX; + float greenPrimaryY; + float bluePrimaryX; + float bluePrimaryY; + float redPrimaryX; + float redPrimaryY; + float whitePointX; + float whitePointY; + uint16_t maxMasteringLuminance; + float minMasteringLuminance; + uint16_t maxContentLightLevel; + uint16_t maxFrameAverageLightLevel; + uint8_t electroOpticalTransferFunction; + uint8_t staticMetadataDescriptorID; +}HDRFloatValues; + +typedef struct HDRDriverValues{ + uint16_t greenPrimaryX; + uint16_t greenPrimaryY; + uint16_t bluePrimaryX; + uint16_t bluePrimaryY; + uint16_t redPrimaryX; + uint16_t redPrimaryY; + uint16_t whitePointX; + uint16_t whitePointY; + uint16_t maxMasteringLuminance; + uint16_t minMasteringLuminance; + uint16_t maxContentLightLevel; + uint16_t maxFrameAverageLightLevel; + uint8_t electroOpticalTransferFunction; + uint8_t staticMetadataDescriptorID; + uint8_t luminance; +}HDRDriverValues; + +#define NTV2_IS_VALID_HDR_PRIMARY(__val__) ((__val__) <= 0x0000C350) +#define NTV2_IS_VALID_HDR_MASTERING_LUMINENCE(__val__) (true) +#define NTV2_IS_VALID_HDR_LIGHT_LEVEL(__val__) (true) + +#endif // NTV2PUBLICINTERFACE_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2registerexpert.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2registerexpert.h new file mode 100644 index 0000000..00219eb --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2registerexpert.h @@ -0,0 +1,199 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2registerexpert.h + @brief Declares the CNTV2RegisterExpert class. + @copyright (C) 2016-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2REGEXPERT_H +#define NTV2REGEXPERT_H + +#include "ajaexport.h" +#include "ajatypes.h" +#include "ntv2enums.h" +#include "ntv2publicinterface.h" +#include "ntv2utils.h" +#include +#include +#include +#if defined (AJALinux) + #include +#endif + + +// Streaming Helpers +#define YesNo(__x__) ((__x__) ? "Y" : "N") +#define OnOff(__x__) ((__x__) ? "On" : "Off") +#define SetNotset(__x__) ((__x__) ? "Set" : "Not Set") +#define EnabDisab(__x__) ((__x__) ? "Enabled" : "Disabled") +#define DisabEnab(__x__) ((__x__) ? "Disabled" : "Enabled") +#define ActInact(__x__) ((__x__) ? "Active" : "Inactive") +#define SuppNotsupp(__x__) ((__x__) ? "Supported" : "Unsupported") +#define PresNotPres(__x__) ((__x__) ? "Present" : "Not Present") +#define ThruDeviceOrBypassed(__x__) ((__x__) ? "Thru Device" : "Device Bypassed") + + +// Register classifier keys +#define kRegClass_NULL std::string () +#define kRegClass_Audio std::string ("kRegClass_Audio") +#define kRegClass_Video std::string ("kRegClass_Video") +#define kRegClass_Anc std::string ("kRegClass_Anc") +#define kRegClass_DMA std::string ("kRegClass_DMA") +#define kRegClass_Mixer std::string ("kRegClass_Mixer") +#define kRegClass_Serial std::string ("kRegClass_Serial") +#define kRegClass_Timecode std::string ("kRegClass_Timecode") +#define kRegClass_Routing std::string ("kRegClass_Routing") +#define kRegClass_Input std::string ("kRegClass_Input") +#define kRegClass_Output std::string ("kRegClass_Output") +#define kRegClass_CSC std::string ("kRegClass_CSC") +#define kRegClass_LUT std::string ("kRegClass_LUT") +#define kRegClass_Analog std::string ("kRegClass_Analog") +#define kRegClass_AES std::string ("kRegClass_AES") +#define kRegClass_HDMI std::string ("kRegClass_HDMI") +#define kRegClass_HDR std::string ("kRegClass_HDR") +#define kRegClass_VPID std::string ("kRegClass_VPID") +#define kRegClass_SDIError std::string ("kRegClass_SDIError") +#define kRegClass_Timing std::string ("kRegClass_Timing") +#define kRegClass_Channel1 std::string ("kRegClass_Channel1") +#define kRegClass_Channel2 std::string ("kRegClass_Channel2") +#define kRegClass_Channel3 std::string ("kRegClass_Channel3") +#define kRegClass_Channel4 std::string ("kRegClass_Channel4") +#define kRegClass_Channel5 std::string ("kRegClass_Channel5") +#define kRegClass_Channel6 std::string ("kRegClass_Channel6") +#define kRegClass_Channel7 std::string ("kRegClass_Channel7") +#define kRegClass_Channel8 std::string ("kRegClass_Channel8") +#define kRegClass_ReadOnly std::string ("kRegClass_ReadOnly") +#define kRegClass_WriteOnly std::string ("kRegClass_WriteOnly") +#define kRegClass_Virtual std::string ("kRegClass_Virtual") +#define kRegClass_Interrupt std::string ("kRegClass_Interrupt") + + +/** + @brief I provide "one-stop shopping" for information about registers and their values. + @bug This class currently excludes bank-selected registers, so support logs for \ref konaip and + \ref ioip will be incomplete. This will be addressed in a future SDK. +**/ +class AJAExport CNTV2RegisterExpert +{ + public: + /** + @param[in] inRegNum Specifies the register number. + @return A string that contains the name of the register (or empty if unknown). + **/ + static std::string GetDisplayName (const uint32_t inRegNum); + + /** + @param[in] inRegNum Specifies the register number. + @param[in] inRegValue Specifies the 32-bit register value. + @param[in] inDeviceID Optionally specifies an NTV2DeviceID. Defaults to DEVICE_ID_NOTFOUND. + @return A string that contains the human-readable rendering of the value of the given register + (or empty if unknown). + **/ + static std::string GetDisplayValue (const uint32_t inRegNum, const uint32_t inRegValue, const NTV2DeviceID inDeviceID = DEVICE_ID_NOTFOUND); + + /** + @param[in] inRegNum Specifies the register number. + @param[in] inClassName Specifies the class name. + @return True if the register is a member of the class; otherwise false. + **/ + static bool IsRegisterInClass (const uint32_t inRegNum, const std::string & inClassName); + + /** + @param[in] inRegNum Specifies the register number. + @return True if the register is read-only (i.e., it cannot be written); otherwise false. + **/ + static inline bool IsReadOnly (const uint32_t inRegNum) {return IsRegisterInClass (inRegNum, kRegClass_ReadOnly);} + + /** + @param[in] inRegNum Specifies the register number. + @return True if the register is write-only (i.e., it cannot be read); otherwise false. + **/ + static inline bool IsWriteOnly (const uint32_t inRegNum) {return IsRegisterInClass (inRegNum, kRegClass_WriteOnly);} + + /** + @return A set of strings containing the names of all known register classes. + **/ + static NTV2StringSet GetAllRegisterClasses (void); + + /** + @return A set of strings containing the names of all register classes the given register belongs to. + **/ + static NTV2StringSet GetRegisterClasses (const uint32_t inRegNum); + + /** + @param[in] inClassName Specifies the register class. + @return A set of register numbers that belong to the specified class. Will be empty if none found. + **/ + static NTV2RegNumSet GetRegistersForClass (const std::string & inClassName); + + /** + @param[in] inChannel Specifies a valid NTV2Channel. + @return A set of register numbers that are associated with the given NTV2Channel (class kRegClass_ChannelN). + Will be empty if an invalid NTV2Channel is specified. + **/ + static NTV2RegNumSet GetRegistersForChannel (const NTV2Channel inChannel); + + /** + @param[in] inDeviceID Specifies a valid NTV2DeviceID. + @param[in] inIncludeVirtuals Specify true to include virtual registers; otherwise virtual registers + will be excluded (the default). + @return A set of register numbers that are legal for the device having the given NTV2DeviceID. + Will be empty if an invalid NTV2DeviceID is specified. + **/ + static NTV2RegNumSet GetRegistersForDevice (const NTV2DeviceID inDeviceID, const bool inIncludeVirtuals = false); + + /** + @param[in] inName Specifies a non-empty string that contains all or part of a register name. + @param[in] inSearchStyle Specifies the search style. Must be EXACTMATCH (the default), CONTAINS, + STARTSWITH or ENDSWITH. + @return A set of register numbers that match all or part of the given name. + Empty if none match. + @note All searching is performed case-insensitively. + **/ + static NTV2RegNumSet GetRegistersWithName (const std::string & inName, const int inSearchStyle = EXACTMATCH); + + /** + @param[in] inXptRegNum Specifies the crosspoint select group register number. Note that it only makes + sense to pass register numbers having names that start with "kRegXptSelectGroup". + @param[in] inMaskIndex Specifies the mask index, an unsigned value that must be less than 4. + (0 specifies the least significant byte of the crosspoint register value, + 3 specifies the most significant byte, etc.) + @return The NTV2InputCrosspointID of the widget input crosspoint associated with the given "Xpt" + register and mask index, or NTV2_INPUT_CROSSPOINT_INVALID if there isn't one. + **/ + static NTV2InputCrosspointID GetInputCrosspointID (const uint32_t inXptRegNum, const uint32_t inMaskIndex); + + /** + @brief Answers with the crosspoint select register and mask information for a given widget input. + @param[in] inInputXpt Specifies the NTV2InputCrosspointID of interest. + @param[out] outXptRegNum Receives the crosspoint select group register number. + @param[out] outMaskIndex Receives the mask index (where 0=0x000000FF, 1=0x0000FF00, 2=0x00FF0000, 3=0xFF000000). + @return True if successful; otherwise false. + **/ + static bool GetCrosspointSelectGroupRegisterInfo (const NTV2InputCrosspointID inInputXpt, uint32_t & outXptRegNum, uint32_t & outMaskIndex); + + static const int CONTAINS = 0; ///< @brief The name must contain the search string (see CNTV2RegisterExpert::GetRegistersWithName) + static const int STARTSWITH = 1; ///< @brief The name must start with the search string (see CNTV2RegisterExpert::GetRegistersWithName) + static const int ENDSWITH = 2; ///< @brief The name must end with the search string (see CNTV2RegisterExpert::GetRegistersWithName) + static const int EXACTMATCH = 3; ///< @brief The name must exactly match the search string (see CNTV2RegisterExpert::GetRegistersWithName) + static bool IsAllocated(void); ///< @return True if the Register Expert singleton has been allocated/created; otherwise false. + + /** + @brief Explicitly allocates the Register Expert singleton. + @return True if successful; otherwise false. + @note Normally, there is no need to call this function, as the RegisterExpert singleton is + automatically allocated. + **/ + static bool Allocate(void); + + /** + @brief Explicitly deallocates the Register Expert singleton. + @return True if successful; otherwise false. + @note Normally, there is no need to call this function, as the RegisterExpert singleton is + automatically deallocated. + **/ + static bool Deallocate(void); + +}; // CNTV2RegisterExpert + +#endif // NTV2REGEXPERT_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2registers2022.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2registers2022.h new file mode 100644 index 0000000..e00b2b2 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2registers2022.h @@ -0,0 +1,386 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2registers2022.h + @brief Defines the KonaIP/IoIP S2022 registers. + @copyright (C) 2014-2021 AJA Video Systems, Inc. +**/ + +#ifndef REGISTERS_2022_H +#define REGISTERS_2022_H + +#include "ntv2registersmb.h" + +///////////////////////////////////////////////////////////////////// +// +// General memory map definitions +// +///////////////////////////////////////////////////////////////////// + +#define SAREK_2022_6_TX_CORE_0 (0x103000/4) +#define SAREK_2022_6_RX_CORE_0 (0x104000/4) +#define SAREK_2022_6_TX_CORE_1 (0x105000/4) +#define SAREK_2022_6_RX_CORE_1 (0x106000/4) + +#define SAREK_2022_2_TX_CORE_0 (0x10a000/4) +#define SAREK_2022_2_RX_CORE_0 (0x10b000/4) +#define SAREK_2022_2_TX_CORE_1 (0x10c000/4) +#define SAREK_2022_2_RX_CORE_1 (0x10d000/4) + +#define SAREK_J2K_ENCODER_1 (0x140000/4) +#define SAREK_TS_ENCODER_1 (0x150000/4) +#define SAREK_J2K_ENCODER_2 (0x1C0000/4) +#define SAREK_TS_ENCODER_2 (0x1D0000/4) + +#define SAREK_IPX_J2K_DECODER_1 (0x160000/4) +#define SAREK_IPX_TS_DECODER_1 (0x170000/4) + +///////////////////////////////////////////////////////////////////// +// +// 2022-6 RX Registers (expressed as address) +// +///////////////////////////////////////////////////////////////////// + +// common +#define kReg2022_6_rx_control 0 // 0x0000 +#define kReg2022_6_rx_reset 1 // 0x0004 +#define kReg2022_6_rx_channel_access 3 // 0x000C + +#define kReg2022_6_rx_sys_conf 8 // 0x0020 +#define kReg2022_6_rx_version 9 // 0x0024 +#define kReg2022_6_rx_network_path_differential 10 // 0x0028 +#define kReg2022_6_rx_fec_processing_delay 12 // 0x0030 +#define kReg2022_6_rx_fecBuf_base_addr 13 // 0x0034 +#define kReg2022_6_rx_fecBuf_pool_size 14 // 0x0038 +#define kReg2022_6_rx_pri_recv_pkt_cnt 15 // 0x003C +#define kReg2022_6_rx_sec_recv_pkt_cnt 16 // 0x0040 +#define kReg2022_6_rx_pri_err_pkt_cnt 17 // 0x0044 +#define kReg2022_6_rx_sec_err_pkt_cnt 18 // 0x0048 +#define kReg2022_6_rx_pri_discard_pkt_cnt 19 // 0x004C +#define kReg2022_6_rx_sec_discard_pkt_cnt 20 // 0x0050 +#define kReg2022_6_rx_gen_stat_reset 21 // 0x0054 + +// channel +#define kReg2022_6_rx_id_hdr_param 33 // 0x0084 +#define kReg2022_6_rx_match_vlan 34 // 0x0088 +#define kReg2022_6_rx_match_dest_ip_addr 35 // 0x008C +#define kReg2022_6_rx_match_src_ip_addr 39 // 0x009C +#define kReg2022_6_rx_match_src_port 43 // 0x00AC +#define kReg2022_6_rx_match_dest_port 44 // 0x00B0 +#define kReg2022_6_rx_match_sel 45 // 0x00B4 +#define kReg2022_6_rx_link_reordered_pkt_cnt 46 // 0x00B8 +#define kReg2022_6_rx_link_stat_reset 47 // 0x00BC +#define kReg2022_6_rx_link_valid_media_pkt_cnt 48 // 0x00C0 +#define kReg2022_6_rx_link_valid_fec_pkt_cnt 49 // 0x00C4 + +// channel shared +#define kReg2022_6_rx_chan_enable 64 // 0x0100 +#define kReg2022_6_rx_chan_timeout 65 // 0x0104 +#define kReg2022_6_rx_chan_stat_reset 67 // 0x010C +#define kReg2022_6_rx_match_ssrc 68 // 0x0110 +#define kReg2022_6_rx_sdi_pkt_status 69 // 0x0114 +#define kReg2022_6_rx_vid_src_fmt 70 // 0x0118 +#define kReg2022_6_rx_playout_delay 71 // 0x011C +#define kReg2022_6_rx_fec_param 73 // 0x0124 +#define kReg2022_6_rx_seamless_protect 74 // 0x0128 +#define kReg2022_6_rx_media_buf_base_addr 75 // 0x012C +#define kReg2022_6_rx_media_pkt_buf_size 76 // 0x0130 +#define kReg2022_6_rx_chan_valid_media_pkt_cnt 77 // 0x0134 +#define kReg2022_6_rx_rec_pkt_cnt 78 // 0x0138 +#define kReg2022_6_rx_dup_pkt_cnt 79 // 0x013C +#define kReg2022_6_rx_cur_pkt_buffered 80 // 0x0140 +#define kReg2022_6_rx_pkt_interval 81 // 0x0144 +#define kReg2022_6_rx_chan_valid_fec_cnt 82 // 0x0148 +#define kReg2022_6_rx_media_buffer_ov 85 // 0x0154 +#define kReg2022_6_rx_unrec_pkt_cnt 86 // 0x0158 +#define kReg2022_6_rx_oor_pkt_cnt 88 // 0x0160 + +///////////////////////////////////////////////////////////////////// +// +// 2022-6 TX Registers +// +///////////////////////////////////////////////////////////////////// + +// general +#define kReg2022_6_tx_control 0 // 0x0000 +#define kReg2022_6_tx_reset 1 // 0x0004 +#define kReg2022_6_tx_channel_access 3 // 0x000C +#define kReg2022_6_tx_pri_mac_low_addr 4 // 0x0010 +#define kReg2022_6_tx_pri_mac_hi_addr 5 // 0x0014 +#define kReg2022_6_tx_sec_mac_low_addr 6 // 0x0018 +#define kReg2022_6_tx_sec_mac_hi_addr 7 // 0x001C +#define kReg2022_6_tx_sys_conf 8 // 0x0020 +#define kReg2022_6_tx_version 9 // 0x0024 +#define kReg2022_6_tx_sys_mem_conf 10 // 0x0028 +#define kReg2022_6_tx_hitless_config 11 // 0x0030 + +//channel +#define kReg2022_6_tx_ip_header 32 // 0x0080 +#define kReg2022_6_tx_vlan_tag_info 33 // 0x0084 +#define kReg2022_6_tx_dest_mac_low_addr 34 // 0x0088 +#define kReg2022_6_tx_dest_mac_hi_addr 35 // 0x008C +#define kReg2022_6_tx_dest_ip_addr 36 // 0x0090 +#define kReg2022_6_tx_src_ip_addr 40 // 0x00A0 +#define kReg2022_6_tx_udp_src_port 44 // 0x00B0 +#define kReg2022_6_tx_udp_dest_port 45 // 0x00B4 +#define kReg2022_6_tx_tx_pkt_cnt 48 // 0x00C0 +#define kReg2022_6_tx_channel_stat_reset 51 // 0x00CC +#define kReg2022_6_tx_link_enable 52 // 0x00D0 +#define kReg2022_6_tx_ip_header_fec 54 // 0x00D8 + +// channel common +#define kReg2022_6_tx_chan_enable 64 // 0x0100 +#define kReg2022_6_tx_video_para_config 68 // 0x0110 +#define kReg2022_6_tx_media_stream_status 69 // 0x0114 +#define kReg2022_6_tx_ssrc 70 // 0x0118 +#define kReg2022_6_tx_fec_config 71 // 0x011C +#define kReg2022_6_tx_fec_L_value 73 // 0x0124 +#define kReg2022_6_tx_fec_D_value 74 // 0x0128 + +///////////////////////////////////////////////////////////////////// +// +// 2022-2 RX Registers +// +///////////////////////////////////////////////////////////////////// + +#define kReg2022_2_rx_control 0 // 0x0000 +#define kReg2022_2_rx_reset 1 // 0x0004 +#define kReg2022_2_rx_channel_access 3 // 0x000C + +#define kReg2022_2_rx_sys_conf 8 // 0x0020 +#define kReg2022_2_rx_version 9 // 0x0024 +#define kReg2022_2_rx_network_path_differential 10 // 0x0028 +#define kReg2022_2_rx_fec_processing_delay 12 // 0x0030 +#define kReg2022_2_rx_fecBuf_base_addr 13 // 0x0034 +#define kReg2022_2_rx_fecBuf_pool_size 14 // 0x0038 +#define kReg2022_2_rx_pri_recv_pkt_cnt 15 // 0x003C +#define kReg2022_2_rx_sec_recv_pkt_cnt 16 // 0x0040 +#define kReg2022_2_rx_pri_err_pkt_cnt 17 // 0x0044 +#define kReg2022_2_rx_sec_err_pkt_cnt 18 // 0x0048 +#define kReg2022_2_rx_pri_discard_pkt_cnt 19 // 0x004C +#define kReg2022_2_rx_sec_discard_pkt_cnt 20 // 0x0050 +#define kReg2022_2_rx_gen_stat_reset 21 // 0x0054 + +#define kReg2022_2_rx_id_hdr_param 33 // 0x0084 +#define kReg2022_2_rx_match_vlan 34 // 0x0088 +#define kReg2022_2_rx_match_dest_ip_addr 35 // 0x008C + +#define kReg2022_2_rx_match_src_ip_addr 39 // 0x009C + +#define kReg2022_2_rx_match_src_port 43 // 0x00AC + +#define kReg2022_2_rx_match_dest_port 44 // 0x00B0 +#define kReg2022_2_rx_match_sel 45 // 0x00B4 +#define kReg2022_2_rx_link_reordered_pkt_cnt 46 // 0x00B8 +#define kReg2022_2_rx_link_stat_reset 47 // 0x00BC +#define kReg2022_2_rx_link_valid_media_pkt_cnt 48 // 0x00C0 +#define kReg2022_2_rx_link_valid_fec_pkt_cnt 49 // 0x00C4 + +#define kReg2022_2_rx_chan_enable 64 // 0x0100 + +#define kReg2022_2_rx_chan_stat_reset 67 // 0x010C +#define kReg2022_2_rx_match_ssrc 68 // 0x0110 + +#define kReg2022_2_rx_playout_delay 71 // 0x011C +#define kReg2022_2_ts_status 72 // 0x0120 +#define kReg2022_2_rx_fec_param 73 // 0x0124 +#define kReg2022_2_rx_seamless_protect 74 // 0x0128 +#define kReg2022_2_rx_media_buf_base_addr 75 // 0x012C +#define kReg2022_2_rx_media_pkt_buf_size 76 // 0x0130 +#define kReg2022_2_rx_chan_valid_media_pkt_cnt 77 // 0x0134 +#define kReg2022_2_rx_rec_pkt_cnt 78 // 0x0138 +#define kReg2022_2_rx_dup_pkt_cnt 79 // 0x013C +#define kReg2022_2_rx_cur_pkt_buffered 80 // 0x0140 +#define kReg2022_2_rx_pkt_interval 81 // 0x0144 + +#define kReg2022_2_rx_media_buffer_ov 85 // 0x0154 +#define kReg2022_2_rx_unrec_pkt_cnt 86 // 0x0158 +#define kReg2022_2_rx_oor_pkt_cnt 88 // 0x0160 + + +///////////////////////////////////////////////////////////////////// +// +// 2022-2 TX Registers +// +///////////////////////////////////////////////////////////////////// + +#define kReg2022_2_tx_control 0 // 0x0000 +#define kReg2022_2_tx_reset 1 // 0x0004 +#define kReg2022_2_tx_channel_access 3 // 0x000C +#define kReg2022_2_tx_pri_mac_low_addr 4 // 0x0010 +#define kReg2022_2_tx_pri_mac_hi_addr 5 // 0x0014 +#define kReg2022_2_tx_sec_mac_low_addr 6 // 0x0018 +#define kReg2022_2_tx_sec_mac_hi_addr 7 // 0x001C +#define kReg2022_2_tx_sys_conf 8 // 0x0020 +#define kReg2022_2_tx_version 9 // 0x0024 + +#define kReg2022_2_tx_hitless_config 12 // 0x0030 + +#define kReg2022_2_tx_ip_header 32 // 0x0080 +#define kReg2022_2_tx_vlan_tag_info 33 // 0x0084 +#define kReg2022_2_tx_dest_mac_low_addr 34 // 0x0088 +#define kReg2022_2_tx_dest_mac_hi_addr 35 // 0x008C +#define kReg2022_2_tx_dest_ip_addr 36 // 0x0090 + +#define kReg2022_2_tx_src_ip_addr 40 // 0x00A0 + +#define kReg2022_2_tx_udp_src_port 44 // 0x00B0 +#define kReg2022_2_tx_udp_dest_port 45 // 0x00B4 + +#define kReg2022_2_tx_tx_pkt_cnt 48 // 0x00C0 + +#define kReg2022_2_tx_channel_stat_reset 51 // 0x00CC + +#define kReg2022_2_tx_tx_enable 52 // 0x00D0 +#define kReg2022_2_tx_transport_max_gap 53 // 0x00D4 +#define kReg2022_2_tx_ip_header_fec 54 // 0x00D8 + +#define kReg2022_2_tx_chan_enable 64 // 0x0100 + +#define kReg2022_2_tx_ts_config 68 // 0x0110 +#define kReg2022_2_tx_ts_status 69 // 0x0114 +#define kReg2022_2_tx_ssrc 70 // 0x0118 +#define kReg2022_2_tx_fec_config 71 // 0x011C +#define kReg2022_2_tx_fec_L_value 73 // 0x0124 +#define kReg2022_2_tx_fec_D_value 74 // 0x0128 +#define kReg2022_2_tx_fec_base_addr 75 // 0x012C + +///////////////////////////////////////////////////////////////////// +// +// J2K Encoder/Decoder Registers +// +///////////////////////////////////////////////////////////////////// + +// Encoder +#define kRegJ2kT0MainCsr 0 +#define kRegJ2kT0FIFOCsr 1 +#define kRegJ2kT0CmdFIFO 4 +#define kRegJ2kT0StatusFIFO 6 +#define kRegJ2kT0Framecount 7 + +#define kRegJ2kT1MainCsr 64 //0x0100/4 +#define kRegJ2kT1FIFOCsr 65 //0x0104/4 +#define kRegJ2kT1CsfCsr 66 //0x0108/4 +#define kRegJ2kT1DebugInfo 67 //0x010C/4 +#define kRegJ2kT1StatusFIFO 70 //0x0118/4 +#define kRegJ2kT1Framecount 71 //0x011C/4 + +#define kRegJ2kT2MainCsr 128 //0x0200/4 +#define kRegJ2kT2FIFOCsr 129 //0x0204/4 +#define kRegJ2kT2CmdFIFO 132 //0x0210/4 +#define kRegJ2kT2StatusFIFO 134 //0x0218/4 +#define kRegJ2kT2Framecount 135 //0x021C/4 + +// Decoder +#define kRegJ2kPrpMainCsr 0 +#define kRegJ2kPrpFIFOCsr 1 +#define kRegJ2kPrpLastTc 2 +#define kRegJ2kPrpCmdFIFO 4 +#define kRegJ2kPrpStatusFIFO 6 + +#define kRegJ2kPopMainCsr 64 //0x0100/4 +#define kRegJ2kPopFIFOCsr 65 //0x0104/4 +#define kRegJ2kPopUllCsr 66 //0x0108/4 +#define kRegJ2kPopCmdFIFO 68 //0x0110/4 +#define kRegJ2kPopStatusFIFO 70 //0x0118/4 + +#define kRegJ2kBuffCsr 128 //0x0200/4 +#define kRegJ2kBuffStatus0 160 //0x0280/4 +#define kRegJ2kBuffImginfos0 161 //0x0284/4 +#define kRegJ2kBuffTimecode0 162 //0x0288/4 +#define kRegJ2kBuffUserdata0 163 //0x028C/4 +#define kRegJ2kBuffStatus1 164 //0x0290/4 +#define kRegJ2kBuffImginfos1 165 //0x0294/4 +#define kRegJ2kBuffTimecode1 166 //0x0298/4 +#define kRegJ2kBuffUserdata1 167 //0x029C/4 +#define kRegJ2kBuffStatus2 168 //0x02A0/4 +#define kRegJ2kBuffImginfos2 169 //0x02A4/4 +#define kRegJ2kBuffTimecode2 170 //0x02A8/4 +#define kRegJ2kBuffUserdata2 171 //0x02AC/4 +#define kRegJ2kBuffStatus3 172 //0x02B0/4 +#define kRegJ2kBuffImginfos3 173 //0x02B4/4 +#define kRegJ2kBuffTimecode3 174 //0x02B8/4 +#define kRegJ2kBuffUserdata3 175 //0x02BC/4 + + +///////////////////////////////////////////////////////////////////// +// +// MPEG2 TS Registers +// +///////////////////////////////////////////////////////////////////// + +// TS Timer Registers +#define kRegTsTimerJ2kTsLoad 0 +#define kRegTsTimerJ2kTsGenTc 1 +#define kRegTsTimerJ2kTsPtsMux 2 + +// TS J2k Encoder Interface Registers +#define kRegTsJ2kEncoderHostEn 0 +#define kRegTsJ2kEncoderInterlacedVideo 1 +#define kRegTsJ2kEncoderFlushTimeout 2 +#define kRegTsJ2kEncoderVideoFrmCnt 3 +#define kRegTsJ2kEncoderVideoByteCnt 4 +#define kRegTsJ2kEncoderEgressFrmCnt 5 +#define kRegTsJ2kEncoderEgressByteCnt 6 + +// TS J2k Decoder Interface Registers +#define kRegTsJ2kDecoderInsertHdr 0 +#define kRegTsJ2kDecoderFrameCount 1 +#define kRegTsJ2kDecoderByteCount 2 + +// TS MPEG2 Encapsulator Registers +#define kRegTsMpeg2EncapPesHdrLookup 0 //0x0000 // table 0x000 - 0x0BB +#define kRegTsMpeg2EncapPesHdrLen 192 //0x00C0 +#define kRegTsMpeg2EncapPtsOffset 193 //0x00C1 +#define kRegTsMpeg2EncapJ2kTsOffset 194 //0x00C2 +#define kRegTsMpeg2EncapAuf1Offset 195 //0x00C3 +#define kRegTsMpeg2EncapAuf2Offset 196 //0x00C4 +#define kRegTsMpeg2EncapPacketRate 202 //0x00CA +#define kRegTsMpeg2EncapPesMax 201 //0x00C9 +#define kRegTsMpeg2EncapTsTxHostEn 224 //0x00E0 +#define kRegTsMpeg2EncapInterlacedVideo 225 //0x00E1 +#define kRegTsMpeg2EncapPayloadParams 226 //0x00E2 +#define kRegTsMpeg2EncapPatTableLookup 256 //0x0100 // table 0x100 - 0x1BB +#define kRegTsMpeg2EncapPatPmtPeriod 496 //0x01F0 +#define kRegTsMpeg2EncapPmtTableLookup 512 //0x0200 // table 0x200 - 0x2BB +#define kRegTsMpeg2EncapApplicationLookup 768 //0x0300 // table 0x300 - 0x3BB +#define kRegTsMpeg2EncapAdaptationHdrLen 1008 //0x03F0 + +// TS MPEG2 Decapsulator Registers +#define kRegTsMpeg2DecapCaptureRam 0 //0x0000 +#define kRegTsMpeg2DecapHostEn 192 //0x00C0 +#define kRegTsMpeg2DecapHeaderCompare 193 //0x00C1 +#define kRegTsMpeg2DecapHeaderMask 194 //0x00C2 +#define kRegTsMpeg2DecapCaptureDone 195 //0x00C3 +#define kRegTsMpeg2DecapPidFilter 196 //0x00C4 +#define kRegTsMpeg2DecapFrmPayloadOffset 208 //0x00D0 +#define kRegTsMpeg2DecapFrmAuf1Offset 209 //0x00D1 +#define kRegTsMpeg2DecapFrmAuf2Offset 210 //0x00D2 +#define kRegTsMpeg2DecapFrmPtsOffset 211 //0x00D3 +#define kRegTsMpeg2DecapFrmJ2kTsOffset 212 //0x00D4 +#define kRegTsMpeg2DecapInterlacedSz16b 213 //0x00D5 + +// MPEG2 TS AES Encapsulator Registers +#define kRegTsAesEncapNumChannels 0 +#define kRegTsAesEncapTsRatePeriod 1 +#define kRegTsAesEncapAudioExtractVidStd 2 +#define kRegTsAesEncapAudioExtractErrRst 3 +#define kRegTsAesEncapAudioExtractChEn 4 +#define kRegTsAesEncapAudioExtractErrStat 5 +#define kRegTsAesEncapAudioExtractClkStat 6 +#define kRegTsAesEncapRxSdiStatus 7 +#define kRegTsAesEncapHostEn 8 +#define kRegTsAesEncapFrameCount 9 +#define kRegTsAesEncapByteCount 10 + +// MPEG2 TS AES Decapsulator Registers +#define kRegTsAesDecapHostEn 0 +#define kRegTsAesDecapLockedBit 1 +#define kRegTsAesDecapNumChannels 2 +#define kRegTsAesDecapSdiTxVidStd 3 +#define kRegTsAesDecapAudioEmbedControl 4 +#define kRegTsAesDecapSineFrequencies 5 +#define kRegTsAesDecapAudioEmbedVidStat 6 +#define kRegTsAesDecapFrameCount 7 +#define kRegTsAesDecapByteCount 8 + +#endif // REGISTERS_2022_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2registers2110.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2registers2110.h new file mode 100644 index 0000000..ad200f4 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2registers2110.h @@ -0,0 +1,371 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2registers2110.h + @brief Defines the KonaIP/IoIP S2110 registers. + @copyright (C) 2014-2021 AJA Video Systems, Inc. +**/ + +#ifndef REGISTERS_2110_H +#define REGISTERS_2110_H + +#include "ntv2registersmb.h" + +#define SAREK_4175_TX_PACKETIZER_1 (0x200000/4) +#define SAREK_4175_TX_PACKETIZER_2 (0x201000/4) +#define SAREK_4175_TX_PACKETIZER_3 (0x202000/4) +#define SAREK_4175_TX_PACKETIZER_4 (0x203000/4) + +#define SAREK_4175_TX_PACKETIZER_RGB12_1 (0x204000/4) +#define SAREK_4175_TX_PACKETIZER_RGB12_2 (0x205000/4) +#define SAREK_4175_TX_PACKETIZER_RGB12_3 (0x206000/4) +#define SAREK_4175_TX_PACKETIZER_RGB12_4 (0x207000/4) + +#define SAREK_3190_TX_PACKETIZER_0 (0x220000/4) +#define SAREK_3190_TX_PACKETIZER_1 (0x221000/4) +#define SAREK_3190_TX_PACKETIZER_2 (0x222000/4) +#define SAREK_3190_TX_PACKETIZER_3 (0x223000/4) + +#define SAREK_4175_RX_DEPACKETIZER_1 (0x208000/4) +#define SAREK_4175_RX_DEPACKETIZER_2 (0x209000/4) +#define SAREK_4175_RX_DEPACKETIZER_3 (0x20a000/4) +#define SAREK_4175_RX_DEPACKETIZER_4 (0x20b000/4) + +#define SAREK_3190_RX_DEPACKETIZER_1 (0x20c000/4) +#define SAREK_3190_RX_DEPACKETIZER_2 (0x20d000/4) +#define SAREK_3190_RX_DEPACKETIZER_3 (0x20e000/4) +#define SAREK_3190_RX_DEPACKETIZER_4 (0x20f000/4) + +#define SAREK_2110_VIDEO_FRAMER_0 (0x210000/4) +#define SAREK_2110_AUDIO_ANC_FRAMER_0 (0x212000/4) +#define SAREK_2110_VIDEO_FRAMER_1 (0x213000/4) +#define SAREK_2110_AUDIO_ANC_FRAMER_1 (0x214000/4) +#define SAREK_2110_TX_ARBITRATOR (0x215000/4) +#define SAREK_2110_DECAPSULATOR_0 (0x211000/4) +#define SAREK_2110_DECAPSULATOR_1 (0x216000/4) +#define SAREK_2110_VOIPFEC (0x217000/4) +#define SAREK_2110_VOIPFEC_CTL (0x218000/4) +#define SAREK_2110_FRAMESYNC (0x219000/4) +#define SAREK_2110_AUDIO_STREAMSELECT (0x230000/4) +#define SAREK_2110_VIDEO_TIMING_CTRLR (0x240000/4) +#define SAREK_2110_VIDEO_TIMING_CTRLR2 (0x241000/4) + +#define SAREK_2110_TEST_GENERATOR (0x308000/4) +#define SAREK_AXIS_PCAP (0x309000/4) + + +///////////////////////////////////////////////////////////////////// +// +// 4175 Packeteizer +// +///////////////////////////////////////////////////////////////////// + +#define kReg4175_pkt_ctrl 0x00 +#define kReg4175_pkt_width 0x04 +#define kReg4175_pkt_height 0x06 +#define kReg4175_pkt_vid_fmt 0x08 +#define kReg4175_pkt_pkts_per_line 0x0a +#define kReg4175_pkt_payload_len 0x0c +#define kReg4175_pkt_payload_len_last 0x0e +#define kReg4175_pkt_ssrc 0x10 +#define kReg4175_pkt_payload_type 0x12 +#define kReg4175_pkt_bpc_reg 0x14 +#define kReg4175_pkt_chan_num 0x16 +#define kReg4175_pkt_tx_pkt_cnt 0x18 +#define kReg4175_pkt_tx_pkt_cnt_valid 0x19 +#define kReg4175_pkt_pix_per_pkt 0x1a +#define kReg4175_pkt_stat_reset 0x1c +#define kReg4175_pkt_interlace_ctrl 0x1e + +///////////////////////////////////////////////////////////////////// +// +// 4175 Depacketizer +// +///////////////////////////////////////////////////////////////////// + +#define kReg4175_depkt_control (0x0000/4) +#define kReg4175_depkt_width_o (0x0010/4) +#define kReg4175_depkt_height_o (0x0018/4) +#define kReg4175_depkt_vid_fmt_o (0x0020/4) +#define kReg4175_depkt_pkts_per_line_o (0x0028/4) +#define kReg4175_depkt_payload_len_o (0x0030/4) +#define kReg4175_depkt_payload_len_last_o (0x0038/4) +#define kReg4175_depkt_bpc_reg_o (0x0040/4) +#define kReg4175_depkt_rx_pkt_cnt_o (0x0048/4) +#define kReg4175_depkt_rx_pkt_cnt_valid_o (0x0050/4) +#define kReg4175_depkt_stat_reset_o (0x0054/4) +#define kReg4175_depkt_rx_field_cnt (0x0058/4) +#define kReg4175_depkt_rx_pkt_cnt (0x005C/4) +#define kReg4175_depkt_rx_byte_cnt (0x0060/4) +#define kReg4175_depkt_bytes_per_line (0x0064/4) +#define kReg4175_depkt_rows_per_field (0x0068/4) +#define kReg4175_depkt_version_id (0x006C/4) +#define kReg4175_depkt_pixels_per_field (0x0070/4) +#define kReg4175_depkt_bytes_per_field (0x0074/4) +#define kReg4175_depkt_sequence_err (0x007C/4) + +///////////////////////////////////////////////////////////////////// +// +// 3190 Packeteizer +// +///////////////////////////////////////////////////////////////////// + +#define kReg3190_pkt_ctrl (0x0000/4) +#define kReg3190_pkt_num_samples (0x0010/4) +#define kReg3190_pkt_num_audio_channels (0x0018/4) +#define kReg3190_pkt_payload_len (0x0020/4) +#define kReg3190_pkt_chan_num (0x0028/4) +#define kReg3190_pkt_payload_type (0x0030/4) +#define kReg3190_pkt_ssrc (0x0038/4) +#define kReg3190_pkt_tx_pkt_cnt (0x0040/4) +#define kReg3190_pkt_stat_reset (0x00B0/4) + + +///////////////////////////////////////////////////////////////////// +// +// 3190 Depacketizer +// +///////////////////////////////////////////////////////////////////// + +#define kReg3190_depkt_enable 0 +#define kReg3190_depkt_config 1 +#define kReg3190_depkt_rx_pkt_count 2 + +///////////////////////////////////////////////////////////////////// +// +// Framer +// +///////////////////////////////////////////////////////////////////// + +#define kRegFramer_control (0x0000/4) +#define kRegFramer_status (0x0004/4) +#define kRegFramer_channel_access (0x0008/4) +#define kRegFramer_sys_config (0x000c/4) +#define kRegFramer_version (0x0010/4) +#define kRegFramer_src_mac_lo (0x0014/4) +#define kRegFramer_src_mac_hi (0x0018/4) +#define kRegFramer_peak_buf_level (0x001c/4) +#define kRegFramer_rx_pkt_cnt (0x0020/4) +#define kRegFramer_drop_pkt_cnt (0x0024/4) +#define kRegFramer_stat_reset (0x0030/4) + +// channel +#define kRegFramer_chan_ctrl (0x0080/4) +#define kRegFramer_dest_mac_lo (0x0084/4) +#define kRegFramer_dest_mac_hi (0x0088/4) +#define kRegFramer_vlan_tag_info (0x008c/4) +#define kRegFramer_ip_hdr_media (0x0090/4) +#define kRegFramer_ip_hdr_fec (0x0094/4) +#define kRegFramer_src_ip (0x0098/4) +#define kRegFramer_dst_ip (0x00a8/4) +#define kRegFramer_udp_src_port (0x00b8/4) +#define kRegFramer_udp_dst_port (0x00bc/4) +#define kRegFramer_tk_pkt_cnt (0x00c0/4) +#define kRegFramer_chan_stat_reset (0x00c4/4) + +///////////////////////////////////////////////////////////////////// +// +// Decapsulator +// +///////////////////////////////////////////////////////////////////// + +#define kRegDecap_chan_enable 0x00 +#define kRegDecap_match_reserved 0x01 +#define kRegDecap_match_src_ip 0x02 +#define kRegDecap_match_dst_ip 0x03 +#define kRegDecap_match_udp_src_port 0x04 +#define kRegDecap_match_udp_dst_port 0x05 +#define kRegDecap_match_payload 0x06 +#define kRegDecap_match_ssrc 0x07 +#define kRegDecap_match_sel 0x08 +#define kRegDecap_unused 0x09 +#define kRegDecap_rx_payload 0x0a +#define kRegDecap_rx_ssrc 0x0b +#define kRegDecap_rx_pkt_cnt 0x0c +#define kRegDecap_reordered_pkt_cnt 0x0d +#define kRegDecap_unused2 0x0e +#define kRegDecap_descriptiom 0x0f + +///////////////////////////////////////////////////////////////////// +// +// VOIP FEC +// +///////////////////////////////////////////////////////////////////// + +#define kRegVfec_control (0x00/4) +#define kRegVfec_status (0x04/4) +#define kRegVfec_channel_access (0x08/4) +#define kRegVfec_sys_config (0x0c/4) +#define kRegVfec_version (0x10/4) +#define kRegVfec_fec_processing_delay (0x20/4) +#define kRegVfec_fec_packet_drop_cnt (0x24/4) + +#define kRegVfec_chan_conf (0x80/4) +#define kRegVfec_valid_pkt_cnt (0x90/4) +#define kRegVfec_unrecv_pkt_cnt (0x94/4) +#define kRegVfec_corr_pkt_cnt (0x98/4) +#define kRegVfec_dup_pkt_cnt (0x9c/4) +#define kRegVfec_channel_status (0xa8/4) +#define kRegVfec_curr_buffer_depth (0xac/4) +#define kRegVfec_oor_pkt_cnt (0xb0/4) +#define kRegVfec_oor_ts_offset (0xb4/4) +#define kRegVfec_link_ts_diff (0xb8/4) + +#define kRegVfec_delay_control (0x00/4) +#define kRegVfec_delay_ch0_playout (0x04/4) +#define kRegVfec_delay_ch1_playout (0x08/4) +#define kRegVfec_delay_ch2_playout (0x0c/4) +#define kRegVfec_delay_ch3_playout (0x10/4) +#define kRegVfec_audio_pkt_read_intrvl (0x14/4) +#define kRegVfec_video_pkt_read_intrvl (0x18/4) +#define kRegVfec_delay_status (0x20/4) +#define kRegVfec_delay_version (0x3c/4) + +///////////////////////////////////////////////////////////////////// +// +// Frame Sync +// +///////////////////////////////////////////////////////////////////// + +#define kRegVFS_mm2s_control (0x00/4) +#define kRegVFS_mm2s_status (0x04/4) +#define kRegVFS_mm2s_index (0x14/4) +#define kRegVFS_park_ptr (0x28/4) +#define kRegVFS_version (0x2c/4) +#define kRegVFS_s2mm_control (0x30/4) +#define kRegVFS_s2mm_status (0x34/4) +#define kRegVFS_s2mm_irq_mask (0x3c/4) +#define kRegVFS_s2mm_index (0x44/4) +#define kRegVFS_mm2s_vsize (0x50/4) +#define kRegVFS_mm2s_hsize (0x54/4) +#define kRegVFS_mm2s_frmdly_stride (0x58/4) +#define kRegVFS_mm2s_start_addr01 (0x5c/4) +#define kRegVFS_mm2s_start_addr02 (0x60/4) +#define kRegVFS_mm2s_start_addr03 (0x64/4) +#define kRegVFS_mm2s_start_addr04 (0x68/4) +#define kRegVFS_mm2s_start_addr05 (0x6c/4) +#define kRegVFS_mm2s_start_addr06 (0x70/4) +#define kRegVFS_mm2s_start_addr07 (0x74/4) +#define kRegVFS_mm2s_start_addr08 (0x78/4) +#define kRegVFS_mm2s_start_addr09 (0x7c/4) +#define kRegVFS_mm2s_start_addr10 (0x80/4) +#define kRegVFS_mm2s_start_addr11 (0x84/4) +#define kRegVFS_mm2s_start_addr12 (0x88/4) +#define kRegVFS_mm2s_start_addr13 (0x8c/4) +#define kRegVFS_mm2s_start_addr14 (0x90/4) +#define kRegVFS_mm2s_start_addr15 (0x94/4) +#define kRegVFS_mm2s_start_addr16 (0x98/4) +#define kRegVFS_s2mm_vsize (0xa0/4) +#define kRegVFS_s2mm_hsize (0xa4/4) +#define kRegVFS_s2mm_frmdly_stride (0xa8/4) +#define kRegVFS_s2mm_start_addr01 (0xac/4) +#define kRegVFS_s2mm_start_addr02 (0xb0/4) +#define kRegVFS_s2mm_start_addr03 (0xb4/4) +#define kRegVFS_s2mm_start_addr04 (0xb8/4) +#define kRegVFS_s2mm_start_addr05 (0xbc/4) +#define kRegVFS_s2mm_start_addr06 (0xc0/4) +#define kRegVFS_s2mm_start_addr07 (0xc4/4) +#define kRegVFS_s2mm_start_addr08 (0xc8/4) +#define kRegVFS_s2mm_start_addr09 (0xcc/4) +#define kRegVFS_s2mm_start_addr10 (0xd0/4) +#define kRegVFS_s2mm_start_addr11 (0xd4/4) +#define kRegVFS_s2mm_start_addr12 (0xd8/4) +#define kRegVFS_s2mm_start_addr13 (0xdc/4) +#define kRegVFS_s2mm_start_addr14 (0xe0/4) +#define kRegVFS_s2mm_start_addr15 (0xe4/4) +#define kRegVFS_s2mm_start_addr16 (0xe8/4) + +///////////////////////////////////////////////////////////////////// +// +// Video Timing Controller +// +///////////////////////////////////////////////////////////////////// + +#define kRegVTC_control (0x000/4) +#define kRegVTC_status (0x004/4) +#define kRegVTC_error (0x008/4) +#define kRegVTC_irq_enable (0x00c/4) +#define kRegVTC_version (0x010/4) +#define kRegVTC_detector_active_size (0x020/4) +#define kRegVTC_detector_timing_status (0x024/4) +#define kRegVTC_detector_encoding (0x028/4) +#define kRegVTC_detector_polarity (0x02c/4) +#define kRegVTC_detector_hsize (0x030/4) +#define kRegVTC_detector_vsize (0x034/4) +#define kRegVTC_detector_hsync (0x038/4) +#define kRegVTC_detector_f0_vblank_h (0x03c/4) +#define kRegVTC_detector_f0_vsync_v (0x040/4) +#define kRegVTC_detector_f0_vsync_h (0x044/4) +#define kRegVTC_generator_active_size (0x060/4) +#define kRegVTC_generator_tmng_status (0x064/4) +#define kRegVTC_generator_encoding (0x068/4) +#define kRegVTC_generator_polarity (0x06c/4) +#define kRegVTC_generator_hsize (0x070/4) +#define kRegVTC_generator_vsize (0x074/4) +#define kRegVTC_generator_hsync (0x078/4) +#define kRegVTC_generator_f0_vblank_h (0x07c/4) +#define kRegVTC_generator_f0_vsync_v (0x080/4) +#define kRegVTC_generator_f0_vsync_h (0x084/4) +#define kRegVTC_generator_f1_vblank_h (0x088/4) +#define kRegVTC_generator_f1_vsync_v (0x08c/4) +#define kRegVTC_generator_f1_vsync_h (0x090/4) +#define kRegVTC_frame_sync_cfg_00 (0x100/4) +#define kRegVTC_frame_sync_cfg_01 (0x104/4) +#define kRegVTC_frame_sync_cfg_02 (0x108/4) +#define kRegVTC_frame_sync_cfg_03 (0x10c/4) +#define kRegVTC_frame_sync_cfg_04 (0x110/4) +#define kRegVTC_frame_sync_cfg_05 (0x114/4) +#define kRegVTC_frame_sync_cfg_06 (0x118/4) +#define kRegVTC_frame_sync_cfg_07 (0x11c/4) +#define kRegVTC_frame_sync_cfg_08 (0x120/4) +#define kRegVTC_frame_sync_cfg_09 (0x124/4) +#define kRegVTC_frame_sync_cfg_10 (0x128/4) +#define kRegVTC_frame_sync_cfg_11 (0x12c/4) +#define kRegVTC_frame_sync_cfg_12 (0x130/4) +#define kRegVTC_frame_sync_cfg_13 (0x134/4) +#define kRegVTC_frame_sync_cfg_14 (0x138/4) +#define kRegVTC_frame_sync_cfg_15 (0x13c/4) +#define kRegVTC_generator_global_delay (0x140/4) + +///////////////////////////////////////////////////////////////////// +// +// Arbitrator +// +///////////////////////////////////////////////////////////////////// + +#define kRegArb_video 0x00 +#define kRegArb_audio 0x01 +#define kRegArb_4KMode 0x07 +#define kRegRxVideoDecode1 0x08 +#define kRegRxVideoDecode2 0x09 +#define kRegRxVideoDecode3 0x0a +#define kRegRxVideoDecode4 0x0b +#define kRegTxVideoDecode1 0x0c +#define kRegTxVideoDecode2 0x0d +#define kRegTxVideoDecode3 0x0e +#define kRegTxVideoDecode4 0x0f + +#define kRegTxAncSSRC1 0x10 +#define kRegTxAncSSRC2 0x11 +#define kRegTxAncSSRC3 0x12 +#define kRegTxAncSSRC4 0x13 +#define kRegTxAncPayload1 0x14 +#define kRegTxAncPayload2 0x15 +#define kRegTxAncPayload3 0x16 +#define kRegTxAncPayload4 0x17 + +///////////////////////////////////////////////////////////////////// +// +// 2110 Block scratch pad registers +// +///////////////////////////////////////////////////////////////////// + +#define kRegRxNtv2VideoDecode1 (S2110_BLOCK_BASE+0) +#define kRegRxNtv2VideoDecode2 (S2110_BLOCK_BASE+1) +#define kRegRxNtv2VideoDecode3 (S2110_BLOCK_BASE+2) +#define kRegRxNtv2VideoDecode4 (S2110_BLOCK_BASE+3) +#define kRegTxNtv2VideoDecode1 (S2110_BLOCK_BASE+4) +#define kRegTxNtv2VideoDecode2 (S2110_BLOCK_BASE+5) +#define kRegTxNtv2VideoDecode3 (S2110_BLOCK_BASE+6) +#define kRegTxNtv2VideoDecode4 (S2110_BLOCK_BASE+7) + +#endif // REGISTERS_2110_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2registersmb.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2registersmb.h new file mode 100644 index 0000000..33367fd --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2registersmb.h @@ -0,0 +1,502 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2registersmb.h + @brief Defines the KonaIP/IoIP registers. + @copyright (C) 2014-2021 AJA Video Systems, Inc. +**/ + +#ifndef REGISTERS_MB_H +#define REGISTERS_MB_H + +#define SAREK_MAX_CHANS 4 +#define SAREK_MAX_PORTS 2 + +#define SAREK_IF_VERSION 4 // update this if mb protocol is changed (here and in mb) + +#define RX_MATCH_2022_VLAN BIT(0) +#define RX_MATCH_2022_SOURCE_IP BIT(1) +#define RX_MATCH_2022_DEST_IP BIT(2) +#define RX_MATCH_2022_SOURCE_PORT BIT(3) +#define RX_MATCH_2022_DEST_PORT BIT(4) +#define RX_MATCH_2022_SSRC BIT(5) + +#define RX_MATCH_2110_VLAN BIT(0) +#define RX_MATCH_2110_SOURCE_IP BIT(1) +#define RX_MATCH_2110_DEST_IP BIT(2) +#define RX_MATCH_2110_SOURCE_PORT BIT(3) +#define RX_MATCH_2110_DEST_PORT BIT(4) +#define RX_MATCH_2110_PAYLOAD BIT(5) +#define RX_MATCH_2110_SSRC BIT(6) + +#define VOIP_SEMAPHORE_SET 0x2 +#define VOIP_SEMAPHORE_CLEAR 0xFFFFFFFD +#define VOIP_PRIMARY_ENABLE 0x7FFFFFFF +#define VOIP_SECONDARY_ENABLE 0x80000000 + +#define PLL_MATCH_SOURCE_IP BIT(0) +#define PLL_MATCH_DEST_IP BIT(1) +#define PLL_MATCH_SOURCE_PORT BIT(2) +#define PLL_MATCH_DEST_PORT BIT(3) +#define PLL_MATCH_ES_PID BIT(4) + +#define PLL_CONFIG_PCR BIT(0) +#define PLL_CONFIG_PTP BIT(1) +#define PLL_CONFIG_RESET BIT(20) +#define PLL_CONFIG_DCO_MODE BIT(28) + + +///////////////////////////////////////////////////////////////////// +// +// General memory map definitions +// +///////////////////////////////////////////////////////////////////// + +#define SAREK_REGS (0x100000/4) // Base address of Sarek General Regs (expressed as regNum) +#define SAREK_GENLOCK_SPI (0x101000/4) +#define SAREK_MAILBOX (0x107000/4) +#define SAREK_PLL (0x108000/4) +#define SAREK_REGS2 (0x10e000/4) +#define SAREK_10G_EMAC_0 (0x180000/4) +#define SAREK_10G_EMAC_1 (0x1a0000/4) +#define SAREK_CSREGS (0x080000/4) +#define SAREK_ENET_FILTER (0x109000/4) +#define SAREK_AXIS_FILTER_0 (0x109000/4) +#define SAREK_AXIS_FILTER_1 (0x10a000/4) + + +///////////////////////////////////////////////////////////////////// +// +// 2022 Sarek General Registers (expressed as regNum) +// +///////////////////////////////////////////////////////////////////// + +#define kRegSarekControl 0 +#define kRegSarekPma 1 +#define kRegSarekSpiSelect 2 +#define kRegSarekRxReset 3 +#define kRegSarekMBUptime 4 +#define kRegSarekMBState 5 +#define kRegSarekMBBuildNum 6 +#define kRegSarekSerialLow 7 +#define kRegSarekSerialHi 8 +#define kRegSarekIGMPVersion 9 +#define kRegSarekMiscState 10 +#define kRegSarekPackageVersion 11 +#define kRegSarekIfVersion 12 +#define kRegSarekLinkStatus 13 +#define kRegSarekServices 14 +#define kRegSarekSampling 15 +#define kRegSarekMAC 16 +#define kRegSarekMAC1 17 +#define kRegSarekMAC2 18 +#define kRegSarekMAC3 19 +#define kRegSarekIP0 20 +#define kRegSarekIP1 21 +#define kRegSarekNET0 22 +#define kRegSarekNET1 23 +#define kRegSarekGATE0 24 +#define kRegSarekGATE1 25 +#define kRegSarekLinkModes 26 +#define kRegSarekRxMatchesA 27 +#define kRegSarekRxMatchesB 28 +#define kRegSarekTxFmts 29 +#define kSarekRegIGMPDisable 30 +#define kSarekRegIGMPDisable2 31 +#define kRegSarekFwCfg 32 +#define kRegSarekDDRStatus 33 +#define kRegSarekXrefStatus 34 +#define kRegSarekSFPStatus 35 +#define kRegSarekDNALow 36 +#define kRegSarekDNAHi 37 +#define kRegSarekLicenseStatus 38 +#define kRegSarekunused39 39 +#define kRegSarekRx1Drops 40 +#define kRegSarekRx2Drops 41 +#define kRegSarekRx3Drops 42 +#define kRegSarekRx4Drops 43 +#define kRegSarekTReady 44 + +// second block +#define TS_BLOCK_BASE 0 +#define IGMP_BLOCK_BASE 100 +#define ENCODER_BLOCK_BASE 200 +#define S2110_BLOCK_BASE 300 + +#define kRegSarekMBSeqNum 0 +#define kRegSarekActProgramNum 1 +#define kRegSarekActProgramPID 2 +#define kRegSarekActVideoPID 3 +#define kRegSarekActAudioPID 4 +#define kRegSraekActPCRPID 5 +#define kRegSarekAudioNumChans 6 +#define kRegSarekAudioBitDepth 7 +#define kRegSarekVideoBitrate 8 +#define kRegSarekAudioBitrate 9 + +#define kRegSarekHostSeqNum 12 // set by host +#define kRegSarekModeSelect 13 // set by host +#define kRegSarekProgNumSelect 14 // set by host +#define kRegSarekProgPIDSelect 15 // set by host +#define kRegSarekAudioNumSelect 16 // set by host + +#define kRegSarekNumPGMs 20 +#define kRegSarekNumAudios 21 + +#define kRegSarekPGMNums 24 +#define kRegSarekPGMPIDs 40 +#define kRegSarekAudioPIDs 56 + +#define kRegSarekBlk2Unused 72 +#define kRegSarek2022_7enb 80 + +// Encoder block regs +#define kRegSarekEncodeVideoFormat1 (ENCODER_BLOCK_BASE+0) +#define kRegSarekEncodeUllMode1 (ENCODER_BLOCK_BASE+1) +#define kRegSarekEncodeBitDepth1 (ENCODER_BLOCK_BASE+2) +#define kRegSarekEncodeChromaSubSamp1 (ENCODER_BLOCK_BASE+3) +#define kRegSarekEncodeMbps1 (ENCODER_BLOCK_BASE+4) +#define kRegSarekEncodeStreamType1 (ENCODER_BLOCK_BASE+5) +#define kRegSarekEncodeAudioChannels1 (ENCODER_BLOCK_BASE+6) +#define kRegSarekEncodeProgramPid1 (ENCODER_BLOCK_BASE+7) +#define kRegSarekEncodeVideoPid1 (ENCODER_BLOCK_BASE+8) +#define kRegSarekEncodePcrPid1 (ENCODER_BLOCK_BASE+9) +#define kRegSarekEncodeAudio1Pid1 (ENCODER_BLOCK_BASE+10) + +#define kRegSarekEncodeVideoFormat2 (ENCODER_BLOCK_BASE+11) +#define kRegSarekEncodeUllMode2 (ENCODER_BLOCK_BASE+12) +#define kRegSarekEncodeBitDepth2 (ENCODER_BLOCK_BASE+13) +#define kRegSarekEncodeChromaSubSamp2 (ENCODER_BLOCK_BASE+14) +#define kRegSarekEncodeMbps2 (ENCODER_BLOCK_BASE+15) +#define kRegSarekEncodeStreamType2 (ENCODER_BLOCK_BASE+16) +#define kRegSarekEncodeAudioChannels2 (ENCODER_BLOCK_BASE+17) +#define kRegSarekEncodeProgramPid2 (ENCODER_BLOCK_BASE+18) +#define kRegSarekEncodeVideoPid2 (ENCODER_BLOCK_BASE+19) +#define kRegSarekEncodePcrPid2 (ENCODER_BLOCK_BASE+20) +#define kRegSarekEncodeAudio1Pid2 (ENCODER_BLOCK_BASE+21) + +///////////////////////////////////////////////////////////////////// +// +// 2022 Sarek General Registers Bit Definitions +// +///////////////////////////////////////////////////////////////////// + +#define RESET_MB BIT(0) +#define VIRTUAL_UART BIT(4) +#define DECODER_1_RESET BIT(11) +#define ENCODER_1_ENABLE BIT(16) +#define ENCODER_1_MD_ENABLE BIT(17) +#define ENCODER_1_SF_ENABLE BIT(18) +#define DECODER_1_NON_ELSM BIT(19) +#define ENCODER_1_CFG_NUM (BIT(20) + BIT(21) + BIT(22)) +#define ENCODER_1_RESET BIT(23) +#define ENCODER_2_ENABLE BIT(24) +#define ENCODER_2_MD_ENABLE BIT(25) +#define ENCODER_2_SF_ENABLE BIT(26) +#define ENCODER_2_CFG_NUM (BIT(28) + BIT(29() + BIT(30)) +#define ENCODER_2_RESET BIT(31) + +#define SAREK_2022_6 BIT(0) +#define SAREK_2022_2 BIT(1) +#define SAREK_MB_PRESENT BIT(2) +#define SAREK_IP_LIVE BIT(3) +#define SAREK_2022_7 BIT(4) +#define SAREK_PTP_PLL BIT(5) +#define SAREK_TX_TOP34 BIT(6) +#define SAREK_2110 BIT(7) +#define SAREK_CS BIT(8) + +#define SAREK_TX0_MASK (BIT(31) + BIT(30) + BIT(29) + BIT(28)) +#define SAREK_RX0_MASK (BIT(27) + BIT(26) + BIT(25) + BIT(24)) +#define SAREK_TX1_MASK (BIT(23) + BIT(22) + BIT(21) + BIT(20)) +#define SAREK_RX1_MASK (BIT(19) + BIT(18) + BIT(17) + BIT(16)) + + +#define SAREK_ReferenceFrameRate (BIT(3) + BIT(2) + BIT(1) + BIT(0)) +#define SAREK_ReferenceFrameLines (BIT(6) + BIT(5) + BIT(4)) +#define SAREK_ReferenceProgessive BIT(7) +#define SAREK_ReferenceSelected (BIT(11) + BIT(10) + BIT(9) + BIT(8)) +#define SAREK_GenlockLocked BIT(12) +#define SAREK_Fractional_1 BIT(16) +#define SAREK_Fractional_2 BIT(17) +#define SAREK_Fractional_3 BIT(18) +#define SAREK_Fractional_4 BIT(19) + +#define SAREK_LICENSE_PRESENT BIT(31) +#define SAREK_LICENSE_VALID BIT(30) +#define SAREK_LICENSE_J2K BIT(1) + +#define PLL_PCR BIT(0) +#define PLL_PTP BIT(1) +#define PLL_UNICAST_DELREQ BIT(5) +#define PLL_PCR_RESET BIT(16) +#define PLL_PTP_RESET BIT(20) +#define PLL_Si5345_DCO_MODE BIT(28) + +#define SFP_1_NOT_PRESENT BIT(0) +#define SFP_1_TX_FAULT BIT(1) +#define SFP_1_RX_LOS BIT(2) +#define SFP_2_NOT_PRESENT BIT(16) +#define SFP_2_TX_FAULT BIT(17) +#define SFP_2_RX_LOS BIT(18) + +#define LINK_A_UP BIT(0) +#define LINK_B_UP BIT(1) + + +///////////////////////////////////////////////////////////////////// +// +// 10G Registers +// +///////////////////////////////////////////////////////////////////// + +#define kReg10gemac_rx_bytes_lo 128 // 0x0200 +#define kReg10gemac_rx_bytes_hi 129 // 0x0204 +#define kReg10gemac_tx_bytes_lo 130 // 0x0208 +#define kReg10gemac_tx_bytes_hi 131 // 0x020C + +#define kReg10gemac_rx_frames_under_lo 132 // 0x0210 +#define kReg10gemac_rx_frames_under_hi 133 // 0x0214 +#define kReg10gemac_rx_frames_frag_lo 134 // 0x0218 +#define kReg10gemac_rx_frames_frag_hi 135 // 0x021C + +#define kReg10gemac_rx_frames_64_lo 136 // 0x0220 +#define kReg10gemac_rx_frames_64_hi 137 // 0x0224 +#define kReg10gemac_rx_frames_65_127_lo 138 // 0x0228 +#define kReg10gemac_rx_frames_65_127_hi 139 // 0x022C +#define kReg10gemac_rx_frames_128_255_lo 140 // 0x0230 +#define kReg10gemac_rx_frames_128_255_hi 141 // 0x0234 +#define kReg10gemac_rx_frames_256_511_l0 142 // 0x0238 +#define kReg10gemac_rx_frames_256_511_hi 143 // 0x023c +#define kReg10gemac_rx_frames_512_1023_lo 144 // 0x0240 +#define kReg10gemac_rx_frames_512_1023_hi 145 // 0x0244 +#define kReg10gemac_rx_frames_1024_max_lo 146 // 0x0248 +#define kReg10gemac_rx_frames_1024_max_hi 147 // 0x024c +#define kReg10gemac_rx_frames_oversize_lo 148 // 0x0250 +#define kReg10gemac_rx_frames_oversize_hi 149 // 0x0254 + +#define kReg10gemac_tx_frames_64_lo 150 // 0x0258 +#define kReg10gemac_tx_frames_64_hi 151 // 0x025c +#define kReg10gemac_tx_frames_65_127_lo 152 // 0x0260 +#define kReg10gemac_tx_frames_65_127_hi 153 // 0x0264 +#define kReg10gemac_tx_frames_128_255_lo 154 // 0x0268 +#define kReg10gemac_tx_frames_128_255_hi 155 // 0x026c +#define kReg10gemac_tx_frames_256_511_l0 156 // 0x0270 +#define kReg10gemac_tx_frames_256_511_hi 157 // 0x0274 +#define kReg10gemac_tx_frames_512_1023_lo 158 // 0x0278 +#define kReg10gemac_tx_frames_512_1023_hi 159 // 0x027c +#define kReg10gemac_tx_frames_1024_max_lo 160 // 0x0280 +#define kReg10gemac_tx_frames_1024_max_hi 161 // 0x0284 +#define kReg10gemac_tx_frames_oversize_lo 162 // 0x0288 +#define kReg10gemac_tx_frames_oversize_hi 163 // 0x028c + +#define kReg10gemac_rx_frames_ok_lo 164 // 0x0290 +#define kReg10gemac_rx_frames_ok_hi 165 // 0x0294 + +#define kReg10gemac_rx_crc_err_lo 166 // 0x0298 +#define kReg10gemac_rx_crc_err_hi 167 // 0x029c +#define kReg10gemac_rx_frames_bdcast_lo 168 // 0x02a0 +#define kReg10gemac_rx_frames_bdcast_hi 169 // 0x02a4 + +#define kReg10gemac_rx_frames_mcast_lo 170 // 0x02a8 +#define kReg10gemac_rx_frames_macst_hi 171 // 0x02ac +#define kReg10gemac_rx_frames_ctrl_lo 172 // 0x02b0 +#define kReg10gemac_rx_frames_ctrt_hi 173 // 0x02b4 +#define kReg10gemac_rx_frames_len_err_lo 174 // 0x02b8 +#define kReg10gemac_rx_frames_len_err_hi 175 // 0x02bc +#define kReg10gemac_rx_frames_vlan_lo 176 // 0x02c0 +#define kReg10gemac_rx_frames_vlan_hi 177 // 0x02c4 +#define kReg10gemac_rx_frames_pause_lo 178 // 0x02c8 +#define kReg10gemac_rx_frames_pause_hi 179 // 0x02cc +#define kReg10gemac_rx_frames_op_lo 180 // 0x02d0 +#define kReg10gemac_rx_frames_op_hi 181 // 0x02d4 + +#define kReg10gemac_tx_frames_ok_lo 182 // 0x02d8 +#define kReg10gemac_tx_frames_ok_hi 183 // 0x02dc +#define kReg10gemac_tx_frames_bdcast_lo 184 // 0x02e0 +#define kReg10gemac_tx_frames_bdcast_hi 185 // 0x02e4 +#define kReg10gemac_tx_frames_mcast_lo 186 // 0x02e8 +#define kReg10gemac_tx_frames_mcast_hi 187 // 0x02ec +#define kReg10gemac_tx_frames_underrun_lo 188 // 0x02f0 +#define kReg10gemac_tx_frames_underrun_hi 189 // 0x02f4 +#define kReg10gemac_tx_frames_ctrl_lo 190 // 0x02f8 +#define kReg10gemac_tx_frames_ctrt_hi 191 // 0x02fc +#define kReg10gemac_tx_frames_vlan_lo 192 // 0x0300 +#define kReg10gemac_tx_frames_vlan_hi 193 // 0x0304 +#define kReg10gemac_tx_frames_pause_lo 194 // 0x0308 +#define kReg10gemac_tx_frames_pause_hi 195 // 0x030c + +#define kReg10gemac_tx_frames_pri_lo 196 // 0x0310 +#define kReg10gemac_tx_frames_pri_hi 197 // 0x0314 +#define kReg10gemac_rx_frames_pri_lo 198 // 0x0318 +#define kReg10gemac_rx_frames_pri_hi 199 // 0x031c + +#define kReg10gemac_rx_cfg_0 256 // 0x0400 +#define kReg10gemac_rx_cfg_1 257 // 0x0404 +#define kReg10gemac_tx_cfg 258 // 0x0408 +#define kReg10gemac_flow_cfg 259 // 0x040c +#define kReg10gemac_reconcil_cfg 260 // 0x0410 +#define kReg10gemac_rx_mtu_cfg 261 // 0x0414 +#define kReg10gemac_tx_mtu_cfg 262 // 0x0418 + +#define kReg10gemac_pri_0_quanta 288 // 0x0480 +#define kReg10gemac_pri_1_quanta 289 // 0x0484 +#define kReg10gemac_pri_2_quanta 290 // 0x0488 +#define kReg10gemac_pri_3_quanta 291 // 0x048c +#define kReg10gemac_pri_4_quanta 292 // 0x0490 +#define kReg10gemac_pri_5_quanta 293 // 0x0494 +#define kReg10gemac_pri_6_quanta 294 // 0x0498 +#define kReg10gemac_pri_7_quanta 295 // 0x049c +#define kReg10gemac_legacy_pause 296 // 0x04a0 + +#define kReg10gemac_version 318 // 0x04f8 +#define kReg10gemac_capability 319 // 0x04fc + +///////////////////////////////////////////////////////////////////// +// +// Genlock SPI Registers +// +///////////////////////////////////////////////////////////////////// + +#define GENL_SPI_RESET 16 // 0x40 +#define GENL_SPI_CONTROL 24 // 0x60 +#define GENL_SPI_STATUS 25 // 0x64 +#define GENL_SPI_WRITE 26 // 0x68 +#define GENL_SPI_READ 27 // 0x6C +#define GENL_SPI_SLAVE_SELECT 28 // 0x70 + +#define GENL_SPI_SET_ADDR_CMD 0 // 0x00 +#define GENL_SPI_WRITE_CMD 16 // 0x40 +#define GENL_SPI_READ_CMD 32 // 0x80 + + +///////////////////////////////////////////////////////////////////// +// +// PLL Registers +// +///////////////////////////////////////////////////////////////////// + +#define kRegPll_Config 0 // 0x0000 +#define kRegPll_PDF_Binthresh 1 // 0x0004 +#define kRegPll_PDF_Binaddr 2 // 0x0008 +#define kRegPll_PDF_Bindata 3 // 0x000c +#define kRegPll_Gain 4 // 0x0010 +#define kRegPll_SrcIp 5 // 0x0014 +#define kRegPll_SrcPort 6 // 0x0018 +#define kRegPll_DstIp 7 // 0x001c +#define kRegPll_DstPort 8 // 0x0020 +#define kRegPll_Es_Pid 9 // 0x0024 +#define kRegPll_Match 10 // 0x0028 +#define kRegPll_DecVidStd 11 // 0x002c +#define kRegPll_Bias 12 // 0x0030 +#define kRegPll_Status 13 // 0x0034 +#define kRegPll_PhaseError 14 // 0x0038 +#define kRegPll_Correction 15 // 0x003c + +#define kRegPll_PTP_PDF_Binthresh 0x10 +#define kRegPll_PTP_PDF_Binaddr 0x11 +#define kRegPll_PTP_PDF_Bindata 0x12 +#define kRegPll_PTP_Gain 0x13 +#define kRegPll_PTP_LclMacLo 0x14 +#define kRegPll_PTP_LclMacHi 0x15 +#define kRegPll_PTP_LclIP 0x16 +#define kRegPll_PTP_LclUdp 0x17 +#define kRegPll_PTP_MstrIP 0x18 +#define kRegPll_PTP_MstrMcast 0x19 +#define kRegPll_PTP_EventUdp 0x1a +#define kRegPll_PTP_GenUdp 0x1b +#define kRegPll_PTP_Match 0x1c +#define kRegPll_PTP_LclClkIdLo 0x1d +#define kRegPll_PTP_LclClkIdHi 0x1e +#define kRegPll_PTP_PhaseError 0x1f +#define kRegPll_PTP_Correction 0x20 +#define kRegPll_PTP_FPptpSecHi 0x21 +#define kRegPll_PTP_FPptpSecLo 0x22 +#define kRegPll_PTP_FPptpNSec 0x23 +#define kRegPll_PTP_CurPtpSecHi 0x24 +#define kRegPll_PTP_CurPtpSecLo 0x25 +#define kRegPll_PTP_CurPtpNSec 0x26 +#define kRegPll_90KHzRTP_TS 0x27 +#define kRegPll_48KHzRTP_TS 0x28 +#define kRegPll_Intr_Reg 0x29 +#define kRegPll_ptp_dst_mac_addr_hi 0x2a +#define kRegPll_ptp_dst_mac_addr_lo 0x2b +#define kRegPll_ptp_dst_ipv4_addr 0x2c +#define kRegPll_ptp_delay_req_sent_cnt 0x2c +#define kRegPll_ptp_sync_cnt 0x2d +#define kRegPll_ptp_follow_up_cnt 0x2e +#define kRegPll_ptp_delay_req_cnt 0x2f +#define kRegPll_ptp_delay_resp_cnt 0x30 +#define kRegPll_ptp_announce_cnt 0x31 + +// additional registers used for SWPTP +#define kRegPll_swptp_SetSecsHi 0x32 // R/W +#define kRegPll_swptp_SetSecsLo 0x33 // R/W +#define kRegPll_swptp_SetNanoSecs 0x34 // R/W +#define kRegPll_swptp_JamNow 0x35 // R/W +#define kRegPll_swptp_Jam90KHzRTP_TS 0x36 // R/W +#define kRegPll_swptp_Jam48KHzRTP_TS 0x37 // R/W +#define kRegPll_swptp_VblankRiseSecHi 0x38 // R +#define kRegPll_swptp_VblankRiseSecLo 0x39 // R +#define kRegPll_swptp_VblankRiseNanoSec 0x3a // R +#define kRegPll_swptp_ClockDate 0x3e // R +#define kRegPll_swptp_ClockVersion 0x3f // R + +// redefinition of registers used for SWPTP +#define kRegPll_swptp_Domain 0x04 // R/W +#define kRegPll_swptp_PreferredGmIdHi 0x05 // R/W +#define kRegPll_swptp_PreferredGmIdLo 0x06 // R/W +#define kRegPll_swptp_GrandMasterIdHi 0x07 // R +#define kRegPll_swptp_GrandMasterIdLo 0x08 // R +#define kRegPll_swptp_MasterIdHi 0x09 // R +#define kRegPll_swptp_MasterIdLo 0x0A // R +#define kRegPll_swptp_LockedState 0x0B // R +#define kRegPll_swptp_MasterOffset 0x0C // R + +///////////////////////////////////////////////////////////////////// +// +// AXI Lite Control Registers +// +///////////////////////////////////////////////////////////////////// + +#define kRegAXI_Lite_Cntrl_Es_Pid 0 +#define kRegAXI_Lite_Cntrl_Gain 1 +#define kRegAXI_Lite_Cntrl_Bias 2 +#define kRegAXI_Lite_Cntrl_BinThresh 3 +#define kRegAXI_Lite_Cntrl_SrcIP 4 +#define kRegAXI_Lite_Cntrl_DstIP 5 +#define kRegAXI_Lite_Cntrl_Port 6 +#define kRegAXI_Lite_Cntrl_Match 7 +#define kRegAXI_Lite_Cntrl_Pll_Reset 8 +#define kRegAXI_Lite_Cntrl_Pll_Status 32 + +///////////////////////////////////////////////////////////////////// +// +// Cochrane CS Registers +// +///////////////////////////////////////////////////////////////////// + +#define kRegCS_ps_gen_ctl 0 +#define kRegCS_hdmi_fmt 1 +#define kRegCS_hdmi_ctl 2 +#define kRegCS_top_gen_ctl 3 +#define kRegCS_sdi_fmt 4 +#define kRegCS_sdi_ctl 5 +#define kRegCS_sdi_vpid_a 6 +#define kRegCS_sdi_vpid_b 7 +#define kRegCS_audio_ctl 8 +#define kRegCS_fec_ctl 9 +#define kRegCS_firmware_id 32 +#define kRegCS_revisions 33 +#define kRegCS_compile_date 34 +#define kRegCS_compile_time 35 +#define kRegCS_audio_auto_delay 36 +#define kRegCS_audio_status 0x25 +#define kRegCS_audio_offset_ptp 0x26 +#define kRegCS_video_offset_ptp 0x27 +#define kRegCS_video_post_ptp 0x28 +#define kRegCS_av_diff_48khz 0x29 +#define kRegCS_vfifo_av_diff_48khz 0x2a +#define kRegCS_vfifo_level 0x2b +#define kRegCS_sfp_status 0x2c + +#endif // REGISTERS_MB_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2resample.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2resample.h new file mode 100644 index 0000000..0724736 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2resample.h @@ -0,0 +1,57 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2resample.h + @brief Declares a number of pixel resampling functions. + @copyright (C) 2004-2021 AJA Video Systems, Inc. +**/ +#ifndef RESAMPLE_H +#define RESAMPLE_H + +#include "ajaexport.h" +#include "ajatypes.h" +#include "ntv2fixed.h" +#include "ntv2videodefines.h" + + +// ReSampleLine +// RGBAlphaPixel Version +AJAExport +void ReSampleLine(RGBAlphaPixel *Input, + RGBAlphaPixel *Output, + UWord startPixel, + UWord endPixel, + LWord numInputPixels, + LWord numOutputPixels); + + +// ReSampleLine +// Word Version +AJAExport +void ReSampleLine(Word *Input, + Word *Output, + UWord startPixel, + UWord endPixel, + LWord numInputPixels, + LWord numOutputPixels); + + +// ReSampleLine +// Word Version +AJAExport +void ReSampleYCbCrSampleLine(Word *Input, + Word *Output, + LWord numInputPixels, + LWord numOutputPixels); + +// ReSampleLine +// Word Version +AJAExport +void ReSampleAudio(Word *Input, + Word *Output, + UWord startPixel, + UWord endPixel, + LWord numInputPixels, + LWord numOutputPixels, + Word channelInterleaveMulitplier=1); + +#endif // RESAMPLE_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2routingexpert.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2routingexpert.h new file mode 100644 index 0000000..f0a964d --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2routingexpert.h @@ -0,0 +1,104 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2routingexpert.h + @brief Declares RoutingExpert class used by CNTV2SignalRouter. + @copyright (C) 2014-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2ROUTINGEXPERT_H +#define NTV2ROUTINGEXPERT_H + +#include "ntv2signalrouter.h" + +#include "ajabase/system/lock.h" +#include "ajabase/common/common.h" +#include "ajabase/common/ajarefptr.h" + +class RoutingExpert; +typedef AJARefPtr RoutingExpertPtr; + +class RoutingExpert +{ + public: + friend class CNTV2SignalRouter; + + static RoutingExpertPtr GetInstance(const bool inCreateIfNecessary = true); + static bool DisposeInstance(void); + static uint32_t NumInstances(void); + + private: + RoutingExpert(); + public: + ~RoutingExpert(); + + protected: + std::string InputXptToString (const NTV2InputXptID inInputXpt) const; + std::string OutputXptToString (const NTV2OutputXptID inOutputXpt) const; + NTV2InputXptID StringToInputXpt (const std::string & inStr) const; + NTV2OutputXptID StringToOutputXpt (const std::string & inStr) const; + NTV2WidgetType WidgetIDToType (const NTV2WidgetID inWidgetID); + NTV2Channel WidgetIDToChannel(const NTV2WidgetID inWidgetID); + NTV2WidgetID WidgetIDFromTypeAndChannel(const NTV2WidgetType inWidgetType, const NTV2Channel inChannel); + bool GetWidgetsForOutput (const NTV2OutputXptID inOutputXpt, NTV2WidgetIDSet & outWidgetIDs) const; + bool GetWidgetsForInput (const NTV2InputXptID inInputXpt, NTV2WidgetIDSet & outWidgetIDs) const; + bool GetWidgetInputs (const NTV2WidgetID inWidgetID, NTV2InputXptIDSet & outInputs) const; + bool GetWidgetOutputs (const NTV2WidgetID inWidgetID, NTV2OutputXptIDSet & outOutputs) const; + bool IsOutputXptValid (const NTV2OutputXptID inOutputXpt) const; + bool IsRGBOnlyInputXpt (const NTV2InputXptID inInputXpt) const; + bool IsYUVOnlyInputXpt (const NTV2InputXptID inInputXpt) const; + bool IsKeyInputXpt (const NTV2InputXptID inInputXpt) const; + bool IsSDIWidget(const NTV2WidgetType inWidgetType) const; + bool IsSDIInWidget(const NTV2WidgetType inWidgetType) const; + bool IsSDIOutWidget(const NTV2WidgetType inWidgetType) const; + bool Is3GSDIWidget(const NTV2WidgetType inWidgetType) const; + bool Is12GSDIWidget(const NTV2WidgetType inWidgetType) const; + bool IsDualLinkWidget(const NTV2WidgetType inWidgetType) const; + bool IsDualLinkInWidget(const NTV2WidgetType inWidgetType) const; + bool IsDualLinkOutWidget(const NTV2WidgetType inWidgetType) const; + bool IsHDMIWidget(const NTV2WidgetType inWidgetType) const; + bool IsHDMIInWidget(const NTV2WidgetType inWidgetType) const; + bool IsHDMIOutWidget(const NTV2WidgetType inWidgetType) const; + + private: + void InitInputXpt2String(void); + void InitOutputXpt2String(void); + void InitInputXpt2WidgetIDs(void); + void InitOutputXpt2WidgetIDs(void); + void InitWidgetIDToChannels(void); + void InitWidgetIDToWidgetTypes(void); + + mutable AJALock gLock; + String2InputXpt gString2InputXpt; + InputXpt2String gInputXpt2String; + InputXpt2WidgetIDs gInputXpt2WidgetIDs; + String2OutputXpt gString2OutputXpt; + OutputXpt2String gOutputXpt2String; + OutputXpt2WidgetIDs gOutputXpt2WidgetIDs; + Widget2OutputXpts gWidget2OutputXpts; + Widget2InputXpts gWidget2InputXpts; + Widget2Channels gWidget2Channels; + Widget2Types gWidget2Types; + // NTV2InputXptID Helpers + NTV2InputXptIDSet gRGBOnlyInputXpts; + NTV2InputXptIDSet gYUVOnlyInputXpts; + NTV2InputXptIDSet gKeyInputXpts; + // NTV2WidgetType Helpers + NTV2WidgetTypeSet gSDIWidgetTypes; + NTV2WidgetTypeSet gSDI3GWidgetTypes; + NTV2WidgetTypeSet gSDI12GWidgetTypes; + NTV2WidgetTypeSet gSDIInWidgetTypes; + NTV2WidgetTypeSet gSDIOutWidgetTypes; + NTV2WidgetTypeSet gDualLinkWidgetTypes; + NTV2WidgetTypeSet gDualLinkInWidgetTypes; + NTV2WidgetTypeSet gDualLinkOutWidgetTypes; + NTV2WidgetTypeSet gHDMIWidgetTypes; + NTV2WidgetTypeSet gHDMIInWidgetTypes; + NTV2WidgetTypeSet gHDMIOutWidgetTypes; + NTV2WidgetTypeSet gAnalogWidgetTypes; + +}; // RoutingExpert + +static RoutingExpertPtr gpRoutingExpert; // RoutingExpert singleton +static AJALock gRoutingExpertLock; // Singleton guard mutex + +#endif diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2rp188.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2rp188.h new file mode 100644 index 0000000..fb09144 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2rp188.h @@ -0,0 +1,193 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2rp188.h + @brief Declares the CRP188 class. See SMPTE RP188 standard for details. + @copyright (C) 2007-2021 AJA Video Systems, Inc. +**/ + +#ifndef __NTV2_RP188_ +#define __NTV2_RP188_ + +#include +#include + +#include "ajaexport.h" +#include "ajatypes.h" +#include "ntv2enums.h" +#include "ntv2videodefines.h" +#include "ntv2publicinterface.h" + + + +#if defined(AJALinux) +# include /* malloc/free */ +# include /* memset, memcpy */ +#endif + + +typedef enum +{ + kTCFormatUnknown, + kTCFormat24fps, + kTCFormat25fps, + kTCFormat30fps, + kTCFormat30fpsDF, + kTCFormat48fps, + kTCFormat50fps, + kTCFormat60fps, + kTCFormat60fpsDF +} TimecodeFormat; + +typedef enum +{ + kTCBurnTimecode, // display current timecode + kTCBurnUserBits, // display current user bits + kTCBurnFrameCount, // display current frame count + kTCBurnBlank // display --:--:--:-- +} TimecodeBurnMode; + + +const int64_t kDefaultFrameCount = 0x80000000; + + +//-------------------------------------------------------------------------------------------------------------------- +// class CRP188 +//-------------------------------------------------------------------------------------------------------------------- +class AJAExport CRP188 +{ +public: + // Constructors + CRP188 (); + CRP188 (const RP188_STRUCT & rp188, const TimecodeFormat tcFormat = kTCFormat30fps); + CRP188 (const NTV2_RP188 & rp188, const TimecodeFormat tcFormat = kTCFormat30fps); + CRP188 (const std::string & sRP188, const TimecodeFormat tcFormat = kTCFormat30fps); + CRP188 (ULWord ulFrms, ULWord ulSecs, ULWord ulMins, ULWord ulHrs, const TimecodeFormat tcFormat = kTCFormat30fps); + CRP188 (ULWord frames, const TimecodeFormat tcFormat = kTCFormat30fps); + virtual ~CRP188(); + void Init (); + bool operator==( const CRP188& s); + + // Setters + void SetRP188 (ULWord ulFrms, ULWord ulSecs, ULWord ulMins, ULWord ulHrs, + NTV2FrameRate frameRate, const bool bDropFrame = false, const bool bSMPTE372 = false); + void SetRP188 (const RP188_STRUCT & rp188, const TimecodeFormat tcFormat = kTCFormatUnknown); + void SetRP188 (const NTV2_RP188 & rp188, const TimecodeFormat tcFormat = kTCFormatUnknown); + void SetRP188 (const std::string &sRP188, const TimecodeFormat tcFormat = kTCFormatUnknown); + void SetRP188 (ULWord ulFrms, ULWord ulSecs, ULWord ulMins, ULWord ulHrs, const TimecodeFormat tcFormat = kTCFormatUnknown); + void SetRP188 (ULWord frames, const TimecodeFormat tcFormat = kTCFormatUnknown); + + void SetDropFrame (bool bDropFrameFlag); + void SetColorFrame (bool bColorFrameFlag); + void SetVaricamFrameActive (bool bVaricamActive, ULWord frame); + void SetVaricamRate (NTV2FrameRate frameRate); + void SetFieldID (ULWord fieldID); + bool GetFieldID (void); + void SetBFGBits (bool bBFG0, bool bBFG1, bool bBFG2); + void SetSource (UByte src); + void SetOutputFilter (UByte src); + + // Getters + bool GetRP188Str (std::string & sRP188) const; + const char * GetRP188CString () const; + bool GetRP188Secs (ULWord & ulSecs) const; + bool GetRP188Frms (ULWord & ulFrms) const; + bool GetRP188Mins (ULWord & ulMins) const; + bool GetRP188Hrs (ULWord & ulHrs) const; + bool GetRP188Reg (RP188_STRUCT & outRP188) const; + bool GetRP188Reg (NTV2_RP188 & outRP188) const; + bool GetFrameCount (ULWord & frameCount); + ULWord MaxFramesPerDay (TimecodeFormat format = kTCFormatUnknown) const; + void ConvertTimecode (ULWord & frameCount, TimecodeFormat format, ULWord hours, ULWord minutes, ULWord seconds, ULWord frames); + void ConvertFrameCount (ULWord frameCount, TimecodeFormat format, ULWord & hours, ULWord & minutes, ULWord & seconds, ULWord & frames); + ULWord AddFrames (ULWord frameCount); + ULWord SubtractFrames (ULWord frameCount); + bool GetRP188UserBitsStr (std::string & sRP188UB); + const char * GetRP188UserBitsCString (); + UByte GetSource () const ; + UByte GetOutputFilter () const ; + TimecodeFormat GetTimecodeFormat() { return _tcFormat; } + + // these tests are ONLY valid if the CRP188 object is instantiated or set with an RP188_STRUCT + bool IsFreshRP188 (void) + { return(_bFresh); } // true if RP188 data is fresh this past frame + bool VaricamFrame0 (void) + { return(_bVaricamActiveF0); } // true if Varicam "Frame0 Active" bit is set + bool VaricamFrame1 (void) + { return(_bVaricamActiveF1); } // true if Varicam "Frame1 Active" bit is set + ULWord VaricamFrameRate (void); + NTV2FrameRate defaultFrameRateForTimecodeFormat (TimecodeFormat format = kTCFormatUnknown) const; + bool FormatIsDropFrame (TimecodeFormat format = kTCFormatUnknown) const; + bool FormatIs60_50fps (TimecodeFormat format = kTCFormatUnknown) const; + bool FormatIsPAL (TimecodeFormat format = kTCFormatUnknown) const; + + ULWord FieldID (void) + { return(_fieldID); } // fieldID bit + bool DropFrame (void) + { return(_bDropFrameFlag); } // drop frame bit + bool ColorFrame (void) + { return(_bColorFrameFlag); } // color frame bit + ULWord BinaryGroup (ULWord smpteNum); + + // For historical reasons, calling SetRP188 clears the user bits, so a call to either of these two functions + // should be done after the timecode value is set + bool SetBinaryGroup (ULWord smpteNum, ULWord bits); + bool SetUserBits (ULWord bits); // eight groups of four bits each + + ULWord UDW (ULWord smpteUDW); + ULWord FramesPerSecond (TimecodeFormat format = kTCFormatUnknown) const; + NTV2FrameRate DefaultFrameRateForTimecodeFormat (TimecodeFormat format = kTCFormatUnknown) const; + + // Modifiers + bool InitBurnIn (NTV2FrameBufferFormat frameBufferFormat, NTV2FrameDimensions frameDimensions, LWord percentY = 0); + void writeV210Pixel (char **pBytePtr, int x, int c, int y); + bool BurnTC (char *pBaseVideoAddress, int rowBytes, TimecodeBurnMode burnMode, int64_t frameCount = kDefaultFrameCount, bool bDisplay60_50fpsAs30_25 = false); + void CopyDigit (char *pDigit, int digitWidth, int digitHeight, char *pFrameBuff, int fbRowBytes); + std::string GetTimeCodeString(bool bDisplay60_50fpsAs30_25 = false); + +private: + void ConvertTcStrToVal (void); // converts _sHMSF to _ulVal + void ConvertTcStrToReg (void); // converts _sHMSF to _rp188 + void RP188ToUserBits (void); // derives _ulUserBits and _sUserBits from RP188 struct + + +private: + TimecodeFormat _tcFormat; // fps, drop- or non-drop frame + bool _bInitialized; // if constructed with no args, set to false + bool _bFresh; // true if hardware told us this was new ANC data (not just what was lying around in the registers) + //bool _bDropFrame; // we have to be told whether we are df or ndf + //bool _b50Hz; // if true, interpret FieldID and Binary Group Flags per 50 Hz spec + + // RP188 user bits + bool _bVaricamActiveF0; // Varicam "Active Frame 0" user bit flag + bool _bVaricamActiveF1; // Varicam "Active Frame 1" user bit flag + ULWord _fieldID; // FieldID bit: '0' or '1' + bool _bDropFrameFlag; // Drop Frame bit: '0' or '1' + bool _bColorFrameFlag; // Color Frame bit: '0' or '1' + ULWord _varicamRate; // Varicam rate expressed as bits [0..3] 1 units, bits [4..7] tens unit. + + std::string _sHMSF; // hour:minute:second:frame in string format + std::string _sUserBits; // Binary Groups 8-1 in string format + ULWord _ulVal[4]; // [0]=frame, [1]=seconds, etc. + ULWord _ulUserBits[8]; // [0] = Binary Group 1, [1] = Binary Group 2, etc. (note: SMPTE labels them 1 - 8) + RP188_STRUCT _rp188; // AJA native format + + bool _bRendered; // set 'true' when Burn-In character map has been rendered + char * _pCharRenderMap; // ptr to rendered Burn-In character set + NTV2FrameBufferFormat _charRenderFBF; // frame buffer format of rendered characters + ULWord _charRenderHeight; // frame height for which rendered characters were rendered + ULWord _charRenderWidth; // frame width for which rendered characters were rendered + int _charWidthBytes; // rendered character width in bytes + int _charHeightLines; // rendered character height in frame lines + int _charPositionX; // offset (in bytes) from left side of screen to first burn-in character + int _charPositionY; // offset (in lines) from top of screen to top of burn-in characters +}; // CRP188 + +/** + @brief Prints the given CRP188's contents into the given output stream. + @param outputStream The stream into which the human-readable timecode will be written. + @param[in] inObj Specifies the CRP188 instance to be streamed. + @return The ostream that was specified. +**/ +AJAExport std::ostream & operator << (std::ostream & outputStream, const CRP188 & inObj); + +#endif // __NTV2_RP188_ diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2rp215.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2rp215.h new file mode 100644 index 0000000..120755e --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2rp215.h @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2rp215.h + @brief Declares the CNTV2RP215Decoder class. See SMPTE RP215 standard for details. + @copyright (C) 2006-2021 AJA Video Systems, Inc. +**/ + +#ifndef __NTV2_RP215_ +#define __NTV2_RP215_ + + +#include "ajatypes.h" +#ifdef MSWindows + #include "stdio.h" + #define nil NULL +#endif +#ifdef AJALinux + #define nil NULL +#endif + +#include "ajatypes.h" +#include "ntv2enums.h" + + +#define RP215_PAYLOADSIZE 215 + + +class CNTV2RP215Decoder +{ + public: + CNTV2RP215Decoder(ULWord* pFrameBufferBaseAddress,NTV2VideoFormat videoFormat,NTV2FrameBufferFormat fbFormat); + ~CNTV2RP215Decoder(); + + bool Locate(); + bool Extract(); + + private: + ULWord* _frameBufferBasePointer; + NTV2VideoFormat _videoFormat; + NTV2FrameBufferFormat _fbFormat; + Word _lineNumber; + Word _pixelNumber; + + UByte _rp215RawBuffer[RP215_PAYLOADSIZE]; +}; + +#endif // __NTV2_RP215_ diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2serialcontrol.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2serialcontrol.h new file mode 100644 index 0000000..36d98ae --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2serialcontrol.h @@ -0,0 +1,84 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2serialcontrol.cpp + @brief Implements the CNTV2SerialControl class. + @copyright (C) 2004-2021 AJA Video Systems, Inc. +**/ + +#ifndef _NTV2SERIALCONTROL_H +#define _NTV2SERIALCONTROL_H + +#include "ajaexport.h" +#include "basemachinecontrol.h" +#include "ntv2card.h" + +#define NTV2_SERIAL_RESPONSE_SIZE 64 +#if !defined (NTV2_DEPRECATE) + #define XENA_SERIAL_RESPONSE_SIZE NTV2_SERIAL_RESPONSE_SIZE +#endif + + +typedef struct +{ + UByte length; + UByte buffer [NTV2_SERIAL_RESPONSE_SIZE]; +} SerialMachineResponse; + + + +/** + @brief This sample class demonstrates how to use the Corvid/Kona/Io UART RS422 port(s). + It is NOT intended to be an extensive machine control implementation. + @note This class is not thread safe. + @note Currently assumes a 30fps frame rate. +**/ +class AJAExport CNTV2SerialControl : public CBaseMachineControl +{ + // Instance Methods + public: + // Constructors & Destructors + explicit CNTV2SerialControl (const UWord inDeviceIndex = 0, const UWord inSerialPortIndexNum = 0); + virtual ~CNTV2SerialControl (); + + // Control Methods + virtual inline bool Open (void) {return _ntv2Card.IsOpen ();} + virtual inline void Close (void) {} + virtual ULWord Play (void); + virtual ULWord ReversePlay (void); + virtual ULWord Stop (void); + virtual ULWord FastForward (void); + virtual ULWord Rewind (void); + virtual ULWord AdvanceFrame (void); + virtual ULWord BackFrame (void); + virtual ULWord GotoFrameByHMS (UByte inHrs, UByte inMins, UByte inSecs, UByte inFrames); + virtual ULWord GetTimecodeString (SByte * timecodeString); + + // Accessors + virtual inline const SerialMachineResponse & GetLastResponse (void) const {return _serialMachineResponse;} // Warning: Not thread safe! + + virtual bool WriteCommand (const UByte * txBuffer, bool response = true); + + virtual bool WriteTxBuffer (const UByte * txBuffer, UWord length); + virtual bool ReadRxBuffer (UByte * rxBuffer, UWord & actualLength, UWord maxlength); + + virtual bool GotACK (void); + + virtual bool WaitForRxInterrupt (void); + virtual bool WaitForTxInterrupt (void); + + // Instance Variables + protected: + CNTV2Card _ntv2Card; + SerialMachineResponse _serialMachineResponse; + RegisterNum _controlRegisterNum; ///< @brief Which UART control register to use: kRegRS422Control (72) or kRegRS4222Control (246) + RegisterNum _receiveRegisterNum; ///< @brief Which UART receive data register to use: kRegRS422Receive (71) or kRegRS4222Receive (245) + RegisterNum _transmitRegisterNum; ///< @brief Which UART transmit data register to use: kRegRS422Transmit (70) or kRegRS4222Transmit (244) + +}; // CNTV2SerialControl + + +#if !defined (NTV2_DEPRECATE) + typedef CNTV2SerialControl CXenaSerialControl; ///< @deprecated Use CNTV2SerialControl instead. +#endif + +#endif // _NTV2SERIALCONTROL_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2signalrouter.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2signalrouter.h new file mode 100644 index 0000000..52d30a5 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2signalrouter.h @@ -0,0 +1,1117 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2signalrouter.h + @brief Declares CNTV2SignalRouter class. + @copyright (C) 2014-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2SIGNALROUTER_H +#define NTV2SIGNALROUTER_H + +#include "ajaexport.h" +#include "ntv2publicinterface.h" +#include +#include +#include +#include + +typedef std::set NTV2OutputCrosspointIDSet, NTV2OutputXptIDSet; ///< @brief A collection of distinct ::NTV2OutputXptID values. +typedef NTV2OutputXptIDSet::const_iterator NTV2OutputCrosspointIDSetConstIter, NTV2OutputXptIDSetConstIter; ///< @brief A const iterator for iterating over an ::NTV2OutputXptIDSet. +typedef NTV2OutputXptIDSet::iterator NTV2OutputCrosspointIDSetIter, NTV2OutputXptIDSetIter; ///< @brief A non-const iterator for iterating over an ::NTV2OutputXptIDSet. + +AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2OutputXptIDSet & inObj); + +typedef NTV2OutputCrosspointIDSet NTV2CrosspointIDSet; ///< @deprecated Use ::NTV2OutputXptIDSet instead. + +typedef std::set NTV2InputCrosspointIDSet, NTV2InputXptIDSet; ///< @brief A collection of distinct ::NTV2InputXptID values. +typedef NTV2InputXptIDSet::const_iterator NTV2InputCrosspointIDSetConstIter, NTV2InputXptIDSetConstIter; ///< @brief A const iterator for iterating over an ::NTV2InputXptIDSet. +typedef NTV2InputXptIDSet::iterator NTV2InputCrosspointIDSetIter, NTV2InputXptIDSetIter; ///< @brief A non-const iterator for iterating over an ::NTV2InputXptIDSet. + +AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2InputXptIDSet & inObj); + +typedef std::set NTV2WidgetIDSet; ///< @brief A collection of distinct ::NTV2WidgetID values. +typedef NTV2WidgetIDSet::const_iterator NTV2WidgetIDSetConstIter; ///< @brief An iterator for iterating over a read-only ::NTV2WidgetIDSet. + +AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2WidgetIDSet & inObj); + + +typedef std::pair NTV2SignalConnection, NTV2XptConnection, NTV2Connection; ///< @brief This links an ::NTV2InputXptID and an ::NTV2OutputXptID. +typedef std::map NTV2XptConnections, NTV2ActualConnections; ///< @brief A map of zero or more one-to-one actual ::NTV2InputXptID to ::NTV2OutputXptID connections. +typedef NTV2XptConnections::const_iterator NTV2XptConnectionsConstIter, NTV2ActualConnectionsConstIter; +typedef std::multimap NTV2PossibleConnections; ///< @brief A map of zero or more one-to-many possible ::NTV2InputXptID to ::NTV2OutputXptID connections. +typedef NTV2PossibleConnections::const_iterator NTV2PossibleConnectionsConstIter; + +AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2XptConnections & inObj); + +typedef std::map String2InputXpt; +typedef String2InputXpt::const_iterator String2InputXptConstIter; + +typedef std::map InputXpt2String; +typedef InputXpt2String::const_iterator InputXpt2StringConstIter; + +typedef std::multimap InputXpt2WidgetIDs; +typedef std::pair InputXpt2WidgetIDPair; +typedef InputXpt2WidgetIDs::const_iterator InputXpt2WidgetIDsConstIter; + +typedef std::map String2OutputXpt; +typedef String2OutputXpt::const_iterator String2OutputXptConstIter; + +typedef std::map OutputXpt2String; +typedef OutputXpt2String::const_iterator OutputXpt2StringConstIter; + +typedef std::multimap OutputXpt2WidgetIDs; +typedef std::pair OutputXpt2WidgetIDPair; +typedef OutputXpt2WidgetIDs::const_iterator OutputXpt2WidgetIDsConstIter; + +typedef std::pair Widget2OutputXptPair; +typedef std::multimap Widget2OutputXpts; +typedef Widget2OutputXpts::const_iterator Widget2OutputXptsConstIter; + +typedef std::pair Widget2InputXptPair; +typedef std::multimap Widget2InputXpts; +typedef Widget2InputXpts::const_iterator Widget2InputXptsConstIter; + +typedef std::pair Widget2ChannelPair; +typedef std::multimap Widget2Channels; +typedef Widget2Channels::const_iterator Widget2ChannelsConstIter; + +typedef std::pair Widget2TypePair; +typedef std::multimap Widget2Types; +typedef Widget2Types::const_iterator Widget2TypesConstIter; + +typedef std::set NTV2WidgetTypeSet; +typedef NTV2WidgetTypeSet::const_iterator NTV2WidgetTypeSetConstIter; + +/** + @brief This class is a collection of widget input-to-output connections that can be applied all-at-once to an NTV2 device. + Call AddConnection to connect a widget input (specified by ::NTV2InputXptID) to a widget's output (specified by ::NTV2OutputXptID). + Call the CNTV2Card::ApplySignalRoute function to apply this route to the device. + @note Use of this class is optional, as widget signal routing can always be performed using direct calls to CNTV2Card::Connect. + @note This class is not thread-safe. + @note Public access to the ::NTV2RoutingEntry structs are deprecated. Please use ::NTV2InputXptID instead. + @see \ref ntv2signalrouting +**/ +class AJAExport CNTV2SignalRouter +{ + // Instance Methods + public: + inline CNTV2SignalRouter () {Reset ();} ///< @brief My default constructor. + virtual inline ~CNTV2SignalRouter () {} ///< @brief My default destructor. + + #if !defined (NTV2_DEPRECATE) + virtual NTV2_DEPRECATED_f(operator NTV2RoutingTable () const); ///< @deprecated This function is obsolete. + virtual NTV2_DEPRECATED_f(operator NTV2RoutingTable* ()); ///< @deprecated This function is obsolete. + virtual inline NTV2_DEPRECATED_f(const NTV2RoutingEntry & getRoutingEntry (const ULWord inIndex) const) {return GetRoutingEntry (inIndex);} ///< @deprecated This function is obsolete. + virtual inline NTV2_DEPRECATED_f(ULWord getCurrentIndex (void) const) {return GetNumberOfConnections ();} ///< @deprecated Use GetNumberOfRoutes instead. + virtual inline NTV2_DEPRECATED_f(bool add (const NTV2RoutingEntry & inEntry)) {return AddConnection (inEntry);} ///< @deprecated Use AddConnection instead. + virtual NTV2_DEPRECATED_f(bool addWithRegisterAndValue (const NTV2RoutingEntry & inEntry, const ULWord inRegisterNum, const ULWord inValue, + const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0)); ///< @deprecated This function is obsolete. + virtual inline NTV2_DEPRECATED_f(void clear (void)) {mConnections.clear ();} ///< @deprecated Use Reset instead. + virtual NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetRoutingEntry (const ULWord inIndex) const); ///< @deprecated This function is obsolete. + virtual NTV2_DEPRECATED_f(bool GetRoutingTable (NTV2RoutingTable & outRoutingTable) const); ///< @deprecated This function is obsolete. + #endif // !defined (NTV2_DEPRECATE) + + #if !defined (NTV2_DEPRECATE_12_5) + virtual NTV2_DEPRECATED_f(bool addWithValue (const NTV2RoutingEntry & inEntry, const ULWord inValue)); ///< @deprecated Use AddConnection with ::NTV2InputXptIDSet instead. + virtual NTV2_DEPRECATED_f(bool AddConnection (const NTV2RoutingEntry & inEntry, const NTV2OutputCrosspointID inSignalOutput = NTV2_XptBlack)); ///< @deprecated Use AddConnection(::NTV2InputXptID, ::NTV2OutputXptID) instead. + #endif // !defined (NTV2_DEPRECATE_12_5) + + /** + @brief Adds a connection between a widget's signal input (sink) and another widget's signal output (source). + @param[in] inSignalInput Specifies the widget signal input (sink) as an ::NTV2InputXptID. + @param[in] inSignalOutput Specifies the widget signal output (source) as an ::NTV2OutputXptID. If not specified, uses ::NTV2_XptBlack. + @return True if successfully added; otherwise false. + @see CNTV2Card::Connect, CNTV2SignalRouter::RemoveConnection + **/ + virtual bool AddConnection (const NTV2InputXptID inSignalInput, const NTV2OutputXptID inSignalOutput = NTV2_XptBlack); + + /** + @brief Removes the connection between the specified input (signal sink) and output (signal source). + @param[in] inSignalInput Specifies the widget signal input (sink) as an ::NTV2InputXptID. + @param[in] inSignalOutput Specifies the widget signal output (source) as an ::NTV2OutputXptID. + @return True if successfully removed; otherwise false. + @see CNTV2Card::Disconnect, CNTV2SignalRouter::AddConnection + **/ + virtual bool RemoveConnection (const NTV2InputXptID inSignalInput, const NTV2OutputXptID inSignalOutput); + + /** + @brief Answers true if I contain a connection between the specified input (signal sink) and output (signal source). + @param[in] inSignalInput Specifies the widget signal input (sink) as an ::NTV2InputXptID. + @param[in] inSignalOutput Specifies the widget signal output (source) as an ::NTV2OutputXptID. + @return True if I have such a connection; otherwise false. + @see CNTV2Card::IsConnected, CNTV2Card::IsConnectedTo + **/ + virtual bool HasConnection (const NTV2InputXptID inSignalInput, const NTV2OutputXptID inSignalOutput) const; + + /** + @brief Answers true if I contain a connection that involves the given input (signal sink). + @param[in] inSignalInput Specifies the widget signal input (sink) of interest as an ::NTV2InputXptID. + @return True if I have a connection involving the given input; otherwise false. + @see CNTV2Card::IsConnected, CNTV2Card::GetConnectedInput, CNTV2SignalRouter::HasConnection + **/ + virtual bool HasInput (const NTV2InputXptID inSignalInput) const; + + /** + @return The output crosspoint that the given input is connected to, or NTV2_XptBlack if not connected. + @param[in] inSignalInput Specifies the widget signal input (sink) of interest. + @see CNTV2Card::GetConnectedOutput + **/ + virtual NTV2OutputXptID GetConnectedOutput (const NTV2InputXptID inSignalInput) const; + + /** + @brief Resets me, erasing any/all existing connections. + @see CNTV2Card::ClearRouting, CNTV2SignalRouter::ResetFromRegisters + **/ + virtual inline void Reset (void) {mConnections.clear ();} + + /** + @brief Resets me, erasing any/all existing connections, then rebuilding my connections from the given register values. + @param[in] inInputXpts Specifies the input crosspoints of interest (perhaps obtained from CNTV2SignalRouter::GetAllWidgetInputs). + @param[in] inRegReads Specifies the routing registers/values (perhaps obtained from CNTV2Card::ReadRegisters). + @return True if successful; otherwise false. + @see CNTV2SignalRouter::Reset, CNTV2SignalRouter::GetRegisterWrites + **/ + virtual bool ResetFromRegisters (const NTV2InputXptIDSet & inInputXpts, const NTV2RegisterReads & inRegReads); + + /** + @brief Resets me, replacing any/all existing connections with the given connections. + @param[in] inConnections Specifies the new routing connections. + @return True if successful; otherwise false. + @see CNTV2SignalRouter::Reset + **/ + virtual bool ResetFrom (const NTV2XptConnections & inConnections) {mConnections = inConnections; return true;} // New in SDK 16.0 + + /** + @return The current number of connections (signal routes). + @see CNTV2SignalRouter::IsEmpty + **/ + virtual inline ULWord GetNumberOfConnections (void) const {return ULWord (mConnections.size ());} + + /** + @return True if I have no connections (signal routes); otherwise false. + @see CNTV2SignalRouter::GetNumberOfConnections + **/ + virtual inline bool IsEmpty (void) const {return mConnections.empty();} + + /** + @return A copy of my connections. + **/ + virtual inline NTV2XptConnections GetConnections (void) const {return mConnections;} + + /** + @brief Returns a sequence of NTV2RegInfo values that can be written to an NTV2 device using its WriteRegisters function. + @param[out] outRegWrites Receives a sequence of NTV2ReadWriteRegisterSingle values. + @return True if successful; otherwise false. + **/ + virtual bool GetRegisterWrites (NTV2RegisterWrites & outRegWrites) const; + + /** + @brief Compares me with another routing, and returns three connection mappings as a result of the comparison: + those that are new, changed, and missing. + @param[in] inRHS The CNTV2SignalRouter that I'm being compared with. + @param[out] outNew Receives the new connections (those that I have, but RHS doesn't). + @param[out] outChanged Receives the changed connections, where only the output crosspoint changed. + The output crosspoint of these changed connections will be those from "inRHS" + -- not the new ones. + @param[out] outMissing Receives the deleted connections (those that RHS has, but I don't). + @return True if identical (i.e. the returned output connection maps are all empty); otherwise false. + @see CNTV2SignalRouter::operator ==, CNTV2SignalRouter::operator != + **/ + virtual bool Compare (const CNTV2SignalRouter & inRHS, + NTV2XptConnections & outNew, + NTV2XptConnections & outChanged, + NTV2XptConnections & outMissing) const; + + /** + @return True if my connections are identical to those of the given right-hand-side signal router; otherwise false. + @param[in] inRHS The CNTV2SignalRouter that I'll be compared with. + @see CNTV2SignalRouter::Compare, CNTV2SignalRouter::operator != + **/ + virtual inline bool operator == (const CNTV2SignalRouter & inRHS) const {NTV2XptConnections tmp; return Compare(inRHS, tmp,tmp,tmp);} + + /** + @return True if my connections differ from those of the given right-hand-side signal router; otherwise false. + @param[in] inRHS The CNTV2SignalRouter that I'll be compared with. + @see CNTV2SignalRouter::Compare, CNTV2SignalRouter::operator == + **/ + virtual inline bool operator != (const CNTV2SignalRouter & inRHS) const {return !(inRHS == *this);} + + /** + @brief Prints me in a human-readable format to the given output stream. + @param inOutStream Specifies the output stream that is to receive the human-readable data. + @param[in] inForRetailDisplay Specify true to use human-readable names in the display; otherwise false to use names found in the SDK. + @return A reference to the specified output stream. + @see CNTV2SignalRouter::PrintCode + **/ + virtual std::ostream & Print (std::ostream & inOutStream, const bool inForRetailDisplay = false) const; + + struct PrintCodeConfig + { + bool mShowComments; ///< @brief If true, show comments in the generated code + bool mShowDeclarations; ///< @brief If true, show variable declarations in the generated code + bool mUseRouter; ///< @brief If true, use calls to CNTV2DeviceRouter instead of CNTV2Card + std::string mPreCommentText; ///< @brief Comment prefix text + std::string mPostCommentText; ///< @brief Comment postfix text + std::string mPreClassText; ///< @brief Class prefix text + std::string mPostClassText; ///< @brief Class postfix text + std::string mPreVariableText; ///< @brief Variable prefix text + std::string mPostVariableText; ///< @brief Variable postfix text + std::string mPreXptText; ///< @brief Crosspoint variable prefix text + std::string mPostXptText; ///< @brief Crosspoint variable postfix text + std::string mPreFunctionText; ///< @brief Function name prefix text + std::string mPostFunctionText; ///< @brief Function name postfix text + std::string mDeviceVarName; ///< @brief Name to use for CNTV2Card variable + std::string mRouterVarName; ///< @brief Name to use for CNTV2DeviceRouter variable + std::string mLineBreakText; ///< @brief Text to use for line breaks + std::string mFieldBreakText; ///< @brief Text to use for field breaks + NTV2XptConnections mNew; ///< @brief Optional, to show new connections + NTV2XptConnections mChanged; ///< @brief Optional, to show changed connections + NTV2XptConnections mMissing; ///< @brief Optional, to show deleted connections + /** + @brief Default constructor sets the following default settings: + - include "//"-style comments and variable declarations; + - uses CNTV2Card calls; + - uses standard newline line breaks. + **/ + PrintCodeConfig (); + }; + + /** + @brief Prints me as source code to the given output stream. + @param[out] outCode Receives the generated source code. + @param[in] inConfig Specifies how the source code will be generated. + If unspecified, uses the PrintCodeConfig's default settings. + @return True if successful; otherwise false. + @see CNTV2SignalRouter::Print + **/ + virtual bool PrintCode (std::string & outCode, const PrintCodeConfig & inConfig = PrintCodeConfig()) const; + + #if !defined (NTV2_DEPRECATE_12_5) + virtual NTV2_DEPRECATED_f(bool PrintCode (std::string & outCode, const bool inShowComments, const bool inShowDeclarations, const bool inUseRouter) const); ///< @deprecated Use the new PrintCode method that accepts a PrintCodeConfig parameter. + #endif // !defined (NTV2_DEPRECATE_12_5) + + // Instance Data + private: + typedef NTV2XptConnections::iterator NTV2XptConnectionsIter; + + NTV2XptConnections mConnections; ///< @brief My collection of NTV2SignalConnections + + + public: // CLASS METHODS + /** + @brief Answers with the ::NTV2InputXptID and ::NTV2OutputXptIDSet for the given ROM register value. + @param[in] inROMRegNum Specifies the ROM register number. + @param[in] inROMRegValue Specifies the ROM register value. + @param[out] outInputXpt Receives the input crosspoint associated with the ROM register. + @param[out] outOutputXpts Receives the valid (implemented) output crosspoint routes. + @param[in] inAppendOutputXpts If true, appends output crosspoints to the output set; + otherwise clears the output crosspoint set (the default). + @return True if successful; otherwise false. + **/ + static bool GetRouteROMInfoFromReg (const ULWord inROMRegNum, const ULWord inROMRegValue, + NTV2InputXptID & outInputXpt, NTV2OutputXptIDSet & outOutputXpts, + const bool inAppendOutputXpts = false); // New in SDK 16.0; moved into CNTV2SignalRouter in SDK 16.1 + + /** + @brief Answers with the implemented crosspoint connections as obtained from the given ROM registers. + @param[in] inROMRegisters The ROM register numbers and values. + @param[out] outConnections Receives the legal implemented connections/routes. + @return True if successful; otherwise false. + **/ + static bool GetPossibleConnections (const NTV2RegReads & inROMRegisters, + NTV2PossibleConnections & outConnections); // New in SDK 16.0; moved into CNTV2SignalRouter in SDK 16.1 + + /** + @brief Prepares an initialized, zeroed NTV2RegReads that's prepared to read all ROM registers from a device. + @param[out] outROMRegisters Receives the prepared NTV2RegReads. + @return True if successful; otherwise false. + **/ + static bool MakeRouteROMRegisters (NTV2RegReads & outROMRegisters); // New in SDK 16.0; moved into CNTV2SignalRouter in SDK 16.1 + + /** + @brief Returns a string containing the most compact human-readable form for a given input crosspoint. + @param[in] inInputXpt Specifies the ::NTV2InputXptID of interest. + @return A string containing the most compact human-readable representation of the input crosspoint. + @see CNTV2SignalRouter::NTV2OutputCrosspointIDToString, CNTV2SignalRouter::StringToNTV2InputCrosspointID + **/ + static std::string NTV2InputCrosspointIDToString (const NTV2InputXptID inInputXpt); + + /** + @brief Returns a string containing the most compact human-readable form for a given output crosspoint. + @param[in] inOutputXpt Specifies the ::NTV2OutputXptID of interest. + @return A string containing the most compact human-readable representation of the output crosspoint. + @see CNTV2SignalRouter::NTV2InputCrosspointIDToString, CNTV2SignalRouter::StringToNTV2OutputCrosspointID + **/ + static std::string NTV2OutputCrosspointIDToString (const NTV2OutputXptID inOutputXpt); + + /** + @brief Returns a string containing the most compact human-readable form for a given input crosspoint. + @param[in] inStr Specifies the string to convert into an NTV2InputXptID. + @return The corresponding input crosspoint. + @see CNTV2SignalRouter::StringToNTV2OutputCrosspointID, CNTV2SignalRouter::NTV2InputCrosspointIDToString + **/ + static NTV2InputXptID StringToNTV2InputCrosspointID (const std::string & inStr); + + /** + @brief Returns the output crosspoint that corresponds to the given string. + @param[in] inStr Specifies the string to convert into an NTV2OutputXptID. + @return The corresponding output crosspoint. + @see CNTV2SignalRouter::StringToNTV2InputCrosspointID, CNTV2SignalRouter::NTV2OutputCrosspointIDToString + **/ + static NTV2OutputXptID StringToNTV2OutputCrosspointID (const std::string & inStr); + + /** + @brief Returns the widget IDs supported by the given device. + @param[in] inDeviceID Specifies the NTV2DeviceID of the NTV2 device of interest. + @param[out] outWidgets Receives the NTV2WidgetIDSet of widgets that are supported by the given device. + @return True if successful; otherwise false. + **/ + static bool GetWidgetIDs (const NTV2DeviceID inDeviceID, NTV2WidgetIDSet & outWidgets); + + /** + @brief Returns the widgets that "own" the specified output crosspoint. + @param[in] inOutputXpt Specifies the output crosspoint of interest. + @param[out] outWidgetIDs Receives the NTV2WidgetIDSet containing the widgets that "own" the output + crosspoint (or an empty set upon failure). + @return True if successful; otherwise false. + **/ + static bool GetWidgetsForOutput (const NTV2OutputXptID inOutputXpt, NTV2WidgetIDSet & outWidgetIDs); + + /** + @brief Returns the widget that "owns" the specified output crosspoint. + @param[in] inOutputXpt Specifies the output crosspoint of interest. + @param[out] outWidgetID Receives the ::NTV2WidgetID of the widget that "owns" the output crosspoint + (or ::NTV2_WIDGET_INVALID upon failure). + @param[in] inDeviceID Optionally specifies a device ID to resolve any ambiguity if more than + one ::NTV2WidgetID is associated with the given ::NTV2OutputXptID. + Defaults to ::DEVICE_ID_NOTFOUND. + @note The default behavior is to answer with the first ::NTV2WidgetID found in the ::NTV2WidgetIDSet. + @return True if successful; otherwise false. + **/ + static bool GetWidgetForOutput (const NTV2OutputXptID inOutputXpt, NTV2WidgetID & outWidgetID, const NTV2DeviceID inDeviceID = DEVICE_ID_NOTFOUND); + + /** + @brief Returns the widgets that "own" the specified input crosspoint. + @param[in] inInputXpt Specifies the input crosspoint of interest. + @param[out] outWidgetIDs Receives the ::NTV2WidgetIDSet containing the widgets that "own" the input + crosspoint (or an empty set upon failure). + @return True if successful; otherwise false. + **/ + static bool GetWidgetsForInput (const NTV2InputXptID inInputXpt, NTV2WidgetIDSet & outWidgetIDs); + + /** + @brief Returns the widget that "owns" the specified input crosspoint. + @param[in] inInputXpt Specifies the input crosspoint of interest. + @param[out] outWidgetID Receives the ::NTV2WidgetID of the widget that "owns" the input crosspoint + (or ::NTV2_WIDGET_INVALID upon failure). + @param[in] inDeviceID Optionally specifies a device ID to resolve any ambiguity if more than + one ::NTV2WidgetID is associated with the given ::NTV2InputXptID. + Defaults to ::DEVICE_ID_NOTFOUND, which returns the first match. + @return True if successful; otherwise false. + **/ + static bool GetWidgetForInput (const NTV2InputXptID inInputXpt, NTV2WidgetID & outWidgetID, const NTV2DeviceID inDeviceID = DEVICE_ID_NOTFOUND); + + /** + @brief Returns the input crosspoints known to be "owned" by the given widget. + @param[in] inWidgetID Specifies the ::NTV2WidgetID of the widget of interest. + @param[out] outInputs Receives the set of ::NTV2InputXptIDSet that are "owned" by the widget + (or empty upon failure). + @return True if successful; otherwise false. + **/ + static bool GetWidgetInputs (const NTV2WidgetID inWidgetID, NTV2InputXptIDSet & outInputs); + + /** + @brief Returns all known widget input crosspoints for the given device. + @param[in] inDeviceID Specifies the ::NTV2DeviceID of the device of interest. + @param[out] outInputs Receives the ::NTV2InputXptIDSet (or empty upon failure). + @return True if successful; otherwise false. + **/ + static bool GetAllWidgetInputs (const NTV2DeviceID inDeviceID, NTV2InputXptIDSet & outInputs); + + /** + @brief Returns all routing registers for the given set of input crosspoints. + @param[in] inInputs Specifies the input crosspoints. + @param[out] outRegInfos Receives the ::NTV2RegInfo collection (empty upon failure). + @return True if successful; otherwise false. + **/ + static bool GetAllRoutingRegInfos (const NTV2InputXptIDSet & inInputs, NTV2RegisterWrites & outRegInfos); + + /** + @brief Returns the output crosspoints known to be "owned" by the given widget. + @param[in] inWidgetID Specifies the ::NTV2WidgetID of the widget of interest. + @param[out] outOutputs Receives the set of ::NTV2OutputXptIDSet that are "owned" by the widget + (or empty upon failure). + @return True if successful; otherwise false. + **/ + static bool GetWidgetOutputs (const NTV2WidgetID inWidgetID, NTV2OutputXptIDSet & outOutputs); + + /** + @brief Converts a set of crosspoint registers into a set of crosspoint connections. + @param[in] inInputXptIDs Specifies the input crosspoints. + @param[in] inRegValues Specifies the crosspoint register values. + @param[out] outConnections Receives the connections found in the given register values. + @return True if successful; otherwise false. + **/ + static bool GetConnectionsFromRegs (const NTV2InputXptIDSet & inInputXptIDs, const NTV2RegisterReads & inRegValues, NTV2XptConnections & outConnections); // New in SDK 16.0 + + /** + @param[in] inInputXpt Specifies the input crosspoint ID of interest. + @return True if the input only accepts RGB; otherwise false. + **/ + static bool IsRGBOnlyInputXpt (const NTV2InputXptID inInputXpt); // New in SDK 16.0 + + /** + @param[in] inInputXpt Specifies the input crosspoint ID of interest. + @return True if the input only accepts YCbCr; otherwise false. + **/ + static bool IsYUVOnlyInputXpt (const NTV2InputXptID inInputXpt); // New in SDK 16.0 + + /** + @param[in] inInputXpt Specifies the input crosspoint ID of interest. + @return True if the input is a mask/key input; otherwise false. + **/ + static bool IsKeyInputXpt (const NTV2InputXptID inInputXpt); // New in SDK 16.0 + + /** + @param[in] inWidgetID Specifies the widget ID of interest. + @return The corresponding channel. + **/ + static NTV2Channel WidgetIDToChannel (const NTV2WidgetID inWidgetID); // New in SDK 16.1 + + /** + @param[in] inWidgetType Specifies the widget type of interest. + @param[in] inChannel Specifies the channel of interest. + @return The corresponding widget ID. + **/ + static NTV2WidgetID WidgetIDFromTypeAndChannel(const NTV2WidgetType inWidgetType, const NTV2Channel inChannel); // New in SDK 16.1 + + /** + @param[in] inWidgetID Specifies the widget ID of interest. + @return The corresponding widget type. + **/ + static NTV2WidgetType WidgetIDToType (const NTV2WidgetID inWidgetID); // New in SDK 16.1 + + /** + @param[in] inWidgetType Specifies the widget type of interest. + @return True if the widget type is an SDI widget. + **/ + static bool IsSDIWidgetType (const NTV2WidgetType inWidgetType); // New in SDK 16.1 + + /** + @param[in] inWidgetType Specifies the widget type of interest. + @return True if the widget type is an SDI Input Widget. + **/ + static bool IsSDIInputWidgetType (const NTV2WidgetType inWidgetType); // New in SDK 16.1 + + /** + @param[in] inWidgetType Specifies the widget type of interest. + @return True if the widget type is an SDI Output widget. + **/ + static bool IsSDIOutputWidgetType (const NTV2WidgetType inWidgetType); // New in SDK 16.1 + + /** + @param[in] inWidgetType Specifies the widget type of interest. + @return True if the widget type is a 3G SDI widget. + **/ + static bool Is3GSDIWidgetType (const NTV2WidgetType inWidgetType); // New in SDK 16.1 + + /** + @param[in] inWidgetType Specifies the widget type of interest. + @return True if the widget type is a 12G SDI widget. + **/ + static bool Is12GSDIWidgetType (const NTV2WidgetType inWidgetType); // New in SDK 16.1 + + /** + @param[in] inWidgetType Specifies the widget type of interest. + @return True if the widget type is a Dual Link widget. + **/ + static bool IsDualLinkWidgetType (const NTV2WidgetType inWidgetType); // New in SDK 16.1 + + /** + @param[in] inWidgetType Specifies the widget type of interest. + @return True if the widget type is a Dual Link Input widget. + **/ + static bool IsDualLinkInWidgetType (const NTV2WidgetType inWidgetType); // New in SDK 16.1 + + /** + @param[in] inWidgetType Specifies the widget type of interest. + @return True if the widget type is a Dual Link Output widget. + **/ + static bool IsDualLinkOutWidgetType (const NTV2WidgetType inWidgetType); // New in SDK 16.1 + + /** + @param[in] inWidgetType Specifies the widget type of interest. + @return True if the widget type is an HDMI widget. + **/ + static bool IsHDMIWidgetType (const NTV2WidgetType inWidgetType); // New in SDK 16.1 + + /** + @param[in] inWidgetType Specifies the widget type of interest. + @return True if the widget type is an HDMI Input widget. + **/ + static bool IsHDMIInWidgetType (const NTV2WidgetType inWidgetType); // New in SDK 16.1 + + /** + @param[in] inWidgetType Specifies the widget type of interest. + @return True if the widget type is an HDMI Output widget. + **/ + static bool IsHDMIOutWidgetType (const NTV2WidgetType inWidgetType); // New in SDK 16.1 + + /** + @brief Compares two sets of crosspoint connections. + @param[in] inLHS Specifies the input crosspoints. + @param[in] inRHS Specifies the crosspoint register values. + @param[out] outNew Receives the new connections found in the RHS that aren't in the LHS. + @param[out] outRemoved Receives the deleted connections not found in the RHS that are in the LHS. + @return True if successful; otherwise false. + **/ + static bool CompareConnections (const NTV2XptConnections & inLHS, + const NTV2XptConnections & inRHS, + NTV2XptConnections & outNew, + NTV2XptConnections & outRemoved); // New in SDK 16.0 + + /** + @brief Decodes a given string into a map of crosspoint connections. + @param[in] inString Specifies the string to be parsed. It can contain the pnemonics that + CNTV2SignalRouter::PrintCode generates, or a simple C++ code snippet that contains + one or more "device.Connect(...)" calls. + @param[out] outConnections Receives the connections from what is successfully parsed from the string. + It will be empty if this function fails. + @return True if successful; otherwise false. + **/ + static bool CreateFromString (const std::string & inString, NTV2XptConnections & outConnections); // New in SDK 16.0 + + /** + @brief Sets the router from the given string. + @param[in] inString Specifies the string to be parsed. + @param[out] outRouter The CNTV2SignalRouter to be cleared and set from what is parsed from the string. + It will be empty if this function fails. + @return True if successful; otherwise false. + @see CNTV2SignalRouter::PrintCode, CNTV2SignalRouter::ResetFromRegisters + **/ + static bool CreateFromString (const std::string & inString, CNTV2SignalRouter & outRouter); + + /** + @brief Converts the given map of crosspoint connections into source code. + @param[out] outCode Receives the generated source code. + @param[in] inConnections Receives the connections from what is successfully parsed from the string. + It will be empty if this function fails. + @param[in] inConfig Specifies how the source code will be generated. + If unspecified, uses the PrintCodeConfig's default settings. + @return True if successful; otherwise false. + **/ + static bool ToCodeString (std::string & outCode, const NTV2XptConnections & inConnections, + const PrintCodeConfig & inConfig = PrintCodeConfig()); // New in SDK 16.0 + + + #if !defined (NTV2_DEPRECATE_12_5) + static NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetInputSelectEntry (const NTV2InputCrosspointID inInputXpt)); ///< @deprecated NTV2RoutingEntry is deprecated. + static NTV2_DEPRECATED_f(NTV2InputCrosspointID NTV2RoutingEntryToInputCrosspointID (const NTV2RoutingEntry & inEntry)); ///< @deprecated NTV2RoutingEntry is deprecated. + #endif // !defined (NTV2_DEPRECATE_12_5) + + static bool IsInitialized(void); ///< @return True if the Signal Router singleton has been allocated/created; otherwise false. + + /** + @brief Explicitly allocates and initializes the Routing Expert singleton. + @return True if successful; otherwise false. + @note Normally, there is no need to call this function, as the Routing Expert singleton is + automatically allocated and initialized. + @see CNTV2SignalRouter::Deinitialize + **/ + static bool Initialize(void); + + /** + @brief Explicitly deinitializes and deallocates the Routing Expert singleton. + @return True if successful; otherwise false. + @note Normally, there is no need to call this function, as the Routing Expert singleton is + automatically deinitialized and deallocated. + @see CNTV2SignalRouter::Initialize + **/ + static bool Deinitialize(void); + +}; // CNTV2SignalRouter + + +/** + @return The appropriate ::NTV2InputXptID for the given FrameStore, or ::NTV2_INPUT_CROSSPOINT_INVALID upon failure. + @param[in] inFrameStore Specifies the FrameStore of interest, expressed as an ::NTV2Channel (a zero-based index value). + @param[in] inIsBInput Specify true to obtain the "B" input crosspoint (for dual-link). Defaults to false (the "A" input crosspoint). +**/ +AJAExport NTV2InputXptID GetFrameBufferInputXptFromChannel (const NTV2Channel inFrameStore, const bool inIsBInput = false); + +/** + @return The appropriate ::NTV2InputXptID for the given color space converter (CSC) widget, or ::NTV2_INPUT_CROSSPOINT_INVALID upon failure. + @param[in] inCSC Specifies the CSC of interest, expressed as an ::NTV2Channel (a zero-based index value). + @param[in] inIsKeyInput Specify true to obtain the key (alpha) input crosspoint. Defaults to false (the video input crosspoint). +**/ +AJAExport NTV2InputXptID GetCSCInputXptFromChannel (const NTV2Channel inCSC, const bool inIsKeyInput = false); + +/** + @return The appropriate ::NTV2InputXptID for the given LUT widget, or ::NTV2_INPUT_CROSSPOINT_INVALID upon failure. + @param[in] inLUT Specifies the LUT of interest, expressed as an ::NTV2Channel (a zero-based index value). +**/ +AJAExport NTV2InputXptID GetLUTInputXptFromChannel (const NTV2Channel inLUT); // New in SDK 16.0 + +/** + @return The appropriate ::NTV2InputXptID for the given Dual-Link Input widget, or ::NTV2_INPUT_CROSSPOINT_INVALID upon failure. + @param[in] inChannel Specifies the Dual-Link Input converter of interest, expressed as an ::NTV2Channel (a zero-based index value). + @param[in] inLinkB Specifies whether to return the A or the B link crosspoint ID. Defaults to the A link crosspoint. +**/ +AJAExport NTV2InputXptID GetDLInInputXptFromChannel (const NTV2Channel inChannel, const bool inLinkB = false); + +/** + @return The appropriate ::NTV2InputXptID for the given Dual Link Output widget, or ::NTV2_INPUT_CROSSPOINT_INVALID upon failure. + @param[in] inDLOutWidget Specifies the Dual Link Output of interest, expressed as an ::NTV2Channel (a zero-based index value). +**/ +AJAExport NTV2InputXptID GetDLOutInputXptFromChannel (const NTV2Channel inDLOutWidget); + +/** + @return The appropriate NTV2OutputCrosspointID for the given color space converter (CSC) widget, or ::NTV2_OUTPUT_CROSSPOINT_INVALID upon failure. + @param[in] inCSC Specifies the CSC of interest, expressed as an ::NTV2Channel (a zero-based index value). + @param[in] inIsKey Specify true to obtain the key (alpha) output crosspoint. Defaults to false (the video output crosspoint). + @param[in] inIsRGB Specify true to obtain the RGB video output crosspoint. Defaults to false (the YUV video output crosspoint). + Ignored if true passed to inIsKey. +**/ +AJAExport NTV2OutputXptID GetCSCOutputXptFromChannel (const NTV2Channel inCSC, const bool inIsKey = false, const bool inIsRGB = false); + +/** + @return The appropriate NTV2OutputCrosspointID for the given LUT widget. + @param[in] inLUT Specifies the LUT of interest, expressed as an ::NTV2Channel (a zero-based index value). +**/ +AJAExport NTV2OutputXptID GetLUTOutputXptFromChannel (const NTV2Channel inLUT); // New in SDK 16.0 + +/** + @return The appropriate NTV2OutputCrosspointID for the given FrameStore, or ::NTV2_OUTPUT_CROSSPOINT_INVALID upon failure. + @param[in] inFrameStore Specifies the FrameStore of interest, expressed as an ::NTV2Channel (a zero-based index value). + @param[in] inIsRGB Specify true to obtain the RGB output crosspoint. Defaults to false (the YUV output crosspoint). + @param[in] inIs425 Specify true to obtain the 425 output crosspoint. Defaults to false (the normal non-425 output crosspoint). +**/ +AJAExport NTV2OutputXptID GetFrameBufferOutputXptFromChannel (const NTV2Channel inFrameStore, const bool inIsRGB = false, const bool inIs425 = false); + +/** + @return The appropriate ::NTV2OutputCrosspointID for the given ::NTV2InputSource, or ::NTV2_OUTPUT_CROSSPOINT_INVALID upon failure. + @param[in] inInputSource Specifies the NTV2InputSource of interest. + @param[in] inIsSDI_DS2 Specify true to obtain the DS2 output crosspoint (for SDI input sources). + Defaults to false (the DS1 output crosspoint). + Ignored for non-SDI input sources. + @param[in] inIsHDMI_RGB Specify true to obtain the RGB output crosspoint (for HDMI input sources). + Defaults to false (the YUV output crosspoint). + Ignored for non-HDMI input sources. + @param[in] inHDMI_Quadrant Specifies the 4K/UHD quadrant of interest (for HDMI input sources), where 0=upperLeft, 1=upperRight, 2=lowerLeft, 3=lowerRight. + Defaults to 0 (upperLeft). Ignored for non-HDMI input sources. +**/ +AJAExport NTV2OutputXptID GetInputSourceOutputXpt (const NTV2InputSource inInputSource, const bool inIsSDI_DS2 = false, + const bool inIsHDMI_RGB = false, const UWord inHDMI_Quadrant = 0); + +/** + @return The appropriate SDI input's ::NTV2OutputCrosspointID for the given SDI Input, or ::NTV2_OUTPUT_CROSSPOINT_INVALID upon failure. + @param[in] inSDIInput Specifies the SDI Input widget of interest, expressed as an ::NTV2Channel (a zero-based index value). + @param[in] inIsDS2 Specify true to obtain the DS2 output crosspoint. Defaults to false (the DS1 output crosspoint). +**/ +AJAExport NTV2OutputXptID GetSDIInputOutputXptFromChannel (const NTV2Channel inSDIInput, const bool inIsDS2 = false); + +/** + @return The ::NTV2OutputCrosspointID for the given Dual Link Output, or ::NTV2_OUTPUT_CROSSPOINT_INVALID upon failure. + @param[in] inDLOutput Specifies the Dual-Link Output widget of interest, expressed as an ::NTV2Channel (a zero-based index value). + @param[in] inIsLinkB Specify true to obtain the DS2 output crosspoint. Defaults to false (the DS1 output crosspoint). +**/ +AJAExport NTV2OutputXptID GetDLOutOutputXptFromChannel(const NTV2Channel inDLOutput, const bool inIsLinkB = false); + +/** + @return The appropriate ::NTV2OutputCrosspointID for the given Dual Link Input, or ::NTV2_OUTPUT_CROSSPOINT_INVALID upon failure. + @param[in] inDLInput Specifies the Dual-Link Input widget of interest, expressed as an ::NTV2Channel (a zero-based index value). +**/ +AJAExport NTV2OutputXptID GetDLInOutputXptFromChannel(const NTV2Channel inDLInput); + +/** + @return The appropriate ::NTV2InputXptID for the given ::NTV2OutputDestination, or ::NTV2_INPUT_CROSSPOINT_INVALID upon failure. + @param[in] inOutputDest Specifies the ::NTV2OutputDestination of interest. + @param[in] inIsSDI_DS2 Specify true to obtain the DS2 input crosspoint (SDI output destinations only). Defaults to false (the DS1 input). + Ignored for non-SDI output destinations. + @param[in] inHDMI_Quadrant Specifies the 4K/UHD quadrant of interest (for HDMI output destinations), + where 0=upperLeft, 1=upperRight, 2=lowerLeft, 3=lowerRight. + Values above 3 are deemed to be non-4K/UHD (the default). + Ignored for non-HDMI output destinations. +**/ +AJAExport NTV2InputXptID GetOutputDestInputXpt (const NTV2OutputDestination inOutputDest, const bool inIsSDI_DS2 = false, const UWord inHDMI_Quadrant = 99); + +/** + @return The appropriate ::NTV2InputXptID for the given SDI Output, or ::NTV2_INPUT_CROSSPOINT_INVALID upon failure. + @param[in] inSDIOutput Specifies the SDI Output widget of interest, expressed as an ::NTV2Channel (a zero-based index value). + @param[in] inIsDS2 Specify true to obtain the DS2 input crosspoint. Defaults to false (the DS1 input). +**/ +AJAExport NTV2InputXptID GetSDIOutputInputXpt (const NTV2Channel inSDIOutput, const bool inIsDS2 = false); + +/** + @return The appropriate mixer's ::NTV2OutputCrosspointID for the given ::NTV2Channel, or ::NTV2_OUTPUT_CROSSPOINT_INVALID upon failure. + @param[in] inChannel Specifies the ::NTV2Channel of interest. Mixer 1 is used for channels 1 & 2, mixer 2 for channels 3 & 4, etc. + @param[in] inIsKey Specify true to obtain the key output crosspoint. Defaults to false (the video output crosspoint). + @see ::GetMixerFGInputXpt, ::GetMixerBGInputXpt, \ref widget_mixkey +**/ +AJAExport NTV2OutputXptID GetMixerOutputXptFromChannel (const NTV2Channel inChannel, const bool inIsKey = false); + +/** + @return The appropriate mixer's foreground ::NTV2InputXptID for the given ::NTV2Channel, or ::NTV2_INPUT_CROSSPOINT_INVALID upon failure. + @param[in] inChannel Specifies the ::NTV2Channel of interest. Mixer 1 is used for channels 1 & 2, mixer 2 for channels 3 & 4, etc. + @param[in] inIsKey Specify true to obtain the key input crosspoint. Defaults to false (the video input). + @see ::GetMixerBGInputXpt, ::GetMixerOutputXptFromChannel, \ref widget_mixkey +**/ +AJAExport NTV2InputXptID GetMixerFGInputXpt (const NTV2Channel inChannel, const bool inIsKey = false); + +/** + @return The appropriate mixer's background ::NTV2InputXptID for the given ::NTV2Channel, or ::NTV2_INPUT_CROSSPOINT_INVALID upon failure. + @param[in] inChannel Specifies the ::NTV2Channel of interest. Mixer 1 is used for channels 1 & 2, mixer 2 for channels 3 & 4, etc. + @param[in] inIsKey Specify true to obtain the key input crosspoint. Defaults to false (the video input). + @see ::GetMixerFGInputXpt, ::GetMixerOutputXptFromChannel, \ref widget_mixkey +**/ +AJAExport NTV2InputXptID GetMixerBGInputXpt (const NTV2Channel inChannel, const bool inIsKey = false); + +/** + @return The appropriate ::NTV2InputXptID for the given TSI Muxer widget, or ::NTV2_INPUT_CROSSPOINT_INVALID upon failure. + @param[in] inTSIMuxer Specifies the 425Mux widget of interest, expressed as an ::NTV2Channel (a zero-based index value). + @param[in] inLinkB Specify true to obtain the "B" input crosspoint. Defaults to false, the "A" input. +**/ +AJAExport NTV2InputXptID GetTSIMuxInputXptFromChannel(const NTV2Channel inTSIMuxer, const bool inLinkB = false); + +/** + @return The appropriate ::NTV2OutputXptID for the given TSI Muxer, or ::NTV2_OUTPUT_CROSSPOINT_INVALID upon failure. + @param[in] inTSIMuxer Specifies the 425Mux widget of interest, expressed as an ::NTV2Channel (a zero-based index value). + @param[in] inLinkB Specify true to obtain the "B" output crosspoint. Defaults to false, the "A" output. + @param[in] inIsRGB Specify true to obtain the RGB output crosspoint. Defaults to false, the YUV output. +**/ +AJAExport NTV2OutputXptID GetTSIMuxOutputXptFromChannel (const NTV2Channel inTSIMuxer, const bool inLinkB = false, const bool inIsRGB = false); + + +// Stream operators +AJAExport std::ostream & operator << (std::ostream & inOutStream, const CNTV2SignalRouter & inObj); + +#if !defined (NTV2_DEPRECATE_12_5) + // Stream operators + AJAExport NTV2_DEPRECATED_f(std::ostream & operator << (std::ostream & inOutStream, const NTV2RoutingEntry & inObj)); + AJAExport NTV2_DEPRECATED_f(std::ostream & operator << (std::ostream & inOutStream, const NTV2RoutingTable & inObj)); + + // Per-widget input crosspoint selection register/mask/shift values + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameBuffer1InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameBuffer1BInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameBuffer2InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameBuffer2BInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameBuffer3InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameBuffer3BInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameBuffer4InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameBuffer4BInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameBuffer5InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameBuffer5BInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameBuffer6InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameBuffer6BInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameBuffer7InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameBuffer7BInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameBuffer8InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameBuffer8BInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCSC1VidInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCSC1KeyInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCSC2VidInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCSC2KeyInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCSC3VidInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCSC3KeyInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCSC4VidInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCSC4KeyInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCSC5VidInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCSC5KeyInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCSC6VidInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCSC6KeyInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCSC7VidInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCSC7KeyInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCSC8VidInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCSC8KeyInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetLUT1InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetLUT2InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetLUT3InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetLUT4InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetLUT5InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetLUT6InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetLUT7InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetLUT8InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut1StandardSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut2StandardSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut3StandardSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut4StandardSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut1InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut1InputDS2SelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut2InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut2InputDS2SelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut3InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut3InputDS2SelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut4InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut4InputDS2SelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut5InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut5InputDS2SelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut6InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut6InputDS2SelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut7InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut7InputDS2SelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut8InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetSDIOut8InputDS2SelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkIn1InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkIn1DSInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkIn2InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkIn2DSInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkIn3InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkIn3DSInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkIn4InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkIn4DSInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkIn5InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkIn5DSInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkIn6InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkIn6DSInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkIn7InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkIn7DSInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkIn8InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkIn8DSInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkOut1InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkOut2InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkOut3InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkOut4InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkOut5InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkOut6InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkOut7InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetDualLinkOut8InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetMixer1BGKeyInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetMixer1BGVidInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetMixer1FGKeyInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetMixer1FGVidInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetMixer2BGKeyInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetMixer2BGVidInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetMixer2FGKeyInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetMixer2FGVidInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetMixer3BGKeyInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetMixer3BGVidInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetMixer3FGKeyInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetMixer3FGVidInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetMixer4BGKeyInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetMixer4BGVidInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetMixer4FGKeyInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetMixer4FGVidInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetHDMIOutInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetHDMIOutQ1InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetHDMIOutQ2InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetHDMIOutQ3InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetHDMIOutQ4InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetXpt4KDCQ1InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetXpt4KDCQ2InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetXpt4KDCQ3InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetXpt4KDCQ4InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & Get425Mux1AInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & Get425Mux1BInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & Get425Mux2AInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & Get425Mux2BInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & Get425Mux3AInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & Get425Mux3BInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & Get425Mux4AInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & Get425Mux4BInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetAnalogOutInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetIICT2InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetAnalogOutCompositeOutSelectEntry(void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetStereoLeftInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetStereoRightInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetProAmpInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetIICT1InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetWaterMarker1InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetWaterMarker2InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetUpdateRegisterSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetConversionMod2InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCompressionModInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetConversionModInputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetCSC1KeyFromInput2SelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameSync2InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. + AJAExport NTV2_DEPRECATED_f(const NTV2RoutingEntry & GetFrameSync1InputSelectEntry (void)); ///< @deprecated NTV2RoutingEntry is deprecated. +#endif // !defined (NTV2_DEPRECATE_12_5) + + +#if !defined (NTV2_DEPRECATE) + typedef CNTV2SignalRouter CXena2Routing; ///< @deprecated Use CNTV2SignalRouter instead. + + #define GetXptLUTInputSelectEntry GetLUT1InputSelectEntry + #define GetDuallinkIn1InputSelectEntry GetDualLinkIn1InputSelectEntry + #define DuallinkIn1InputSelectEntry DualLinkIn1InputSelectEntry + #define DuallinkOutInputSelectEntry DualLinkOut1InputSelectEntry + #define GetDuallinkOutInputSelectEntry GetDualLinkOut1InputSelectEntry + #define DuallinkOut2InputSelectEntry DualLinkOut2InputSelectEntry + #define GetDuallinkOut2InputSelectEntry GetDualLinkOut2InputSelectEntry + #define DuallinkOut3InputSelectEntry DualLinkOut3InputSelectEntry + #define GetDuallinkOut3InputSelectEntry GetDualLinkOut3InputSelectEntry + #define DuallinkOut4InputSelectEntry DualLinkOut4InputSelectEntry + #define GetDuallinkOut4InputSelectEntry GetDualLinkOut4InputSelectEntry + #define DuallinkOut5InputSelectEntry DualLinkOut5InputSelectEntry + #define GetDuallinkOut5InputSelectEntry GetDualLinkOut5InputSelectEntry + #define DuallinkOut6InputSelectEntry DualLinkOut6InputSelectEntry + #define GetDuallinkOut6InputSelectEntry GetDualLinkOut6InputSelectEntry + #define DuallinkOut7InputSelectEntry DualLinkOut7InputSelectEntry + #define GetDuallinkOut7InputSelectEntry GetDualLinkOut7InputSelectEntry + #define DuallinkOut8InputSelectEntry DualLinkOut8InputSelectEntry + #define GetDuallinkOut8InputSelectEntry GetDualLinkOut8InputSelectEntry + #define MixerBGKeyInputSelectEntry Mixer1BGKeyInputSelectEntry + #define MixerBGVidInputSelectEntry Mixer1BGVidInputSelectEntry + #define MixerFGKeyInputSelectEntry Mixer1FGKeyInputSelectEntry + #define MixerFGVidInputSelectEntry Mixer1FGVidInputSelectEntry + #define GetMixerBGKeyInputSelectEntry GetMixer1BGKeyInputSelectEntry + #define GetMixerBGVidInputSelectEntry GetMixer1BGVidInputSelectEntry + #define GetMixerFGKeyInputSelectEntry GetMixer1FGKeyInputSelectEntry + #define GetMixerFGVidInputSelectEntry GetMixer1FGVidInputSelectEntry + + #define XptLUTInputSelectEntry LUT1InputSelectEntry + #define XptLUT2InputSelectEntry LUT2InputSelectEntry + #define XptLUT3InputSelectEntry LUT3InputSelectEntry + #define XptLUT4InputSelectEntry LUT4InputSelectEntry + #define XptLUT5InputSelectEntry LUT5InputSelectEntry + #define XptLUT6InputSelectEntry LUT6InputSelectEntry + #define XptLUT7InputSelectEntry LUT7InputSelectEntry + #define XptLUT8InputSelectEntry LUT8InputSelectEntry + + #define GetXptLUT1InputSelectEntry GetLUT1InputSelectEntry + #define GetXptLUT2InputSelectEntry GetLUT2InputSelectEntry + #define GetXptLUT3InputSelectEntry GetLUT3InputSelectEntry + #define GetXptLUT4InputSelectEntry GetLUT4InputSelectEntry + #define GetXptLUT5InputSelectEntry GetLUT5InputSelectEntry + #define GetXptLUT6InputSelectEntry GetLUT6InputSelectEntry + #define GetXptLUT7InputSelectEntry GetLUT7InputSelectEntry + #define GetXptLUT8InputSelectEntry GetLUT8InputSelectEntry + + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry FrameBuffer1InputSelectEntry); ///< @deprecated Use GetFrameBuffer1InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry FrameBuffer2InputSelectEntry); ///< @deprecated Use GetFrameBuffer2InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry FrameBuffer3InputSelectEntry); ///< @deprecated Use GetFrameBuffer3InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry FrameBuffer4InputSelectEntry); ///< @deprecated Use GetFrameBuffer4InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry FrameBuffer5InputSelectEntry); ///< @deprecated Use GetFrameBuffer5InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry FrameBuffer6InputSelectEntry); ///< @deprecated Use GetFrameBuffer6InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry FrameBuffer7InputSelectEntry); ///< @deprecated Use GetFrameBuffer7InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry FrameBuffer8InputSelectEntry); ///< @deprecated Use GetFrameBuffer8InputSelectEntry instead. + + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CSC1VidInputSelectEntry); ///< @deprecated Use GetCSC1VidInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CSC1KeyInputSelectEntry); ///< @deprecated Use GetCSC1KeyInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CSC2VidInputSelectEntry); ///< @deprecated Use GetCSC2VidInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CSC2KeyInputSelectEntry); ///< @deprecated Use GetCSC2KeyInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CSC3VidInputSelectEntry); ///< @deprecated Use GetCSC3VidInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CSC3KeyInputSelectEntry); ///< @deprecated Use GetCSC3KeyInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CSC4VidInputSelectEntry); ///< @deprecated Use GetCSC4VidInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CSC4KeyInputSelectEntry); ///< @deprecated Use GetCSC4KeyInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CSC5VidInputSelectEntry); ///< @deprecated Use GetCSC5VidInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CSC5KeyInputSelectEntry); ///< @deprecated Use GetCSC5KeyInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CSC6VidInputSelectEntry); ///< @deprecated Use GetCSC6VidInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CSC6KeyInputSelectEntry); ///< @deprecated Use GetCSC6KeyInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CSC7VidInputSelectEntry); ///< @deprecated Use GetCSC7VidInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CSC7KeyInputSelectEntry); ///< @deprecated Use GetCSC7KeyInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CSC8VidInputSelectEntry); ///< @deprecated Use GetCSC8VidInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CSC8KeyInputSelectEntry); ///< @deprecated Use GetCSC8KeyInputSelectEntry instead. + + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry XptLUTInputSelectEntry); ///< @deprecated Use GetLUT1InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry XptLUT2InputSelectEntry); ///< @deprecated Use GetLUT2InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry XptLUT3InputSelectEntry); ///< @deprecated Use GetLUT3InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry XptLUT4InputSelectEntry); ///< @deprecated Use GetLUT4InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry XptLUT5InputSelectEntry); ///< @deprecated Use GetLUT5InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry XptLUT6InputSelectEntry); ///< @deprecated Use GetLUT6InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry XptLUT7InputSelectEntry); ///< @deprecated Use GetLUT7InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry XptLUT8InputSelectEntry); ///< @deprecated Use GetLUT8InputSelectEntry instead. + + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut1StandardSelectEntry); ///< @deprecated Use GetSDIOut1StandardSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut2StandardSelectEntry); ///< @deprecated Use GetSDIOut2StandardSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut3StandardSelectEntry); ///< @deprecated Use GetSDIOut3StandardSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut4StandardSelectEntry); ///< @deprecated Use GetSDIOut4StandardSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut1InputSelectEntry); ///< @deprecated Use GetSDIOut1InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut1InputDS2SelectEntry); ///< @deprecated Use GetSDIOut1InputDS2SelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut2InputSelectEntry); ///< @deprecated Use GetSDIOut2InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut2InputDS2SelectEntry); ///< @deprecated Use GetSDIOut2InputDS2SelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut3InputSelectEntry); ///< @deprecated Use GetSDIOut3InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut3InputDS2SelectEntry); ///< @deprecated Use GetSDIOut3InputDS2SelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut4InputSelectEntry); ///< @deprecated Use GetSDIOut4InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut4InputDS2SelectEntry); ///< @deprecated Use GetSDIOut4InputDS2SelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut5InputSelectEntry); ///< @deprecated Use GetSDIOut5InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut5InputDS2SelectEntry); ///< @deprecated Use GetSDIOut5InputDS2SelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut6InputSelectEntry); ///< @deprecated Use GetSDIOut6InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut6InputDS2SelectEntry); ///< @deprecated Use GetSDIOut6InputDS2SelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut7InputSelectEntry); ///< @deprecated Use GetSDIOut7InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut7InputDS2SelectEntry); ///< @deprecated Use GetSDIOut7InputDS2SelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut8InputSelectEntry); ///< @deprecated Use GetSDIOut8InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry SDIOut8InputDS2SelectEntry); ///< @deprecated Use GetSDIOut8InputDS2SelectEntry instead. + + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkIn1InputSelectEntry); ///< @deprecated Use GetDualLinkIn1InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkIn1DSInputSelectEntry); ///< @deprecated Use GetDualLinkIn1DSInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkIn2InputSelectEntry); ///< @deprecated Use GetDualLinkIn2InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkIn2DSInputSelectEntry); ///< @deprecated Use GetDualLinkIn2DSInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkIn3InputSelectEntry); ///< @deprecated Use GetDualLinkIn3InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkIn3DSInputSelectEntry); ///< @deprecated Use GetDualLinkIn3DSInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkIn4InputSelectEntry); ///< @deprecated Use GetDualLinkIn4InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkIn4DSInputSelectEntry); ///< @deprecated Use GetDualLinkIn4DSInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkIn5InputSelectEntry); ///< @deprecated Use GetDualLinkIn5InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkIn5DSInputSelectEntry); ///< @deprecated Use GetDualLinkIn5DSInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkIn6InputSelectEntry); ///< @deprecated Use GetDualLinkIn6InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkIn6DSInputSelectEntry); ///< @deprecated Use GetDualLinkIn6DSInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkIn7InputSelectEntry); ///< @deprecated Use GetDualLinkIn7InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkIn7DSInputSelectEntry); ///< @deprecated Use GetDualLinkIn7DSInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkIn8InputSelectEntry); ///< @deprecated Use GetDualLinkIn8InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkIn8DSInputSelectEntry); ///< @deprecated Use GetDualLinkIn8DSInputSelectEntry instead. + + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkOut1InputSelectEntry); ///< @deprecated Use GetDualLinkOut1InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkOut2InputSelectEntry); ///< @deprecated Use GetDualLinkOut2InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkOut3InputSelectEntry); ///< @deprecated Use GetDualLinkOut3InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkOut4InputSelectEntry); ///< @deprecated Use GetDualLinkOut4InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkOut5InputSelectEntry); ///< @deprecated Use GetDualLinkOut5InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkOut6InputSelectEntry); ///< @deprecated Use GetDualLinkOut6InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkOut7InputSelectEntry); ///< @deprecated Use GetDualLinkOut7InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry DualLinkOut8InputSelectEntry); ///< @deprecated Use GetDualLinkOut8InputSelectEntry instead. + + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Mixer1BGKeyInputSelectEntry); ///< @deprecated Use GetMixer1BGKeyInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Mixer1BGVidInputSelectEntry); ///< @deprecated Use GetMixer1BGVidInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Mixer1FGKeyInputSelectEntry); ///< @deprecated Use GetMixer1FGKeyInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Mixer1FGVidInputSelectEntry); ///< @deprecated Use GetMixer1FGVidInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Mixer2BGKeyInputSelectEntry); ///< @deprecated Use GetMixer2BGKeyInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Mixer2BGVidInputSelectEntry); ///< @deprecated Use GetMixer2BGVidInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Mixer2FGKeyInputSelectEntry); ///< @deprecated Use GetMixer2FGKeyInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Mixer2FGVidInputSelectEntry); ///< @deprecated Use GetMixer2FGVidInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Mixer3BGKeyInputSelectEntry); ///< @deprecated Use GetMixer3BGKeyInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Mixer3BGVidInputSelectEntry); ///< @deprecated Use GetMixer3BGVidInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Mixer3FGKeyInputSelectEntry); ///< @deprecated Use GetMixer3FGKeyInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Mixer3FGVidInputSelectEntry); ///< @deprecated Use GetMixer3FGVidInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Mixer4BGKeyInputSelectEntry); ///< @deprecated Use GetMixer4BGKeyInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Mixer4BGVidInputSelectEntry); ///< @deprecated Use GetMixer4BGVidInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Mixer4FGKeyInputSelectEntry); ///< @deprecated Use GetMixer4FGKeyInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Mixer4FGVidInputSelectEntry); ///< @deprecated Use GetMixer4FGVidInputSelectEntry instead. + + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Xpt4KDCQ1InputSelectEntry); ///< @deprecated Use GetXpt4KDCQ1InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Xpt4KDCQ2InputSelectEntry); ///< @deprecated Use GetXpt4KDCQ2InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Xpt4KDCQ3InputSelectEntry); ///< @deprecated Use GetXpt4KDCQ3InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry Xpt4KDCQ4InputSelectEntry); ///< @deprecated Use GetXpt4KDCQ4InputSelectEntry instead. + + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry HDMIOutQ1InputSelectEntry); ///< @deprecated Use GetHDMIOutQ1InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry HDMIOutQ2InputSelectEntry); ///< @deprecated Use GetHDMIOutQ2InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry HDMIOutQ3InputSelectEntry); ///< @deprecated Use GetHDMIOutQ3InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry HDMIOutQ4InputSelectEntry); ///< @deprecated Use GetHDMIOutQ4InputSelectEntry instead. + + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CompressionModInputSelectEntry); ///< @deprecated Use GetCompressionModInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry ConversionModInputSelectEntry); ///< @deprecated Use GetConversionModInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry CSC1KeyFromInput2SelectEntry); ///< @deprecated Use GetCSC1KeyFromInput2SelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry FrameSync2InputSelectEntry); ///< @deprecated Use GetFrameSync2InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry FrameSync1InputSelectEntry); ///< @deprecated Use GetFrameSync1InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry AnalogOutInputSelectEntry); ///< @deprecated Use GetAnalogOutInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry ProAmpInputSelectEntry); ///< @deprecated Use GetProAmpInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry IICT1InputSelectEntry); ///< @deprecated Use GetIICT1InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry WaterMarker1InputSelectEntry); ///< @deprecated Use GetWaterMarker1InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry WaterMarker2InputSelectEntry); ///< @deprecated Use GetWaterMarker2InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry UpdateRegisterSelectEntry); ///< @deprecated Use GetUpdateRegisterSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry ConversionMod2InputSelectEntry); ///< @deprecated Use GetConversionMod2InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry HDMIOutInputSelectEntry); ///< @deprecated Use GetHDMIOutInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry IICT2InputSelectEntry); ///< @deprecated Use GetIICT2InputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry AnalogOutCompositeOutSelectEntry); ///< @deprecated Use GetAnalogOutCompositeOutSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry StereoLeftInputSelectEntry); ///< @deprecated Use GetStereoLeftInputSelectEntry instead. + extern NTV2_DEPRECATED_v(const NTV2RoutingEntry StereoRightInputSelectEntry); ///< @deprecated Use GetStereoRightInputSelectEntry instead. +#endif // !defined (NTV2_DEPRECATE) + +#endif // NTV2SIGNALROUTER_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2spiinterface.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2spiinterface.h new file mode 100644 index 0000000..9d421a4 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2spiinterface.h @@ -0,0 +1,96 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2spiinterface.h + @brief Declares the CNTV2SpiFlash and CNTV2AxiSpiFlash classes. + @copyright (C) 2017-2021 AJA Video Systems, Inc. All rights reserved. +**/ +#ifndef NTV2SPIINTERFACE_H +#define NTV2SPIINTERFACE_H + +#include "ntv2card.h" + +typedef enum +{ + SPI_FLASH_SECTION_UBOOT, + SPI_FLASH_SECTION_KERNEL, + SPI_FLASH_SECTION_LICENSE, + SPI_FLASH_SECTION_MCSINFO, + SPI_FLASH_SECTION_MAC, + SPI_FLASH_SECTION_SERIAL, + + SPI_FLASH_SECTION_TOTAL // should be at end, represents the whole flash chip +}SpiFlashSection; + +class CNTV2SpiFlash +{ +public: + CNTV2SpiFlash(bool verbose = false) : mVerbose(verbose) {} + virtual ~CNTV2SpiFlash() {} + + virtual bool Read(const uint32_t address, std::vector &data, uint32_t maxBytes = 1) = 0; + virtual bool Write(const uint32_t address, const std::vector data, uint32_t maxBytes = 1) = 0; + virtual bool Erase(const uint32_t address, uint32_t bytes) = 0; + virtual bool Verify(const uint32_t address, const std::vector& dataWritten) = 0; + virtual uint32_t Size(SpiFlashSection sectionID = SPI_FLASH_SECTION_TOTAL) = 0; + virtual uint32_t Offset(SpiFlashSection sectionID = SPI_FLASH_SECTION_TOTAL) = 0; + virtual void SetVerbosity(bool verbose) {mVerbose = verbose;} + virtual bool GetVerbosity() {return mVerbose;} + + static bool DeviceSupported(NTV2DeviceID deviceId) {(void)deviceId; return false;} + +protected: + bool mVerbose; +}; + +class CNTV2AxiSpiFlash : public CNTV2SpiFlash +{ +public: + CNTV2AxiSpiFlash(int index = 0, bool verbose = false); + virtual ~CNTV2AxiSpiFlash(); + + // common flash interface + virtual bool Read(const uint32_t address, std::vector &data, uint32_t maxBytes = 1); + virtual bool Write(const uint32_t address, const std::vector data, uint32_t maxBytes = 1); + virtual bool Erase(const uint32_t address, uint32_t bytes); + virtual bool Verify(const uint32_t address, const std::vector& dataWritten); + virtual uint32_t Size(SpiFlashSection sectionID = SPI_FLASH_SECTION_TOTAL); + virtual uint32_t Offset(SpiFlashSection sectionID = SPI_FLASH_SECTION_TOTAL); + static bool DeviceSupported(NTV2DeviceID deviceId); + + // Axi specific +private: + bool NTV2DeviceOk(); + + void SpiReset(); + bool SpiResetFifos(); + void SpiEnableWrite(bool enable); + bool SpiTransfer(std::vector commandSequence, + const std::vector inputData, + std::vector& outputData, uint32_t maxByteCutoff = 1); + + bool FlashDeviceInfo(uint8_t& manufactureID, uint8_t& memInerfaceType, + uint8_t& memDensity, uint8_t& sectorArchitecture, + uint8_t& familyID); + bool FlashReadConfig(uint8_t& configValue); + bool FlashReadStatus(uint8_t& statusValue); + bool FlashReadBankAddress(uint8_t& bankAddressVal); + bool FlashWriteBankAddress(const uint8_t bankAddressVal); + + void FlashFixAddress(const uint32_t address, std::vector& commandSequence); + + uint32_t mBaseByteAddress; + uint32_t mSize; + uint32_t mSectorSize; + + CNTV2Card mDevice; + + uint32_t mSpiResetReg; + uint32_t mSpiControlReg; + uint32_t mSpiStatusReg; + uint32_t mSpiWriteReg; + uint32_t mSpiReadReg; + uint32_t mSpiSlaveReg; + uint32_t mSpiGlobalIntReg; +}; + +#endif // NTV2SPIINTERFACE_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2supportlogger.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2supportlogger.h new file mode 100644 index 0000000..782d843 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2supportlogger.h @@ -0,0 +1,127 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2supportlogger.h + @brief Declares the CNTV2SupportLogger class. + @copyright (C) 2017-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef NTV2SUPPORTLOGGER_H +#define NTV2SUPPORTLOGGER_H + +#include "ntv2card.h" +#include +#include +#include "ntv2utils.h" + +typedef enum +{ + NTV2_SupportLoggerSectionInfo = 0x00000001 << 0, + NTV2_SupportLoggerSectionAutoCirculate = 0x00000001 << 1, + NTV2_SupportLoggerSectionAudio = 0x00000001 << 2, + NTV2_SupportLoggerSectionRouting = 0x00000001 << 3, + NTV2_SupportLoggerSectionRegisters = 0x00000001 << 4, + NTV2_SupportLoggerSectionsAll = 0xFFFFFFFF +} NTV2SupportLoggerSections; + +/** + @brief Generates a standard support log (register log) for any NTV2 device attached to the host. + To write the log into a file, open a std::ofstream, then stream this object into it. +**/ +class AJAExport CNTV2SupportLogger +{ +public: + /** + @brief Construct from CNTV2Card instance. + @param[in] card Specifies the CNTV2Card instance of the device to be logged. The instance should already be open. + @param[in] sections Optionally specifies which sections to include in the log. Defaults to all sections. + **/ + CNTV2SupportLogger (CNTV2Card & card, + NTV2SupportLoggerSections sections = NTV2_SupportLoggerSectionsAll); + + /** + @brief Default constructor. + @param[in] cardIndex Optionally specifies the zero-based index of the CNTV2Card device to be logged. + Defaults to zero, the first device found. + @param[in] sections Optionally specifies which sections to include in the log. Defaults to all sections. + **/ + CNTV2SupportLogger (UWord cardIndex = 0, + NTV2SupportLoggerSections sections = NTV2_SupportLoggerSectionsAll); + + virtual ~CNTV2SupportLogger (); ///< @brief My default destructor + + static int Version (void); ///< @return The log file version I will produce. + + /** + @brief Prepends arbitrary string data to my support log, ahead of a given section. + @param[in] section Specifies the NTV2SupportLoggerSection to prepend. + @param[in] sectionData Specifies the text data to prepend. + **/ + virtual void PrependToSection (uint32_t section, const std::string & sectionData); + + /** + @brief Appends arbitrary string data to my support log, after a given section. + @param[in] section Specifies the NTV2SupportLoggerSection to append. + @param[in] sectionData Specifies the text data to append. + **/ + virtual void AppendToSection (uint32_t section, const std::string & sectionData); + + /** + @brief Adds header text to my log. + @param[in] sectionName Specifies the section name. + @param[in] sectionData Specifies the header text. + **/ + virtual void AddHeader (const std::string & sectionName, const std::string & sectionData); + + /** + @brief Adds footer text to my log. + @param[in] sectionName Specifies the section name. + @param[in] sectionData Specifies the footer text. + **/ + virtual void AddFooter (const std::string & sectionName, const std::string & sectionData); + + virtual std::string ToString (void) const; ///< @return My entire support log as a standard string. + + /** + @brief Writes my support log into a string object. + @param[out] outString Receives my entire support log as a standard string, replacing its contents. + **/ + virtual void ToString (std::string & outString) const; + + virtual bool LoadFromLog (const std::string & inLogFilePath, const bool bForceLoad); + + +private: + void FetchInfoLog (std::ostringstream& oss) const; + void FetchRegisterLog (std::ostringstream& oss) const; + void FetchAutoCirculateLog (std::ostringstream& oss) const; + void FetchAudioLog (std::ostringstream& oss) const; + void FetchRoutingLog (std::ostringstream& oss) const; + +private: + CNTV2Card & mDevice; + bool mDispose; + NTV2SupportLoggerSections mSections; + std::string mHeaderStr; + std::string mFooterStr; + std::map mPrependMap; + std::map mAppendMap; + +public: + static std::string InventLogFilePathAndName (CNTV2Card & inDevice, + std::string inPrefix = "aja_supportlog", + std::string inExtension = "log"); // New in SDK 16.0 + static bool DumpDeviceSDRAM (CNTV2Card & inDevice, + const std::string & inFilePath, + std::ostream & msgStream); // New in SDK 16.0 +}; // CNTV2SupportLogger + + +/** + @brief Writes a given CNTV2SupportLogger's text into the given output stream. + @param outStream Specifies the output stream to be written. + @param[in] inData Specifies the CNTV2SupportLogger. + @return A reference to the same output stream that was specified in "outStream". +**/ +AJAExport std::ostream & operator << (std::ostream & outStream, const CNTV2SupportLogger & inData); + +#endif // NTV2SUPPORTLOGGER_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2task.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2task.h new file mode 100644 index 0000000..b0e90ea --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2task.h @@ -0,0 +1,118 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2task.h + @brief Declares the CNTV2Task class (deprecated). + @copyright (C) 2008-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2TASK_H +#define NTV2TASK_H + +#include "ajaexport.h" +#include "ntv2card.h" +#if !defined (NTV2_DEPRECATE) + #include "ntv2signalrouter.h" +#endif // !defined (NTV2_DEPRECATE) + +#if defined(AJALinux) + #include +#endif +#include + +/** + @brief The AutoCirculate "task" facility is deprecated. Use the new AutoCirculate APIs. +**/ +class AJAExport NTV2_DEPRECATED_CLASS CNTV2Task +{ +public: + + // constructors + CNTV2Task(); + CNTV2Task (const CNTV2Task & other); + virtual ~CNTV2Task(); + + // initialize the task list + AJA_VIRTUAL void Init(); + + // clear the task list + AJA_VIRTUAL void Clear(); + + // add a frame synchronized register write + AJA_VIRTUAL AutoCircGenericTask * AddRegisterWriteTask (ULWord registerNum, + ULWord registerValue, + ULWord registerMask = 0xffffffff, + ULWord registerShift = 0); + + // add a frame synchronized register read + AJA_VIRTUAL AutoCircGenericTask * AddRegisterReadTask (ULWord registerNum, + ULWord registerMask = 0xffffffff, + ULWord registerShift = 0); + + #if !defined (NTV2_DEPRECATE) + // convert routing entries to register write tasks + AJA_VIRTUAL NTV2_DEPRECATED_f(AutoCircGenericTask * AddRoutingEntry (const NTV2RoutingEntry & inEntry)); + AJA_VIRTUAL NTV2_DEPRECATED_f(AutoCircGenericTask * AddRoutingEntryWithValue (const NTV2RoutingEntry & inEntry, const ULWord inValue)); + AJA_VIRTUAL NTV2_DEPRECATED_f(void AddSignalRouting (const CNTV2SignalRouter & inRouter)); + + + AJA_VIRTUAL NTV2_DEPRECATED_f(AutoCircGenericTask * AddXena2Routing (const NTV2RoutingEntry & inEntry)); + AJA_VIRTUAL NTV2_DEPRECATED_f(AutoCircGenericTask * AddXena2RoutingWithValue (const NTV2RoutingEntry & inEntry, const ULWord inValue)); + AJA_VIRTUAL NTV2_DEPRECATED_f(void CopyXena2Routing (const CNTV2SignalRouter * pInRouter)); + // dump the task list to debug output + AJA_VIRTUAL NTV2_DEPRECATED_f(void DumpTaskList (void) const); + #endif // !defined (NTV2_DEPRECATE) + + // add time code write + AJA_VIRTUAL AutoCircGenericTask * AddTimeCodeWriteTask (RP188_STRUCT * pTCInOut1 = NULL, + RP188_STRUCT* pTCInOut2 = NULL, + RP188_STRUCT* pLTCEmbedded = NULL, + RP188_STRUCT* pLTCAnalog = NULL, + RP188_STRUCT* pLTCEmbedded2 = NULL, + RP188_STRUCT* pLTCAnalog2 = NULL, + RP188_STRUCT* pTCInOut3 = NULL, + RP188_STRUCT* pTCInOut4 = NULL, + RP188_STRUCT* pTCInOut5 = NULL, + RP188_STRUCT* pTCInOut6 = NULL, + RP188_STRUCT* pTCInOut7 = NULL, + RP188_STRUCT* pTCInOut8 = NULL); + + // add time code read + AJA_VIRTUAL AutoCircGenericTask* AddTimeCodeReadTask(); + + // get a task by index + AJA_VIRTUAL AutoCircGenericTask* GetTask (ULWord index); + AJA_VIRTUAL const AutoCircGenericTask & GetTask (const ULWord index) const; + + // get the current number of tasks + AJA_VIRTUAL ULWord GetNumTasks (void) const; + + // get the maximum number of tasks + AJA_VIRTUAL ULWord GetMaxTasks (void) const; + + // get a pointer to the task structure for TransferWithAutoCirculate_Ex2 + AJA_VIRTUAL PAUTOCIRCULATE_TASK_STRUCT GetTaskStruct(); + + // operators + AJA_VIRTUAL CNTV2Task & operator = (const CNTV2Task & other); + AJA_VIRTUAL operator AUTOCIRCULATE_TASK_STRUCT () const { return m_AutoCircTask; } + AJA_VIRTUAL operator PAUTOCIRCULATE_TASK_STRUCT () { return &m_AutoCircTask; } + +protected: + // used internally and by the driver + static bool InitTaskArray(AutoCircGenericTask* pTaskArray, ULWord numTasks); + static ULWord CopyTaskArray(AutoCircGenericTask* pDstArray, ULWord dstSize, ULWord dstMax, + const AutoCircGenericTask* pSrcArray, ULWord srcSize, ULWord srcNum); + + AUTOCIRCULATE_TASK_STRUCT m_AutoCircTask; + AutoCircGenericTask m_TaskArray [AUTOCIRCULATE_TASK_MAX_TASKS]; + +}; // CNTV2Task + + +// ostream operators +std::ostream & operator << (std::ostream & inOutStream, const AutoCircGenericTask & inObj); +std::ostream & operator << (std::ostream & inOutStream, const CNTV2Task & inObj); +std::ostream & operator << (std::ostream & inOutStream, const AutoCircRegisterTask & inObj); +std::ostream & operator << (std::ostream & inOutStream, const AutoCircTimeCodeTask & inObj); + +#endif // NTV2TASK_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2testpatterngen.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2testpatterngen.h new file mode 100644 index 0000000..ab915a4 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2testpatterngen.h @@ -0,0 +1,289 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ajantv2/includes/ntv2testpatterngen.h + @brief Declares the NTV2TestPatternGen class. + @copyright (C) 2010-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2_TESTPATTERN_GEN_ +#define NTV2_TESTPATTERN_GEN_ + +#include "ajaexport.h" +#include "ntv2videodefines.h" +#include "ntv2enums.h" +#include "ntv2utils.h" +#include +#include +#include + +typedef std::vector NTV2TestPatternBuffer, NTV2TestPatBuffer; ///< @brief A byte vector that stores a complete video frame. +#if !defined(NTV2_DEPRECATE_15_0) + typedef std::vector NTV2TestPatternList; ///< @deprecated Use NTV2TestPatternNames instead. +#endif//!defined(NTV2_DEPRECATE_15_0) +typedef NTV2StringList NTV2TestPatternNames; ///< @brief A list (std::vector) of pattern names. + +/** + @brief Identifies a predefined NTV2 test pattern. +**/ +enum NTV2TestPatternSelect +{ + NTV2_TestPatt_ColorBars100, + NTV2_TestPatt_FIRST = NTV2_TestPatt_ColorBars100, + NTV2_TestPatt_ColorBars75, + NTV2_TestPatt_Ramp, + NTV2_TestPatt_MultiBurst, + NTV2_TestPatt_LineSweep, + NTV2_TestPatt_CheckField, + NTV2_TestPatt_FlatField, + NTV2_TestPatt_MultiPattern, + NTV2_TestPatt_Black, + NTV2_TestPatt_White, + NTV2_TestPatt_Border, + NTV2_TestPatt_LinearRamp, + NTV2_TestPatt_SlantRamp, + NTV2_TestPatt_ZonePlate, + NTV2_TestPatt_ColorQuadrant, + NTV2_TestPatt_ColorQuadrantBorder, + NTV2_TestPatt_ColorQuadrantTsi, + NTV2_TestPatt_TsiAlignment, + NTV2_TestPatt_ZonePlate_12b_RGB, + NTV2_TestPatt_LinearRamp_12b_RGB, + NTV2_TestPatt_HLG_Narrow_12b_RGB, + NTV2_TestPatt_PQ_Narrow_12b_RGB, + NTV2_TestPatt_PQ_Wide_12b_RGB, + NTV2_TestPatt_All, + NTV2_TestPatt_INVALID = NTV2_TestPatt_All, + NTV2_TestPatt_LAST = NTV2_TestPatt_All +}; +typedef NTV2TestPatternSelect NTV2TestPatternID; + +#define NTV2_IS_VALID_PATTERN(__S__) ((__S__) >= NTV2_TestPatt_ColorBars100 && (__S__) < NTV2_TestPatt_All) +#define NTV2_IS_12B_PATTERN(__S__) ((__S__) >= NTV2_TestPatt_ZonePlate_12b_RGB && (__S__) < NTV2_TestPatt_All) + +typedef std::set NTV2TestPatternSet; +typedef NTV2TestPatternSet::const_iterator NTV2TestPatternSetConstIter; + + +/** + @brief The NTV2 test pattern generator. + @bug ::NTV2TestPatternGen doesn't work for planar formats. +**/ +class AJAExport NTV2TestPatternGen +{ + // CLASS METHODS + public: + /** + @name Class Methods + **/ + ///@{ + + /** + @param[in] inPattern Specifies the test pattern of interest. + @param[in] inDesc Specifies a description of the raster being used. + @return True, if the given test pattern can be drawn for the given raster description. + **/ + static bool canDrawTestPattern (const NTV2TestPatternSelect inPattern, + const NTV2FormatDescriptor & inDesc); + + /** + @return An ordered collection of strings containing the names of all available test patterns. + **/ + static NTV2TestPatternNames getTestPatternNames (void); + + /** + @return An ordered collection of strings containing the names of all available flat-field "web colors". + **/ + static NTV2StringList getColorNames (void); // New in SDK 16.0 + + /** + @return The test pattern that corresponds to the given name. + @param[in] inName Specifies the test pattern name. The search is done case-insensitively. + **/ + static NTV2TestPatternSelect findTestPatternByName (const std::string & inName); // New in SDK 16.0 + + /** + @return The flat-field RGB "web color" value that corresponds to the given name. + The highest-order byte in the 32-bit result is 0x00; the next-lower byte + is the Red value (0-255); the next-lower byte is the Green value (0-255); + the lowest-order byte is the Blue value (0-255). A zero return value + means "not found". + @param[in] inName Specifies the "web color" name. The search is done case-insensitively. + @note "Black" and "White" are not returned, as these are available as ordinary + test patterns NTV2_TestPatt_Black and NTV2_TestPatt_White, respectively. + **/ + static ULWord findRGBColorByName (const std::string & inName); // New in SDK 16.0 + + #if !defined(NTV2_DEPRECATE_15_0) + static NTV2_SHOULD_BE_DEPRECATED (NTV2TestPatternList & getTestPatternList (void)); + #endif // !defined(NTV2_DEPRECATE_15_0) + ///@} + + // INSTANCE METHODS + public: + /** + @name Constructors & Destructors + **/ + ///@{ + NTV2TestPatternGen (); + virtual inline ~NTV2TestPatternGen () {} + ///@} + + /** + @name Drawing Methods + **/ + ///@{ + /** + @brief Renders the given test pattern or color into a host raster buffer. + @param[in] inTPName Specifies the name of the test pattern or web color to be drawn. + @param[in] inFormatDesc Describes the raster memory. + @param inBuffer Specifies the host memory buffer to be written. + @note If the format descriptor describes a "tall" or "taller" (VANC) raster geometry, + the first byte in the specified buffer is presumed to be the start of the VANC region. + @note If my mSetDstVancBlack member is true, the buffer's VANC region will also be cleared + to legal black. + @return True if successful; otherwise false. + @bug Needs planar pixel format implementations. + **/ + virtual bool DrawTestPattern (const std::string & inTPName, + const NTV2FormatDescriptor & inFormatDesc, + NTV2_POINTER & inBuffer); // New in SDK 16.0 + /** + @brief Renders the given test pattern into a host raster buffer. + @param[in] inPattern Specifies the test pattern to be drawn. + @param[in] inFormatDesc Describes the raster memory. + @param inBuffer Specifies the host memory buffer to be written. + @note If the format descriptor describes a "tall" or "taller" (VANC) geometry, the + first byte in the specified buffer is presumed to be the start of the VANC region. + @note If my mSetDstVancBlack member is true, the buffer's VANC region will also be cleared + to legal black. + @return True if successful; otherwise false. + @bug Needs planar pixel format implementations. + **/ + virtual bool DrawTestPattern (const NTV2TestPatternSelect inPattern, + const NTV2FormatDescriptor & inFormatDesc, + NTV2_POINTER & inBuffer); // New in SDK 16.0 + +#if !defined(NTV2_DEPRECATE_16_0) + /** + @deprecated Use the DrawTestPattern method that requires an NTV2_POINTER to specify the buffer to fill. + **/ + virtual inline NTV2_DEPRECATED_f(bool DrawTestPattern (const NTV2TestPatternSelect inPattern, const NTV2FormatDescriptor & inDesc, NTV2TestPatBuffer & outBuffer)) + {return DrawTestPattern(inPattern, inDesc.GetRasterWidth(), inDesc.GetVisibleRasterHeight(), inDesc.GetPixelFormat(), outBuffer);} + /** + @deprecated Use the DrawTestPattern method that requires an NTV2_POINTER to specify the buffer to fill. + **/ + virtual NTV2_DEPRECATED_f(bool DrawTestPattern (const NTV2TestPatternSelect inPat, const uint32_t inWdth, const uint32_t inHght, const NTV2FrameBufferFormat inPF, NTV2TestPatBuffer & outBuf)); +#endif // !defined(NTV2_DEPRECATE_16_0) + ///@} + + /** + @name Getters + **/ + ///@{ + inline bool getUseRGBSmpteRange (void) const {return mSetRGBSmpteRange;} + inline NTV2SignalMask getSignalMask (void) const {return mSignalMask;} + inline const double & getSliderValue (void) const {return mSliderValue;} + inline bool getAlphaFromLuma (void) const {return mSetAlphaFromLuma;} + inline bool setVANCToLegalBlack (void) const {return mSetDstVancBlack;} ///< @return True if DrawTestPattern will also set VANC lines (if any) to legal black. + ///@} + + /** + @name Setters + **/ + ///@{ + inline NTV2TestPatternGen & setUseRGBSmpteRange (const bool useRGBSmpteRange) {mSetRGBSmpteRange = useRGBSmpteRange; return *this;} + inline NTV2TestPatternGen & setSignalMask (const NTV2SignalMask signalMask) {mSignalMask = signalMask; return *this;} + inline NTV2TestPatternGen & setSliderValue (const double & sliderValue) {mSliderValue = sliderValue; return *this;} + inline NTV2TestPatternGen & setAlphaFromLuma (const bool alphaFromLuma) {mSetAlphaFromLuma = alphaFromLuma; return *this;} + /** + @brief Changes my "clear VANC lines to legal black" setting. + @param[in] inClearVANC Specify true to have my DrawTestPattern method automatically clear the VANC region (if any) to legal black. + @return A non-constant reference to me. + **/ + inline NTV2TestPatternGen & setVANCToLegalBlack (const bool inClearVANC) {mSetDstVancBlack = inClearVANC; return *this;} + ///@} + + // INTERNAL METHODS + protected: + virtual bool DrawSegmentedTestPattern (); + virtual bool DrawYCbCrFrame (uint16_t Y, uint16_t Cb, uint16_t Cr); + virtual bool DrawBorderFrame (); + virtual bool DrawLinearRampFrame (); + virtual bool DrawSlantRampFrame (); + virtual bool DrawZonePlateFrame (); + virtual bool DrawQuadrantBorderFrame (); + virtual bool DrawColorQuadrantFrame (); + virtual bool DrawColorQuadrantFrameTsi (); + virtual bool DrawColorQuadrantFrameTsi2 (); + + // 12-bit patterns: + virtual bool DrawTestPatternNarrowHLG(); + virtual bool DrawTestPatternNarrowPQ(); + virtual bool DrawTestPatternWidePQ(); + virtual bool Draw12BitRamp(); + virtual bool Draw12BitZonePlate(); + virtual void PrepareForOutput(); + + bool IsSDStandard(void) const; + bool GetStandard (int & outStandard, bool & outIs4K, bool & outIs8K) const; + virtual bool drawIt (void); + + // INSTANCE DATA + protected: + NTV2TestPatternID mPatternID; ///< @brief Pattern number +// NTV2FormatDesc mDstFormat; ///< @brief Dest format + NTV2PixelFormat mDstPixelFormat; ///< @brief Dest pixel format + uint32_t mDstFrameWidth; ///< @brief Dest width (pixels) + uint32_t mDstFrameHeight; ///< @brief Dest height (lines) + uint32_t mDstLinePitch; ///< @brief Dest bytes per row + uint32_t mSrcLinePitch; ///< @brief Src bytes per row + uint32_t mDstBufferSize; ///< @brief Dest visible buffer size (bytes) + uint8_t * mpDstBuffer; ///< @brief Dest buffer (start of active video) + uint32_t * mpPackedLineBuffer; + uint16_t * mpUnpackedLineBuffer; + bool mSetRGBSmpteRange; + bool mSetAlphaFromLuma; + bool mSetDstVancBlack; ///< @brief Set destination VANC lines to legal black? + double mSliderValue; ///< @brief Used for Zone Plate + NTV2SignalMask mSignalMask; ///< @brief Component mask for MultiBurst, LineSweep + + uint32_t mNumPixels; + uint32_t mNumLines; + uint32_t mBitsPerComponent; + uint32_t mSamplesPerPixel; + uint16_t mCompressionType; + uint32_t mDataOffset; + uint32_t mDataSize; + std::vector mData; + std::vector mUnPackedRAWBuffer; + std::vector mRGBBuffer; + +}; // NTV2TestPatternGen + +#if !defined(NTV2_DEPRECATE_14_3) + typedef NTV2TestPatternGen AJATestPatternGenEx; ///< @deprecated Use NTV2TestPatternGen instead. + typedef NTV2TestPatternBuffer AJATestPatternBufferEx; ///< @deprecated Use NTV2TestPatternBuffer instead. + typedef NTV2TestPatternSelect AJATestPatternSelectEx; ///< @deprecated Use NTV2TestPatternSelect instead. + #define AJA_TestPattEx_ColorBars100 NTV2_TestPatt_ColorBars100 ///< @deprecated Use NTV2_TestPatt_ColorBars100 instead. + #define AJA_TestPattEx_ColorBars75 NTV2_TestPatt_ColorBars75 ///< @deprecated Use NTV2_TestPatt_ColorBars75 instead. + #define AJA_TestPattEx_Ramp NTV2_TestPatt_Ramp ///< @deprecated Use NTV2_TestPatt_Ramp instead. + #define AJA_TestPattEx_MultiBurst NTV2_TestPatt_MultiBurst ///< @deprecated Use NTV2_TestPatt_MultiBurst instead. + #define AJA_TestPattEx_LineSweep NTV2_TestPatt_LineSweep ///< @deprecated Use NTV2_TestPatt_LineSweep instead. + #define AJA_TestPattEx_CheckField NTV2_TestPatt_CheckField ///< @deprecated Use NTV2_TestPatt_CheckField instead. + #define AJA_TestPattEx_FlatField NTV2_TestPatt_FlatField ///< @deprecated Use NTV2_TestPatt_FlatField instead. + #define AJA_TestPattEx_MultiPattern NTV2_TestPatt_MultiPattern ///< @deprecated Use NTV2_TestPatt_MultiPattern instead. + #define AJA_TestPattEx_Black NTV2_TestPatt_Black ///< @deprecated Use NTV2_TestPatt_Black instead. + #define AJA_TestPattEx_White NTV2_TestPatt_White ///< @deprecated Use NTV2_TestPatt_White instead. + #define AJA_TestPattEx_Border NTV2_TestPatt_Border ///< @deprecated Use NTV2_TestPatt_Border instead. + #define AJA_TestPattEx_LinearRamp NTV2_TestPatt_LinearRamp ///< @deprecated Use NTV2_TestPatt_LinearRamp instead. + #define AJA_TestPattEx_SlantRamp NTV2_TestPatt_SlantRamp ///< @deprecated Use NTV2_TestPatt_SlantRamp instead. + #define AJA_TestPattEx_ZonePlate NTV2_TestPatt_ZonePlate ///< @deprecated Use NTV2_TestPatt_ZonePlate instead. + #define AJA_TestPattEx_ColorQuadrant NTV2_TestPatt_ColorQuadrant ///< @deprecated Use NTV2_TestPatt_ColorQuadrant instead. + #define AJA_TestPattEx_ColorQuadrantBorder NTV2_TestPatt_ColorQuadrantBorder ///< @deprecated Use NTV2_TestPatt_ColorQuadrantBorder instead. + #define AJA_TestPattEx_ColorQuadrantTsi NTV2_TestPatt_ColorQuadrantTsi ///< @deprecated Use NTV2_TestPatt_ColorQuadrantTsi instead. + #define AJA_TestPattEx_All NTV2_TestPatt_All ///< @deprecated Use NTV2_TestPatt_All instead. +#elif !defined(NTV2_DEPRECATE_15_0) + typedef NTV2TestPatternList AJATestPatternListEx; ///< @deprecated Use NTV2TestPatternNames instead. +#endif // NTV2_DEPRECATE_15_0 + +#endif // NTV2_TESTPATTERN_GEN_ diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2transcode.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2transcode.h new file mode 100644 index 0000000..cfaf684 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2transcode.h @@ -0,0 +1,740 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2transcode.h + @brief Declares a number of pixel format transcoder functions. + @copyright (C) 2004-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2TRANSCODE_H +#define NTV2TRANSCODE_H +#include "ajaexport.h" +#include "ajatypes.h" +#include "ntv2fixed.h" +#include "ntv2videodefines.h" +#include + +// TODO: DEBUG ONLY +#include + + +/** + @brief Converts a single 8-bit YCbCr '2vuy' raster line to 10-bit YCbCr 'v210' (from NTV2_FBF_8BIT_YCBCR to NTV2_FBF_10BIT_YCBCR ). + @param[in] pInSrcLine_2vuy Specifies a valid, non-NULL address of the first byte of the '2vuy' + raster line to be converted. + @param[out] pOutDstLine_v210 Specifies a valid, non-NULL address of the first byte of the 'v210' + raster line to receive the converted data. + @param[in] inNumPixels The number of pixels to be converted. + @return True if successful; otherwise false. +**/ +AJAExport bool ConvertLine_2vuy_to_v210 (const UByte * pInSrcLine_2vuy, ULWord * pOutDstLine_v210, const ULWord inNumPixels); + +/** + @brief Converts a single 8-bit YCbCr '2vuy' raster line to 10-bit YCbCr 'v210' (from NTV2_FBF_8BIT_YCBCR to NTV2_FBF_8BIT_YCBCR_YUY2 ). + @param[in] pInSrcLine_2vuy Specifies a valid, non-NULL address of the first byte of the '2vuy' + raster line to be converted. + @param[out] pOutDstLine_yuy2 Specifies a valid, non-NULL address of the first byte of the 'YUY2' + raster line to receive the converted data. + @param[in] inNumPixels The number of pixels to be converted. + @return True if successful; otherwise false. +**/ +AJAExport bool ConvertLine_2vuy_to_yuy2 (const UByte * pInSrcLine_2vuy, UWord * pOutDstLine_yuy2, const ULWord inNumPixels); + +/** + @brief Converts a single 10-bit YCbCr 'v210' raster line to 8-bit YCbCr '2vuy'. + @param[in] pInSrcLine_v210 Specifies a valid, non-NULL address of the first byte of the 'v210' + raster line to be converted. + @param[out] pOutDstLine_2vuy Specifies a valid, non-NULL address of the first byte of the '2vuy' + raster line to receive the converted data. + @param[in] inNumPixels The number of pixels to be converted. + @return True if successful; otherwise false. +**/ +AJAExport bool ConvertLine_v210_to_2vuy (const ULWord * pInSrcLine_v210, UByte * pOutDstLine_2vuy, const ULWord inNumPixels); + +/** + @brief Converts a single 10-bit YCbCr 'v210' raster line to 8-bit YCbCr '2vuy' vector. + @param[in] pInSrcLine_v210 Specifies a valid, non-NULL address of the first byte of the 'v210' raster line to be converted. + @param[out] outDstLine2vuy Receives the 8-bit '2vuy' vector. Will be cleared upon entry and filled upon exit. + @param[in] inNumPixels The number of pixels to be converted. + @return True if successful; otherwise false. +**/ +AJAExport bool ConvertLine_v210_to_2vuy (const void * pInSrcLine_v210, std::vector & outDstLine2vuy, const ULWord inNumPixels); + +/** + @brief Converts a single 8-bit ABGR raster line to 10-bit ABGR (from NTV2_FBF_ABGR to NTV2_FBF_10BIT_RGB ). + @param[in] pInSrcLine_8bitABGR Specifies a valid, non-NULL address of the first byte of the 8-bit ABGR raster line to be converted. + @param[out] pOutDstLine_10BitABGR Specifies a valid, non-NULL address of the first byte of the 10-bit ABGR raster line to receive the converted data. + @param[in] inNumPixels The number of pixels to be converted. + @return True if successful; otherwise false. +**/ +AJAExport bool ConvertLine_8bitABGR_to_10bitABGR (const UByte * pInSrcLine_8bitABGR, ULWord * pOutDstLine_10BitABGR, const ULWord inNumPixels); + +/** + @brief Converts a single 8-bit ABGR raster line to 10-bit RGB DPX (from NTV2_FBF_ABGR to NTV2_FBF_10BIT_DPX ). + @param[in] pInSrcLine_8bitABGR Specifies a valid, non-NULL address of the first byte of the 8-bit ABGR raster line to be converted. + @param[out] pOutDstLine_10BitDPX Specifies a valid, non-NULL address of the first byte of the 10-bit RGB DPX raster line to receive the converted data. + @param[in] inNumPixels The number of pixels to be converted. + @return True if successful; otherwise false. +**/ +AJAExport bool ConvertLine_8bitABGR_to_10bitRGBDPX (const UByte * pInSrcLine_8bitABGR, ULWord * pOutDstLine_10BitDPX, const ULWord inNumPixels); + +/** + @brief Converts a single 8-bit ABGR raster line to 10-bit RGB DPX (from NTV2_FBF_ABGR to NTV2_FBF_10BIT_DPX_LE ). + @param[in] pInSrcLine_8bitABGR Specifies a valid, non-NULL address of the first byte of the 8-bit ABGR raster line to be converted. + @param[out] pOutDstLine_10BitDPXLE Specifies a valid, non-NULL address of the first byte of the 10-bit RGB DPX LE raster line to receive the converted data. + @param[in] inNumPixels The number of pixels to be converted. + @return True if successful; otherwise false. +**/ +AJAExport bool ConvertLine_8bitABGR_to_10bitRGBDPXLE (const UByte * pInSrcLine_8bitABGR, ULWord * pOutDstLine_10BitDPXLE, const ULWord inNumPixels); + +/** + @brief Converts a single 8-bit ABGR raster line to 24-bit RGB (from NTV2_FBF_ABGR to NTV2_FBF_24BIT_RGB ). + @param[in] pInSrcLine_8bitABGR Specifies a valid, non-NULL address of the first byte of the 8-bit ABGR raster line to be converted. + @param[out] pOutDstLine_24BitRGB Specifies a valid, non-NULL address of the first byte of the 24-bit RGB raster line to receive the converted data. + @param[in] inNumPixels The number of pixels to be converted. + @return True if successful; otherwise false. +**/ +AJAExport bool ConvertLine_8bitABGR_to_24bitRGB (const UByte * pInSrcLine_8bitABGR, UByte * pOutDstLine_24BitRGB, const ULWord inNumPixels); + +/** + @brief Converts a single 8-bit ABGR raster line to 24-bit BGR (from NTV2_FBF_ABGR to NTV2_FBF_24BIT_BGR ). + @param[in] pInSrcLine_8bitABGR Specifies a valid, non-NULL address of the first byte of the 8-bit ABGR raster line to be converted. + @param[out] pOutDstLine_24BitBGR Specifies a valid, non-NULL address of the first byte of the 24-bit BGR raster line to receive the converted data. + @param[in] inNumPixels The number of pixels to be converted. + @return True if successful; otherwise false. +**/ +AJAExport bool ConvertLine_8bitABGR_to_24bitBGR (const UByte * pInSrcLine_8bitABGR, UByte * pOutDstLine_24BitBGR, const ULWord inNumPixels); + +/** + @brief Converts a single 8-bit ABGR raster line to 48-bit RGB (from NTV2_FBF_ABGR to NTV2_FBF_48BIT_RGB ). + @param[in] pInSrcLine_8bitABGR Specifies a valid, non-NULL address of the first byte of the 8-bit ABGR raster line to be converted. + @param[out] pOutDstLine_48BitRGB Specifies a valid, non-NULL address of the first byte of the 48-bit RGB raster line to receive the converted data. + @param[in] inNumPixels The number of pixels to be converted. + @return True if successful; otherwise false. +**/ +AJAExport bool ConvertLine_8bitABGR_to_48bitRGB (const UByte * pInSrcLine_8bitABGR, ULWord * pOutDstLine_48BitRGB, const ULWord inNumPixels); + + +// ConvertLineToYCbCr422 +// 8 Bit +AJAExport void ConvertLineToYCbCr422 (RGBAlphaPixel * RGBLine, + UByte * YCbCrLine, + LWord numPixels , + LWord startPixel, + bool fUseSDMatrix); + +// ConvertLineToYCbCr422 +// 10 Bit +AJAExport void ConvertLineToYCbCr422 (RGBAlphaPixel * RGBLine, + UWord * YCbCrLine, + LWord numPixels, + LWord startPixel, + bool fUseSDMatrix); + +// ConvertLinetoRGB +// 8 Bit Version +AJAExport void ConvertLinetoRGB (UByte * ycbcrBuffer, + RGBAlphaPixel * rgbaBuffer , + ULWord numPixels, + bool fUseSDMatrix, + bool fUseSMPTERange = false); + +// ConvertLinetoRGB +// 10 Bit Version +AJAExport void ConvertLinetoRGB (UWord * ycbcrBuffer, + RGBAlphaPixel * rgbaBuffer, + ULWord numPixels, + bool fUseSDMatrix, + bool fUseSMPTERange = false, + bool fAlphaFromLuma = false); + +// ConvertLineto10BitRGB +// 10 Bit YCbCr and 10 Bit RGB Version +AJAExport void ConvertLineto10BitRGB (UWord * ycbcrBuffer, + RGBAlpha10BitPixel * rgbaBuffer, + ULWord numPixels, + bool fUseSDMatrix, + bool fUseSMPTERange = false); +// ConvertLineto10BitYCbCrA +// 10 Bit YCbCr to 10 Bit YCbCrA +AJAExport void ConvertLineto10BitYCbCrA (const UWord * pInYCbCrBuffer, + ULWord * pOutYCbCrABuffer, + const ULWord inNumPixels); + +// ConvertRGBLineto10BitRGB +// 8 Bit RGB and 10 Bit RGB Version +AJAExport void ConvertRGBLineto10BitRGB (const RGBAlphaPixel * pInRGBA8Buffer, + RGBAlpha10BitPixel * pOutRGBA10Buffer, + const ULWord inNumPixels); + +// ConvertRGBALineToRGB +// 8 bit RGBA to 8 bit RGB (RGB24) +// Conversion is done into the same buffer +AJAExport void ConvertRGBALineToRGB (RGBAlphaPixel * rgbaBuffer, + ULWord numPixels); + +// ConvertRGBALineToBGR +// 8 bit RGBA to 8 bit BGR (BGR24) +// Conversion is done into the same buffer +AJAExport void ConvertRGBALineToBGR (RGBAlphaPixel * rgbaBuffer, + ULWord numPixels); + +// ConvertLineto10BitRGB +// 8 Bit RGBA to and 10 Bit RGB Packed Version +AJAExport void ConvertLineto10BitRGB (const RGBAlphaPixel * pInRGBA8Buffer, + ULWord * pOutRGB10BitBuffer, + ULWord inNumPixels); + +// ConvertLineto8BitYCbCr +// 10 Bit YCbCr to 8 Bit YCbCr +AJAExport void ConvertLineto8BitYCbCr (UWord * ycbcr10BitBuffer, + UByte * ycbcr8BitBuffer, + ULWord numPixels); + +// Converts UYVY(2yuv) -> YUY2(yuv2) in place +AJAExport void Convert8BitYCbCrToYUY2 (UByte * ycbcrBuffer, + ULWord numPixels); + +// Converts 8 Bit ARGB 8 Bit RGBA in place +AJAExport void ConvertARGBYCbCrToRGBA (UByte * rgbaBuffer, + ULWord numPixels); + + +// Converts 8 Bit ARGB 8 Bit ABGR in place +AJAExport void ConvertARGBYCbCrToABGR (UByte * rgbaBuffer, + ULWord numPixels); + +// Convert 8 Bit ARGB to 8 bit RGB +AJAExport void ConvertARGBToRGB (UByte * rgbaLineBuffer, + UByte * rgbLineBuffer, + ULWord numPixels); + +// Convert 16 Bit ARGB to 16 bit RGB +AJAExport void Convert16BitARGBTo16BitRGBEx (UWord * rgbaLineBuffer, + UWord * rgbLineBuffer, + ULWord numPixels); + +// Convert 16 Bit ARGB to 16 bit RGB +AJAExport void Convert16BitARGBTo16BitRGB (RGBAlpha16BitPixel * rgbaLineBuffer, + UWord * rgbLineBuffer, + ULWord numPixels); + +// Convert 16 Bit ARGB to 12 bit RGB Packed // New in SDK 15.5 +AJAExport void Convert16BitARGBTo12BitRGBPacked(RGBAlpha16BitPixel *rgbaLineBuffer , + UByte * rgbLineBuffer, + ULWord numPixels); + +// Convert 8 Bit ARGB to 8 bit BGR +AJAExport void ConvertARGBToBGR (const UByte * pInRGBALineBuffer, + UByte * pOutRGBLineBuffer, + const ULWord inNumPixels); + +// ConvertLineto16BitRGB +// 10 Bit YCbCr and 16 Bit RGB Version +AJAExport void ConvertLineto16BitRGB (UWord * ycbcrBuffer, + RGBAlpha16BitPixel * rgbaBuffer, + ULWord numPixels, + bool fUseSDMatrix, + bool fUseSMPTERange = false); + +/* +// ConvertLinetoRGB +// 10 Bit YCbCr Version -> 10 Bit RGB +AJAExport +void ConvertLinetoRGB(UWord * ycbcrBuffer, + RGBAlpha10BitPixel * rgbaBuffer, + ULWord numPixels); +*/ + +// Pack 10 Bit RGBA to 10 Bit RGB Format for our board +AJAExport void PackRGB10BitFor10BitRGB (RGBAlpha10BitPixel * pBuffer, + const ULWord inNumPixels); + +// Pack 10 Bit RGBA to 10 Bit DPX Format for our board +AJAExport void PackRGB10BitFor10BitDPX (RGBAlpha10BitPixel * pBuffer, + const ULWord inNumPixels, + const bool bigEndian = true); + +// Pack 10 Bit RGBA to NTV2_FBF_10BIT_RGB_PACKED Format for our board +AJAExport void PackRGB10BitFor10BitRGBPacked (RGBAlpha10BitPixel * pBuffer, + const ULWord inNumPixels); + + +inline void SDConvertRGBAlphatoYCbCr(RGBAlphaPixel * pSource, YCbCrPixel * pTarget) +{ + LWord Y,Cb,Cr; + + Y = CCIR601_8BIT_BLACK + FixedRound((Fixed_)0x41BC*pSource->Red + + (Fixed_)0x810F*pSource->Green + + (Fixed_)0x1910*pSource->Blue ); + pTarget->y = (UByte)Y; + + Cb = CCIR601_8BIT_CHROMAOFFSET + FixedRound((Fixed_)-0x25F1*pSource->Red - + (Fixed_)0x4A7E*pSource->Green + + (Fixed_)0x7070*pSource->Blue ); + + pTarget->cb = (UByte)Cb; + + Cr = CCIR601_8BIT_CHROMAOFFSET + FixedRound((Fixed_)0x7070*pSource->Red - + (Fixed_)0x5E27*pSource->Green - + (Fixed_)0x1249*pSource->Blue ); + + pTarget->cr = (UByte)Cr; +} + +inline void HDConvertRGBAlphatoYCbCr(RGBAlphaPixel * pSource, YCbCrPixel * pTarget) +{ + LWord Y,Cb,Cr; + + Y = CCIR601_8BIT_BLACK + FixedRound((Fixed_)0x2E8A*pSource->Red + + (Fixed_)0x9C9F*pSource->Green + + (Fixed_)0x0FD2*pSource->Blue ); + pTarget->y = UByte(Y); + + Cb = CCIR601_8BIT_CHROMAOFFSET + FixedRound((Fixed_)-0x18F4*pSource->Red - + (Fixed_)0x545B*pSource->Green + + (Fixed_)0x6DA9*pSource->Blue ); + + pTarget->cb = uint8_t(SByte(Cb)); + + Cr = CCIR601_8BIT_CHROMAOFFSET + FixedRound((Fixed_)0x6D71*pSource->Red - + (Fixed_)0x6305*pSource->Green - + (Fixed_)0x0A06*pSource->Blue ); + + pTarget->cr = uint8_t(SByte(Cr)); +} + + +inline void SDConvertRGBAlphatoYCbCr(const RGBAlphaPixel * pSource, YCbCr10BitPixel * pTarget) +{ + LWord Y,Cb,Cr; + + Y = CCIR601_10BIT_BLACK + (((Fixed_)0x41BC*pSource->Red + + (Fixed_)0x810F*pSource->Green + + (Fixed_)0x1910*pSource->Blue )>>14); + pTarget->y = UWord(Y); + + Cb = CCIR601_10BIT_CHROMAOFFSET + (((Fixed_)-0x25F1*pSource->Red - + (Fixed_)0x4A7E*pSource->Green + + (Fixed_)0x7070*pSource->Blue )>>14); + + pTarget->cb = UWord(Cb&0x3FF); + + Cr = CCIR601_10BIT_CHROMAOFFSET + (((Fixed_)0x7070*pSource->Red - + (Fixed_)0x5E27*pSource->Green - + (Fixed_)0x1249*pSource->Blue )>>14); + + pTarget->cr = UWord(Cr&0x3FF); +} + +inline void HDConvertRGBAlphatoYCbCr(const RGBAlphaPixel * pSource, YCbCr10BitPixel * pTarget) +{ + LWord Y,Cb,Cr; + + Y = CCIR601_10BIT_BLACK + (((Fixed_)0x2E8A*pSource->Red + + (Fixed_)0x9C9F*pSource->Green + + (Fixed_)0x0FD2*pSource->Blue )>>14); + pTarget->y = (UWord)Y; + + Cb = CCIR601_10BIT_CHROMAOFFSET + (((Fixed_)-0x18F4*pSource->Red - + (Fixed_)0x545B*pSource->Green + + (Fixed_)0x6DA9*pSource->Blue )>>14); + + pTarget->cb = UWord(Cb&0x3FF); + + Cr = CCIR601_10BIT_CHROMAOFFSET + (((Fixed_)0x6D71*pSource->Red - + (Fixed_)0x6305*pSource->Green - + (Fixed_)0x0A06*pSource->Blue )>>14); + + pTarget->cr = UWord(Cr&0x3FF); +} + +inline void SDConvertYCbCrtoRGB(YCbCrAlphaPixel *pSource, + RGBAlphaPixel *pTarget) +{ + LWord Red,Green,Blue; + Fixed_ ConvertedY; + + ConvertedY = 0x12A15*((LWord)pSource->y - CCIR601_8BIT_BLACK); + + Red = FixedRound(ConvertedY + + 0x19895*((LWord)(pSource->cr-CCIR601_8BIT_CHROMAOFFSET))); + + pTarget->Red = (UByte)ClipRGB_8BIT(Red); + + Blue = FixedRound(ConvertedY + + 0x20469*((LWord)(pSource->cb-CCIR601_8BIT_CHROMAOFFSET) )); + + pTarget->Blue = (UByte)ClipRGB_8BIT(Blue); + + Green = FixedRound(ConvertedY - + 0x644A*((LWord)(pSource->cb-CCIR601_8BIT_CHROMAOFFSET) ) - + 0xD01F*((LWord)(pSource->cr-CCIR601_8BIT_CHROMAOFFSET) )); + + pTarget->Green = (UByte)ClipRGB_8BIT(Green); + + pTarget->Alpha = pSource->Alpha; +} + +inline void SDConvert10BitYCbCrtoRGB(const YCbCr10BitAlphaPixel *pSource, + RGBAlphaPixel *pTarget) +{ + LWord Red,Green,Blue; + Fixed_ ConvertedY; + + ConvertedY = 0x4A86*((LWord)pSource->y - CCIR601_10BIT_BLACK); + + Red = FixedRound(ConvertedY + + 0x6626*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET))); + + pTarget->Red = (UByte)ClipRGB_8BIT(Red); + + Blue = FixedRound(ConvertedY + + 0x811B*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) )); + + pTarget->Blue = (UByte)ClipRGB_8BIT(Blue); + + Green = FixedRound(ConvertedY - + 0x1913*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) ) - + 0x3408*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET) )); + + pTarget->Green = (UByte)ClipRGB_8BIT(Green); + + pTarget->Alpha = (UByte)pSource->Alpha; +} + +inline void HDConvertYCbCrtoRGB(YCbCrAlphaPixel *pSource, + RGBAlphaPixel *pTarget) +{ + LWord Red,Green,Blue; + Fixed_ ConvertedY; + + ConvertedY = 0x12ACF*((LWord)pSource->y - CCIR601_8BIT_BLACK); + + Red = FixedRound(ConvertedY + + 0x1DF71*((LWord)(pSource->cr-CCIR601_8BIT_CHROMAOFFSET))); + + pTarget->Red = (UByte)ClipRGB_8BIT(Red); + + Blue = FixedRound(ConvertedY + + 0x22A86*((LWord)(pSource->cb-CCIR601_8BIT_CHROMAOFFSET) )); + + pTarget->Blue = (UByte)ClipRGB_8BIT(Blue); + + Green = FixedRound(ConvertedY - + 0x3806*((LWord)(pSource->cb-CCIR601_8BIT_CHROMAOFFSET) ) - + 0x8C32*((LWord)(pSource->cr-CCIR601_8BIT_CHROMAOFFSET) )); + + pTarget->Green = (UByte)ClipRGB_8BIT(Green); + + pTarget->Alpha = pSource->Alpha; +} + +inline void HDConvert10BitYCbCrtoRGB(const YCbCr10BitAlphaPixel *pSource, + RGBAlphaPixel *pTarget) +{ + LWord Red,Green,Blue; + Fixed_ ConvertedY; + + ConvertedY = (0x12ACF>>2)*((LWord)pSource->y - CCIR601_10BIT_BLACK); + + Red = FixedRound(ConvertedY + + (0x1DF71>>2)*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET))); + + pTarget->Red = (UByte)ClipRGB_8BIT(Red); + + Blue = FixedRound(ConvertedY + + (0x22A86>>2)*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) )); + + pTarget->Blue = (UByte)ClipRGB_8BIT(Blue); + + Green = FixedRound(ConvertedY - + (0x3806>>2)*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) ) - + (0x8C32>>2)*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET) )); + + pTarget->Green = (UByte)ClipRGB_8BIT(Green); + + pTarget->Alpha = (UByte)pSource->Alpha; +} + + +inline void SDConvert10BitYCbCrto10BitRGB(YCbCr10BitAlphaPixel *pSource, + RGBAlpha10BitPixel *pTarget) +{ + LWord Red,Green,Blue; + Fixed_ ConvertedY; + + ConvertedY = 0x12A15*((LWord)pSource->y - CCIR601_10BIT_BLACK); + + Red = FixedRound(ConvertedY + + 0x19895*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET))); + + pTarget->Red = (UWord)ClipRGB_10BIT(Red); + + Blue = FixedRound(ConvertedY + + 0x20469*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) )); + + pTarget->Blue = (UWord)ClipRGB_10BIT(Blue); + + Green = FixedRound(ConvertedY - + 0x644A*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) ) - + 0xD01F*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET) )); + + pTarget->Green = (UWord)ClipRGB_10BIT(Green); + + pTarget->Alpha = pSource->Alpha; +} + +inline void HDConvert10BitYCbCrto10BitRGB(YCbCr10BitAlphaPixel *pSource, + RGBAlpha10BitPixel *pTarget) +{ + LWord Red,Green,Blue; + Fixed_ ConvertedY; + + ConvertedY = 0x12ACF*((LWord)pSource->y - CCIR601_10BIT_BLACK); + + Red = FixedRound(ConvertedY + + 0x1DF71*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET))); + + pTarget->Red = (UWord)ClipRGB_10BIT(Red); + + Blue = FixedRound(ConvertedY + + 0x22A86*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) )); + + pTarget->Blue = (UWord)ClipRGB_10BIT(Blue); + + Green = FixedRound(ConvertedY - + 0x3806*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) ) - + 0x8C32*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET) )); + + pTarget->Green = (UWord)ClipRGB_10BIT(Green); + + pTarget->Alpha = pSource->Alpha; +} + +// KAM - start +inline void SDConvert10BitYCbCrto16BitRGB(YCbCr10BitAlphaPixel *pSource, + RGBAlpha16BitPixel *pTarget) +{ + ULWord Red,Green,Blue; + Fixed_ ConvertedY; + + ConvertedY = 0x12A15*((LWord)pSource->y - CCIR601_10BIT_BLACK); + + Red = ULWord(FixedRound(ConvertedY + + 0x19895*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET)))); + + //Red = Red<<4; // only 12 bits used, put them in the MSB + pTarget->Red = (UWord)ClipRGB_16BIT(Red<<6); // TBD: fix coefficents instead + + Blue = ULWord(FixedRound(ConvertedY + + 0x20469*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) ))); + + //Blue = Blue<<4; // only 12 bits used, put them in the MSB + pTarget->Blue = (UWord)ClipRGB_16BIT(Blue<<6); // TBD: fix coefficents instead + + Green = ULWord(FixedRound(ConvertedY - + 0x644A*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) ) - + 0xD01F*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET) ))); + + //Green = Green<<4; // only 12 bits used, put them in the MSB + pTarget->Green = (UWord)ClipRGB_16BIT(Green<<6); // TBD: fix coefficents instead + + // TBD: shift alpha??? + pTarget->Alpha = pSource->Alpha; +} + +inline void HDConvert10BitYCbCrto16BitRGB(YCbCr10BitAlphaPixel *pSource, + RGBAlpha16BitPixel *pTarget) +{ + ULWord Red,Green,Blue; + Fixed_ ConvertedY; + + ConvertedY = 0x12ACF*((LWord)pSource->y - CCIR601_10BIT_BLACK); + + Red = ULWord(FixedRound(ConvertedY + + 0x1DF71*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET)))); + + //Red = Red<<4; // only 12 bits used, put them in the MSB + pTarget->Red = (UWord)ClipRGB_16BIT(Red); // TBD: fix coefficents instead + + Blue = ULWord(FixedRound(ConvertedY + + 0x22A86*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) ))); + + //Blue = Blue<<4; // only 12 bits used, put them in the MSB + pTarget->Blue = (UWord)ClipRGB_16BIT(Blue); // TBD: fix coefficents instead + + Green = ULWord(FixedRound(ConvertedY - + 0x3806*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET) ) - + 0x8C32*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET) ))); + + //Green = Green<<4; // only 12 bits used, put them in the MSB + pTarget->Green = (UWord)ClipRGB_16BIT(Green); // TBD: fix coefficents instead + + // TBD: shift alpha??? + pTarget->Alpha = pSource->Alpha; +} + +inline void SDConvertYCbCrtoRGBSmpte(YCbCrAlphaPixel *pSource, + RGBAlphaPixel *pTarget) +{ + LWord Red,Green,Blue; + Fixed_ ConvertedY; + + ConvertedY = 0xFF40*((LWord)pSource->y - CCIR601_8BIT_BLACK); + + Red = FixedRound(ConvertedY + + 0x15DDF*((LWord)(pSource->cr-CCIR601_8BIT_CHROMAOFFSET))) + CCIR601_8BIT_BLACK; + + pTarget->Red = (UByte)ClipRGB_8BIT(Red); + + Blue = FixedRound(ConvertedY + + 0x1BA34*((LWord)(pSource->cb-CCIR601_8BIT_CHROMAOFFSET))) + CCIR601_8BIT_BLACK; + + pTarget->Blue = (UByte)ClipRGB_8BIT(Blue); + + Green = FixedRound(ConvertedY - + 0x55E1*((LWord)(pSource->cb-CCIR601_8BIT_CHROMAOFFSET)) - + 0xB237*((LWord)(pSource->cr-CCIR601_8BIT_CHROMAOFFSET))) + CCIR601_8BIT_BLACK; + + pTarget->Green = (UByte)ClipRGB_8BIT(Green); + + pTarget->Alpha = pSource->Alpha; +} + +inline void SDConvert10BitYCbCrtoRGBSmpte(YCbCr10BitAlphaPixel *pSource, + RGBAlphaPixel *pTarget) +{ + LWord Red,Green,Blue; + Fixed_ ConvertedY; + + ConvertedY = 0x3FD1*((LWord)pSource->y - CCIR601_10BIT_BLACK); + + Red = FixedRound(ConvertedY + + 0x5778*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET))) + CCIR601_8BIT_BLACK; + + pTarget->Red = (UByte)ClipRGB_8BIT(Red); + + Blue = FixedRound(ConvertedY + + 0x6E8E*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET))) + CCIR601_8BIT_BLACK; + + pTarget->Blue = (UByte)ClipRGB_8BIT(Blue); + + Green = FixedRound(ConvertedY - + 0x1579*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET)) - + 0x2C8E*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET))) + CCIR601_8BIT_BLACK; + + pTarget->Green = (UByte)ClipRGB_8BIT(Green); + + pTarget->Alpha = (UByte)pSource->Alpha; +} + +inline void HDConvertYCbCrtoRGBSmpte(YCbCrAlphaPixel *pSource, + RGBAlphaPixel *pTarget) +{ + LWord Red,Green,Blue; + Fixed_ ConvertedY; + + ConvertedY = 0xFFDF*((LWord)pSource->y - CCIR601_8BIT_BLACK); + + Red = FixedRound(ConvertedY + + 0x19A8C*((LWord)(pSource->cr-CCIR601_8BIT_CHROMAOFFSET))) + CCIR601_8BIT_BLACK; + + pTarget->Red = (UByte)ClipRGB_8BIT(Red); + + Blue = FixedRound(ConvertedY + + 0x1DAD7*((LWord)(pSource->cb-CCIR601_8BIT_CHROMAOFFSET))) + CCIR601_8BIT_BLACK; + + pTarget->Blue = (UByte)ClipRGB_8BIT(Blue); + + Green = FixedRound(ConvertedY - + 0x2FF9*((LWord)(pSource->cb-CCIR601_8BIT_CHROMAOFFSET)) - + 0x780D*((LWord)(pSource->cr-CCIR601_8BIT_CHROMAOFFSET))) + CCIR601_8BIT_BLACK; + + pTarget->Green = (UByte)ClipRGB_8BIT(Green); + + pTarget->Alpha = pSource->Alpha; +} + +inline void HDConvert10BitYCbCrtoRGBSmpte(YCbCr10BitAlphaPixel *pSource, + RGBAlphaPixel *pTarget) +{ + LWord Red,Green,Blue; + Fixed_ ConvertedY; + + ConvertedY = (0xFFDF>>2)*((LWord)pSource->y - CCIR601_10BIT_BLACK); + + Red = FixedRound(ConvertedY + + (0x19A8C>>2)*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET))) + CCIR601_8BIT_BLACK; + + pTarget->Red = (UByte)ClipRGB_8BIT(Red); + + Blue = FixedRound(ConvertedY + + (0x1DAD7>>2)*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET))) + CCIR601_8BIT_BLACK; + + pTarget->Blue = (UByte)ClipRGB_8BIT(Blue); + + Green = FixedRound(ConvertedY - + (0x2FF9>>2)*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET)) - + (0x780D>>2)*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET))) + CCIR601_8BIT_BLACK; + + pTarget->Green = (UByte)ClipRGB_8BIT(Green); + + pTarget->Alpha = (UByte)pSource->Alpha; +} + + +inline void SDConvert10BitYCbCrto10BitRGBSmpte(YCbCr10BitAlphaPixel *pSource, + RGBAlpha10BitPixel *pTarget) +{ + LWord Red,Green,Blue; + Fixed_ ConvertedY; + + ConvertedY = 0xFF40*((LWord)pSource->y - CCIR601_10BIT_BLACK); + + Red = FixedRound(ConvertedY + + 0x15DDF*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET))) + CCIR601_10BIT_BLACK; + + pTarget->Red = (UWord)ClipRGB_10BIT(Red); + + Blue = FixedRound(ConvertedY + + 0x1BA34*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET))) + CCIR601_10BIT_BLACK; + + pTarget->Blue = (UWord)ClipRGB_10BIT(Blue); + + Green = FixedRound(ConvertedY - + 0x55E1*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET)) - + 0xB237*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET))) + CCIR601_10BIT_BLACK; + + pTarget->Green = (UWord)ClipRGB_10BIT(Green); + + pTarget->Alpha = pSource->Alpha; +} + +inline void HDConvert10BitYCbCrto10BitRGBSmpte(YCbCr10BitAlphaPixel *pSource, + RGBAlpha10BitPixel *pTarget) +{ + LWord Red,Green,Blue; + Fixed_ ConvertedY; + + ConvertedY = 0xFFDF*((LWord)pSource->y - CCIR601_10BIT_BLACK); + + Red = FixedRound(ConvertedY + + 0x19A8C*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET))) + CCIR601_10BIT_BLACK; + + pTarget->Red = (UWord)ClipRGB_10BIT(Red); + + Blue = FixedRound(ConvertedY + + 0x1DAD7*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET))) + CCIR601_10BIT_BLACK; + + pTarget->Blue = (UWord)ClipRGB_10BIT(Blue); + + Green = FixedRound(ConvertedY - + 0x2FF9*((LWord)(pSource->cb-CCIR601_10BIT_CHROMAOFFSET)) - + 0x780D*((LWord)(pSource->cr-CCIR601_10BIT_CHROMAOFFSET))) + CCIR601_10BIT_BLACK; + + pTarget->Green = (UWord)ClipRGB_10BIT(Green); + + pTarget->Alpha = pSource->Alpha; +} + +#endif // NTV2TRANSCODE_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2tshelper.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2tshelper.h new file mode 100644 index 0000000..45125d1 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2tshelper.h @@ -0,0 +1,818 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2tshelper.h + @brief Declares Transport Stream helper classes. + @copyright (C) 2008-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2TSHELPER_H +#define NTV2TSHELPER_H + +#include +#include + +#define KIPDPRINT 0 + +#if defined(MSWindows) + + #if (KIPDPRINT==0) + // no log + #define kipdprintf(...) + + #elif (KIPDPRINT==1) + // printf + #include + #define kipdprintf(...) printf(__VA_ARGS__) + + #endif + +#elif defined(AJALinux) + + #if (KIPDPRINT==0) + // no log + #define kipdprintf(...) + + #elif (KIPDPRINT==1) + // printf + #include + #define kipdprintf(...) printf(__VA_ARGS__) + + #endif + +#elif defined(AJAMac) + + #if (KIPDPRINT==0) + // no log + #define kipdprintf(_format_...) + + #elif (KIPDPRINT==1) + // printf + #include + #define kipdprintf(_format_...) printf(_format_) + #endif + +#endif + + +typedef enum +{ + kJ2KStreamTypeStandard, + kJ2KStreamTypeNonElsm +} J2KStreamType; + +typedef enum +{ + kJ2KChromaSubSamp_444, + kJ2KChromaSubSamp_422_444, + kJ2KChromaSubSamp_422_Standard +} J2KChromaSubSampling; + +typedef enum +{ + kJ2KCodeBlocksize_32x32, + kJ2KCodeBlocksize_32x64, + kJ2KCodeBlocksize_64x32 = 4, + kJ2KCodeBlocksize_64x64, + kJ2KCodeBlocksize_128x32 = 12 +} J2KCodeBlocksize; + +typedef enum +{ + kTsEncapTypeJ2k, + kTsEncapTypePcr, + kTsEncapTypeAes +} TsEncapType; + +typedef struct TsEncapStreamData +{ + J2KStreamType j2kStreamType; + uint32_t width; + uint32_t height; + uint32_t denFrameRate; + uint32_t numFrameRate; + uint32_t numAudioChannels; + uint32_t programPid; + uint32_t videoPid; + uint32_t pcrPid; + uint32_t audio1Pid; + bool interlaced; +} TsEncapStreamData; + + +typedef struct TsVideoStreamData +{ + J2KStreamType j2kStreamType; + uint32_t width; + uint32_t height; + uint32_t denFrameRate; + uint32_t numFrameRate; + uint32_t numAudioChannels; + bool interlaced; +} TsVideoStreamData; + +class TSGenerator +{ + public: + // Input + uint16_t _tsId; + uint8_t _version; + uint32_t _tableLength; + TsEncapType _tsEncapType; + + // Generated packet + uint8_t _pkt8[188]; + uint32_t _pkt32[188]; + + public: + TSGenerator() + { + init(); + initPacket(); + } + + ~TSGenerator() + { + } + + void init() + { + _tsId = 1; + _version = 1; + _tableLength = 0; + _tsEncapType = kTsEncapTypeJ2k; + } + + void initPacket() + { + for ( int i = 0; i < 188; i++ ) + { + _pkt8[i] = 0xff; + _pkt32[i] = 0xffff; + } + } + + uint32_t chksum_crc32(unsigned char *data, int len) + { + uint32_t crc_table[256] = + { + 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, + 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, + 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7, + 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, + 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, + 0x709f7b7a, 0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, + 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58, 0xbaea46ef, + 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, + 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb, + 0xceb42022, 0xca753d95, 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, + 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0, + 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, + 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4, + 0x0808d07d, 0x0cc9cdca, 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, + 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08, + 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, + 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc, + 0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, + 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, 0xe0b41de7, 0xe4750050, + 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, + 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, + 0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, + 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, 0x4f040d56, 0x4bc510e1, + 0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, + 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, + 0x3f9b762c, 0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, + 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, 0xf12f560e, 0xf5ee4bb9, + 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, + 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, + 0xcda1f604, 0xc960ebb3, 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, + 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71, + 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3, + 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2, + 0x470cdd2b, 0x43cdc09c, 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, + 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e, + 0x18197087, 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, + 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a, + 0x2d15ebe3, 0x29d4f654, 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, + 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, 0xe3a1cbc1, 0xe760d676, + 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, + 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, + 0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, + 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 + }; + + int32_t i; + uint32_t crc = 0xffffffff; + + for (i=0; i> 24) ^ *data++) & 0xff]; + + return crc; + } + + void dump8() + { + for (uint32_t i=0; i<_tableLength; i++) + { + if (i % 16 == 15) { + kipdprintf("0x%02x\n", _pkt8[i]); + } else { + kipdprintf("0x%02x, ", _pkt8[i]); + } + } + kipdprintf("\n\n"); + } + + void dump32() + { + for (uint32_t i=0; i<_tableLength; i++) + { + if (i % 16 == 15) { + kipdprintf("0x%04x\n", _pkt32[i]); + } else { + kipdprintf("0x%04x ", _pkt32[i]); + } + } + kipdprintf("\n\n"); + } + + protected: + void put16( uint16_t val, int &pos ) + { + _pkt8[pos++] = (uint8_t)(val>>8); + _pkt8[pos++] = (uint8_t)val; + } + + void put32( uint32_t val, int &pos ) + { + _pkt8[pos++] = (uint8_t)(val>>24); + _pkt8[pos++] = (uint8_t)(val>>16); + _pkt8[pos++] = (uint8_t)(val>>8); + _pkt8[pos++] = (uint8_t)val; + } +}; + +class PESGen : public TSGenerator +{ +public: + TsVideoStreamData _videoStreamData; + std::map _elemNumToPID; + uint64_t _pts; // these can be passed in and will be initialized to reaonsable values + int32_t _auf1; + int32_t _auf2; + uint32_t _bitRate; + int32_t _ptsOffset; // theses values are filled in by the generator + int32_t _j2kTsOffset; + int32_t _auf1Offset; + int32_t _auf2Offset; + int32_t _hh; + int32_t _mm; + int32_t _ss; + int32_t _ff; + + +public: + PESGen() + { + initLocal(); + } + + ~PESGen() + { + } + + void initLocal() + { + _elemNumToPID.clear(); + _pts = 0; + _auf1 = 0; + _auf2 = 0; + _bitRate = 75000000; + _hh = 0; + _mm = 0; + _ss = 0; + _ff = 0; + } + + int makePacket() + { + initPacket(); + int pos = 0; + _ptsOffset = 0xff; // For non-elsm streams these are all 0xff + _j2kTsOffset = 0xff; // for standard streams they will be filled in accordingly + _auf1Offset = 0xff; + _auf2Offset = 0xff; + + // Header + _pkt8[pos++] = 0x47; // sync byte + _pkt8[pos] = 1<<6; // payload unit start indicator + _pkt8[pos++] |= (uint8_t) ((_elemNumToPID[1] >> 8) & 0x1f); // PID for Video + _pkt8[pos++] = (uint8_t) (_elemNumToPID[1] & 0xff); // PID for Video + _pkt8[pos++] = 0x10; // Continuity Counter must increment when transmitted + + // generate PES data for AES streams + if (_tsEncapType == kTsEncapTypeAes) + { + _pkt8[pos++] = 0; // packet_start_code_prefix + _pkt8[pos++] = 0; + _pkt8[pos++] = (uint8_t) (1 & 0xff); + _pkt8[pos++] = (uint8_t) (0xbd); + + _pkt8[pos++] = 0; // (packet_length >> 8) & 0xff + _pkt8[pos++] = 0; // packet_length & 0xff + _pkt8[pos++] = 0x80; // alignment + _pkt8[pos++] = 0x80; // 11 + _pkt8[pos++] = 5; // 12 + + _ptsOffset = pos; + + _pkt8[pos] = 0x21; // 13 + _pkt8[pos++] |= (uint8_t) ((_pts >> 29) & 0xe); + _pkt8[pos] = 0x0; // 14 + _pkt8[pos++] |= (uint8_t) ((_pts >> 22) & 0xff); + _pkt8[pos] = 0x1; // 15 + _pkt8[pos++] |= (uint8_t) ((_pts >> 14) & 0xfe); + _pkt8[pos] = 0x0; // 16 + _pkt8[pos++] |= (uint8_t) ((_pts >> 7) & 0xff); + _pkt8[pos] = 0x1; // 17 + _pkt8[pos++] |= (uint8_t) ((_pts << 1) & 0xfe); + + _pkt8[pos++] = 0x0; // 18 + _pkt8[pos++] = 0x0; + + // These two bytes are defined in Table 1 of ST302 spec starting with num channels + if (_videoStreamData.j2kStreamType == kJ2KStreamTypeStandard) + { + _pkt8[pos++] = 0x0; // 2 channels, 6 bits of channel ID + _pkt8[pos++] = 0x10; // two bits of channel ID, 20 bits per sample, alignment 0 reserved + } + else + { + _pkt8[pos++] = 0x0; // 2 channels, 6 bits of channel ID + _pkt8[pos++] = 0x20; // two bits of channel ID, 24 bits per sample, alignment 0 reserved + } + + _auf1Offset = 0x1000012; + _auf2Offset = 0x1000c08; + + } + else + { + // generate PES data for standard streams, for non-elsm just do the header + if (_videoStreamData.j2kStreamType == kJ2KStreamTypeStandard) + { + _pkt8[pos++] = 0; // packet_start_code_prefix + _pkt8[pos++] = 0; + _pkt8[pos++] = (uint8_t) (1 & 0xff); + _pkt8[pos++] = (uint8_t) (0xbd); + + _pkt8[pos++] = 0; // (packet_length >> 8) & 0xff + _pkt8[pos++] = 0; // packet_length & 0xff + _pkt8[pos++] = 0x84; // alignment + _pkt8[pos++] = 0x80; // 11 + _pkt8[pos++] = 5; // 12 + + _ptsOffset = pos; + + _pkt8[pos] = 0x21; // 13 + _pkt8[pos++] |= (uint8_t) ((_pts >> 29) & 0xe); + _pkt8[pos] = 0x0; // 14 + _pkt8[pos++] |= (uint8_t) ((_pts >> 22) & 0xff); + _pkt8[pos] = 0x1; // 15 + _pkt8[pos++] |= (uint8_t) ((_pts >> 14) & 0xfe); + _pkt8[pos] = 0x0; // 16 + _pkt8[pos++] |= (uint8_t) ((_pts >> 7) & 0xff); + _pkt8[pos] = 0x1; // 17 + _pkt8[pos++] |= (uint8_t) ((_pts << 1) & 0xfe); + + _pkt8[pos++] = 0x65; // "e" + _pkt8[pos++] = 0x6c; // "l" + _pkt8[pos++] = 0x73; // "s" + _pkt8[pos++] = 0x6D; // "m" + + _pkt8[pos++] = 0x66; // "f" + _pkt8[pos++] = 0x72; // "r" + _pkt8[pos++] = 0x61; // "a" + _pkt8[pos++] = 0x74; // "t" + + _pkt8[pos++] = (uint8_t) ((_videoStreamData.denFrameRate >> 8) & 0xff); + _pkt8[pos++] = (uint8_t) (_videoStreamData.denFrameRate & 0xff); + _pkt8[pos++] = (uint8_t) ((_videoStreamData.numFrameRate >> 8) & 0xff); + _pkt8[pos++] = (uint8_t) (_videoStreamData.numFrameRate & 0xff); + + _pkt8[pos++] = 0x62; // "b" + _pkt8[pos++] = 0x72; // "r" + _pkt8[pos++] = 0x61; // "a" + _pkt8[pos++] = 0x74; // "t" + + _pkt8[pos++] = (uint8_t) (_bitRate >> 24); // 34 + _pkt8[pos++] = (uint8_t) ((_bitRate >> 16) & 0xff); + _pkt8[pos++] = (uint8_t) ((_bitRate >> 8) & 0xff); + _pkt8[pos++] = (uint8_t) (_bitRate & 0xff); + + _auf1Offset = pos; + + _pkt8[pos++] = (uint8_t) (_auf1 >> 24); // 38 + _pkt8[pos++] = (uint8_t) ((_auf1 >> 16) & 0xff); + _pkt8[pos++] = (uint8_t) ((_auf1 >> 8) & 0xff); + _pkt8[pos++] = (uint8_t) (_auf1 & 0xff); + + if (_videoStreamData.interlaced) + { + _auf2Offset = pos; + + _pkt8[pos++] = (uint8_t) (_auf2 >> 24); // 42 + _pkt8[pos++] = (uint8_t) ((_auf2 >> 16) & 0xff); + _pkt8[pos++] = (uint8_t) ((_auf2 >> 8) & 0xff); + _pkt8[pos++] = (uint8_t) (_auf2 & 0xff); + + _pkt8[pos++] = 0x66; // "f" + _pkt8[pos++] = 0x69; // "i" + _pkt8[pos++] = 0x65; // "e" + _pkt8[pos++] = 0x6c; // "l" + + _pkt8[pos++] = (uint8_t) (2 & 0xff); + _pkt8[pos++] = (uint8_t) (1 & 0xff); + + _pkt8[pos++] = 0x74; // "t" + _pkt8[pos++] = 0x63; // "c" + _pkt8[pos++] = 0x6f; // "o" + _pkt8[pos++] = 0x64; // "d" + + _j2kTsOffset = pos; + _pkt8[pos++] = (uint8_t) (_hh & 0xff); + _pkt8[pos++] = (uint8_t) (_mm & 0xff); + _pkt8[pos++] = (uint8_t) (_ss & 0xff); + _pkt8[pos++] = (uint8_t) (_ff & 0xff); + + _pkt8[pos++] = 0x62; // "b" + _pkt8[pos++] = 0x63; // "c" + _pkt8[pos++] = 0x6f; // "o" + _pkt8[pos++] = 0x6c; // "l" + + _pkt8[pos++] = 3; + _pkt8[pos++] = 0x0; + } + else + { + _pkt8[pos++] = 0x74; // "t" + _pkt8[pos++] = 0x63; // "c" + _pkt8[pos++] = 0x6f; // "o" + _pkt8[pos++] = 0x64; // "d" + + _j2kTsOffset = pos; + _pkt8[pos++] = (uint8_t) (0 & 0xff); // hh + _pkt8[pos++] = (uint8_t) (0 & 0xff); // mm + _pkt8[pos++] = (uint8_t) (0 & 0xff); // ss + _pkt8[pos++] = (uint8_t) (0 & 0xff); // ff + + _pkt8[pos++] = 0x62; // "b" + _pkt8[pos++] = 0x63; // "c" + _pkt8[pos++] = 0x6f; // "o" + _pkt8[pos++] = 0x6c; // "l" + + _pkt8[pos++] = 3; + _pkt8[pos++] = 0xff; + } + } + } + + _tableLength = pos; + return pos; + } + + int32_t calcPatPmtPeriod() + { + double d1, d2; + + // Next PAT / PMT Transmission Rate + d2 = 1.0 / 125000000; // Clock Period + d1 = 90e-3 / d2 - 1.0; + return (int32_t) d1; + } +}; + +class PATGen : public TSGenerator +{ + public: + // Input + std::map _progNumToPID; + + public: + PATGen() + { + initLocal(); + } + + ~PATGen() + { + } + + void initLocal() + { + _progNumToPID.clear(); + } + + int makePacket() + { + initPacket(); + int pos = 0; + + // Header + _pkt8[pos++] = 0x47; // sync byte + _pkt8[pos++] = 1<<6; // payload unit start indicator + _pkt8[pos++] = 0; // PID for PAT = 0 + _pkt8[pos++] = 0x10; // Continuity Counter must increment when transmitted + _pkt8[pos++] = 0; // pointer + + int crcStart = pos; + + _pkt8[pos++] = 0; // table id = 0 + + int length = 9 + (4 * (int)_progNumToPID.size()); + put16( (uint16_t)0xb000 + (length & 0x3ff), pos); // syntax indicator, reserved, length + put16( _tsId, pos ); + + _pkt8[pos++] = 0xc1 + ((_version & 0x1f)<< 1); // version, current/next + put16( 0, pos ); // section number = last section number = 0 + + std::map ::const_iterator it = _progNumToPID.begin(); + while (it != _progNumToPID.end()) + { + put16( it->first, pos ); + put16( (uint16_t)0xe000 + (it->second & 0x1fff), pos ); + it++; + } + int crcEnd = pos - 1; + + int crc = chksum_crc32(_pkt8 + crcStart, crcEnd - crcStart + 1 ); + put32( crc, pos ); + + _tableLength = pos; + return pos; + } +}; + +class PMTGen : public TSGenerator +{ + public: + TsVideoStreamData _videoStreamData; + std::map _progNumToPID; + std::map _pcrNumToPID; + std::map _videoNumToPID; + std::map _audioNumToPID; + + public: + PMTGen() + { + initLocal(); + } + + ~PMTGen() + { + } + + void initLocal() + { + _progNumToPID.clear(); + _pcrNumToPID.clear(); + _videoNumToPID.clear(); + _audioNumToPID.clear(); + } + + int makePacket() + { + initPacket(); + int pos = 0; + int len, lengthPos, j2kLengthPos, audioLengthPos; + + // Header + _pkt8[pos++] = 0x47; // sync byte + _pkt8[pos] = 1<<6; // payload unit start indicator + _pkt8[pos++] |= (uint8_t) ((_progNumToPID[1] >> 8) & 0x1f); // PID for PMT + _pkt8[pos++] = (uint8_t) (_progNumToPID[1] & 0xff); // PID for PMT + _pkt8[pos++] = 0x10; // Continuity Counter must increment when transmitted + _pkt8[pos++] = 0; // pointer + + int crcStart = pos; + + _pkt8[pos++] = 2; // table id = 0 + lengthPos = pos; // need to come back and fill in length so save position (assume < 256) + _pkt8[pos++] = 0xb0; + pos++; + + put16(0x01, pos); // program number + + _pkt8[pos++] = 0xc1 + ((_version & 0x1f)<< 1); // version, current/next + put16( 0, pos ); // section number = last section number = 0 + + _pkt8[pos] = 0xe0; // PCR pid and reserved bits + _pkt8[pos++] |= (uint8_t) ((_pcrNumToPID[1] >> 8) & 0x1f); + _pkt8[pos++] = (uint8_t) (_pcrNumToPID[1] & 0xff); + + _pkt8[pos++] = 0xf0; // reserved bits and program info length + _pkt8[pos++] = 0x00; // reserved bits and program info length + + // Do the streams + + if (_videoNumToPID[1] != 0) + { + // J2K + _pkt8[pos++] = 0x21; // J2K Type + _pkt8[pos] = 0xe0; // elementary pid and reserved bits + _pkt8[pos++] |= (uint8_t) ((_videoNumToPID[1] >> 8) & 0x1f); + _pkt8[pos++] = (uint8_t) (_videoNumToPID[1] & 0xff); + + j2kLengthPos = pos; // need to come back and fill in descriptor length so save position + pos+=2; + + len = makeJ2kDescriptor(pos); // generate the J2K descriptor + + _pkt8[j2kLengthPos] = 0xf0; // fill in the length and reserved bits now + _pkt8[j2kLengthPos++] |= (uint8_t) ((len >> 8) & 0x1f); + _pkt8[j2kLengthPos] = (uint8_t) (len & 0xff); + } + + if ((_audioNumToPID[1] != 0) && (_videoStreamData.numAudioChannels != 0)) + { + // Audio + _pkt8[pos++] = 0x06; // Audio Type + _pkt8[pos] = 0xe0; // audio pid and reserved bits + _pkt8[pos++] |= (uint8_t) ((_audioNumToPID[1] >> 8) & 0x1f); + _pkt8[pos++] = (uint8_t) (_audioNumToPID[1] & 0xff); + + audioLengthPos = pos; // need to come back and fill in descriptor length so save position + pos+=2; + + len = makeAudioDescriptor(pos); // generate the audio descriptor + + _pkt8[audioLengthPos] = 0xf0; // fill in the length and reserved bits now + _pkt8[audioLengthPos++] |= (uint8_t) ((len >> 8) & 0x1f); + _pkt8[audioLengthPos] = (uint8_t) (len & 0xff); + } + + // now we know the length so fill that in + _pkt8[lengthPos] = 0xb0; + _pkt8[lengthPos++] |= (uint8_t) (((pos-crcStart+1) >> 8) & 0x1f); + _pkt8[lengthPos] = (uint8_t) ((pos-crcStart+1) & 0xff); + + int crcEnd = pos - 1; + + int crc = chksum_crc32(_pkt8 + crcStart, crcEnd - crcStart + 1 ); + put32( crc, pos ); + + _tableLength = pos; + return pos; + } + + int makeJ2kDescriptor(int &pos) + { + int startPos = pos; + uint32_t profileLevel; + uint32_t maxBitRate; + uint32_t height; + + if (_videoStreamData.j2kStreamType == kJ2KStreamTypeStandard) + { + profileLevel = 0x102; + maxBitRate = 160000000; + } + else + { + profileLevel = 0x101; + maxBitRate = 213000000; + } + + if (_videoStreamData.interlaced) height = _videoStreamData.height/2; + else height = _videoStreamData.height; + + // Header + _pkt8[pos++] = 0x32; // descriptor tag + _pkt8[pos++] = 24; // descriptor length + put16( profileLevel, pos ); // profile level + + if (_videoStreamData.j2kStreamType == kJ2KStreamTypeStandard) + { + // Standard stream + put32( _videoStreamData.width, pos ); // width + put32( height, pos ); // height + put32( maxBitRate, pos ); // max bit rate + put32( 1250000, pos ); // max buffer size (constant for now) + put16( _videoStreamData.denFrameRate, pos ); // frame rate + put16( _videoStreamData.numFrameRate, pos ); + _pkt8[pos++] = 3; // color spec + _pkt8[pos] = _videoStreamData.interlaced <<6; // interlaced and still mode + _pkt8[pos++] |= 0x3F; // reserved bits all 1's for standard streams + } + else + { + // Non-elsm stream + put16( 0x0100, pos ); + put16( _videoStreamData.width, pos ); // width + put16( height, pos ); // height + if (_videoStreamData.interlaced) + put16( height, pos ); // height again for interlaced + else + put16( 0, pos ); // otherwise nothing + put32( maxBitRate, pos ); // max bit rate (constant for now) + _pkt8[pos++] = 0; + _pkt8[pos++] = 0; + _pkt8[pos++] = 0x05; + _pkt8[pos++] = 0x33; + put16( _videoStreamData.denFrameRate, pos ); // frame rate + put16( _videoStreamData.numFrameRate, pos ); + _pkt8[pos++] = 0; + _pkt8[pos++] = 0; + } + + return pos-startPos; + } + + int makeAudioDescriptor(int &pos) + { + int startPos = pos; + // Header + _pkt8[pos++] = 0x0a; // descriptor tag + _pkt8[pos++] = 4; // descriptor length + _pkt8[pos++] = 0x45; // "E" + _pkt8[pos++] = 0x4e; // "N" + _pkt8[pos++] = 0x47; // "G" + _pkt8[pos++] = 0; + + _pkt8[pos++] = 0x05; // descriptor tag + if (_videoStreamData.j2kStreamType == kJ2KStreamTypeNonElsm) + _pkt8[pos++] = 6; // length non-elsm + else + _pkt8[pos++] = 4; // length standard stream (omitted ST302 channel spec) + + _pkt8[pos++] = 0x42; // "B" + _pkt8[pos++] = 0x53; // "S" + _pkt8[pos++] = 0x53; // "S" + _pkt8[pos++] = 0x44; // "D" + + // These two bytes are defined in Table 1 of ST302 spec starting with num channels, we dont add these for standard streams + if (_videoStreamData.j2kStreamType == kJ2KStreamTypeNonElsm) + { + _pkt8[pos++] = (_videoStreamData.numAudioChannels/2) - 1; // number of audio pairs (0 is 1 pair of audio), 6 bits of channel ID + _pkt8[pos++] = 0x20; // two bits of channel ID, 24 bits per sample, alignment 0 reserved + } + + return pos-startPos; + } +}; + +class ADPGen : public TSGenerator +{ +public: + std::map _elemNumToPID; + +public: + ADPGen() + { + initLocal(); + } + + ~ADPGen() + { + } + + void initLocal() + { + _elemNumToPID.clear(); + } + + int makePacket() + { + initPacket(); + int pos = 0; + + // Header + _pkt32[pos++] = 0x47; // sync byte + _pkt32[pos++] = ((_elemNumToPID[1] >> 8) & 0x1f); // PID for stream + _pkt32[pos++] = (_elemNumToPID[1] & 0xff); + + if (_tsEncapType == kTsEncapTypePcr) + { + _pkt32[pos++] = (2 << 4); // Continuity Counter must increment when transmitted + _pkt32[pos++] = 0; // pointer + _pkt32[pos++] = 0x10; // pointer + + _pkt32[pos++] = 0x800; // PCR + _pkt32[pos++] = 0x900; + _pkt32[pos++] = 0xa00; + _pkt32[pos++] = 0xb00; + _pkt32[pos++] = 0xc00; + _pkt32[pos++] = 0xd00; + } + else + { + _pkt32[pos++] = (3 << 4); // Continuity Counter must increment when transmitted + _pkt32[pos++] = 0; // pointer + _pkt32[pos++] = 0; // pointer + } + + _tableLength = pos; + return pos; + } +}; + +#endif diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2utf8.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2utf8.h new file mode 100644 index 0000000..98e9f96 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2utf8.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2utf8.h + @brief Declares the bare-bones UTF8 support functions (for the nub). + @copyright (C) 2008-2021 AJA Video Systems, Inc. +**/ + +#ifndef __NTV2UTF8_H +#define __NTV2UTF8_H + +#include "ajatypes.h" // for NTV2_NUB_CLIENT_SUPPORT +#include "ajaexport.h" + +#if defined (NTV2_NUB_CLIENT_SUPPORT) + AJAExport bool map_utf8_to_codepage437(const char *src, int u8_len, unsigned char *cp437equiv); + AJAExport void strncpyasutf8(char *dest, const char *src, int dest_buf_size); + AJAExport void strncpyasutf8_map_cp437(char *dest, const char *src, int dest_buf_size); +#endif // defined (NTV2_NUB_CLIENT_SUPPORT) + +#endif // __NTV2UTF8_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2utils.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2utils.h new file mode 100644 index 0000000..a00af5d --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2utils.h @@ -0,0 +1,1137 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2utils.h + @brief Declares numerous NTV2 utility functions. + @copyright (C) 2004-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2UTILS_H +#define NTV2UTILS_H + +#include "ajaexport.h" +#include "ajatypes.h" +#include "ntv2enums.h" +#include "ntv2videodefines.h" +#include "ntv2publicinterface.h" +#include "ntv2formatdescriptor.h" +#include "ntv2m31publicinterface.h" +#include "ntv2signalrouter.h" +#include +#include +#include +#if defined (AJALinux) + #include +#endif + +#define Enum2Str(e) {e, #e}, +////////////////////////////////////////////////////// +// BEGIN SECTION MOVED FROM 'videoutilities.h' +////////////////////////////////////////////////////// +#define DEFAULT_PATT_GAIN 0.9 // some patterns pay attention to this... +#define HD_NUMCOMPONENTPIXELS_2K 2048 +#define HD_NUMCOMPONENTPIXELS_1080_2K 2048 +#define HD_NUMCOMPONENTPIXELS_1080 1920 + +#define CCIR601_10BIT_BLACK 64 +#define CCIR601_10BIT_WHITE 940 +#define CCIR601_10BIT_CHROMAOFFSET 512 + +#define CCIR601_8BIT_BLACK 16 +#define CCIR601_8BIT_WHITE 235 +#define CCIR601_8BIT_CHROMAOFFSET 128 + +// line pitch is in bytes. +#define FRAME_0_BASE (0x0) +#define FRAME_1080_10BIT_LINEPITCH (1280*4) +#define FRAME_1080_8BIT_LINEPITCH (1920*2) +#define FRAME_QUADHD_10BIT_SIZE (FRAME_1080_10BIT_LINEPITCH*2160) +#define FRAME_QUADHD_8BIT_SIZE (FRAME_1080_8BIT_LINEPITCH*2160) +#define FRAME_BASE(__frameNum__,__frameSize__) ((__frameNum__)*(__frameSize__)) + +AJAExport NTV2_SHOULD_BE_DEPRECATED(uint32_t CalcRowBytesForFormat (const NTV2FrameBufferFormat inPF, const uint32_t pixWidth)); ///< @deprecated This function doesn't support planar pixel formats. Use ::NTV2FormatDescriptor instead. +AJAExport void UnPack10BitYCbCrBuffer (uint32_t* packedBuffer, uint16_t* ycbcrBuffer, uint32_t numPixels); +AJAExport void PackTo10BitYCbCrBuffer (const uint16_t *ycbcrBuffer, uint32_t *packedBuffer, const uint32_t numPixels); +AJAExport void MakeUnPacked10BitYCbCrBuffer (uint16_t* buffer, uint16_t Y , uint16_t Cb , uint16_t Cr,uint32_t numPixels); +AJAExport void ConvertLineTo8BitYCbCr (const uint16_t * ycbcr10BitBuffer, uint8_t * ycbcr8BitBuffer, const uint32_t numPixels); +AJAExport void ConvertUnpacked10BitYCbCrToPixelFormat (uint16_t *unPackedBuffer, uint32_t *packedBuffer, uint32_t numPixels, NTV2FrameBufferFormat pixelFormat, + bool bUseSmpteRange=false, bool bAlphaFromLuma=false); +AJAExport void MaskUnPacked10BitYCbCrBuffer (uint16_t* ycbcrUnPackedBuffer, uint16_t signalMask , uint32_t numPixels); +AJAExport void StackQuadrants (uint8_t* pSrc, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcRowBytes, uint8_t* pDst); +AJAExport void CopyFromQuadrant (uint8_t* srcBuffer, uint32_t srcHeight, uint32_t srcRowBytes, uint32_t srcQuadrant, uint8_t* dstBuffer, uint32_t quad13Offset=0); +AJAExport void CopyToQuadrant (uint8_t* srcBuffer, uint32_t srcHeight, uint32_t srcRowBytes, uint32_t dstQuadrant, uint8_t* dstBuffer, uint32_t quad13Offset=0); +////////////////////////////////////////////////////// +// END SECTION MOVED FROM 'videoutilities.h' +////////////////////////////////////////////////////// + +/** + @brief Unpacks a line of NTV2_FBF_10BIT_YCBCR video into 16-bit-per-component YUV data. + @param[in] pIn10BitYUVLine A valid, non-NULL pointer to the start of the line that contains the NTV2_FBF_10BIT_YCBCR data + to be converted. + @param[out] out16BitYUVLine Receives the unpacked 16-bit-per-component YUV data. The sequence is cleared before filling. + The UWord sequence will be Cb0, Y0, Cr0, Y1, Cb1, Y2, Cr1, Y3, Cb2, Y4, Cr2, Y5, . . . + @param[in] inNumPixels Specifies the width of the line to be converted, in pixels. + @return True if successful; otherwise false. +**/ +AJAExport bool UnpackLine_10BitYUVtoUWordSequence (const void * pIn10BitYUVLine, UWordSequence & out16BitYUVLine, ULWord inNumPixels); + +/** + @brief Packs a line of 16-bit-per-component YCbCr (NTV2_FBF_10BIT_YCBCR) video into 10-bit-per-component YCbCr data. + @param[in] in16BitYUVLine The UWordSequence that contains the 16-bit-per-component YUV data to be converted into + 10-bit-per-component YUV. + @param[out] pOut10BitYUVLine A valid, non-NULL pointer to the output buffer to receive the packed 10-bit-per-component YUV data. + @param[in] inNumPixels Specifies the width of the line to be converted, in pixels. + @return True if successful; otherwise false. +**/ +AJAExport bool PackLine_UWordSequenceTo10BitYUV (const UWordSequence & in16BitYUVLine, ULWord * pOut10BitYUVLine, const ULWord inNumPixels); + +/** + @brief Packs up to one raster line of uint16_t YUV components into an NTV2_FBF_10BIT_YCBCR frame buffer. + @param[in] inYCbCrLine The YUV components to be packed into the frame buffer. This must contain at least 12 values. + @param inFrameBuffer The frame buffer in host memory that is to be modified. + @param[in] inDescriptor The NTV2FormatDescriptor that describes the frame buffer. + @param[in] inLineOffset The zero-based line offset into the frame buffer where the packed components will be written. + @return True if successful; otherwise false. + @note Neighboring components in the packed output will be corrupted if input component values exceed 0x3FF. + @note This is a safer version of the ::PackLine_UWordSequenceTo10BitYUV function. +**/ +AJAExport bool YUVComponentsTo10BitYUVPackedBuffer (const std::vector & inYCbCrLine, NTV2_POINTER & inFrameBuffer, + const NTV2FormatDescriptor & inDescriptor, const UWord inLineOffset); + +/** + @brief Unpacks up to one raster line of an NTV2_FBF_10BIT_YCBCR frame buffer into an array of uint16_t values + containing the 10-bit YUV data. + @param[out] outYCbCrLine The YUV components unpacked from the frame buffer. This will be cleared upon entry, and + if successful, will contain at least 12 values upon exit. + @param inFrameBuffer The frame buffer in host memory that is to be read. + @param[in] inDescriptor The NTV2FormatDescriptor that describes the frame buffer. + @param[in] inLineOffset The zero-based line offset into the frame buffer. + @return True if successful; otherwise false. + @note This is a safer version of the ::UnpackLine_10BitYUVtoUWordSequence function. +**/ +AJAExport bool UnpackLine_10BitYUVtoU16s (std::vector & outYCbCrLine, const NTV2_POINTER & inFrameBuffer, + const NTV2FormatDescriptor & inDescriptor, const UWord inLineOffset); + + +#if !defined (NTV2_DEPRECATE) + AJAExport NTV2_DEPRECATED_f(void UnPackLineData (const ULWord * pIn10BitYUVLine, UWord * pOut16BitYUVLine, const ULWord inNumPixels)); ///< @deprecated Replaced by UnpackLine_10BitYUVto16BitYUV. + AJAExport NTV2_DEPRECATED_f(void PackLineData (const UWord * pIn16BitYUVLine, ULWord * pOut10BitYUVLine, const ULWord inNumPixels)); ///< @deprecated Replaced by PackLine_16BitYUVto10BitYUV. +#endif // NTV2_DEPRECATE + +/** + @brief Unpacks a line of 10-bit-per-component YCbCr video into 16-bit-per-component YCbCr (NTV2_FBF_10BIT_YCBCR) data. + @param[in] pIn10BitYUVLine A valid, non-NULL pointer to the input buffer that contains the packed 10-bit-per-component YUV data + to be converted into 16-bit-per-component YUV. + @param[out] pOut16BitYUVLine A valid, non-NULL pointer to the output buffer to receive the unpacked 16-bit-per-component YUV data. + @param[in] inNumPixels Specifies the width of the line to be converted, in pixels. +**/ +AJAExport void UnpackLine_10BitYUVto16BitYUV (const ULWord * pIn10BitYUVLine, UWord * pOut16BitYUVLine, const ULWord inNumPixels); + +/** + @brief Packs a line of 16-bit-per-component YCbCr (NTV2_FBF_10BIT_YCBCR) video into 10-bit-per-component YCbCr data. + @param[in] pIn16BitYUVLine A valid, non-NULL pointer to the input buffer that contains the 16-bit-per-component YUV data to be + converted into 10-bit-per-component YUV. + @param[out] pOut10BitYUVLine A valid, non-NULL pointer to the output buffer to receive the packed 10-bit-per-component YUV data. + @param[in] inNumPixels Specifies the width of the line to be converted, in pixels. +**/ +AJAExport void PackLine_16BitYUVto10BitYUV (const UWord * pIn16BitYUVLine, ULWord * pOut10BitYUVLine, const ULWord inNumPixels); + +AJAExport void RePackLineDataForYCbCrDPX (ULWord *packedycbcrLine, ULWord numULWords); +AJAExport void UnPack10BitDPXtoRGBAlpha10BitPixel (RGBAlpha10BitPixel* rgba10BitBuffer, const ULWord * DPXLinebuffer, ULWord numPixels, bool bigEndian); +AJAExport void UnPack10BitDPXtoForRP215withEndianSwap(UWord* rawrp215Buffer,ULWord* DPXLinebuffer ,ULWord numPixels); +AJAExport void UnPack10BitDPXtoForRP215(UWord* rawrp215Buffer,ULWord* DPXLinebuffer ,ULWord numPixels); +AJAExport void MaskYCbCrLine(UWord* ycbcrLine, UWord signalMask , ULWord numPixels); + +/** + @brief Writes a line of unpacked 10-bit Y/C legal SMPTE black values into the given UWord buffer. + @param[in] pOutLineData A valid, non-NULL pointer to the destination UWord buffer. + @param[in] inNumPixels Specifies the width of the line, in pixels. Defaults to 1920. + @warning This function performs no error checking. Memory corruption will occur if the destination buffer + is smaller than 4 x inNumPixels bytes (i.e. smaller than 2 x inNumPixels UWords). +**/ +AJAExport void Make10BitBlackLine (UWord * pOutLineData, const ULWord inNumPixels = 1920); + +AJAExport void Make10BitWhiteLine(UWord* pOutLineData, const ULWord numPixels=1920); +#if !defined(NTV2_DEPRECATE_13_0) + AJAExport NTV2_DEPRECATED_f(void Fill10BitYCbCrVideoFrame (PULWord _baseVideoAddress, + const NTV2Standard inStandard, + const NTV2FrameBufferFormat inPixelFormat, + const YCbCr10BitPixel inPixelColor, + const bool inVancEnabled = false, + const bool in2Kx1080 = false, + const bool inWideVANC = false)); ///< @deprecated Use the identical function that accepts an ::NTV2VANCMode parameter instead of two booleans. +#endif // !defined(NTV2_DEPRECATE_13_0) +/** + @return True if successful; otherwise false. +**/ +AJAExport bool Fill10BitYCbCrVideoFrame (void * pBaseVideoAddress, + const NTV2Standard inStandard, + const NTV2FrameBufferFormat inPixelFormat, + const YCbCr10BitPixel inPixelColor, + const NTV2VANCMode inVancMode = NTV2_VANCMODE_OFF); + +AJAExport void Make8BitBlackLine(UByte* lineData,ULWord numPixels=1920,NTV2FrameBufferFormat=NTV2_FBF_8BIT_YCBCR); +AJAExport void Make8BitWhiteLine(UByte* lineData,ULWord numPixels=1920,NTV2FrameBufferFormat=NTV2_FBF_8BIT_YCBCR); +AJAExport void Make10BitLine(UWord* lineData, const UWord Y, const UWord Cb, const UWord Cr, const ULWord numPixels = 1920); +AJAExport void Make8BitLine(UByte* lineData, UByte Y , UByte Cb , UByte Cr,ULWord numPixels=1920,NTV2FrameBufferFormat=NTV2_FBF_8BIT_YCBCR); +#if !defined(NTV2_DEPRECATE_13_0) + AJAExport NTV2_DEPRECATED_f(void Fill8BitYCbCrVideoFrame (PULWord _baseVideoAddress, + const NTV2Standard inStandard, + const NTV2FrameBufferFormat inFBF, + const YCbCrPixel inPixelColor, + const bool inVancEnabled = false, + const bool in2Kx1080 = false, + const bool inWideVanc = false)); ///< @deprecated Use the identical function that accepts an ::NTV2VANCMode parameter instead of two booleans. +#endif // !defined(NTV2_DEPRECATE_13_0) +AJAExport bool Fill8BitYCbCrVideoFrame (void * pBaseVideoAddress, const NTV2Standard inStandard, const NTV2FrameBufferFormat inFBF, + const YCbCrPixel inPixelColor, const NTV2VANCMode inVancMode = NTV2_VANCMODE_OFF); +AJAExport void Fill4k8BitYCbCrVideoFrame(PULWord _baseVideoAddress, + NTV2FrameBufferFormat frameBufferFormat, + YCbCrPixel color, + bool vancEnabled=false, + bool b4k=false, + bool wideVANC=false); +AJAExport void CopyRGBAImageToFrame(ULWord* pSrcBuffer, ULWord srcHeight, ULWord srcWidth, + ULWord* pDstBuffer, ULWord dstHeight, ULWord dstWidth); + +/** + @brief Sets all or part of a destination raster image to legal black. + @param[in] inPixelFormat Specifies the NTV2FrameBufferFormat of the destination buffer. + (Note that many pixel formats are not currently supported.) + @param pDstBuffer Specifies the address of the destination buffer to be modified. Must be non-NULL. + @param[in] inDstBytesPerLine The number of bytes per raster line of the destination buffer. Note that this value + is used to compute the maximum pixel width of the destination raster. Also note that + some pixel formats set constraints on this value (e.g., NTV2_FBF_10BIT_YCBCR requires + this be a multiple of 16, while NTV2_FBF_8BIT_YCBCR requires an even number). + Must exceed zero. + @param[in] inDstTotalLines The total number of raster lines to set to legal black. Must exceed zero. + @bug Need implementations for NTV2_FBF_8BIT_YCBCR_YUY2, NTV2_FBF_10BIT_DPX, NTV2_FBF_10BIT_YCBCR_DPX, NTV2_FBF_24BIT_RGB, + NTV2_FBF_24BIT_BGR, NTV2_FBF_10BIT_YCBCRA, NTV2_FBF_10BIT_DPX_LE, NTV2_FBF_48BIT_RGB, NTV2_FBF_10BIT_RGB_PACKED, + NTV2_FBF_10BIT_ARGB, NTV2_FBF_16BIT_ARGB, the 3-plane planar formats NTV2_FBF_8BIT_YCBCR_420PL3, + NTV2_FBF_8BIT_YCBCR_422PL3, NTV2_FBF_10BIT_YCBCR_420PL3_LE, and NTV2_FBF_10BIT_YCBCR_422PL3_LE, plus the 2-plane + planar formats NTV2_FBF_10BIT_YCBCR_420PL2, NTV2_FBF_10BIT_YCBCR_422PL2, NTV2_FBF_8BIT_YCBCR_420PL2, and + NTV2_FBF_8BIT_YCBCR_422PL2. + @return True if successful; otherwise false. +**/ +AJAExport bool SetRasterLinesBlack (const NTV2FrameBufferFormat inPixelFormat, + UByte * pDstBuffer, + const ULWord inDstBytesPerLine, + const UWord inDstTotalLines); + +/** + @brief Copies all or part of a source raster image into another raster at a given position. + @param[in] inPixelFormat Specifies the NTV2FrameBufferFormat of both the destination and source buffers. + (Note that many pixel formats are not currently supported.) + @param pDstBuffer Specifies the starting address of the destination buffer to be modified. Must be non-NULL. + @param[in] inDstBytesPerLine The number of bytes per raster line of the destination buffer. Note that this value + is used to compute the maximum pixel width of the destination raster. Also note that + some pixel formats set constraints on this value (e.g., NTV2_FBF_10BIT_YCBCR requires + this be a multiple of 16, while NTV2_FBF_8BIT_YCBCR requires an even number). + Must exceed zero. + @param[in] inDstTotalLines The maximum height of the destination buffer, in raster lines. Must exceed zero. + @param[in] inDstVertLineOffset Specifies the vertical line offset into the destination raster where the top edge + of the source image will appear. This value must be less than the inDstTotalLines + value (i.e., at least one line of the source must appear in the destination). + @param[in] inDstHorzPixelOffset Specifies the horizontal pixel offset into the destination raster where the left + edge of the source image will appear. This value must be less than the maximum + width of the destination raster (as stipulated by the inDstBytesPerLine parameter). + Thus, at least one pixel of the source (the leftmost edge) must appear in the destination + (at the right edge). Note that some pixel formats set constraints on this value (e.g., + NTV2_FBF_10BIT_YCBCR requires this be a multiple of 6, while NTV2_FBF_8BIT_YCBCR requires + this to be even). + @param[in] pSrcBuffer Specifies the starting address of the source buffer to be copied from. Must be non-NULL. + @param[in] inSrcBytesPerLine The number of bytes per raster line of the source buffer. Note that this value is used + to compute the maximum pixel width of the source raster. Also note that some pixel formats + set constraints on this value (e.g., NTV2_FBF_10BIT_YCBCR requires this be a multiple + of 16, while NTV2_FBF_8BIT_YCBCR requires this to be even). Must exceed zero. + @param[in] inSrcTotalLines The maximum height of the source buffer, in raster lines. Must exceed zero. + @param[in] inSrcVertLineOffset Specifies the top edge of the source image to copy. This value must be less than + the inSrcTotalLines value. + @param[in] inSrcVertLinesToCopy Specifies the height of the source image to copy, in lines. This value can be larger + than what's possible. The function guarantees that lines past the bottom edge of the + source raster will not be accessed. It is not an error to specify zero, although + nothing will be copied. + @param[in] inSrcHorzPixelOffset Specifies the left edge of the source image to copy. This value must be less than the + maximum width of the source raster (as stipulated by the inSrcBytesPerLine parameter). + Note that some pixel formats set constraints on this value (e.g., NTV2_FBF_10BIT_YCBCR + requires this be a multiple of 6, while NTV2_FBF_8BIT_YCBCR requires this to be even). + @param[in] inSrcHorzPixelsToCopy Specifies the width of the source image to copy, in pixels. This value can be larger + than what's possible. This function will ensure that pixels past the right edge of the + source raster will not be accessed. It is not an error to specify zero, although nothing + will be copied. Note that some pixel formats set constraints on this value(e.g., + NTV2_FBF_10BIT_YCBCR requires this be a multiple of 6, while NTV2_FBF_8BIT_YCBCR requires + this to be even). + @return True if successful; otherwise false. + @note The source and destination buffers MUST have the same pixel format. + @note The source and destination buffers must NOT point to the same buffer. + @note The use of unsigned values precludes positioning the source raster above the top line of the destination raster, + or to the left of the destination raster's left edge. This function will, however, clip the source raster if it + overhangs the bottom and/or right edge of the destination raster. + @note This function probably can't be made to work with planar formats. + @bug Needs implementations for NTV2_FBF_10BIT_YCBCRA, NTV2_FBF_10BIT_RGB_PACKED, NTV2_FBF_10BIT_ARGB, + NTV2_FBF_16BIT_ARGB. +**/ +AJAExport bool CopyRaster (const NTV2FrameBufferFormat inPixelFormat, + UByte * pDstBuffer, + const ULWord inDstBytesPerLine, + const UWord inDstTotalLines, + const UWord inDstVertLineOffset, + const UWord inDstHorzPixelOffset, + const UByte * pSrcBuffer, + const ULWord inSrcBytesPerLine, + const UWord inSrcTotalLines, + const UWord inSrcVertLineOffset, + const UWord inSrcVertLinesToCopy, + const UWord inSrcHorzPixelOffset, + const UWord inSrcHorzPixelsToCopy); + +AJAExport NTV2Standard GetNTV2StandardFromScanGeometry (const UByte inScanGeometry, const bool inIsProgressiveTransport); + +/** + @return The ::NTV2VideoFormat that is supported by the device (in frame buffer). + @param[in] inVideoFormat Specifies the input ::NTV2VideoFormat of interest. +**/ +AJAExport NTV2VideoFormat GetSupportedNTV2VideoFormatFromInputVideoFormat (const NTV2VideoFormat inVideoFormat); + +/** + @return The ::NTV2Standard that corresponds to the given ::NTV2VideoFormat. + @param[in] inVideoFormat Specifies the ::NTV2VideoFormat of interest. + @see ::GetNTV2FrameGeometryFromVideoFormat, ::GetGeometryFromStandard +**/ +AJAExport NTV2Standard GetNTV2StandardFromVideoFormat (const NTV2VideoFormat inVideoFormat); + +/** + @return The ::NTV2FrameGeometry that corresponds to the given ::NTV2VideoFormat. + @param[in] inVideoFormat Specifies the ::NTV2VideoFormat of interest. + @see ::GetNTV2StandardFromScanGeometry +**/ +AJAExport NTV2FrameGeometry GetNTV2FrameGeometryFromVideoFormat (const NTV2VideoFormat inVideoFormat); + +#if defined (NTV2_DEPRECATE) + #define GetHdmiV2StandardFromVideoFormat(__vf__) ::GetNTV2StandardFromVideoFormat (__vf__) +#else + AJAExport NTV2V2Standard GetHdmiV2StandardFromVideoFormat (NTV2VideoFormat videoFormat); +#endif + +#if !defined(NTV2_DEPRECATE_13_0) + AJAExport NTV2_DEPRECATED_f(ULWord GetVideoActiveSize (const NTV2VideoFormat inVideoFormat, + const NTV2FrameBufferFormat inFBFormat, + const bool inVANCenabled, + const bool inWideVANC = false)); ///< @deprecated Use the same function that accepts an ::NTV2VANCMode instead of two booleans. + AJAExport NTV2_DEPRECATED_f(ULWord GetVideoWriteSize (const NTV2VideoFormat inVideoFormat, + const NTV2FrameBufferFormat inFBFormat, + const bool inVANCenabled, + const bool inWideVANC)); ///< @deprecated Use the same function that accepts an ::NTV2VANCMode instead of two booleans. +#endif // !defined(NTV2_DEPRECATE_13_0) + +/** + @return The minimum number of bytes required to store a single frame of video in the given frame buffer format + having the given video format, including VANC lines, if any. + @param[in] inVideoFormat Specifies the video format. + @param[in] inFBFormat Specifies the frame buffer format. + @param[in] inVancMode Optionally specifies the VANC mode. Defaults to OFF (no VANC lines). +**/ +AJAExport ULWord GetVideoActiveSize (const NTV2VideoFormat inVideoFormat, + const NTV2FrameBufferFormat inFBFormat, + const NTV2VANCMode inVancMode = NTV2_VANCMODE_OFF); + + +/** + @brief Identical to the ::GetVideoActiveSize function, except rounds the result up to the nearest 4K page + size multiple. + @return The number of bytes required to store a single frame of video in the given frame buffer format + having the given video format, including VANC lines, if any, rounded up to the nearest 4096-byte multiple. + @param[in] inVideoFormat Specifies the video format. + @param[in] inFBFormat Specifies the frame buffer format. + @param[in] inVancMode Optionally specifies the VANC mode. Defaults to OFF (no VANC lines). + @details Historically, this "nearest 4K page size" was necessary to get high-speed I/O bursting to work + between the AJA device and the Windows disk system. The file needed to be opened with FILE_FLAG_NO_BUFFERING + to bypass the file system cache. +**/ +AJAExport ULWord GetVideoWriteSize (const NTV2VideoFormat inVideoFormat, + const NTV2FrameBufferFormat inFBFormat, + const NTV2VANCMode inVancMode = NTV2_VANCMODE_OFF); + +AJAExport NTV2VideoFormat GetQuarterSizedVideoFormat (const NTV2VideoFormat inVideoFormat); +AJAExport NTV2VideoFormat GetQuadSizedVideoFormat (const NTV2VideoFormat inVideoFormat, const bool isSquareDivision = true); +AJAExport NTV2FrameGeometry GetQuarterSizedGeometry (const NTV2FrameGeometry inGeometry); +AJAExport NTV2FrameGeometry Get4xSizedGeometry (const NTV2FrameGeometry inGeometry); +AJAExport NTV2Standard GetQuarterSizedStandard (const NTV2Standard inGeometry); +AJAExport NTV2Standard Get4xSizedStandard (const NTV2Standard inGeometry, const bool bIs4k = false); + +AJAExport double GetFramesPerSecond (const NTV2FrameRate inFrameRate); +inline double GetFrameTime (const NTV2FrameRate inFrameRate) {return double(1.0) / GetFramesPerSecond(inFrameRate);} + +/** + @return The first NTV2VideoFormat that matches the given frame rate and raster dimensions (and whether it's interlaced or not). + @param[in] inFrameRate Specifies the frame rate of interest. + @param[in] inHeightLines Specifies the raster height, in lines of visible video. + @param[in] inWidthPixels Specifies the raster width, in pixels. + @param[in] inIsInterlaced Specify true for interlaced/psf video, or false for progressive. + @param[in] inIsLevelB Specify true for level B, or false for everything else. + @param[in] inIsPSF Specify true for segmented format false for everything else. + +**/ +AJAExport NTV2VideoFormat GetFirstMatchingVideoFormat (const NTV2FrameRate inFrameRate, + const UWord inHeightLines, + const UWord inWidthPixels, + const bool inIsInterlaced, + const bool inIsLevelB, + const bool inIsPSF); + +/** + @brief Answers with the given frame rate, in frames per second, as two components: + the numerator and denominator of the fractional rate. + @param[in] inFrameRate Specifies the frame rate of interest. + @param[out] outFractionNumerator Receives the numerator of the fractional frame rate. + This will be zero if the function returns false. + @param[out] outFractionDenominator Receives the denominator of the fractional frame rate. + If the function is successful, this will be either 1000 or 1001. + This will be zero if the function returns false. + @return True if successful; otherwise false. +**/ +AJAExport bool GetFramesPerSecond (const NTV2FrameRate inFrameRate, ULWord & outFractionNumerator, ULWord & outFractionDenominator); + +/** + @param[in] inDevID Specifies the ::NTV2DeviceID of the device of interest. + @param[in] inFR Specifies the ::NTV2FrameRate of interest. + @param[in] inFG Specifies the ::NTV2FrameGeometry of interest. + @param[in] inStd Specifies the ::NTV2Standard of interest. + @deprecated This function is deprecated. + @note The implementation of this function is very inefficient. Do not call it every frame. + @return True if the device having the given NTV2DeviceID supports the given frame rate, geometry and standard. +**/ +AJAExport NTV2_SHOULD_BE_DEPRECATED(bool NTV2DeviceCanDoFormat (const NTV2DeviceID inDevID, const NTV2FrameRate inFR, const NTV2FrameGeometry inFG, const NTV2Standard inStd)); + +/** + @brief Returns the number of audio samples for a given video frame rate, audio sample rate, and frame number. + This is useful since AJA devices use fixed audio sample rates (typically 48KHz), and some video frame + rates will necessarily result in some frames having more audio samples than others. + @param[in] inFrameRate Specifies the video frame rate. + @param[in] inAudioRate Specifies the audio sample rate. Must be one of NTV2_AUDIO_48K or NTV2_AUDIO_96K. + @param[in] inCadenceFrame Optionally specifies a frame number for maintaining proper cadence in a frame sequence, + for those video frame rates that don't accommodate an even number of audio samples. + Defaults to zero. + @param[in] inIsSMPTE372Enabled Specifies that 1080p60, 1080p5994 or 1080p50 is being used. In this mode, the device's + framerate might be NTV2_FRAMERATE_3000, but since 2 links are coming out, the video rate + is effectively NTV2_FRAMERATE_6000. Defaults to false. + @return The number of audio samples. + @see See \ref audiosamplecount +**/ +AJAExport ULWord GetAudioSamplesPerFrame (const NTV2FrameRate inFrameRate, const NTV2AudioRate inAudioRate, ULWord inCadenceFrame = 0, bool inIsSMPTE372Enabled = false); +AJAExport LWord64 GetTotalAudioSamplesFromFrameNbrZeroUpToFrameNbr (NTV2FrameRate frameRate, NTV2AudioRate audioRate, ULWord frameNbrNonInclusive); + +/** + @brief Returns the audio sample rate as a number of audio samples per second. + @param[in] inAudioRate Specifies the audio sample rate. + @return The number of audio samples per second, or zero upon failure. + @see See \ref audiosamplecount +**/ +AJAExport double GetAudioSamplesPerSecond (const NTV2AudioRate inAudioRate); // New in SDK 16.2 + +AJAExport NTV2_SHOULD_BE_DEPRECATED(ULWord GetVaricamRepeatCount (const NTV2FrameRate inSequenceRate, const NTV2FrameRate inPlayRate, const ULWord inCadenceFrame = 0)); +AJAExport ULWord GetScaleFromFrameRate (const NTV2FrameRate inFrameRate); +AJAExport NTV2FrameRate GetFrameRateFromScale (long scale, long duration, NTV2FrameRate playFrameRate); +AJAExport NTV2FrameRate GetNTV2FrameRateFromNumeratorDenominator (const ULWord inNumerator, const ULWord inDenominator); // New in SDK 16.0 + +/** + @return The NTV2FrameRate of the given NTV2VideoFormat. + @param[in] inVideoFormat Specifies the NTV2VideoFormat of interest. + @note This function is physical-transport-centric, so "B" formats will answer with the frame rate + of a single link. For example, ::NTV2_FORMAT_1080p_6000_B will result in ::NTV2_FRAMERATE_3000. + See \ref duallinkoverview for more information. +**/ +AJAExport NTV2FrameRate GetNTV2FrameRateFromVideoFormat (const NTV2VideoFormat inVideoFormat); + +/** + @return The equivalent non-VANC ::NTV2FrameGeometry value for a given ::NTV2FrameGeometry. + @param[in] inFrameGeometry Specifies the ::NTV2FrameGeometry to be normalized into its non-VANC equivalent. + @see ::GetVANCFrameGeometry +**/ +AJAExport NTV2FrameGeometry GetNormalizedFrameGeometry (const NTV2FrameGeometry inFrameGeometry); + +/** + @return The equivalent VANC ::NTV2FrameGeometry value for a given ::NTV2VANCMode. + @param[in] inFrameGeometry Specifies the ::NTV2FrameGeometry to be converted into its VANC equivalent. + @param[in] inVancMode Specifies the desired ::NTV2VANCMode. + @see ::GetNormalizedFrameGeometry +**/ +AJAExport NTV2FrameGeometry GetVANCFrameGeometry (const NTV2FrameGeometry inFrameGeometry, const NTV2VANCMode inVancMode); + +/** + @return The first matching ::NTV2FrameGeometry that matches the given ::NTV2FrameDimensions, + or ::NTV2_FG_INVALID if none match. + @param[in] inFD Specifies the ::NTV2FrameDimensions of interest. +**/ +AJAExport NTV2FrameGeometry GetGeometryFromFrameDimensions (const NTV2FrameDimensions & inFD); // New in SDK 16.0 + +/** + @return True if the given ::NTV2FrameGeometry has tall or taller geometries associated with it; + otherwise false. + @param[in] inFrameGeometry Specifies the ::NTV2FrameGeometry. + @see ::GetVANCFrameGeometry +**/ +AJAExport bool HasVANCGeometries (const NTV2FrameGeometry inFrameGeometry); + +/** + @return An ::NTV2GeometrySet containing normal, tall and (possibly) taller frame geometries + that are associated with the given ::NTV2FrameGeometry; or an empty set if passed + an invalid geometry. + @param[in] inFrameGeometry Specifies the ::NTV2FrameGeometry. (Need not be normalized.) + @note The resulting set will, at the least, contain the given geometry (if valid). + @see ::GetVANCFrameGeometry +**/ +AJAExport NTV2GeometrySet GetRelatedGeometries (const NTV2FrameGeometry inFrameGeometry); + +/** + @return The equivalent NTV2VANCMode for a given ::NTV2FrameGeometry. + @param[in] inFrameGeometry Specifies the ::NTV2FrameGeometry. + @see ::GetVANCFrameGeometry +**/ +AJAExport NTV2VANCMode GetVANCModeForGeometry (const NTV2FrameGeometry inFrameGeometry); + +/** + @return The pixel width of the given ::NTV2FrameGeometry. + @param[in] inFrameGeometry Specifies the ::NTV2FrameGeometry of interest. + @see ::GetVANCFrameGeometry +**/ +AJAExport ULWord GetNTV2FrameGeometryWidth (const NTV2FrameGeometry inFrameGeometry); + +/** + @return The height, in lines, of the given ::NTV2FrameGeometry. + @param[in] inFrameGeometry Specifies the ::NTV2FrameGeometry of interest. + @see ::GetVANCFrameGeometry +**/ +AJAExport ULWord GetNTV2FrameGeometryHeight (const NTV2FrameGeometry inFrameGeometry); + +/** + @return The equivalent normalized (non-VANC) ::NTV2FrameGeometry value for a given ::NTV2Standard. + @param[in] inStandard Specifies the ::NTV2Standard to be converted into a normalized ::NTV2FrameGeometry. +**/ +AJAExport NTV2FrameGeometry GetGeometryFromStandard (const NTV2Standard inStandard); + +/** + @return The equivalent ::NTV2Standard for the given ::NTV2FrameGeometry. + @param[in] inGeometry Specifies the ::NTV2FrameGeometry to be converted into a ::NTV2Standard. + @param[in] inIsProgressive Specifies if the resulting Standard should have a progressive transport or not. + Defaults to true. +**/ +AJAExport NTV2Standard GetStandardFromGeometry (const NTV2FrameGeometry inGeometry, const bool inIsProgressive = true); + +AJAExport ULWord GetDisplayWidth (const NTV2VideoFormat videoFormat); +AJAExport ULWord GetDisplayHeight (const NTV2VideoFormat videoFormat); +AJAExport NTV2ConversionMode GetConversionMode (const NTV2VideoFormat inFormat, const NTV2VideoFormat outFormat); +AJAExport NTV2VideoFormat GetInputForConversionMode (const NTV2ConversionMode conversionMode); +AJAExport NTV2VideoFormat GetOutputForConversionMode (const NTV2ConversionMode conversionMode); + +AJAExport NTV2Channel GetNTV2ChannelForIndex (const ULWord inIndex0); +AJAExport ULWord GetIndexForNTV2Channel (const NTV2Channel inChannel); + +AJAExport NTV2_SHOULD_BE_DEPRECATED(NTV2Crosspoint GetNTV2CrosspointChannelForIndex (const ULWord inIndex0)); +AJAExport NTV2_SHOULD_BE_DEPRECATED(ULWord GetIndexForNTV2CrosspointChannel (const NTV2Crosspoint inChannel)); +AJAExport NTV2_SHOULD_BE_DEPRECATED(NTV2Crosspoint GetNTV2CrosspointInputForIndex (const ULWord inIndex0)); +AJAExport NTV2_SHOULD_BE_DEPRECATED(ULWord GetIndexForNTV2CrosspointInput (const NTV2Crosspoint inChannel)); +AJAExport NTV2_SHOULD_BE_DEPRECATED(NTV2Crosspoint GetNTV2CrosspointForIndex (const ULWord inIndex0)); +AJAExport NTV2_SHOULD_BE_DEPRECATED(ULWord GetIndexForNTV2Crosspoint (const NTV2Crosspoint inChannel)); +AJAExport NTV2_SHOULD_BE_DEPRECATED(bool IsNTV2CrosspointInput (const NTV2Crosspoint inChannel)); +AJAExport NTV2_SHOULD_BE_DEPRECATED(bool IsNTV2CrosspointOutput (const NTV2Crosspoint inChannel)); +AJAExport NTV2_SHOULD_BE_DEPRECATED(std::string NTV2CrosspointToString (const NTV2Crosspoint inChannel)); +AJAExport NTV2_SHOULD_BE_DEPRECATED(NTV2Channel NTV2CrosspointToNTV2Channel (const NTV2Crosspoint inCrosspointChannel)); +AJAExport NTV2_SHOULD_BE_DEPRECATED(NTV2Crosspoint NTV2ChannelToInputCrosspoint (const NTV2Channel inChannel)); +AJAExport NTV2_SHOULD_BE_DEPRECATED(NTV2Crosspoint NTV2ChannelToOutputCrosspoint (const NTV2Channel inChannel)); +AJAExport NTV2_SHOULD_BE_DEPRECATED(NTV2InputSource GetNTV2HDMIInputSourceForIndex (const ULWord inIndex0)); + +AJAExport NTV2VideoFormat GetTransportCompatibleFormat (const NTV2VideoFormat inFormat, const NTV2VideoFormat inTargetFormat); +AJAExport bool IsTransportCompatibleFormat (const NTV2VideoFormat inFormat1, const NTV2VideoFormat inFormat2); + +/** + @return The input source that corresponds to an index value, or ::NTV2_INPUTSOURCE_INVALID upon failure. + @param[in] inIndex0 Specifies the unsigned, zero-based integer value to be converted into an equivalent ::NTV2InputSource. + @param[in] inKinds Optionally specifies the input source type (SDI, HDMI, Analog, etc.) of interest. + Defaults to ::NTV2_INPUTSOURCES_SDI. +**/ +AJAExport NTV2InputSource GetNTV2InputSourceForIndex (const ULWord inIndex0, const NTV2InputSourceKinds inKinds = NTV2_INPUTSOURCES_SDI); +AJAExport ULWord GetIndexForNTV2InputSource (const NTV2InputSource inValue); // 0-based index + +/** + @brief Converts the given ::NTV2Channel value into the equivalent input ::INTERRUPT_ENUMS value. + @param[in] inChannel Specifies the ::NTV2Channel to be converted. + @return The equivalent input ::INTERRUPT_ENUMS value. +**/ +AJAExport INTERRUPT_ENUMS NTV2ChannelToInputInterrupt (const NTV2Channel inChannel); + +/** + @brief Converts the given ::NTV2Channel value into the equivalent output ::INTERRUPT_ENUMS value. + @param[in] inChannel Specifies the ::NTV2Channel to be converted. + @return The equivalent output ::INTERRUPT_ENUMS value. +**/ +AJAExport INTERRUPT_ENUMS NTV2ChannelToOutputInterrupt (const NTV2Channel inChannel); + +/** + @brief Converts the given ::NTV2Channel value into the equivalent ::NTV2TCIndex value. + @param[in] inChannel Specifies the ::NTV2Channel to be converted. + @param[in] inEmbeddedLTC Specify true for embedded LTC. Defaults to false. + @param[in] inIsF2 Specify true for VITC2. Defaults to false. + @return The equivalent ::NTV2TCIndex value. +**/ +AJAExport NTV2TCIndex NTV2ChannelToTimecodeIndex (const NTV2Channel inChannel, const bool inEmbeddedLTC = false, const bool inIsF2 = false); + +/** + @return The NTV2TCIndexes that are associated with the given SDI connector. + @param[in] inSDIConnector The SDI connector of interest, specified as an ::NTV2Channel (a zero-based index number). +**/ +AJAExport NTV2TCIndexes GetTCIndexesForSDIConnector (const NTV2Channel inSDIConnector); + +/** + @brief Converts the given ::NTV2TCIndex value into the appropriate ::NTV2Channel value. + @param[in] inTCIndex Specifies the ::NTV2TCIndex to be converted. + @return The equivalent ::NTV2Channel value. +**/ +AJAExport NTV2Channel NTV2TimecodeIndexToChannel (const NTV2TCIndex inTCIndex); + +/** + @brief Converts the given ::NTV2TCIndex value into the appropriate ::NTV2InputSource value. + @param[in] inTCIndex Specifies the ::NTV2TCIndex to be converted. + @return The equivalent ::NTV2InputSource value. +**/ +AJAExport NTV2InputSource NTV2TimecodeIndexToInputSource (const NTV2TCIndex inTCIndex); + + +#define GetTCIndexesForSDIInput GetTCIndexesForSDIConnector +#define NTV2ChannelToCaptureCrosspoint NTV2ChannelToInputCrosspoint +#define NTV2ChannelToIngestCrosspoint NTV2ChannelToInputCrosspoint +#define NTV2ChannelToInputChannelSpec NTV2ChannelToInputCrosspoint +#define NTV2ChannelToPlayoutCrosspoint NTV2ChannelToOutputCrosspoint +#define NTV2ChannelToOutputChannelSpec NTV2ChannelToOutputCrosspoint + + +/** + @brief Converts the given ::NTV2Framesize value into an exact byte count. + @param[in] inFrameSize Specifies the ::NTV2Framesize to be converted. + @return The equivalent number of bytes. +**/ +AJAExport ULWord NTV2FramesizeToByteCount (const NTV2Framesize inFrameSize); + +/** + @brief Converts the given NTV2BufferSize value into its exact byte count. + @param[in] inBufferSize Specifies the NTV2AudioBufferSize to be converted. + @return The equivalent number of bytes. +**/ +AJAExport ULWord NTV2AudioBufferSizeToByteCount (const NTV2AudioBufferSize inBufferSize); + +/** + @brief Converts the given NTV2Channel value into its equivalent NTV2EmbeddedAudioInput. + @param[in] inChannel Specifies the NTV2Channel to be converted. + @return The equivalent NTV2EmbeddedAudioInput value. +**/ +AJAExport NTV2EmbeddedAudioInput NTV2ChannelToEmbeddedAudioInput (const NTV2Channel inChannel); + +/** + @brief Converts a given NTV2InputSource to its equivalent NTV2EmbeddedAudioInput value. + @param[in] inInputSource Specifies the NTV2InputSource to be converted. + @return The equivalent NTV2EmbeddedAudioInput value. +**/ +AJAExport NTV2EmbeddedAudioInput NTV2InputSourceToEmbeddedAudioInput (const NTV2InputSource inInputSource); + +/** + @param[in] inInputSource Specifies the NTV2InputSource. + @return The NTV2AudioSource that corresponds to the given NTV2InputSource. +**/ +AJAExport NTV2AudioSource NTV2InputSourceToAudioSource (const NTV2InputSource inInputSource); + +/** + @brief Converts a given NTV2InputSource to its equivalent NTV2Crosspoint value. + @param[in] inInputSource Specifies the NTV2InputSource to be converted. + @return The equivalent NTV2Crosspoint value. + **/ +AJAExport NTV2Crosspoint NTV2InputSourceToChannelSpec (const NTV2InputSource inInputSource); + +/** + @brief Converts a given NTV2InputSource to its equivalent NTV2Channel value. + @param[in] inInputSource Specifies the NTV2InputSource to be converted. + @return The equivalent NTV2Channel value. +**/ +AJAExport NTV2Channel NTV2InputSourceToChannel (const NTV2InputSource inInputSource); + +/** + @brief Converts a given NTV2InputSource to its equivalent NTV2ReferenceSource value. + @param[in] inInputSource Specifies the NTV2InputSource to be converted. + @return The equivalent NTV2ReferenceSource value. +**/ +AJAExport NTV2ReferenceSource NTV2InputSourceToReferenceSource (const NTV2InputSource inInputSource); + +/** + @brief Converts a given NTV2InputSource to its equivalent NTV2AudioSystem value. + @param[in] inInputSource Specifies the NTV2InputSource to be converted. + @return The equivalent NTV2AudioSystem value. +**/ +AJAExport NTV2AudioSystem NTV2InputSourceToAudioSystem (const NTV2InputSource inInputSource); + +/** + @brief Converts a given NTV2InputSource to its equivalent NTV2TimecodeIndex value. + @param[in] inInputSource Specifies the NTV2InputSource to be converted. + @param[in] inEmbeddedLTC Specify true for embedded ATC LTC. Defaults to false. + @return The equivalent NTV2TimecodeIndex value. +**/ +AJAExport NTV2TimecodeIndex NTV2InputSourceToTimecodeIndex (const NTV2InputSource inInputSource, const bool inEmbeddedLTC = false); + +/** + @brief Converts the given NTV2Channel value into its equivalent NTV2AudioSystem. + @param[in] inChannel Specifies the NTV2Channel to be converted. + @return The equivalent NTV2AudioSystem value. +**/ +AJAExport NTV2AudioSystem NTV2ChannelToAudioSystem (const NTV2Channel inChannel); + +/** + @param[in] inChannel Specifies the NTV2Channel to be converted. + @param[in] inKinds Specifies the type of input source of interest (SDI, HDMI, etc.). + Defaults to SDI. + @return The NTV2InputSource value that corresponds to the given NTV2Channel value. +**/ +AJAExport NTV2InputSource NTV2ChannelToInputSource (const NTV2Channel inChannel, const NTV2InputSourceKinds inKinds = NTV2_INPUTSOURCES_SDI); + +/** + @brief Converts a given NTV2OutputDestination to its equivalent NTV2Channel value. + @param[in] inOutputDest Specifies the NTV2OutputDestination to be converted. + @return The equivalent NTV2Channel value. +**/ +AJAExport NTV2Channel NTV2OutputDestinationToChannel (const NTV2OutputDestination inOutputDest); + +/** + @brief Converts the given NTV2Channel value into its ordinary equivalent NTV2OutputDestination. + @param[in] inChannel Specifies the NTV2Channel to be converted. + @return The equivalent NTV2OutputDestination value. +**/ +AJAExport NTV2OutputDestination NTV2ChannelToOutputDestination (const NTV2Channel inChannel); + +/** + @return The frame rate family that the given ::NTV2FrameRate belongs to. + (This is the ::NTV2FrameRate of the family having the lowest ordinal value.) + @param[in] inFrameRate Specifies the frame rate of interest. +**/ +AJAExport NTV2FrameRate GetFrameRateFamily (const NTV2FrameRate inFrameRate); + +/** + @brief Compares two frame rates and returns true if they are "compatible" (with respect to a multiformat-capable device). + @param[in] inFrameRate1 Specifies one of the frame rates to be compared. + @param[in] inFrameRate2 Specifies another frame rate to be compared. +**/ +AJAExport bool IsMultiFormatCompatible (const NTV2FrameRate inFrameRate1, const NTV2FrameRate inFrameRate2); + +/** + @brief Compares two video formats and returns true if they are "compatible" (with respect to a multiformat-capable device). + @param[in] inFormat1 Specifies one of the video formats to be compared. + @param[in] inFormat2 Specifies another video format to be compared. +**/ +AJAExport bool IsMultiFormatCompatible (const NTV2VideoFormat inFormat1, const NTV2VideoFormat inFormat2); + +AJAExport bool IsPSF (const NTV2VideoFormat format); +AJAExport bool IsProgressivePicture (const NTV2VideoFormat format); +AJAExport bool IsProgressiveTransport (const NTV2VideoFormat format); +AJAExport bool IsProgressiveTransport (const NTV2Standard format); +AJAExport bool IsRGBFormat (const NTV2FrameBufferFormat format); +AJAExport bool IsYCbCrFormat (const NTV2FrameBufferFormat format); +AJAExport bool IsAlphaChannelFormat (const NTV2FrameBufferFormat format); +AJAExport bool Is2KFormat (const NTV2VideoFormat format); +AJAExport bool Is4KFormat (const NTV2VideoFormat format); +AJAExport bool Is8KFormat (const NTV2VideoFormat format); +AJAExport bool IsRaw (const NTV2FrameBufferFormat format); +AJAExport bool Is8BitFrameBufferFormat (const NTV2FrameBufferFormat fbFormat); +AJAExport bool IsVideoFormatA (const NTV2VideoFormat format); +AJAExport bool IsVideoFormatB (const NTV2VideoFormat format); +AJAExport bool IsVideoFormatJ2KSupported (const NTV2VideoFormat format); + + +AJAExport int RecordCopyAudio (PULWord pAja, PULWord pSR, int iStartSample, int iNumBytes, int iChan0, + int iNumChans, bool bKeepAudio24Bits); + +/** + @brief Fills the given buffer with 32-bit (ULWord) audio tone samples. + @param pAudioBuffer If non-NULL, must be a valid pointer to the buffer to be filled with audio samples, + and must be at least 4 x numSamples x numChannels bytes in size. + Callers may specify NULL to have the function return the required size of the buffer. + @param inOutCurrentSample On entry, specifies the sample where waveform generation is to resume. + If audioBuffer is non-NULL, on exit, receives the sample number where waveform generation left off. + Callers should specify zero for the first invocation of this function. + @param[in] inNumSamples Specifies the number of samples to generate. + @param[in] inSampleRate Specifies the sample rate, in samples per second. + @param[in] inAmplitude Specifies the amplitude of the generated tone. + @param[in] inFrequency Specifies the frequency of the generated tone, in cycles per second (Hertz). + @param[in] inNumBits Specifies the number of bits per sample. Should be between 8 and 32 (inclusive). + @param[in] inByteSwap If true, byte-swaps each 32-bit sample before copying it into the destination buffer. + @param[in] inNumChannels Specifies the number of audio channels to produce. + @return The total number of bytes written into the destination buffer (or if audioBuffer is NULL, the minimum + required size of the destination buffer, in bytes). +**/ +AJAExport ULWord AddAudioTone ( ULWord * pAudioBuffer, + ULWord & inOutCurrentSample, + const ULWord inNumSamples, + const double inSampleRate, + const double inAmplitude, + const double inFrequency, + const ULWord inNumBits, + const bool inByteSwap, + const ULWord inNumChannels); + +/** + @brief Fills the given buffer with 32-bit (ULWord) audio tone samples with a different frequency in each audio channel. + @param pAudioBuffer If non-NULL, must be a valid pointer to the buffer to be filled with audio samples, + and must be at least 4 x numSamples x numChannels bytes in size. + Callers may specify NULL to have the function return the required size of the buffer. + @param inOutCurrentSample On entry, specifies the sample where waveform generation is to resume. + If audioBuffer is non-NULL, on exit, receives the sample number where waveform generation left off. + Callers should specify zero for the first invocation of this function. + @param[in] inNumSamples Specifies the number of samples to generate. + @param[in] inSampleRate Specifies the sample rate, in samples per second. + @param[in] pInAmplitudes A valid, non-NULL pointer to an array of per-channel amplitude values. + This array must contain at least "inNumChannels" entries. + @param[in] pInFrequencies A valid, non-NULL pointer to an array of per-channel frequency values, in cycles per second (Hertz). + This array must contain at least "inNumChannels" entries. + @param[in] inNumBits Specifies the number of bits per sample. Should be between 8 and 32 (inclusive). + @param[in] inByteSwap If true, byte-swaps each 32-bit sample before copying it into the destination buffer. + @param[in] inNumChannels Specifies the number of audio channels to produce. + @return The total number of bytes written into the destination buffer (or if audioBuffer is NULL, the minimum + required size of the destination buffer, in bytes). +**/ +AJAExport ULWord AddAudioTone ( ULWord * pAudioBuffer, + ULWord & inOutCurrentSample, + const ULWord inNumSamples, + const double inSampleRate, + const double * pInAmplitudes, + const double * pInFrequencies, + const ULWord inNumBits, + const bool inByteSwap, + const ULWord inNumChannels); + +/** + @brief Fills the given buffer with 16-bit (UWord) audio tone samples. + @param pAudioBuffer If non-NULL, must be a valid pointer to the buffer to be filled with audio samples, + and must be at least numSamples*2*numChannels bytes in size. + Callers may specify NULL to have the function return the required size of the buffer. + @param inOutCurrentSample On entry, specifies the sample where waveform generation is to resume. + If audioBuffer is non-NULL, on exit, receives the sample number where waveform generation left off. + Callers should specify zero for the first invocation of this function. + @param[in] inNumSamples Specifies the number of samples to generate. + @param[in] inSampleRate Specifies the sample rate, in samples per second. + @param[in] inAmplitude Specifies the amplitude of the generated tone. + @param[in] inFrequency Specifies the frequency of the generated tone, in cycles per second (Hertz). + @param[in] inNumBits Specifies the number of bits per sample. Should be between 8 and 16 (inclusive). + @param[in] inByteSwap If true, byte-swaps each 16-bit sample before copying it into the destination buffer. + @param[in] inNumChannels Specifies the number of audio channels to produce. + @return The total number of bytes written into the destination buffer (or if audioBuffer is NULL, the minimum + required size of the destination buffer, in bytes). +**/ +AJAExport ULWord AddAudioTone ( UWord * pAudioBuffer, + ULWord & inOutCurrentSample, + const ULWord inNumSamples, + const double inSampleRate, + const double inAmplitude, + const double inFrequency, + const ULWord inNumBits, + const bool inByteSwap, + const ULWord inNumChannels); + +AJAExport ULWord AddAudioTestPattern (ULWord * pAudioBuffer, + ULWord & inOutCurrentSample, + const ULWord inNumSamples, + const ULWord inModulus, + const bool inEndianConvert, + const ULWord inNumChannels); + +#if !defined (NTV2_DEPRECATE) + AJAExport bool BuildRoutingTableForOutput (CNTV2SignalRouter & outRouter, + NTV2Channel channel, + NTV2FrameBufferFormat fbf, + bool convert = false, // ignored + bool lut = false, + bool dualLink = false, + bool keyOut = false); + + AJAExport bool BuildRoutingTableForInput (CNTV2SignalRouter & outRouter, + NTV2Channel channel, + NTV2FrameBufferFormat fbf, + bool withKey = false, + bool lut = false, + bool dualLink = false, + bool EtoE = true); + + AJAExport bool BuildRoutingTableForInput (CNTV2SignalRouter & outRouter, + NTV2Channel channel, + NTV2FrameBufferFormat fbf, + bool convert, // Turn on the conversion module + bool withKey, // only supported for ::NTV2_CHANNEL1 for rgb formats with alpha + bool lut, // not supported + bool dualLink, // assume coming in RGB(only checked for ::NTV2_CHANNEL1 + bool EtoE); + + AJAExport bool BuildRoutingTableForInput (CNTV2SignalRouter & outRouter, + NTV2InputSource inputSource, + NTV2Channel channel, + NTV2FrameBufferFormat fbf, + bool convert, // Turn on the conversion module + bool withKey, // only supported for ::NTV2_CHANNEL1 for rgb formats with alpha + bool lut, // not supported + bool dualLink, // assume coming in RGB(only checked for ::NTV2_CHANNEL1 + bool EtoE); + + AJAExport ULWord ConvertFusionAnalogToTempCentigrade (ULWord adc10BitValue); + + AJAExport ULWord ConvertFusionAnalogToMilliVolts (ULWord adc10BitValue, ULWord millivoltsResolution); +#endif // !defined (NTV2_DEPRECATE) + + +/** + @brief Writes the given NTV2FrameDimensions to the specified output stream. + @param inOutStream Specifies the output stream to receive the human-readable representation of the NTV2FrameDimensions. + @param[in] inFrameDimensions Specifies the NTV2FrameDimensions to print to the output stream. + @return A non-constant reference to the specified output stream. +**/ +AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2FrameDimensions inFrameDimensions); + + +/** + @brief Used to describe Start of Active Video (SAV) location and field dominance for a given NTV2Standard. + (See GetSmpteLineNumber function.) +**/ +typedef struct AJAExport NTV2SmpteLineNumber +{ + ULWord smpteFirstActiveLine; ///< @brief SMPTE line number of first (top-most) active line of video + ULWord smpteSecondActiveLine; ///< @brief SMPTE line number of second active line of video + bool firstFieldTop; ///< @brief True if the first field on the wire is the top-most field in the raster (field dominance) +private: + NTV2Standard mStandard; ///< @brief The NTV2Standard I was constructed from + +public: + /** + @brief Constructs me from a given NTV2Standard. + @param[in] inStandard Specifies the NTV2Standard. + **/ + explicit NTV2SmpteLineNumber (const NTV2Standard inStandard = NTV2_STANDARD_INVALID); + + /** + @return True if valid; otherwise false. + **/ + inline bool IsValid (void) const {return NTV2_IS_VALID_STANDARD (mStandard) && smpteFirstActiveLine;} + + /** + @returns The SMPTE line number of the Start of Active Video (SAV). + @param[in] inRasterFieldID Specifies a valid raster field ID (not the wire field ID). + Defaults to NTV2_FIELD0 (i.e. first field) of the raster. + Use NTV2_FIELD1 for the starting line of a PsF frame. + **/ + ULWord GetFirstActiveLine (const NTV2FieldID inRasterFieldID = NTV2_FIELD0) const; + + /** + @returns The SMPTE line number of the last raster line. + @param[in] inRasterFieldID Specifies a valid raster field ID (not the wire field ID). + Defaults to NTV2_FIELD0 (i.e. first field) of the raster. + Use NTV2_FIELD1 for the starting line of a PsF frame. + **/ + ULWord GetLastLine (const NTV2FieldID inRasterFieldID = NTV2_FIELD0) const; + + /** + @return True if I'm equal to the given NTV2SmpteLineNumber. + @param[in] inRHS The right-hand-side operand that I'll be compared with. + **/ + bool operator == (const NTV2SmpteLineNumber & inRHS) const; + + /** + @brief Writes a human-readable description of me into the given output stream. + @param inOutStream The output stream to be written into. + @return The output stream I was handed. + **/ + std::ostream & Print (std::ostream & inOutStream) const; + + /** + @param[in] inLineOffset Specifies a line offset to add to the printed SMPTE line number. + Defaults to zero. + @param[in] inRasterFieldID Specifies a valid raster field ID (not the wire field ID). + Defaults to NTV2_FIELD0 (i.e. first field) of the raster. + @return A string containing the human-readable line number. + **/ + std::string PrintLineNumber (const ULWord inLineOffset = 0, const NTV2FieldID inRasterFieldID = NTV2_FIELD0) const; + +private: + explicit inline NTV2SmpteLineNumber (const ULWord inFirstActiveLine, + const ULWord inSecondActiveLine, + const bool inFirstFieldTop, + const NTV2Standard inStandard) + : smpteFirstActiveLine (inFirstActiveLine), + smpteSecondActiveLine (inSecondActiveLine), + firstFieldTop (inFirstFieldTop), + mStandard (inStandard) { } + +} NTV2SmpteLineNumber; + + +/** + @brief Writes the given NTV2SmpteLineNumber to the specified output stream. + @param inOutStream Specifies the output stream to receive the human-readable representation of the NTV2SmpteLineNumber. + @param[in] inSmpteLineNumber Specifies the NTV2SmpteLineNumber instance to print to the output stream. + @return A non-constant reference to the specified output stream. +**/ +AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2SmpteLineNumber & inSmpteLineNumber); + + +/** + @brief For the given video standard, returns the SMPTE-designated line numbers for Field 1 and Field 2 that correspond + to the start-of-active-video (SAV). + @param[in] inStandard Specifies the video standard of interest. + @return The NTV2SmpteLineNumber structure that corresponds to the given video standard. +**/ +inline NTV2SmpteLineNumber GetSmpteLineNumber (const NTV2Standard inStandard) {return NTV2SmpteLineNumber (inStandard);} + + +typedef std::vector NTV2DeviceIDList; ///< @brief An ordered list of NTV2DeviceIDs. +typedef NTV2DeviceIDList::iterator NTV2DeviceIDListIter; ///< @brief A convenient non-const iterator for NTV2DeviceIDList. +typedef NTV2DeviceIDList::const_iterator NTV2DeviceIDListConstIter; ///< @brief A convenient const iterator for NTV2DeviceIDList. + +AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2DeviceIDList & inSet); ///< @brief Handy ostream writer for NTV2DeviceIDList. + + +typedef std::set NTV2DeviceIDSet; ///< @brief A set of NTV2DeviceIDs. +typedef NTV2DeviceIDSet::iterator NTV2DeviceIDSetIter; ///< @brief A convenient non-const iterator for NTV2DeviceIDSet. +typedef NTV2DeviceIDSet::const_iterator NTV2DeviceIDSetConstIter; ///< @brief A convenient const iterator for NTV2DeviceIDSet. + +/** + @brief Returns an NTV2DeviceIDSet of devices supported by the SDK. + @param[in] inKinds Optionally specifies an ::NTV2DeviceKinds filter. Defaults to ::NTV2_DEVICEKIND_ALL. + @return An ::NTV2DeviceIDSet of devices supported by the SDK. +**/ +AJAExport NTV2DeviceIDSet NTV2GetSupportedDevices (const NTV2DeviceKinds inKinds = NTV2_DEVICEKIND_ALL); + +AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2DeviceIDSet & inSet); ///< @brief Handy ostream writer for NTV2DeviceIDSet. + +/** + @brief Returns an SDK version component value. + @param[in] inVersionComponent Optionally specifies which version component to return. + Legal values are 0 (major version), 1 (minor version), 2 (point or "dot" version), + and 3 (build number). Defaults to 0 (the major version). + @return The value of the requested version component, or zero if an invalid version component is specified. +**/ +AJAExport UWord NTV2GetSDKVersionComponent (const int inVersionComponent = 0); // New in SDK 16.1 + + +typedef std::vector NTV2OutputCrosspointIDs; ///< @brief An ordered sequence of NTV2OutputCrosspointID values. +typedef NTV2OutputCrosspointIDs::iterator NTV2OutputCrosspointIDsIter; ///< @brief A convenient non-const iterator for NTV2OutputCrosspointIDs. +typedef NTV2OutputCrosspointIDs::const_iterator NTV2OutputCrosspointIDsConstIter; ///< @brief A convenient const iterator for NTV2OutputCrosspointIDs. + +AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2OutputCrosspointIDs & inList); ///< @brief Handy ostream writer for NTV2OutputCrosspointIDs. + + +typedef std::vector NTV2InputCrosspointIDs; ///< @brief An ordered sequence of NTV2InputCrosspointID values. +typedef NTV2InputCrosspointIDs::iterator NTV2InputCrosspointIDsIter; ///< @brief A convenient non-const iterator for NTV2InputCrosspointIDs. +typedef NTV2InputCrosspointIDs::const_iterator NTV2InputCrosspointIDsConstIter; ///< @brief A convenient const iterator for NTV2InputCrosspointIDs. + +AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2OutputCrosspointIDs & inList); ///< @brief Handy ostream writer for NTV2OutputCrosspointIDs. + + +AJAExport std::string NTV2DeviceIDToString (const NTV2DeviceID inValue, const bool inForRetailDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2VideoFormatToString (const NTV2VideoFormat inValue, const bool inUseFrameRate = false); // New in SDK 12.0 +AJAExport std::string NTV2StandardToString (const NTV2Standard inValue, const bool inForRetailDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2FrameBufferFormatToString (const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2M31VideoPresetToString (const M31VideoPreset inValue, const bool inForRetailDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2FrameGeometryToString (const NTV2FrameGeometry inValue, const bool inForRetailDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2FrameRateToString (const NTV2FrameRate inValue, const bool inForRetailDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2InputSourceToString (const NTV2InputSource inValue, const bool inForRetailDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2OutputDestinationToString (const NTV2OutputDestination inValue, const bool inForRetailDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2ReferenceSourceToString (const NTV2ReferenceSource inValue, const bool inForRetailDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2RegisterWriteModeToString (const NTV2RegisterWriteMode inValue, const bool inForRetailDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2InterruptEnumToString (const INTERRUPT_ENUMS inInterruptEnumValue); +AJAExport std::string NTV2IpErrorEnumToString (const NTV2IpError inIpErrorEnumValue); +AJAExport std::string NTV2ChannelToString (const NTV2Channel inValue, const bool inForRetailDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2AudioSystemToString (const NTV2AudioSystem inValue, const bool inCompactDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2AudioRateToString (const NTV2AudioRate inValue, const bool inForRetailDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2AudioBufferSizeToString (const NTV2AudioBufferSize inValue, const bool inForRetailDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2AudioLoopBackToString (const NTV2AudioLoopBack inValue, const bool inForRetailDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2EmbeddedAudioClockToString (const NTV2EmbeddedAudioClock inValue, const bool inForRetailDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2GetBitfileName (const NTV2DeviceID inValue, const bool useOemNameOnWindows = false); +AJAExport bool NTV2IsCompatibleBitfileName (const std::string & inBitfileName, const NTV2DeviceID inDeviceID); +AJAExport NTV2DeviceID NTV2GetDeviceIDFromBitfileName (const std::string & inBitfileName); +AJAExport std::string NTV2GetFirmwareFolderPath (void); +AJAExport std::ostream & operator << (std::ostream & inOutStream, const RP188_STRUCT & inObj); +AJAExport std::string NTV2GetVersionString (const bool inDetailed = false); +AJAExport std::string NTV2RegisterNumberToString (const NTV2RegisterNumber inValue); // New in SDK 12.0 +AJAExport std::string AutoCircVidProcModeToString (const AutoCircVidProcMode inValue, const bool inCompactDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2ColorCorrectionModeToString (const NTV2ColorCorrectionMode inValue, const bool inCompactDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2InputCrosspointIDToString (const NTV2InputCrosspointID inValue, const bool inForRetailDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2OutputCrosspointIDToString (const NTV2OutputCrosspointID inValue, const bool inForRetailDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2WidgetIDToString (const NTV2WidgetID inValue, const bool inCompactDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2WidgetTypeToString (const NTV2WidgetType inValue, const bool inCompactDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2TaskModeToString (const NTV2EveryFrameTaskMode inValue, const bool inCompactDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2RegNumSetToString (const NTV2RegisterNumberSet & inValue); // New in SDK 12.0 +AJAExport std::string NTV2TCIndexToString (const NTV2TCIndex inValue, const bool inCompactDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2AudioChannelPairToString (const NTV2AudioChannelPair inValue, const bool inCompactDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2AudioChannelQuadToString (const NTV2Audio4ChannelSelect inValue, const bool inCompactDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2AudioChannelOctetToString (const NTV2Audio8ChannelSelect inValue, const bool inCompactDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2FramesizeToString (const NTV2Framesize inValue, const bool inCompactDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2ModeToString (const NTV2Mode inValue, const bool inCompactDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2VANCModeToString (const NTV2VANCMode inValue, const bool inCompactDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2MixerKeyerModeToString (const NTV2MixerKeyerMode inValue, const bool inCompactDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2MixerInputControlToString (const NTV2MixerKeyerInputControl inValue, const bool inCompactDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2VideoLimitingToString (const NTV2VideoLimiting inValue, const bool inCompactDisplay = false); // New in SDK 12.0 +AJAExport std::string NTV2BreakoutTypeToString (const NTV2BreakoutType inValue, const bool inCompactDisplay = false); // New in SDK 15.5 +AJAExport std::string NTV2AncDataRgnToStr (const NTV2AncDataRgn inValue, const bool inCompactDisplay = false); // New in SDK 15.5 +AJAExport std::string NTV2UpConvertModeToString (const NTV2UpConvertMode inValue, const bool inCompactDisplay = false); // New in SDK 16.1 +AJAExport std::string NTV2DownConvertModeToString (const NTV2DownConvertMode inValue, const bool inCompactDisplay = false); // New in SDK 16.1 +AJAExport std::string NTV2IsoConvertModeToString (const NTV2IsoConvertMode inValue, const bool inCompactDisplay = false); // New in SDK 16.1 + +AJAExport std::string NTV2HDMIBitDepthToString (const NTV2HDMIBitDepth inValue, const bool inCompactDisplay = false); // New in SDK 16.1 +AJAExport std::string NTV2HDMIAudioChannelsToString (const NTV2HDMIAudioChannels inValue, const bool inCompactDisplay = false); // New in SDK 16.1 +AJAExport std::string NTV2HDMIProtocolToString (const NTV2HDMIProtocol inValue, const bool inCompactDisplay = false); // New in SDK 16.1 +AJAExport std::string NTV2HDMIRangeToString (const NTV2HDMIRange inValue, const bool inCompactDisplay = false); // New in SDK 16.1 +AJAExport std::string NTV2HDMIColorSpaceToString (const NTV2HDMIColorSpace inValue, const bool inCompactDisplay = false); // New in SDK 16.1 +AJAExport std::string NTV2AudioFormatToString (const NTV2AudioFormat inValue, const bool inCompactDisplay = false); // New in SDK 16.1 + +AJAExport std::string NTV2BitfileTypeToString (const NTV2BitfileType inValue, const bool inCompactDisplay = false); // New in SDK 16.2 +AJAExport bool convertHDRFloatToRegisterValues (const HDRFloatValues & inFloatValues, HDRRegValues & outRegisterValues); +AJAExport bool convertHDRRegisterToFloatValues (const HDRRegValues & inRegisterValues, HDRFloatValues & outFloatValues); +AJAExport void setHDRDefaultsForBT2020 (HDRRegValues & outRegisterValues); +AJAExport void setHDRDefaultsForDCIP3 (HDRRegValues & outRegisterValues); +#if !defined(NTV2_DEPRECATE_16_1) + inline std::string NTV2AudioMonitorSelectToString (const NTV2AudioMonitorSelect inValue, const bool inForRetailDisplay = false) {return NTV2AudioChannelPairToString(inValue, inForRetailDisplay);} ///< @deprecated Use ::NTV2AudioChannelPairToString instead. +#endif // !defined(NTV2_DEPRECATE_16_1) + +typedef std::vector NTV2StringList; // New in SDK 12.5 +typedef NTV2StringList::iterator NTV2StringListIter; // New in SDK 16.0 +typedef NTV2StringList::const_iterator NTV2StringListConstIter;// New in SDK 12.5 +typedef std::set NTV2StringSet; // New in SDK 12.5 +typedef NTV2StringSet::const_iterator NTV2StringSetConstIter; // New in SDK 12.5 + +AJAExport std::string NTV2EmbeddedAudioInputToString (const NTV2EmbeddedAudioInput inValue, const bool inCompactDisplay = false); // New in SDK 13.0 +AJAExport std::string NTV2AudioSourceToString (const NTV2AudioSource inValue, const bool inCompactDisplay = false); // New in SDK 13.0 + +AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2StringList & inData); // New in SDK 15.5 +AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2StringSet & inData); + + +AJAExport NTV2RegisterReads FromRegNumSet (const NTV2RegNumSet & inRegNumSet); +AJAExport NTV2RegNumSet ToRegNumSet (const NTV2RegisterReads & inRegReads); +AJAExport bool GetRegNumChanges (const NTV2RegNumSet & inBefore, const NTV2RegNumSet & inAfter, NTV2RegNumSet & outGone, NTV2RegNumSet & outSame, NTV2RegNumSet & outAdded); +AJAExport bool GetChangedRegisters (const NTV2RegisterReads & inBefore, const NTV2RegisterReads & inAfter, NTV2RegNumSet & outChanged); // New in SDK 16.0 + +AJAExport std::string PercentEncode (const std::string & inStr); ///< @return The URL-encoded input string. +AJAExport std::string PercentDecode (const std::string & inStr); ///< @return The URL-decoded input string. + + +// FUTURE ** THESE WILL BE DISAPPEARING ** Deprecate in favor of the new "NTV2xxxxxxToString" functions... +#define NTV2CrosspointIDToString NTV2OutputCrosspointIDToString ///< @deprecated Use NTV2OutputCrosspointIDToString +#if !defined (NTV2_DEPRECATE) + AJAExport NTV2_DEPRECATED_f(std::string NTV2V2StandardToString (const NTV2V2Standard inValue, const bool inForRetailDisplay = false)); + extern AJAExport NTV2_DEPRECATED_v(const char * NTV2VideoFormatStrings[]); ///< @deprecated Use NTV2VideoFormatToString instead. + extern AJAExport NTV2_DEPRECATED_v(const char * NTV2VideoStandardStrings[]); ///< @deprecated Use NTV2StandardToString instead. + extern AJAExport NTV2_DEPRECATED_v(const char * NTV2PixelFormatStrings[]); ///< @deprecated Use NTV2FrameBufferFormatToString instead. + extern AJAExport NTV2_DEPRECATED_v(const char * NTV2FrameRateStrings[]); ///< @deprecated Use NTV2FrameRateToString instead. + extern AJAExport NTV2_DEPRECATED_v(const char * frameBufferFormats[]); ///< @deprecated Use NTV2FrameBufferFormatToString instead. + + AJAExport NTV2_DEPRECATED_f(std::string frameBufferFormatString (NTV2FrameBufferFormat inFrameBufferFormat)); ///< @deprecated Use NTV2FrameBufferFormatToString and pass 'true' for 'inForRetailDisplay' + AJAExport NTV2_DEPRECATED_f(void GetNTV2BoardString (NTV2BoardID inBoardID, std::string & outString)); ///< @deprecated Use NTV2DeviceIDToString and concatenate a space instead + + AJAExport NTV2_DEPRECATED_f(std::string NTV2BoardIDToString (const NTV2BoardID inValue, const bool inForRetailDisplay = false)); ///< @deprecated Use NTV2DeviceIDToString(NTV2DeviceID,bool) instead. + AJAExport NTV2_DEPRECATED_f(void GetNTV2RetailBoardString (NTV2BoardID inBoardID, std::string & outString)); ///< @deprecated Use NTV2DeviceIDToString(NTV2DeviceID,bool) instead. + AJAExport NTV2_DEPRECATED_f(NTV2BoardType GetNTV2BoardTypeForBoardID (NTV2BoardID inBoardID)); ///< @deprecated This function is obsolete because NTV2BoardType is obsolete. +#endif // !defined (NTV2_DEPRECATE) +#if defined (AJAMac) + AJAExport bool GetInstalledMacDriverVersion (UWord & outMaj, UWord & outMin, UWord & outPt, UWord & outBld, UWord & outType); +#endif // AJAMac + +#endif // NTV2UTILS_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2verticalfilter.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2verticalfilter.h new file mode 100644 index 0000000..c474cf3 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2verticalfilter.h @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2verticalfilter.h + @brief Declares the VerticalFilterLine and FieldInterpolateLine functions. + @copyright (C) 2004-2021 AJA Video Systems, Inc. +**/ + +#ifndef VERTICALFILTER_H +#define VERTICALFILTER_H + +#include "ajaexport.h" +#include "ajatypes.h" +#include "ntv2videodefines.h" +#include "ntv2fixed.h" + + +AJAExport void VerticalFilterLine ( RGBAlphaPixel * topLine, + RGBAlphaPixel * midLine, + RGBAlphaPixel * bottomLine, + RGBAlphaPixel * destLine, + LWord numPixels ); + +AJAExport void FieldInterpolateLine ( RGBAlphaPixel * topLine, + RGBAlphaPixel * bottomLine, + RGBAlphaPixel * destLine, + LWord numPixels ); + +#endif // VERTICALFILTER_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2videodefines.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2videodefines.h new file mode 100644 index 0000000..ae92e86 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2videodefines.h @@ -0,0 +1,221 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2videodefines.h + @brief Declares common video macros and structs used in the SDK. + @copyright (C) 2004-2021 AJA Video Systems, Inc. All rights reserved. +**/ +#ifndef VIDEODEFINES_H +#define VIDEODEFINES_H +#include "ajatypes.h" + +#define PI_FLOAT (3.141592654) + +#define CCIR601_8BIT_BLACK 16 +#define CCIR601_8BIT_WHITE 235 +#define CCIR601_8BIT_CHROMAOFFSET 128 + +#define CCIR601_10BIT_BLACK 64 +#define CCIR601_10BIT_WHITE 940 +#define CCIR601_10BIT_CHROMAOFFSET 512 + +#define MIN_RGB_8BIT 0 +#define MAX_RGB_8BIT 255 +#define MIN_RGB_10BIT 0 +#define MAX_RGB_10BIT 1023 +#define MIN_RGB_16BIT 0 // KAM +#define MAX_RGB_16BIT 65535 // KAM + +// NOTE: Changed the "(__x__) < MIN_RGB_nBIT" comparisons to "(__x__) <= MIN_RGB_nBIT" +// in the following three macros to eliminate gcc "comparison always true" warnings +// when __x__ is an unsigned value. +#define ClipRGB_8BIT(__x__) ((__x__) > MAX_RGB_8BIT ? (MAX_RGB_8BIT) \ + : ((__x__) <= MIN_RGB_8BIT ? (MIN_RGB_8BIT) \ + : (__x__))) +#define ClipRGB_10BIT(__x__) ((__x__) > MAX_RGB_10BIT ? (MAX_RGB_10BIT) \ + : ((__x__) <= MIN_RGB_10BIT ? (MIN_RGB_10BIT) \ + : (__x__))) +#define ClipRGB_16BIT(__x__) ((__x__) > MAX_RGB_16BIT ? (MAX_RGB_16BIT) \ + : ((__x__) <= MIN_RGB_16BIT ? (MIN_RGB_16BIT) \ + : (__x__))) + +#define NUMACTIVELINES_525 486 +#define NUMACTIVELINES_625 576 + +#define MAXSQUAREPIXELS_525 648 +#define MAXSQUAREPIXELS_625 768 + +#define NUMCOMPONENTPIXELS 720 +#define YCBCRLINEPITCH_SD 480 // in 32 bit words for packed 10 bit +#define RGBALPHALINEPITCH_625 720 // in 32 bit words no matter what framegeometry +#define RGBALPHALINEPITCH_525 720 // in 32 bit words no matter what framegeometry +#define RGB24LINEPITCH_525 (540) +#define RGB24LINEPITCH_625 (540) + + +// HD Defines +#define HD_NUMACTIVELINES_720 720 //duh? +#define HD_NUMACTIVELINES_1080 1080 // double duh? +#define HD_NUMACTIVELINES_2K 1556 +#define HD_NUMLINES_2K 1588 // In actual FrameBuffer +#define HD_FIRSTACTIVELINE_2K (HD_NUMLINES_2K-HD_NUMACTIVELINES_2K) +#define HD_NUMLINES_4K 2160 +#define FD_NUMLINES_8K 4320 + +#define HD_NUMACTIVELINES_720_QREZ (HD_NUMACTIVELINES_720/2) +#define HD_NUMACTIVELINES_1080_QREZ (HD_NUMACTIVELINES_1080/2) + +#define HD_NUMCOMPONENTPIXELS_720 1280 // in a line +#define HD_NUMCOMPONENTPIXELS_1080 1920 // in a line +#define HD_NUMCOMPONENTPIXELS_1080_2K 2048 // in a line +#define HD_NUMCOMPONENTPIXELS_2K 2048 // in a line +#define HD_NUMCOMPONENTPIXELS_QUADHD 3840 // in a line +#define HD_NUMCOMPONENTPIXELS_4K 4096 // in a line +#define FD_NUMCOMPONENTPIXELS_UHD2 7680 // in a line +#define FD_NUMCOMPONENTPIXELS_8K 8192 // in a line + +#define HD_NUMCOMPONENTPIXELS_720_DVCPRO 960 // in a line +#define HD_NUMCOMPONENTPIXELS_1080_DVCPRO 1280 // in a line + +#define HD_NUMCOMPONENTPIXELS_720_QREZ (HD_NUMCOMPONENTPIXELS_720/2) // in a line +#define HD_NUMCOMPONENTPIXELS_1080_QREZ (HD_NUMCOMPONENTPIXELS_1080/2) // in a line + +#define HD_NUMCOMPONENTPIXELS_720_HDV 960 // in a line +#define HD_NUMCOMPONENTPIXELS_1080_HDV 1440 // in a line + +// Linepitch always in 32 bit words. +#define HD_YCBCRLINEPITCH_720 864 // dx*8/3/4 32 bit words for packed 10 bit +#define HD_YCBCRLINEPITCH_1080 1280 // "" +#define HD_YCBCRLINEPITCH_2K 1376 // "" +#define HD_YCBCRLINEPITCH_3840 2560 // "" +#define HD_YCBCRLINEPITCH_4K 2752 // "" +#define FD_YCBCRLINEPITCH_UHD2 5120 // "" +#define FD_YCBCRLINEPITCH_8K 5472 // "" + +#define HD_YCBCRLINEPITCH_720_DVCPRO (960*2/4) // dvcpro always 8 bit +#define HD_YCBCRLINEPITCH_1080_DVCPRO (1280*2/4) // dvcpro always 8 bit + +#define HD_YCBCRLINEPITCH_720_QREZ (1280/4) // in 32 bit words for packed 10 bit +#define HD_YCBCRLINEPITCH_1080_QREZ (1920/4) // "" + +#define HD_YCBCRLINEPITCH_720_HDV (960*2/4) // hdv always 8 bit +#define HD_YCBCRLINEPITCH_1080_HDV (1440*2/4) // hdv always 8 bit + +#define RGB24LINEPITCH_720 (960) +#define RGB24LINEPITCH_1080 (1440) +#define RGB24LINEPITCH_2048 (1536) +#define RGB24LINEPITCH_3840 (2880) +#define RGB24LINEPITCH_4096 (3072) +#define RGB24LINEPITCH_7680 (5760) +#define RGB24LINEPITCH_8192 (6144) + +#define RGB48LINEPITCH_525 (RGB24LINEPITCH_525*2) +#define RGB48LINEPITCH_625 (RGB24LINEPITCH_625*2) +#define RGB48LINEPITCH_720 (RGB24LINEPITCH_720*2) +#define RGB48LINEPITCH_1080 (RGB24LINEPITCH_1080*2) +#define RGB48LINEPITCH_2048 (RGB24LINEPITCH_2048*2) +#define RGB48LINEPITCH_3840 (RGB24LINEPITCH_3840*2) +#define RGB48LINEPITCH_4096 (RGB24LINEPITCH_4096*2) +#define RGB48LINEPITCH_7680 (RGB24LINEPITCH_7680*2) +#define RGB48LINEPITCH_8192 (RGB24LINEPITCH_8192*2) + +#define RGB12PLINEPITCH_525 (MAXSQUAREPIXELS_525*36/8)/4 +#define RGB12PLINEPITCH_625 (MAXSQUAREPIXELS_625*36/8)/4 +#define RGB12PLINEPITCH_720 (HD_NUMCOMPONENTPIXELS_720*36/8)/4 +#define RGB12PLINEPITCH_1080 (HD_NUMCOMPONENTPIXELS_1080*36/8)/4 +#define RGB12PLINEPITCH_2048 (HD_NUMCOMPONENTPIXELS_1080_2K*36/8)/4 +#define RGB12PLINEPITCH_3840 (HD_NUMCOMPONENTPIXELS_QUADHD*36/8)/4 +#define RGB12PLINEPITCH_4096 (HD_NUMCOMPONENTPIXELS_4K*36/8)/4 +#define RGB12PLINEPITCH_7680 (FD_NUMCOMPONENTPIXELS_UHD2*36/8)/4 +#define RGB12PLINEPITCH_8192 (FD_NUMCOMPONENTPIXELS_8K*36/8)/4 + +#define PRORES_MAXBUFFERSIZE (1105920) // bytes - PAL 10bit + +// Roll Defines +#define HD_ROLLNUMLINES 4096 +#define HD_ROLLNUMPIXELS 4096 + +typedef struct { + unsigned char Blue; + unsigned char Green; + unsigned char Red; + unsigned char Alpha; +} RGBAlphaPixel; + + +typedef struct { + UWord Blue; + UWord Green; + UWord Red; + UWord Alpha; +} RGBAlpha10BitPixel; + +typedef struct { + UWord Blue; + UWord Green; + UWord Red; + UWord Alpha; +} RGBAlpha16BitPixel; + +typedef struct { + unsigned char Red; + unsigned char Green; + unsigned char Blue; + unsigned char Alpha; +} AERGBAlphaPixel; + +typedef struct { + Fixed_ Blue; + Fixed_ Green; + Fixed_ Red; + Fixed_ Alpha; +} RGBAlphaFixedPixel; + +typedef struct { + unsigned char Red; + unsigned char Green; + unsigned char Blue; +} RGBPixel; + +typedef struct { + unsigned char Blue; + unsigned char Green; + unsigned char Red; +} BGRPixel; + +typedef struct +{ + unsigned char Alpha; + unsigned char cr; + unsigned char y; + unsigned char cb; +} YCbCrAlphaPixel; + +typedef struct +{ + unsigned char cb; + unsigned char y; + unsigned char cr; +} YCbCrPixel; + +typedef struct +{ + UWord cb; + UWord y; + UWord cr; +} YCbCr10BitPixel; + +typedef struct +{ + UWord Alpha; + UWord cb; + UWord y; + UWord cr; +} YCbCr10BitAlphaPixel; + +typedef struct { + char SigName[40]; + short Y[NUMCOMPONENTPIXELS]; + short ColorDiff[NUMCOMPONENTPIXELS]; +} TestLineDataStr; + +#endif // VIDEODEFINES_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2virtualregisters.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2virtualregisters.h new file mode 100644 index 0000000..b10df6d --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2virtualregisters.h @@ -0,0 +1,941 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2virtualregisters.h + @brief Declares enums for virtual registers used in all platform drivers and the SDK. + @copyright (C) 2011-2021 AJA Video Systems, Inc.All rights reserved. +**/ + +#ifndef NTV2VIRTUALREGISTERS_H +#define NTV2VIRTUALREGISTERS_H + +#define VIRTUALREG_START 10000 // Virtual registers start at register number 10000 +#define MAX_NUM_VIRTUAL_REGISTERS 1024 // Starting in SDK 12.6, there's room for 1024 virtual registers + +/** + @brief Virtual registers are used to pass 32-bit values to/from the device driver, and aren't always + associated with hardware registers. + + @note Drivers after SDK 12.5.x all allocate a 4K page for storing an array of 1024 x 4-byte integers. + OEM applications can store values in slots kVRegFirstOEM thru kVRegLast, inclusive. + AJA recommends storing at kVRegLast, kVRegLast-1, kVRegLast-2, etc., being careful + to never store anything below kVRegFirstOEM. + + @note AJA does not reserve virtual registers for OEMs, and thus, collisions may occur with other OEM applications. +**/ +typedef enum +{ + // Common to all platforms + kVRegDriverVersion = VIRTUALREG_START, ///< @brief Packed driver version -- use NTV2DriverVersionEncode, NTV2DriverVersionDecode* macros to encode/decode + + // Windows platform custom section + kVRegAudioRecordPinDelay = VIRTUALREG_START+1, // Audio Delay relative to video, for Windows Media capture + kVRegRelativeVideoPlaybackDelay = VIRTUALREG_START+2, // Video Delay relative to audio, for Windows Media playback + kVRegGlobalAudioPlaybackMode = VIRTUALREG_START+3, // Shared with Linux, but not Mac + kVRegFlashProgramKey = VIRTUALREG_START+4, + kVRegStrictTiming = VIRTUALREG_START+5, // Drift Correction requires Strict Frame Timing for Windows Media playback;Required for BackHaul;Correlate Presentation Time Stamp with Graph Clock;Turn off (default) to allow Playback even when Graph Manager gives us a Bogus Clcok! + + // COMMON_VIRTUAL_REGS_KONA2 + kVRegInputSelect = VIRTUALREG_START+20, // Input 1, Input 2, DualLink + kVRegSecondaryFormatSelect = VIRTUALREG_START+21, // NTV2VideoFormats + kVRegDigitalOutput1Select = VIRTUALREG_START+22, // Primary, Secondary + kVRegDigitalOutput2Select = VIRTUALREG_START+23, // Primary, Secondary, DualLink + kVRegAnalogOutputSelect = VIRTUALREG_START+24, // Primary, Secondary + kVRegAnalogOutputType = VIRTUALREG_START+25, // Analog output type + kVRegAnalogOutBlackLevel = VIRTUALREG_START+26, // Analog output black level + kVRegInputSelectUser = VIRTUALREG_START+27, // Input 1, Input 2, DualLink, set by user + + // COMMON_VIRTUAL_REGS_MISC + kVRegVideoOutPauseMode = VIRTUALREG_START+40, // whether we pause on a frame or a field + kVRegPulldownPattern = VIRTUALREG_START+41, // which 3:2 pulldown pattern to use + kVRegColorSpaceMode = VIRTUALREG_START+42, // which color space matrix (Rec601, Rec709, ...) to use + kVRegGammaMode = VIRTUALREG_START+43, // which gamma LUT (Rec601, Rec709, ...) to use + kVRegLUTType = VIRTUALREG_START+44, // the current LUT function loaded into hardware + kVRegRGB10Range = VIRTUALREG_START+45, // deprecated + kVRegRGB10Endian = VIRTUALREG_START+46, // the user selected 10-bit RGB endian + kVRegFanControl = VIRTUALREG_START+47, // the user fan control setting + + // Windows platform custom section + kVRegBitFileDownload = VIRTUALREG_START+50, // NTV2BitfileType + kVRegSaveRegistersToRegistry = VIRTUALREG_START+51, // no argument + kVRegRecallRegistersFromRegistry = VIRTUALREG_START+52, // same address as above, on purpose + kVRegClearAllSubscriptions = VIRTUALREG_START+53, // NTV2BitfileType + kVRegRestoreHardwareProcampRegisters = VIRTUALREG_START+54, + kVRegAcquireReferenceCount = VIRTUALREG_START+55, // Acquire the board with a reference count on acquire + kVRegReleaseReferenceCount = VIRTUALREG_START+56, + + kVRegDTAudioMux0 = VIRTUALREG_START+60, // Firmware desired + kVRegDTAudioMux1 = VIRTUALREG_START+61, // Firmware desired + kVRegDTAudioMux2 = VIRTUALREG_START+62, // Firmware desired + kVRegDTFirmware = VIRTUALREG_START+63, // Firmware desired + kVRegDTVersionAja = VIRTUALREG_START+64, // Driver version (Aja) + kVRegDTVersionDurian = VIRTUALREG_START+65, // Driver version (Durian) + kVRegDTAudioCapturePinConnected = VIRTUALREG_START+66, // Audio Capture Pin Connected ? + + kVRegTimeStampMode = VIRTUALREG_START+70, // 0-Scaled timestamps(100ns), 1- Raw PerformanceCounter + kVRegTimeStampLastOutputVerticalLo = VIRTUALREG_START+71, // Lower 32 bits. + kVRegTimeStampLastOutputVerticalHi = VIRTUALREG_START+72, // Hi 32 bits. + kVRegTimeStampLastInput1VerticalLo = VIRTUALREG_START+73, + kVRegTimeStampLastInput1VerticalHi = VIRTUALREG_START+74, + kVRegTimeStampLastInput2VerticalLo = VIRTUALREG_START+75, + kVRegTimeStampLastInput2VerticalHi = VIRTUALREG_START+76, + kVRegNumberVideoMappingRegisters = VIRTUALREG_START+77, + kVRegNumberAudioMappingRegisters = VIRTUALREG_START+78, + kVRegAudioSyncTolerance = VIRTUALREG_START+79, + kVRegDmaSerialize = VIRTUALREG_START+80, + kVRegSyncChannel = VIRTUALREG_START+81, // Mac name + kVRegSyncChannels = VIRTUALREG_START+81, // Windows and Linux name for the same thing + kVRegSoftwareUartFifo = VIRTUALREG_START+82, + kVRegTimeCodeCh1Delay = VIRTUALREG_START+83, + kVRegTimeCodeCh2Delay = VIRTUALREG_START+84, + kVRegTimeCodeIn1Delay = VIRTUALREG_START+85, + kVRegTimeCodeIn2Delay = VIRTUALREG_START+86, + kVRegTimeCodeCh3Delay = VIRTUALREG_START+87, + kVRegTimeCodeCh4Delay = VIRTUALREG_START+88, + kVRegTimeCodeIn3Delay = VIRTUALREG_START+89, + kVRegTimeCodeIn4Delay = VIRTUALREG_START+90, + kVRegTimeCodeCh5Delay = VIRTUALREG_START+91, + kVRegTimeCodeIn5Delay = VIRTUALREG_START+92, + kVRegTimeCodeCh6Delay = VIRTUALREG_START+93, + kVRegTimeCodeIn6Delay = VIRTUALREG_START+94, + kVRegTimeCodeCh7Delay = VIRTUALREG_START+95, + kVRegTimeCodeIn7Delay = VIRTUALREG_START+96, + kVRegTimeCodeCh8Delay = VIRTUALREG_START+97, + kVRegTimeCodeIn8Delay = VIRTUALREG_START+98, + + kVRegDebug1 = VIRTUALREG_START+100, // general debug register + kVRegDebugLastFormat = VIRTUALREG_START+101, // IP debug registers + kVRegDebugIPConfigTimeMS = VIRTUALREG_START+102, + + // Control Panel virtual registers + kVRegDisplayReferenceSelect = VIRTUALREG_START+120, + kVRegVANCMode = VIRTUALREG_START+121, + kVRegDualStreamTransportType = VIRTUALREG_START+122, + kVRegSDIOut1TransportType = kVRegDualStreamTransportType, + kVRegDSKMode = VIRTUALREG_START+123, + kVRegIsoConvertEnable = VIRTUALREG_START+124, + kVRegDSKAudioMode = VIRTUALREG_START+125, + kVRegDSKForegroundMode = VIRTUALREG_START+126, + kVRegDSKForegroundFade = VIRTUALREG_START+127, + kVRegCaptureReferenceSelect = VIRTUALREG_START+128, // deprecated + + kVReg2XTransferMode = VIRTUALREG_START+130, // deprecated + kVRegSDIOutput1RGBRange = VIRTUALREG_START+131, + kVRegSDIInput1FormatSelect = VIRTUALREG_START+132, + kVRegSDIInput2FormatSelect = VIRTUALREG_START+133, + kVRegSDIInput1RGBRange = VIRTUALREG_START+134, + kVRegSDIInput2RGBRange = VIRTUALREG_START+135, + kVRegSDIInput1Stereo3DMode = VIRTUALREG_START+136, // deprecated + kVRegSDIInput2Stereo3DMode = VIRTUALREG_START+137, // deprecated + kVRegFrameBuffer1RGBRange = VIRTUALREG_START+138, + kVRegFrameBuffer1Stereo3DMode = VIRTUALREG_START+139, // deprecated + + kVRegHDMIInRgbRange = VIRTUALREG_START+140, + kVRegHDMIOutRgbRange = VIRTUALREG_START+141, // See also kVRegHDMIOutRGBRange + kVRegAnalogInBlackLevel = VIRTUALREG_START+142, + kVRegAnalogInputType = VIRTUALREG_START+143, + kVRegHDMIOutColorSpaceModeCtrl = VIRTUALREG_START+144, + kVRegHDMIOutProtocolMode = VIRTUALREG_START+145, + kVRegHDMIOutStereoSelect = VIRTUALREG_START+146, // deprecated + kVRegHDMIOutStereoCodecSelect = VIRTUALREG_START+147, // deprecated + kVRegHdmiOutSubSample = VIRTUALREG_START+148, + kVRegSDIInput1ColorSpaceMode = VIRTUALREG_START+149, + + kVRegSDIInput2ColorSpaceMode = VIRTUALREG_START+150, + kVRegSDIOutput2RGBRange = VIRTUALREG_START+151, + kVRegSDIOutput1Stereo3DMode = VIRTUALREG_START+152, // deprecated + kVRegSDIOutput2Stereo3DMode = VIRTUALREG_START+153, // deprecated + kVRegFrameBuffer2RGBRange = VIRTUALREG_START+154, + kVRegFrameBuffer2Stereo3DMode = VIRTUALREG_START+155, // deprecated + kVRegAudioGainDisable = VIRTUALREG_START+156, + kVRegLTCOnRefInSelect = VIRTUALREG_START+157, + kVRegActiveVideoOutFilter = VIRTUALREG_START+158, // deprecated + kVRegAudioInputMapSelect = VIRTUALREG_START+159, + + kVRegAudioInputDelay = VIRTUALREG_START+160, + kVRegDSKGraphicFileIndex = VIRTUALREG_START+161, + kVRegTimecodeBurnInMode = VIRTUALREG_START+162, // deprecated + kVRegUseQTTimecode = VIRTUALREG_START+163, // deprecated + kVRegAvailable164 = VIRTUALREG_START+164, + kVRegRP188SourceSelect = VIRTUALREG_START+165, + kVRegQTCodecModeDebug = VIRTUALREG_START+166, // deprecated + kVRegHDMIOutColorSpaceModeStatus = VIRTUALREG_START+167, // deprecated + kVRegDeviceOnline = VIRTUALREG_START+168, + kVRegIsDefaultDevice = VIRTUALREG_START+169, + + kVRegDesktopFrameBufferStatus = VIRTUALREG_START+170, // deprecated + kVRegSDIOutput1ColorSpaceMode = VIRTUALREG_START+171, + kVRegSDIOutput2ColorSpaceMode = VIRTUALREG_START+172, + kVRegAudioOutputDelay = VIRTUALREG_START+173, + kVRegTimelapseEnable = VIRTUALREG_START+174, // deprecated + kVRegTimelapseCaptureValue = VIRTUALREG_START+175, // deprecated + kVRegTimelapseCaptureUnits = VIRTUALREG_START+176, // deprecated + kVRegTimelapseIntervalValue = VIRTUALREG_START+177, // deprecated + kVRegTimelapseIntervalUnits = VIRTUALREG_START+178, // deprecated + kVRegFrameBufferInstalled = VIRTUALREG_START+179, // deprecated + + kVRegAnalogInStandard = VIRTUALREG_START+180, // deprecated + kVRegOutputTimecodeOffset = VIRTUALREG_START+181, // deprecated + kVRegOutputTimecodeType = VIRTUALREG_START+182, // deprecated + kVRegQuicktimeUsingBoard = VIRTUALREG_START+183, // deprecated + kVRegApplicationPID = VIRTUALREG_START+184, // The rest of this section handled by IOCTL in Mac + kVRegApplicationCode = VIRTUALREG_START+185, + kVRegReleaseApplication = VIRTUALREG_START+186, + kVRegForceApplicationPID = VIRTUALREG_START+187, + kVRegForceApplicationCode = VIRTUALREG_START+188, + kVRegIpConfigStreamRefresh = VIRTUALREG_START+189, + kVRegSDIInModel = VIRTUALREG_START+190, + kVRegInputChangedCount = VIRTUALREG_START+191, + kVReg8kOutputTransportSelection = VIRTUALREG_START+192, + kVRegAnalogIoSelect = VIRTUALREG_START+193, + + + // COMMON_VIRTUAL_REGS_PROCAMP_CONTROLS + kVRegProcAmpSDRegsInitialized = VIRTUALREG_START+200, + kVRegProcAmpStandardDefBrightness = VIRTUALREG_START+201, + kVRegProcAmpStandardDefContrast = VIRTUALREG_START+202, + kVRegProcAmpStandardDefSaturation = VIRTUALREG_START+203, + kVRegProcAmpStandardDefHue = VIRTUALREG_START+204, + kVRegProcAmpStandardDefCbOffset = VIRTUALREG_START+205, + kVRegProcAmpStandardDefCrOffset = VIRTUALREG_START+206, + kVRegProcAmpEndStandardDefRange = VIRTUALREG_START+207, + + kVRegProcAmpHDRegsInitialized = VIRTUALREG_START+220, + kVRegProcAmpHighDefBrightness = VIRTUALREG_START+221, + kVRegProcAmpHighDefContrast = VIRTUALREG_START+222, + kVRegProcAmpHighDefSaturationCb = VIRTUALREG_START+223, + kVRegProcAmpHighDefSaturationCr = VIRTUALREG_START+224, + kVRegProcAmpHighDefHue = VIRTUALREG_START+225, + kVRegProcAmpHighDefCbOffset = VIRTUALREG_START+226, + kVRegProcAmpHighDefCrOffset = VIRTUALREG_START+227, + kVRegProcAmpEndHighDefRange = VIRTUALREG_START+228, + + // COMMON_VIRTUAL_REGS_USERSPACE_BUFFLEVEL + kVRegChannel1UserBufferLevel = VIRTUALREG_START+240, + kVRegChannel2UserBufferLevel = VIRTUALREG_START+241, + kVRegInput1UserBufferLevel = VIRTUALREG_START+242, + kVRegInput2UserBufferLevel = VIRTUALREG_START+243, + + // COMMON_VIRTUAL_REGS_EX + kVRegProgressivePicture = VIRTUALREG_START+260, + kVRegLUT2Type = VIRTUALREG_START+261, + kVRegLUT3Type = VIRTUALREG_START+262, + kVRegLUT4Type = VIRTUALREG_START+263, + kVRegDigitalOutput3Select = VIRTUALREG_START+264, + kVRegDigitalOutput4Select = VIRTUALREG_START+265, + kVRegHDMIOutputSelect = VIRTUALREG_START+266, + kVRegRGBRangeConverterLUTType = VIRTUALREG_START+267, + kVRegTestPatternChoice = VIRTUALREG_START+268, + kVRegTestPatternFormat = VIRTUALREG_START+269, + kVRegEveryFrameTaskFilter = VIRTUALREG_START+270, + kVRegDefaultInput = VIRTUALREG_START+271, + kVRegDefaultVideoOutMode = VIRTUALREG_START+272, + kVRegDefaultVideoFormat = VIRTUALREG_START+273, + kVRegDigitalOutput5Select = VIRTUALREG_START+274, + kVRegLUT5Type = VIRTUALREG_START+275, + + // Macintosh platform custom section + kVRegMacUserModeDebugLevel = VIRTUALREG_START+300, + kVRegMacKernelModeDebugLevel = VIRTUALREG_START+301, + kVRegMacUserModePingLevel = VIRTUALREG_START+302, + kVRegMacKernelModePingLevel = VIRTUALREG_START+303, + kVRegLatencyTimerValue = VIRTUALREG_START+304, + + kVRegAudioInputSelect = VIRTUALREG_START+306, + kVRegSerialSuspended = VIRTUALREG_START+307, + kVRegXilinxProgramming = VIRTUALREG_START+308, + kVRegETTDiagLastSerialTimestamp = VIRTUALREG_START+309, + kVRegETTDiagLastSerialTimecode = VIRTUALREG_START+310, + kVRegStartupStatusFlags = VIRTUALREG_START+311, + kVRegRGBRangeMode = VIRTUALREG_START+312, + kVRegEnableQueuedDMAs = VIRTUALREG_START+313, // If non-zero, enables queued DMAs on multi-engine devices (Mac only) + + // Linux platform custom section + kVRegBA0MemorySize = VIRTUALREG_START+320, // Memory-mapped register (BAR0) window size in bytes. + kVRegBA1MemorySize = VIRTUALREG_START+321, // Memory-mapped framebuffer window size in bytes. + kVRegBA4MemorySize = VIRTUALREG_START+322, + kVRegNumDmaDriverBuffers = VIRTUALREG_START+323, // Number of bigphysarea frames available (Read only). + kVRegDMADriverBufferPhysicalAddress = VIRTUALREG_START+324, // Physical address of bigphysarea buffer + kVRegBA2MemorySize = VIRTUALREG_START+325, + kVRegAcquireLinuxReferenceCount = VIRTUALREG_START+326, // Acquire the board with a reference count on acquire + kVRegReleaseLinuxReferenceCount = VIRTUALREG_START+327, + + // IoHD virtual registers + kVRegAdvancedIndexing = VIRTUALREG_START+340, // OBSOLETE after 12.4 + kVRegTimeStampLastInput3VerticalLo = VIRTUALREG_START+341, + kVRegTimeStampLastInput3VerticalHi = VIRTUALREG_START+342, + kVRegTimeStampLastInput4VerticalLo = VIRTUALREG_START+343, + kVRegTimeStampLastInput4VerticalHi = VIRTUALREG_START+344, + kVRegTimeStampLastInput5VerticalLo = VIRTUALREG_START+345, + kVRegTimeStampLastInput5VerticalHi = VIRTUALREG_START+346, + kVRegTimeStampLastInput6VerticalLo = VIRTUALREG_START+347, + kVRegTimeStampLastInput6VerticalHi = VIRTUALREG_START+348, + kVRegTimeStampLastInput7VerticalLo = VIRTUALREG_START+349, + kVRegTimeStampLastInput7VerticalHi = VIRTUALREG_START+350, + kVRegTimeStampLastInput8VerticalLo = VIRTUALREG_START+351, + kVRegTimeStampLastInput8VerticalHi = VIRTUALREG_START+352, + + kVRegTimeStampLastOutput2VerticalLo = VIRTUALREG_START+353, + kVRegTimeStampLastOutput2VerticalHi = VIRTUALREG_START+354, + + kVRegTimeStampLastOutput3VerticalLo = VIRTUALREG_START+355, + kVRegTimeStampLastOutput3VerticalHi = VIRTUALREG_START+356, + kVRegTimeStampLastOutput4VerticalLo = VIRTUALREG_START+357, + kVRegTimeStampLastOutput4VerticalHi = VIRTUALREG_START+358, + + kVRegTimeStampLastOutput5VerticalLo = VIRTUALREG_START+359, + + kVRegTimeStampLastOutput5VerticalHi = VIRTUALREG_START+360, + kVRegTimeStampLastOutput6VerticalLo = VIRTUALREG_START+361, + kVRegTimeStampLastOutput6VerticalHi = VIRTUALREG_START+362, + kVRegTimeStampLastOutput7VerticalLo = VIRTUALREG_START+363, + kVRegTimeStampLastOutput7VerticalHi = VIRTUALREG_START+364, + kVRegTimeStampLastOutput8VerticalLo = VIRTUALREG_START+365, + + kVRegResetCycleCount = VIRTUALREG_START+366, // counts the number of device resets caused by plug-and-play or sleep, increments each time + kVRegUseProgressive = VIRTUALREG_START+367, // when an option (e.g. Avid MC) choose P over PSF formats + + kVRegFlashSize = VIRTUALREG_START+368, // size of the flash partition for flash status + kVRegFlashStatus = VIRTUALREG_START+369, // progress of flash patition + kVRegFlashState = VIRTUALREG_START+370, // state status of flash + + kVRegPCIDeviceID = VIRTUALREG_START+371, // set by driver (read only) + + kVRegUartRxFifoSize = VIRTUALREG_START+372, + + kVRegEFTNeedsUpdating = VIRTUALREG_START+373, // set when any retail virtual register has been changed + + kVRegSuspendSystemAudio = VIRTUALREG_START+374, // set when app wants to use AC audio and disable host audio (e.g., CoreAudio on MacOS) + kVRegAcquireReferenceCounter = VIRTUALREG_START+375, + + kVRegTimeStampLastOutput8VerticalHi = VIRTUALREG_START+376, + + kVRegFramesPerVertical = VIRTUALREG_START+377, + kVRegServicesInitialized = VIRTUALREG_START+378, // set true when device is initialized by services + + kVRegFrameBufferGangCount = VIRTUALREG_START+379, + + kVRegChannelCrosspointFirst = VIRTUALREG_START+380, + // kVRegChannelCrosspointFirst+1 + // kVRegChannelCrosspointFirst+2 + // kVRegChannelCrosspointFirst+3 + // kVRegChannelCrosspointFirst+4 + // kVRegChannelCrosspointFirst+5 + // kVRegChannelCrosspointFirst+6 + kVRegChannelCrosspointLast = VIRTUALREG_START+387, // kVRegChannelCrosspointFirst+7 + + // Starting in SDK 13.0, kVRegDriverVersionMajor, kVRegDriverVersionMinor and kVRegDriverVersionPoint + // were all replaced by a single virtual register kVRegDriverVersion. + kVRegMonAncField1Offset = VIRTUALREG_START+389, ///< @brief Monitor Anc Field1 byte offset from end of frame buffer (IoIP only, GUMP) + kVRegMonAncField2Offset = VIRTUALREG_START+390, ///< @brief Monitor Anc Field2 byte offset from end of frame buffer (IoIP only, GUMP) + kVRegFollowInputFormat = VIRTUALREG_START+391, + + kVRegAncField1Offset = VIRTUALREG_START+392, ///< @brief Anc Field1 byte offset from end of frame buffer (GUMP on all boards except RTP for SMPTE2022/IP) + kVRegAncField2Offset = VIRTUALREG_START+393, ///< @brief Anc Field2 byte offset from end of frame buffer (GUMP on all boards except RTP for SMPTE2022/IP) + kVRegAgentCheck = VIRTUALREG_START+394, + kVRegUnused_2 = VIRTUALREG_START+395, + + kVReg4kOutputTransportSelection = VIRTUALREG_START+396, + kVRegCustomAncInputSelect = VIRTUALREG_START+397, + kVRegUseThermostat = VIRTUALREG_START+398, + kVRegThermalSamplingRate = VIRTUALREG_START+399, + kVRegFanSpeed = VIRTUALREG_START+400, + + kVRegVideoFormatCh1 = VIRTUALREG_START+401, + kVRegVideoFormatCh2 = VIRTUALREG_START+402, + kVRegVideoFormatCh3 = VIRTUALREG_START+403, + kVRegVideoFormatCh4 = VIRTUALREG_START+404, + kVRegVideoFormatCh5 = VIRTUALREG_START+405, + kVRegVideoFormatCh6 = VIRTUALREG_START+406, + kVRegVideoFormatCh7 = VIRTUALREG_START+407, + kVRegVideoFormatCh8 = VIRTUALREG_START+408, + + // Sarek VOIP section + kVRegIPAddrEth0 = VIRTUALREG_START+409, + kVRegSubnetEth0 = VIRTUALREG_START+410, + kVRegGatewayEth0 = VIRTUALREG_START+411, + + kVRegIPAddrEth1 = VIRTUALREG_START+412, + kVRegSubnetEth1 = VIRTUALREG_START+413, + kVRegGatewayEth1 = VIRTUALREG_START+414, + + kVRegRxcEnable1 = VIRTUALREG_START+415, + kVRegRxcSfp1RxMatch1 = VIRTUALREG_START+416, + kVRegRxcSfp1SourceIp1 = VIRTUALREG_START+417, + kVRegRxcSfp1DestIp1 = VIRTUALREG_START+418, + kVRegRxcSfp1SourcePort1 = VIRTUALREG_START+419, + kVRegRxcSfp1DestPort1 = VIRTUALREG_START+420, + kVRegRxcSfp1Vlan1 = VIRTUALREG_START+421, + kVRegRxcSfp2RxMatch1 = VIRTUALREG_START+422, + kVRegRxcSfp2SourceIp1 = VIRTUALREG_START+423, + kVRegRxcSfp2DestIp1 = VIRTUALREG_START+424, + kVRegRxcSfp2SourcePort1 = VIRTUALREG_START+425, + kVRegRxcSfp2DestPort1 = VIRTUALREG_START+426, + kVRegRxcSfp2Vlan1 = VIRTUALREG_START+427, + kVRegRxcSsrc1 = VIRTUALREG_START+428, + kVRegRxcPlayoutDelay1 = VIRTUALREG_START+429, + + kVRegRxcEnable2 = VIRTUALREG_START+430, + kVRegRxcSfp1RxMatch2 = VIRTUALREG_START+431, + kVRegRxcSfp1SourceIp2 = VIRTUALREG_START+432, + kVRegRxcSfp1DestIp2 = VIRTUALREG_START+433, + kVRegRxcSfp1SourcePort2 = VIRTUALREG_START+434, + kVRegRxcSfp1DestPort2 = VIRTUALREG_START+435, + kVRegRxcSfp1Vlan2 = VIRTUALREG_START+436, + kVRegRxcSfp2RxMatch2 = VIRTUALREG_START+437, + kVRegRxcSfp2SourceIp2 = VIRTUALREG_START+438, + kVRegRxcSfp2DestIp2 = VIRTUALREG_START+439, + kVRegRxcSfp2SourcePort2 = VIRTUALREG_START+440, + kVRegRxcSfp2DestPort2 = VIRTUALREG_START+441, + kVRegRxcSfp2Vlan2 = VIRTUALREG_START+442, + kVRegRxcSsrc2 = VIRTUALREG_START+443, + kVRegRxcPlayoutDelay2 = VIRTUALREG_START+444, + + kVRegTxcEnable3 = VIRTUALREG_START+445, + kVRegTxcSfp1LocalPort3 = VIRTUALREG_START+446, + kVRegTxcSfp1RemoteIp3 = VIRTUALREG_START+447, + kVRegTxcSfp1RemotePort3 = VIRTUALREG_START+448, + kVRegTxcSfp2LocalPort3 = VIRTUALREG_START+449, + kVRegTxcSfp2RemoteIp3 = VIRTUALREG_START+450, + kVRegTxcSfp2RemotePort3 = VIRTUALREG_START+451, + + kVRegTxcEnable4 = VIRTUALREG_START+452, + kVRegTxcSfp1LocalPort4 = VIRTUALREG_START+453, + kVRegTxcSfp1RemoteIp4 = VIRTUALREG_START+454, + kVRegTxcSfp1RemotePort4 = VIRTUALREG_START+455, + kVRegTxcSfp2LocalPort4 = VIRTUALREG_START+456, + kVRegTxcSfp2RemoteIp4 = VIRTUALREG_START+457, + kVRegTxcSfp2RemotePort4 = VIRTUALREG_START+458, + + kVRegMailBoxAcquire = VIRTUALREG_START+459, + kVRegMailBoxRelease = VIRTUALREG_START+460, + kVRegMailBoxAbort = VIRTUALREG_START+461, + kVRegMailBoxTimeoutNS = VIRTUALREG_START+462, // Units are 100 ns, not nanoseconds! + + kVRegRxc_2DecodeSelectionMode1 = VIRTUALREG_START+463, + kVRegRxc_2DecodeProgramNumber1 = VIRTUALREG_START+464, + kVRegRxc_2DecodeProgramPID1 = VIRTUALREG_START+465, + kVRegRxc_2DecodeAudioNumber1 = VIRTUALREG_START+466, + + kVRegRxc_2DecodeSelectionMode2 = VIRTUALREG_START+467, + kVRegRxc_2DecodeProgramNumber2 = VIRTUALREG_START+468, + kVRegRxc_2DecodeProgramPID2 = VIRTUALREG_START+469, + kVRegRxc_2DecodeAudioNumber2 = VIRTUALREG_START+470, + + kVRegTxc_2EncodeVideoFormat1 = VIRTUALREG_START+471, + kVRegTxc_2EncodeUllMode1 = VIRTUALREG_START+472, + kVRegTxc_2EncodeBitDepth1 = VIRTUALREG_START+473, + kVRegTxc_2EncodeChromaSubSamp1 = VIRTUALREG_START+474, + kVRegTxc_2EncodeMbps1 = VIRTUALREG_START+475, + kVRegTxc_2EncodeAudioChannels1 = VIRTUALREG_START+476, + kVRegTxc_2EncodeStreamType1 = VIRTUALREG_START+477, + kVRegTxc_2EncodeProgramPid1 = VIRTUALREG_START+478, + kVRegTxc_2EncodeVideoPid1 = VIRTUALREG_START+479, + kVRegTxc_2EncodePcrPid1 = VIRTUALREG_START+480, + kVRegTxc_2EncodeAudio1Pid1 = VIRTUALREG_START+481, + + kVRegTxc_2EncodeVideoFormat2 = VIRTUALREG_START+482, + kVRegTxc_2EncodeUllMode2 = VIRTUALREG_START+483, + kVRegTxc_2EncodeBitDepth2 = VIRTUALREG_START+484, + kVRegTxc_2EncodeChromaSubSamp2 = VIRTUALREG_START+485, + kVRegTxc_2EncodeMbps2 = VIRTUALREG_START+486, + kVRegTxc_2EncodeAudioChannels2 = VIRTUALREG_START+487, + kVRegTxc_2EncodeStreamType2 = VIRTUALREG_START+488, + kVRegTxc_2EncodeProgramPid2 = VIRTUALREG_START+489, + kVRegTxc_2EncodeVideoPid2 = VIRTUALREG_START+490, + kVRegTxc_2EncodePcrPid2 = VIRTUALREG_START+491, + kVRegTxc_2EncodeAudio1Pid2 = VIRTUALREG_START+492, + + kVReg2022_7Enable = VIRTUALREG_START+493, + kVReg2022_7NetworkPathDiff = VIRTUALREG_START+494, + + kVRegKIPRxCfgError = VIRTUALREG_START+495, + kVRegKIPTxCfgError = VIRTUALREG_START+496, + kVRegKIPEncCfgError = VIRTUALREG_START+497, + kVRegKIPDecCfgError = VIRTUALREG_START+498, + kVRegKIPNetCfgError = VIRTUALREG_START+499, + kVRegUseHDMI420Mode = VIRTUALREG_START+500, + kVRegUnused501 = VIRTUALREG_START+501, + + kVRegUserDefinedDBB = VIRTUALREG_START+502, + + kVRegHDMIOutAudioChannels = VIRTUALREG_START+503, + kVRegUnused504 = VIRTUALREG_START+504, + kVRegZeroHostAncPostCapture = VIRTUALREG_START+505, + kVRegZeroDeviceAncPostCapture = VIRTUALREG_START+506, + kVRegAudioMonitorChannelSelect = VIRTUALREG_START+507, + kVRegAudioMixerOverrideState = VIRTUALREG_START+508, + kVRegAudioMixerSourceMainEnable = VIRTUALREG_START+509, + kVRegAudioMixerSourceAux1Enable = VIRTUALREG_START+510, + kVRegAudioMixerSourceAux2Enable = VIRTUALREG_START+511, + kVRegAudioMixerSourceMainGain = VIRTUALREG_START+512, + kVRegAudioMixerSourceAux1Gain = VIRTUALREG_START+513, + kVRegAudioMixerSourceAux2Gain = VIRTUALREG_START+514, + kVRegAudioCapMixerSourceMainEnable = VIRTUALREG_START+515, + kVRegAudioCapMixerSourceAux1Enable = VIRTUALREG_START+516, + kVRegAudioCapMixerSourceAux2Enable = VIRTUALREG_START+517, + kVRegAudioCapMixerSourceMainGain = VIRTUALREG_START+518, + kVRegAudioCapMixerSourceAux1Gain = VIRTUALREG_START+519, + kVRegAudioCapMixerSourceAux2Gain = VIRTUALREG_START+520, + + kVRegSwizzle4kInput = VIRTUALREG_START+521, + kVRegSwizzle4kOutput = VIRTUALREG_START+522, + + kVRegAnalogAudioIOConfiguration = VIRTUALREG_START+523, + kVRegHdmiHdrOutChanged = VIRTUALREG_START+524, + + kVRegDisableAutoVPID = VIRTUALREG_START+525, + kVRegEnableBT2020 = VIRTUALREG_START+526, + kVRegHdmiHdrOutMode = VIRTUALREG_START+527, + + kVRegServicesForceInit = VIRTUALREG_START+528, // set true when power state changes + kVRegServicesModeFinal = VIRTUALREG_START+529, + + kVRegNTV2VPIDTransferCharacteristics1 = VIRTUALREG_START+530, + kVRegNTV2VPIDColorimetry1 = VIRTUALREG_START+531, + kVRegNTV2VPIDLuminance1 = VIRTUALREG_START+532, + kVRegNTV2VPIDTransferCharacteristics = kVRegNTV2VPIDTransferCharacteristics1, + kVRegNTV2VPIDColorimetry = kVRegNTV2VPIDColorimetry1, + kVRegNTV2VPIDLuminance = kVRegNTV2VPIDLuminance1, + + kVRegNTV2VPIDTransferCharacteristics2 = VIRTUALREG_START+533, + kVRegNTV2VPIDColorimetry2 = VIRTUALREG_START+534, + kVRegNTV2VPIDLuminance2 = VIRTUALREG_START+535, + + kVRegNTV2VPIDTransferCharacteristics3 = VIRTUALREG_START+536, + kVRegNTV2VPIDColorimetry3 = VIRTUALREG_START+537, + kVRegNTV2VPIDLuminance3 = VIRTUALREG_START+538, + + kVRegNTV2VPIDTransferCharacteristics4 = VIRTUALREG_START+539, + kVRegNTV2VPIDColorimetry4 = VIRTUALREG_START+540, + kVRegNTV2VPIDLuminance4 = VIRTUALREG_START+541, + + kVRegNTV2VPIDTransferCharacteristics5 = VIRTUALREG_START+542, + kVRegNTV2VPIDColorimetry5 = VIRTUALREG_START+543, + kVRegNTV2VPIDLuminance5 = VIRTUALREG_START+544, + + kVRegNTV2VPIDTransferCharacteristics6 = VIRTUALREG_START+545, + kVRegNTV2VPIDColorimetry6 = VIRTUALREG_START+546, + kVRegNTV2VPIDLuminance6 = VIRTUALREG_START+547, + + kVRegNTV2VPIDTransferCharacteristics7 = VIRTUALREG_START+548, + kVRegNTV2VPIDColorimetry7 = VIRTUALREG_START+549, + kVRegNTV2VPIDLuminance7 = VIRTUALREG_START+550, + + kVRegNTV2VPIDTransferCharacteristics8 = VIRTUALREG_START+551, + kVRegNTV2VPIDColorimetry8 = VIRTUALREG_START+552, + kVRegNTV2VPIDLuminance8 = VIRTUALREG_START+553, + + kVRegUserColorimetry = VIRTUALREG_START+554, + kVRegUserTransfer = VIRTUALREG_START+555, + kVRegUserLuminance = VIRTUALREG_START+556, + + kVRegHdrColorimetryCh1 = VIRTUALREG_START+557, + kVRegHdrTransferCh1 = VIRTUALREG_START+558, + kVRegHdrLuminanceCh1 = VIRTUALREG_START+559, + kVRegHdrGreenXCh1 = VIRTUALREG_START+560, + kVRegHdrGreenYCh1 = VIRTUALREG_START+561, + kVRegHdrBlueXCh1 = VIRTUALREG_START+562, + kVRegHdrBlueYCh1 = VIRTUALREG_START+563, + kVRegHdrRedXCh1 = VIRTUALREG_START+564, + kVRegHdrRedYCh1 = VIRTUALREG_START+565, + kVRegHdrWhiteXCh1 = VIRTUALREG_START+566, + kVRegHdrWhiteYCh1 = VIRTUALREG_START+567, + kVRegHdrMasterLumMaxCh1 = VIRTUALREG_START+568, + kVRegHdrMasterLumMinCh1 = VIRTUALREG_START+569, + kVRegHdrMaxCLLCh1 = VIRTUALREG_START+570, + kVRegHdrMaxFALLCh1 = VIRTUALREG_START+571, + kVRegHDROverrideState = VIRTUALREG_START+572, + + kVRegPCIMaxReadRequestSize = VIRTUALREG_START+573, + + kVRegUserInColorimetry = VIRTUALREG_START+574, + kVRegUserInTransfer = VIRTUALREG_START+575, + kVRegUserInLuminance = VIRTUALREG_START+576, + + kVRegHdrInColorimetryCh1 = VIRTUALREG_START+577, + kVRegHdrInTransferCh1 = VIRTUALREG_START+578, + kVRegHdrInLuminanceCh1 = VIRTUALREG_START+579, + kVRegHdrInGreenXCh1 = VIRTUALREG_START+580, + kVRegHdrInGreenYCh1 = VIRTUALREG_START+581, + kVRegHdrInBlueXCh1 = VIRTUALREG_START+582, + kVRegHdrInBlueYCh1 = VIRTUALREG_START+583, + kVRegHdrInRedXCh1 = VIRTUALREG_START+584, + kVRegHdrInRedYCh1 = VIRTUALREG_START+585, + kVRegHdrInWhiteXCh1 = VIRTUALREG_START+586, + kVRegHdrInWhiteYCh1 = VIRTUALREG_START+587, + kVRegHdrInMasterLumMaxCh1 = VIRTUALREG_START+588, + kVRegHdrInMasterLumMinCh1 = VIRTUALREG_START+589, + kVRegHdrInMaxCLLCh1 = VIRTUALREG_START+590, + kVRegHdrInMaxFALLCh1 = VIRTUALREG_START+591, + kVRegHDRInOverrideState = VIRTUALREG_START+592, + + kVRegNTV2VPIDRGBRange1 = VIRTUALREG_START+593, + kVRegNTV2VPIDRGBRange2 = VIRTUALREG_START+594, + kVRegNTV2VPIDRGBRange3 = VIRTUALREG_START+595, + kVRegNTV2VPIDRGBRange4 = VIRTUALREG_START+596, + kVRegNTV2VPIDRGBRange5 = VIRTUALREG_START+597, + kVRegNTV2VPIDRGBRange6 = VIRTUALREG_START+598, + kVRegNTV2VPIDRGBRange7 = VIRTUALREG_START+599, + kVRegNTV2VPIDRGBRange8 = VIRTUALREG_START+600, + + kVRegRotaryGainOverrideEnable = VIRTUALREG_START+601, + kVRegAudioMixerOutputGain = VIRTUALREG_START+602, + kVRegAudioHeadphoneGain = VIRTUALREG_START+603, + kVRegAudioMixerOutputEnable = VIRTUALREG_START+604, + kVRegAudioHeadphoneEnable = VIRTUALREG_START+605, + kVRegAudioEncoderOutputEnable = VIRTUALREG_START+606, + kVRegAudioEncoderHeadphoneEnable = VIRTUALREG_START+607, + + kVRegDmaTransferRateC2H1 = VIRTUALREG_START+608, + kVRegDmaHardwareRateC2H1 = VIRTUALREG_START+609, + kVRegDmaTransferRateH2C1 = VIRTUALREG_START+610, + kVRegDmaHardwareRateH2C1 = VIRTUALREG_START+611, + kVRegDmaTransferRateC2H2 = VIRTUALREG_START+612, + kVRegDmaHardwareRateC2H2 = VIRTUALREG_START+613, + kVRegDmaTransferRateH2C2 = VIRTUALREG_START+614, + kVRegDmaHardwareRateH2C2 = VIRTUALREG_START+615, + kVRegDmaTransferRateC2H3 = VIRTUALREG_START+616, + kVRegDmaHardwareRateC2H3 = VIRTUALREG_START+617, + kVRegDmaTransferRateH2C3 = VIRTUALREG_START+618, + kVRegDmaHardwareRateH2C3 = VIRTUALREG_START+619, + kVRegDmaTransferRateC2H4 = VIRTUALREG_START+620, + kVRegDmaHardwareRateC2H4 = VIRTUALREG_START+621, + kVRegDmaTransferRateH2C4 = VIRTUALREG_START+622, + kVRegDmaHardwareRateH2C4 = VIRTUALREG_START+623, + + kVRegHDMIInAviInfo1 = VIRTUALREG_START+624, + + kVRegMaskHDMIInColorimetry = BIT(3)+BIT(2)+BIT(1)+BIT(0), + kVRegShiftHDMIInColorimetry = 0, + kVRegMaskHDMIInDolbyVision = BIT(4), + kVRegShiftHDMIInDolbyVision = 4, + + kVRegHDMIInDrmInfo1 = VIRTUALREG_START+625, + + kVRegMaskHDMIInPresent = BIT(0), + kVRegShiftHDMIInPresent = 0, + kVRegMaskHDMIInEOTF = BIT(11)+BIT(10)+BIT(9)+BIT(8), + kVRegShiftHDMIInEOTF = 8, + kVRegMaskHDMIInMetadataID = BIT(15)+BIT(14)+BIT(13)+BIT(12), + kVRegShiftHDMIInMetadataID = 12, + + kVRegHDMIInDrmGreenPrimary1 = VIRTUALREG_START+626, + kVRegHDMIInDrmBluePrimary1 = VIRTUALREG_START+627, + kVRegHDMIInDrmRedPrimary1 = VIRTUALREG_START+628, + kVRegHDMIInDrmWhitePoint1 = VIRTUALREG_START+629, + kVRegHDMIInDrmMasteringLuminence1 = VIRTUALREG_START+630, + kVRegHDMIInDrmLightLevel1 = VIRTUALREG_START+631, + + kVRegHDMIInAviInfo2 = VIRTUALREG_START+632, + kVRegHDMIInDrmInfo2 = VIRTUALREG_START+633, + kVRegHDMIInDrmGreenPrimary2 = VIRTUALREG_START+634, + kVRegHDMIInDrmBluePrimary2 = VIRTUALREG_START+635, + kVRegHDMIInDrmRedPrimary2 = VIRTUALREG_START+636, + kVRegHDMIInDrmWhitePoint2 = VIRTUALREG_START+637, + kVRegHDMIInDrmMasteringLuminence2 = VIRTUALREG_START+638, + kVRegHDMIInDrmLightLevel2 = VIRTUALREG_START+639, + + kVRegBaseFirmwareDeviceID = VIRTUALREG_START+640, + + kVRegHDMIOutStatus1 = VIRTUALREG_START+641, + kVRegMaskHDMOutVideoStandard = BIT(3)+BIT(2)+BIT(1)+BIT(0), + kVRegShiftHDMOutVideoStandard = 0, + kVRegMaskHDMOutVideoFrameRate = BIT(7)+BIT(6)+BIT(5)+BIT(4), + kVRegShiftHDMOutVideoFrameRate = 4, + kVRegMaskHDMOutBitDepth = BIT(11)+BIT(10)+BIT(9)+BIT(8), + kVRegShiftHDMOutBitDepth = 8, + kVRegMaskHDMOutColorRGB = BIT(12), + kVRegShiftHDMOutColorRGB = 12, + kVRegMaskHDMOutRangeFull = BIT(13), + kVRegShiftHDMOutRangeFull = 13, + kVRegMaskHDMOutPixel420 = BIT(14), + kVRegShiftHDMOutPixel420 = 14, + kVRegMaskHDMOutProtocol = BIT(15), + kVRegShiftHDMOutProtocol = 15, + kVRegMaskHDMOutAudioFormat = BIT(19)+BIT(18)+BIT(17)+BIT(16), + kVRegShiftHDMOutAudioFormat = 16, + kVRegMaskHDMOutAudioRate = BIT(23)+BIT(22)+BIT(21)+BIT(20), + kVRegShiftHDMOutAudioRate = 20, + kVRegMaskHDMOutAudioChannels = BIT(27)+BIT(26)+BIT(25)+BIT(24), + kVRegShiftHDMOutAudioChannels = 24, + + kVRegLastAJA = VIRTUALREG_START+642, ///< @brief The last AJA virtual register slot + kVRegFirstOEM = kVRegLastAJA + 1, ///< @brief The first virtual register slot available for general use + kVRegLast = VIRTUALREG_START + MAX_NUM_VIRTUAL_REGISTERS - 1 ///< @brief Last virtual register slot + +} VirtualRegisterNum; + + +#if !defined(NTV2_DEPRECATE_15_0) + #define kVRegLinuxDriverVersion VIRTUALREG_START ///< @deprecated Obsolete in SDK 15.0, use kVRegDriverVersion instead +#endif +#if !defined(NTV2_DEPRECATE_15_2) + #define kVRegHDMIOutRGBRange (VIRTUALREG_START+504) ///< @deprecated Appears to be unused, but easily confused with kVRegHDMIOutRgbRange +#endif +#if !defined (NTV2_DEPRECATE_12_7) + // The old virtual register names will be deprecated sometime after SDK 13.0.0 + #define kRegLinuxDriverVersion kVRegLinuxDriverVersion + #define kRegRelativeVideoPlaybackDelay kVRegRelativeVideoPlaybackDelay + #define kRegAudioRecordPinDelay kVRegAudioRecordPinDelay + #define kRegDriverVersion kVRegDriverVersion + #define kRegGlobalAudioPlaybackMode kVRegGlobalAudioPlaybackMode + #define kRegFlashProgramKey kVRegFlashProgramKey + #define kRegStrictTiming kVRegStrictTiming + #define kK2RegInputSelect kVRegInputSelect + #define kK2RegSecondaryFormatSelect kVRegSecondaryFormatSelect + #define kK2RegDigitalOutput1Select kVRegDigitalOutput1Select + #define kK2RegDigitalOutput2Select kVRegDigitalOutput2Select + #define kK2RegAnalogOutputSelect kVRegAnalogOutputSelect + #define kK2RegAnalogOutputType kVRegAnalogOutputType + #define kK2RegAnalogOutBlackLevel kVRegAnalogOutBlackLevel + #define kVideoOutPauseMode kVRegVideoOutPauseMode + #define kPulldownPattern kVRegPulldownPattern + #define kColorSpaceMode kVRegColorSpaceMode + #define kGammaMode kVRegGammaMode + #define kLUTType kVRegLUTType + #define kRGB10Range kVRegRGB10Range + #define kRGB10Endian kVRegRGB10Endian + #define kRegBitFileDownload kVRegBitFileDownload + #define kRegSaveRegistersToRegistry kVRegSaveRegistersToRegistry + #define kRegRecallRegistersFromRegistry kVRegRecallRegistersFromRegistry + #define kRegClearAllSubscriptions kVRegClearAllSubscriptions + #define kRegRestoreHardwareProcampRegisters kVRegRestoreHardwareProcampRegisters + #define kRegAcquireReferenceCount kVRegAcquireReferenceCount + #define kRegReleaseReferenceCount kVRegReleaseReferenceCount + #define kRegDTAudioMux0 kVRegDTAudioMux0 + #define kRegDTAudioMux1 kVRegDTAudioMux1 + #define kRegDTAudioMux2 kVRegDTAudioMux2 + #define kRegDTFirmware kVRegDTFirmware + #define kRegDTVersionAja kVRegDTVersionAja + #define kRegDTVersionDurian kVRegDTVersionDurian + #define kRegDTAudioCapturePinConnected kVRegDTAudioCapturePinConnected + #define kRegTimeStampMode kVRegTimeStampMode + #define kRegTimeStampLastOutputVerticalLo kVRegTimeStampLastOutputVerticalLo + #define kRegTimeStampLastOutputVerticalHi kVRegTimeStampLastOutputVerticalHi + #define kRegTimeStampLastInput1VerticalLo kVRegTimeStampLastInput1VerticalLo + #define kRegTimeStampLastInput1VerticalHi kVRegTimeStampLastInput1VerticalHi + #define kRegTimeStampLastInput2VerticalLo kVRegTimeStampLastInput2VerticalLo + #define kRegTimeStampLastInput2VerticalHi kVRegTimeStampLastInput2VerticalHi + #define kRegNumberVideoMappingRegisters kVRegNumberVideoMappingRegisters + #define kRegNumberAudioMappingRegisters kVRegNumberAudioMappingRegisters + #define kRegAudioSyncTolerance kVRegAudioSyncTolerance + #define kRegDmaSerialize kVRegDmaSerialize + #define kRegSyncChannel kVRegSyncChannel + #define kRegSyncChannels kVRegSyncChannels + #define kRegSoftwareUartFifo kVRegSoftwareUartFifo + #define kRegTimeCodeCh1Delay kVRegTimeCodeCh1Delay + #define kRegTimeCodeCh2Delay kVRegTimeCodeCh2Delay + #define kRegTimeCodeIn1Delay kVRegTimeCodeIn1Delay + #define kRegTimeCodeIn2Delay kVRegTimeCodeIn2Delay + #define kRegTimeCodeCh3Delay kVRegTimeCodeCh3Delay + #define kRegTimeCodeCh4Delay kVRegTimeCodeCh4Delay + #define kRegTimeCodeIn3Delay kVRegTimeCodeIn3Delay + #define kRegTimeCodeIn4Delay kVRegTimeCodeIn4Delay + #define kRegTimeCodeCh5Delay kVRegTimeCodeCh5Delay + #define kRegTimeCodeIn5Delay kVRegTimeCodeIn5Delay + #define kRegTimeCodeCh6Delay kVRegTimeCodeCh6Delay + #define kRegTimeCodeIn6Delay kVRegTimeCodeIn6Delay + #define kRegTimeCodeCh7Delay kVRegTimeCodeCh7Delay + #define kRegTimeCodeIn7Delay kVRegTimeCodeIn7Delay + #define kRegTimeCodeCh8Delay kVRegTimeCodeCh8Delay + #define kRegTimeCodeIn8Delay kVRegTimeCodeIn8Delay + #define kRegDebug1 kVRegDebug1 + #define kDisplayReferenceSelect kVRegDisplayReferenceSelect + #define kVANCMode kVRegVANCMode + #define kRegDualStreamTransportType kVRegDualStreamTransportType + #define kSDIOut1TransportType kVRegSDIOut1TransportType + #define kDSKMode kVRegDSKMode + #define kIsoConvertEnable kVRegIsoConvertEnable + #define kDSKAudioMode kVRegDSKAudioMode + #define kDSKForegroundMode kVRegDSKForegroundMode + #define kDSKForegroundFade kVRegDSKForegroundFade + #define kCaptureReferenceSelect kVRegCaptureReferenceSelect + #define kPanMode kVRegPanMode + #define kReg2XTransferMode kVReg2XTransferMode + #define kRegSDIOutput1RGBRange kVRegSDIOutput1RGBRange + #define kRegSDIInput1FormatSelect kVRegSDIInput1FormatSelect + #define kRegSDIInput2FormatSelect kVRegSDIInput2FormatSelect + #define kRegSDIInput1RGBRange kVRegSDIInput1RGBRange + #define kRegSDIInput2RGBRange kVRegSDIInput2RGBRange + #define kRegSDIInput1Stereo3DMode kVRegSDIInput1Stereo3DMode + #define kRegSDIInput2Stereo3DMode kVRegSDIInput2Stereo3DMode + #define kRegFrameBuffer1RGBRange kVRegFrameBuffer1RGBRange + #define kRegFrameBuffer1Stereo3DMode kVRegFrameBuffer1Stereo3DMode + #define kPanModeOffsetH kVRegPanModeOffsetH + #define kPanModeOffsetV kVRegPanModeOffsetV + #define kK2RegAnalogInBlackLevel kVRegAnalogInBlackLevel + #define kK2RegAnalogInputType kVRegAnalogInputType + #define kRegHDMIOutColorSpaceModeCtrl kVRegHDMIOutColorSpaceModeCtrl + #define kHDMIOutProtocolMode kVRegHDMIOutProtocolMode + #define kRegHDMIOutStereoSelect kVRegHDMIOutStereoSelect + #define kRegHDMIOutStereoCodecSelect kVRegHDMIOutStereoCodecSelect + #define kRegSDIInput1ColorSpaceMode kVRegSDIInput1ColorSpaceMode + #define kRegSDIInput2ColorSpaceMode kVRegSDIInput2ColorSpaceMode + #define kRegSDIOutput2RGBRange kVRegSDIOutput2RGBRange + #define kRegSDIOutput1Stereo3DMode kVRegSDIOutput1Stereo3DMode + #define kRegSDIOutput2Stereo3DMode kVRegSDIOutput2Stereo3DMode + #define kRegFrameBuffer2RGBRange kVRegFrameBuffer2RGBRange + #define kRegFrameBuffer2Stereo3DMode kVRegFrameBuffer2Stereo3DMode + #define kRegAudioGainDisable kVRegAudioGainDisable + #define kDBLAudioEnable kVRegLTCOnRefInSelect + #define kActiveVideoOutFilter kVRegActiveVideoOutFilter + #define kRegAudioInputMapSelect kVRegAudioInputMapSelect + #define kAudioInputDelay kVRegAudioInputDelay + #define kDSKGraphicFileIndex kVRegDSKGraphicFileIndex + #define kTimecodeBurnInMode kVRegTimecodeBurnInMode + #define kUseQTTimecode kVRegUseQTTimecode + #define kRegAvailable164 kVRegAvailable164 + #define kRP188SourceSelect kVRegRP188SourceSelect + #define kQTCodecModeDebug kVRegQTCodecModeDebug + #define kRegHDMIOutColorSpaceModeStatus kVRegHDMIOutColorSpaceModeStatus + #define kDeviceOnline kVRegDeviceOnline + #define kIsDefaultDevice kVRegIsDefaultDevice + #define kRegDesktopFrameBufferStatus kVRegDesktopFrameBufferStatus + #define kRegSDIOutput1ColorSpaceMode kVRegSDIOutput1ColorSpaceMode + #define kRegSDIOutput2ColorSpaceMode kVRegSDIOutput2ColorSpaceMode + #define kAudioOutputDelay kVRegAudioOutputDelay + #define kTimelapseEnable kVRegTimelapseEnable + #define kTimelapseCaptureValue kVRegTimelapseCaptureValue + #define kTimelapseCaptureUnits kVRegTimelapseCaptureUnits + #define kTimelapseIntervalValue kVRegTimelapseIntervalValue + #define kTimelapseIntervalUnits kVRegTimelapseIntervalUnits + #define kFrameBufferInstalled kVRegFrameBufferInstalled + #define kK2RegAnalogInStandard kVRegAnalogInStandard + #define kRegOutputTimecodeOffset kVRegOutputTimecodeOffset + #define kRegOutputTimecodeType kVRegOutputTimecodeType + #define kRegQuicktimeUsingBoard kVRegQuicktimeUsingBoard + #define kRegApplicationPID kVRegApplicationPID + #define kRegApplicationCode kVRegApplicationCode + #define kRegReleaseApplication kVRegReleaseApplication + #define kRegForceApplicationPID kVRegForceApplicationPID + #define kRegForceApplicationCode kVRegForceApplicationCode + #define kRegProcAmpSDRegsInitialized kVRegProcAmpSDRegsInitialized + #define kRegProcAmpStandardDefBrightness kVRegProcAmpStandardDefBrightness + #define kRegProcAmpStandardDefContrast kVRegProcAmpStandardDefContrast + #define kRegProcAmpStandardDefSaturation kVRegProcAmpStandardDefSaturation + #define kRegProcAmpStandardDefHue kVRegProcAmpStandardDefHue + #define kRegProcAmpStandardDefCbOffset kVRegProcAmpStandardDefCbOffset + #define kRegProcAmpStandardDefCrOffset kVRegProcAmpStandardDefCrOffset + #define kRegProcAmpEndStandardDefRange kVRegProcAmpEndStandardDefRange + #define kRegProcAmpHDRegsInitialized kVRegProcAmpHDRegsInitialized + #define kRegProcAmpHighDefBrightness kVRegProcAmpHighDefBrightness + #define kRegProcAmpHighDefContrast kVRegProcAmpHighDefContrast + #define kRegProcAmpHighDefSaturationCb kVRegProcAmpHighDefSaturationCb + #define kRegProcAmpHighDefSaturationCr kVRegProcAmpHighDefSaturationCr + #define kRegProcAmpHighDefHue kVRegProcAmpHighDefHue + #define kRegProcAmpHighDefCbOffset kVRegProcAmpHighDefCbOffset + #define kRegProcAmpHighDefCrOffset kVRegProcAmpHighDefCrOffset + #define kRegProcAmpEndHighDefRange kVRegProcAmpEndHighDefRange + #define kRegChannel1UserBufferLevel kVRegChannel1UserBufferLevel + #define kRegChannel2UserBufferLevel kVRegChannel2UserBufferLevel + #define kRegInput1UserBufferLevel kVRegInput1UserBufferLevel + #define kRegInput2UserBufferLevel kVRegInput2UserBufferLevel + #define kRegProgressivePicture kVRegProgressivePicture + #define kRegLUT2Type kVRegLUT2Type + #define kRegLUT3Type kVRegLUT3Type + #define kRegLUT4Type kVRegLUT4Type + #define kK2RegDigitalOutput3Select kVRegDigitalOutput3Select + #define kK2RegDigitalOutput4Select kVRegDigitalOutput4Select + #define kK2RegHDMIOutputSelect kVRegHDMIOutputSelect + #define kK2RegRGBRangeConverterLUTType kVRegRGBRangeConverterLUTType + #define kRegTestPatternChoice kVRegTestPatternChoice + #define kRegTestPatternFormat kVRegTestPatternFormat + #define kRegEveryFrameTaskFilter kVRegEveryFrameTaskFilter + #define kRegDefaultInput kVRegDefaultInput + #define kRegDefaultVideoOutMode kVRegDefaultVideoOutMode + #define kRegDefaultVideoFormat kVRegDefaultVideoFormat + #define kK2RegDigitalOutput5Select kVRegDigitalOutput5Select + #define kRegLUT5Type kVRegLUT5Type + #define kRegMacUserModeDebugLevel kVRegMacUserModeDebugLevel + #define kRegMacKernelModeDebugLevel kVRegMacKernelModeDebugLevel + #define kRegMacUserModePingLevel kVRegMacUserModePingLevel + #define kRegMacKernelModePingLevel kVRegMacKernelModePingLevel + #define kRegLatencyTimerValue kVRegLatencyTimerValue + #define kRegAudioInputSelect kVRegAudioInputSelect + #define kSerialSuspended kVRegSerialSuspended + #define kXilinxProgramming kVRegXilinxProgramming + #define kETTDiagLastSerialTimestamp kVRegETTDiagLastSerialTimestamp + #define kETTDiagLastSerialTimecode kVRegETTDiagLastSerialTimecode + #define kStartupStatusFlags kVRegStartupStatusFlags + #define kRegRGBRangeMode kVRegRGBRangeMode + #define kRegEnableQueuedDMAs kVRegEnableQueuedDMAs + #define kRegBA0MemorySize kVRegBA0MemorySize + #define kRegBA1MemorySize kVRegBA1MemorySize + #define kRegBA4MemorySize kVRegBA4MemorySize + #define kRegNumDmaDriverBuffers kVRegNumDmaDriverBuffers + #define kRegDMADriverBufferPhysicalAddress kVRegDMADriverBufferPhysicalAddress + #define kRegBA2MemorySize kVRegBA2MemorySize + #define kRegAcquireLinuxReferenceCount kVRegAcquireLinuxReferenceCount + #define kRegReleaseLinuxReferenceCount kVRegReleaseLinuxReferenceCount + #define kRegAdvancedIndexing kVRegAdvancedIndexing + #define kRegTimeStampLastInput3VerticalLo kVRegTimeStampLastInput3VerticalLo + #define kRegTimeStampLastInput3VerticalHi kVRegTimeStampLastInput3VerticalHi + #define kRegTimeStampLastInput4VerticalLo kVRegTimeStampLastInput4VerticalLo + #define kRegTimeStampLastInput4VerticalHi kVRegTimeStampLastInput4VerticalHi + #define kRegTimeStampLastInput5VerticalLo kVRegTimeStampLastInput5VerticalLo + #define kRegTimeStampLastInput5VerticalHi kVRegTimeStampLastInput5VerticalHi + #define kRegTimeStampLastInput6VerticalLo kVRegTimeStampLastInput6VerticalLo + #define kRegTimeStampLastInput6VerticalHi kVRegTimeStampLastInput6VerticalHi + #define kRegTimeStampLastInput7VerticalLo kVRegTimeStampLastInput7VerticalLo + #define kRegTimeStampLastInput7VerticalHi kVRegTimeStampLastInput7VerticalHi + #define kRegTimeStampLastInput8VerticalLo kVRegTimeStampLastInput8VerticalLo + #define kRegTimeStampLastInput8VerticalHi kVRegTimeStampLastInput8VerticalHi + #define kRegTimeStampLastOutput2VerticalLo kVRegTimeStampLastOutput2VerticalLo + #define kRegTimeStampLastOutput2VerticalHi kVRegTimeStampLastOutput2VerticalHi + #define kRegTimeStampLastOutput3VerticalLo kVRegTimeStampLastOutput3VerticalLo + #define kRegTimeStampLastOutput3VerticalHi kVRegTimeStampLastOutput3VerticalHi + #define kRegTimeStampLastOutput4VerticalLo kVRegTimeStampLastOutput4VerticalLo + #define kRegTimeStampLastOutput4VerticalHi kVRegTimeStampLastOutput4VerticalHi + #define kRegTimeStampLastOutput5VerticalLo kVRegTimeStampLastOutput5VerticalLo + #define kRegTimeStampLastOutput5VerticalHi kVRegTimeStampLastOutput5VerticalHi + #define kRegTimeStampLastOutput6VerticalLo kVRegTimeStampLastOutput6VerticalLo + #define kRegTimeStampLastOutput6VerticalHi kVRegTimeStampLastOutput6VerticalHi + #define kRegTimeStampLastOutput7VerticalLo kVRegTimeStampLastOutput7VerticalLo + #define kRegTimeStampLastOutput7VerticalHi kVRegTimeStampLastOutput7VerticalHi + #define kRegTimeStampLastOutput8VerticalLo kVRegTimeStampLastOutput8VerticalLo + #define kRegResetCycleCount kVRegResetCycleCount + #define kRegUseProgressive kVRegUseProgressive + #define kRegFlashSize kVRegFlashSize + #define kRegFlashStatus kVRegFlashStatus + #define kRegFlashState kVRegFlashState + #define kRegPCIDeviceID kVRegPCIDeviceID + #define kRegUartRxFifoSize kVRegUartRxFifoSize + #define kRegEFTNeedsUpdating kVRegEFTNeedsUpdating + #define kRegSuspendSystemAudio kVRegSuspendSystemAudio + #define kRegAcquireReferenceCounter kVRegAcquireReferenceCounter + #define kRegTimeStampLastOutput8VerticalHi kVRegTimeStampLastOutput8VerticalHi + #define kRegFramesPerVertical kVRegFramesPerVertical + #define kRegServicesInitialized kVRegServicesInitialized + #define kRegFrameBufferGangCount kVRegFrameBufferGangCount + #define kRegChannelCrosspointFirst kVRegChannelCrosspointFirst + #define kRegChannelCrosspointLast kVRegChannelCrosspointLast + #define kRegDriverVersionMajor kVRegDriverVersionMajor + #define kRegDriverVersionMinor kVRegDriverVersionMinor + #define kRegDriverVersionPoint kVRegDriverVersionPoint + #define kRegFollowInputFormat kVRegFollowInputFormat + #define kRegAncField1Offset kVRegAncField1Offset + #define kRegAncField2Offset kVRegAncField2Offset + #define kRegUnused_1 kVRegUnused_1 + #define kRegUnused_2 kVRegUnused_2 + #define kReg4kOutputTransportSelection kVReg4kOutputTransportSelection + #define kRegCustomAncInputSelect kVRegCustomAncInputSelect + #define kRegUseThermostat kVRegUseThermostat + #define kRegThermalSamplingRate kVRegThermalSamplingRate + #define kRegFanSpeed kVRegFanSpeed + #define kRegVideoFormatCh1 kVRegVideoFormatCh1 + #define kRegVideoFormatCh2 kVRegVideoFormatCh2 + #define kRegVideoFormatCh3 kVRegVideoFormatCh3 + #define kRegVideoFormatCh4 kVRegVideoFormatCh4 + #define kRegVideoFormatCh5 kVRegVideoFormatCh5 + #define kRegVideoFormatCh6 kVRegVideoFormatCh6 + #define kRegVideoFormatCh7 kVRegVideoFormatCh7 + #define kRegVideoFormatCh8 kVRegVideoFormatCh8 + #define kRegUserDefinedDBB kVRegUserDefinedDBB + #define kRegHDMIOutAudioChannels kVRegHDMIOutAudioChannels + #define kRegHDMIOutRGBRange kVRegHDMIOutRGBRange + #define kRegLastAJA kVRegLastAJA + #define kRegFirstOEM kVRegFirstOEM + #define kRegLast kVRegLast +#endif // NTV2_DEPRECATE_12_7 + +#endif// NTV2VIRTUALREGISTERS_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2vpid.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2vpid.h new file mode 100644 index 0000000..84eaf79 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2vpid.h @@ -0,0 +1,182 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2vpid.h + @brief Declares the CNTV2VPID class. See SMPTE 352 standard for details. + @copyright (C) 2012-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2VPID_H +#define NTV2VPID_H + +#include "ajaexport.h" +#include "ntv2publicinterface.h" +#include "ajabase/system/info.h" + +#if defined(AJALinux) +#include +#endif + +/** + @brief A convenience class that simplifies encoding or decoding the 4-byte VPID payload + that can be read or written from/to VPID registers. +**/ +class AJAExport CNTV2VPID +{ +public: + /** + @name Construction, Destruction, Copying, Assigning + **/ + ///@{ + CNTV2VPID (const ULWord inData = 0); + CNTV2VPID (const CNTV2VPID & other); + virtual CNTV2VPID & operator = (const CNTV2VPID & inRHS); + virtual inline ~CNTV2VPID () {} + ///@} + + /** + @name Inquiry + **/ + ///@{ + virtual inline ULWord GetVPID (void) const {return m_uVPID;} ///< @return My current 4-byte VPID value. + virtual VPIDVersion GetVersion (void) const; + virtual NTV2VideoFormat GetVideoFormat (void) const; + virtual bool IsStandard3Ga (void) const; + virtual bool IsStandardMultiLink4320 (void) const; + virtual bool IsStandardTwoSampleInterleave (void) const; + virtual VPIDStandard GetStandard (void) const; + virtual bool GetProgressiveTransport (void) const; + virtual bool GetProgressivePicture (void) const; + virtual VPIDPictureRate GetPictureRate (void) const; + virtual bool GetImageAspect16x9 (void) const; + virtual VPIDSampling GetSampling (void) const; + virtual bool IsRGBSampling (void) const; // New in SDK 16.0 + virtual VPIDChannel GetChannel (void) const; + virtual VPIDChannel GetDualLinkChannel (void) const; + virtual VPIDBitDepth GetBitDepth (void) const; + virtual inline bool IsValid (void) const {return GetVersion() == VPIDVersion_1;} ///< @return True if valid; otherwise false. + virtual AJALabelValuePairs & GetInfo (AJALabelValuePairs & outInfo) const; + virtual NTV2VPIDXferChars GetTransferCharacteristics (void) const; + virtual NTV2VPIDColorimetry GetColorimetry (void) const; + virtual NTV2VPIDLuminance GetLuminance (void) const; + virtual NTV2VPIDRGBRange GetRGBRange (void) const; // New in SDK 16.0 + virtual std::ostream & Print (std::ostream & ostrm) const; + virtual std::ostream & PrintPretty (std::ostream & ostrm) const; // New in SDK 16.0 + virtual std::string AsString (const bool inTabular = false) const; // New in SDK 16.0 + ///@} + + /** + @name Changing + **/ + ///@{ + virtual inline CNTV2VPID & SetVPID (const ULWord inData) {m_uVPID = inData; return *this;} + + virtual bool SetVPID (const NTV2VideoFormat inVideoFormat, + const NTV2FrameBufferFormat inFrameBufferFormat, + const bool inIsProgressive, + const bool inIs16x9Aspect, + const VPIDChannel inVPIDChannel); + + virtual bool SetVPID (const NTV2VideoFormat inOutputFormat, + const bool inIsDualLink, + const bool inIs48BitRGBFormat, + const bool inIsOutput3Gb, + const bool inIsSMPTE425, + const VPIDChannel inVPIDhannel); + + + + virtual CNTV2VPID & SetVersion (const VPIDVersion inVersion); + virtual CNTV2VPID & SetStandard (const VPIDStandard inStandard); + virtual CNTV2VPID & SetProgressiveTransport (const bool inIsProgressiveTransport); + virtual CNTV2VPID & SetProgressivePicture (const bool inIsProgressivePicture); + virtual CNTV2VPID & SetPictureRate (const VPIDPictureRate inPictureRate); + virtual CNTV2VPID & SetImageAspect16x9 (const bool inIs16x9Aspect); + virtual CNTV2VPID & SetSampling (const VPIDSampling inSampling); + virtual CNTV2VPID & SetChannel (const VPIDChannel inChannel); + virtual CNTV2VPID & SetDualLinkChannel (const VPIDChannel inChannel); + virtual CNTV2VPID & SetBitDepth (const VPIDBitDepth inBitDepth); + virtual CNTV2VPID & SetTransferCharacteristics (const NTV2VPIDXferChars inXferChars); + virtual CNTV2VPID & SetColorimetry (const NTV2VPIDColorimetry inColorimetry); + virtual CNTV2VPID & SetLuminance (const NTV2VPIDLuminance inLuminance); + virtual CNTV2VPID & SetRGBRange (const NTV2VPIDRGBRange inRGBRange); // New in SDK 16.0 + virtual inline CNTV2VPID & MakeInvalid (void) {return SetVPID(0);} // New in SDK 16.0 + + ///@} + + + /** + @name Class Methods + **/ + ///@{ + static bool SetVPIDData (ULWord & outVPID, + const NTV2VideoFormat inOutputFormat, + const NTV2FrameBufferFormat inFrameBufferFormat, + const bool inIsProgressive, + const bool inIs16x9Aspect, + const VPIDChannel inVPIDChannel, + const bool inUseVPIDChannel = true); // defaults to using VPID channel + + static bool SetVPIDData (ULWord & outVPID, + const NTV2VideoFormat inOutputFormat, + const bool inIsDualLinkRGB, + const bool inIsRGB48Bit, + const bool inIsOutput3Gb, + const bool inIsSMPTE425, + const VPIDChannel inVPIDChannel, + const bool inUseVPIDChannel = true, + const bool inOutputIs6G = false, + const bool inOutputIs12G = false, + const NTV2VPIDXferChars inXferChars = NTV2_VPID_TC_SDR_TV, + const NTV2VPIDColorimetry inColorimetry = NTV2_VPID_Color_Rec709, + const NTV2VPIDLuminance inLuminance = NTV2_VPID_Luminance_YCbCr, + const NTV2VPIDRGBRange inRGBRange = NTV2_VPID_Range_Narrow); // New in SDK 16.0 + + static const std::string VersionString (const VPIDVersion version); // New in SDK 15.5 + static const std::string StandardString (const VPIDStandard std); // New in SDK 15.5 + static const std::string PictureRateString (const VPIDPictureRate rate); // New in SDK 15.5 + static const std::string SamplingString (const VPIDSampling sample); // New in SDK 15.5 + static const std::string ChannelString (const VPIDChannel chan); // New in SDK 15.5 + static const std::string DynamicRangeString (const VPIDDynamicRange range); // New in SDK 15.5 + static const std::string BitDepthString (const VPIDBitDepth depth); // New in SDK 15.5 + static const std::string LinkString (const VPIDLink link); // New in SDK 15.5 + static const std::string AudioString (const VPIDAudio audio); // New in SDK 15.5 + static const std::string VPIDVersionToString (const VPIDVersion inVers); // New in SDK 16.0.1 + static const std::string VPIDStandardToString (const VPIDStandard inStd); // New in SDK 16.0.1 + static bool VPIDStandardIsSingleLink (const VPIDStandard inStd); // New in SDK 16.0 + static bool VPIDStandardIsDualLink (const VPIDStandard inStd); // New in SDK 16.0 + static bool VPIDStandardIsQuadLink (const VPIDStandard inStd); // New in SDK 16.0 + static bool VPIDStandardIsOctLink (const VPIDStandard inStd); // New in SDK 16.0 + #if !defined (NTV2_DEPRECATE) + virtual VPIDDynamicRange NTV2_DEPRECATED_f(GetDynamicRange (void) const); + virtual void NTV2_DEPRECATED_f(SetDynamicRange (const VPIDDynamicRange inDynamicRange)); + static inline NTV2_DEPRECATED_f(bool SetVPIDData (ULWord * pOutVPID, + const NTV2VideoFormat inOutputFormat, + const NTV2FrameBufferFormat inFrameBufferFormat, + const bool inIsProgressive, + const bool inIs16x9Aspect, + const VPIDChannel inVPIDChannel, + const bool inUseVPIDChannel = true)) + {return pOutVPID ? SetVPIDData (*pOutVPID, inOutputFormat, inFrameBufferFormat, inIsProgressive, inIs16x9Aspect, inVPIDChannel, inUseVPIDChannel) : false;} + + static inline NTV2_DEPRECATED_f(bool SetVPIDData (ULWord * pOutVPID, + const NTV2VideoFormat inOutputFormat, + const bool inDualLinkRGB, + const bool inIsRGB48Bit, + const bool inIsOutput3Gb, + const bool inIsSMPTE425, + const VPIDChannel inVPIDChannel, + const bool inUseChannel = true)) + {return pOutVPID ? SetVPIDData (*pOutVPID, inOutputFormat, inDualLinkRGB, inIsRGB48Bit, inIsOutput3Gb, inIsSMPTE425, inVPIDChannel, inUseChannel) : false;} + + virtual inline NTV2_DEPRECATED_f(void Init (void)) {} ///< @deprecated Obsolete. Do not use. + #endif // !defined (NTV2_DEPRECATE) + ///@} + +private: + ULWord m_uVPID; ///< @brief My 32-bit VPID data value + +}; // CNTV2VPID + +AJAExport std::ostream & operator << (std::ostream & ostrm, const CNTV2VPID & inData); + +#endif // NTV2VPID_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2vpidfromspec.h b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2vpidfromspec.h new file mode 100644 index 0000000..40badd9 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/includes/ntv2vpidfromspec.h @@ -0,0 +1,92 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2vpidfromspec.h + @brief Declares functions for the C implementations of VPID generation from a VPIDSpec. + @copyright (C) 2004-2021 AJA Video Systems, Inc. + @note This file is included in driver builds. It must not contain any C++. +**/ + +#ifndef NTV2VPIDFROMSPEC_H +#define NTV2VPIDFROMSPEC_H + +#include "ajaexport.h" +#include "ntv2publicinterface.h" + +/** + @brief Contains all the information needed to generate a valid VPID +**/ + +////VPID Stuff +/////////////////////////////////////////////////////////////// + +typedef struct +{ + NTV2VideoFormat videoFormat; ///< @brief Specifies the format of the video stream. + NTV2FrameBufferFormat pixelFormat; ///< @brief Specifies the pixel format of the source of the video stream. + bool isRGBOnWire; ///< @brief If true, the transport on the wire is RGB. + bool isOutputLevelA; ///< @brief If true, the video stream will leave the device as a level A signal. + bool isOutputLevelB; ///< @brief If true, the video stream will leave the device as a level B signal. + bool isDualLink; ///< @brief If true, the video stream is part of a SMPTE 372 dual link signal. + bool isTwoSampleInterleave; ///< @brief If true, the video stream is in SMPTE 425-3 two sample interleave format. + bool useChannel; ///< @brief If true, the following vpidChannel value should be inserted into th VPID. + VPIDChannel vpidChannel; ///< @brief Specifies the channel number of the video stream. + bool isStereo; ///< @brief If true, the video stream is part of a stereo pair. + bool isRightEye; ///< @brief If true, the video stream is the right eye of a stereo pair. + VPIDAudio audioCarriage; ///< @brief Specifies how audio is carried in additional channels. + bool isOutput6G; ///< @brief If true, the transport on the wire is 6G. + bool isOutput12G; ///< @brief If true, the transport on the wire is 12G. + bool enableBT2020; ///< @brief If true, the VPID will insert BT.2020 data. + NTV2VPIDTransferCharacteristics transferCharacteristics; ///< @brief Describes the transfer characteristics + NTV2VPIDColorimetry colorimetry; ///< @brief Describes the Colorimetry + NTV2VPIDLuminance luminance; ///< @brief Describes the luminance and color difference + NTV2VPIDRGBRange rgbRange; ///< @brief Describes the RGB range as full or SMPTE + bool isMultiLink; ///< @brief If true, the video stream is 12G -> 3G multi-link +} VPIDSpec; + +typedef enum +{ + dualStreamFlag = 1, + output3GFlag = 2, + output3GbFlag = 4, + SMPTE425Flag = 8, + DC4KInPath = 16, + CSCInPath = 32 +} VPIDFlags; + +typedef struct +{ + VPIDSpec vpidSpec; + ULWord deviceNumber; + NTV2Channel videoChannel; + ULWord frameStoreIndex; + VPIDFlags flags; + bool is3G; + bool isDS2; + bool isComplete; + ULWord value; + bool isDS1; + bool isML1; + bool isML2; + bool isML3; + bool isML4; +} VPIDControl; + +/** + @brief Generates a VPID based on the supplied specification. + @param[out] pOutVPID Specifies the location where the generated VPID will be stored. + @param[in] pInVPIDSpec Specifies the location of the settings describing the VPID to be generated. + @return True if generation was successful, otherwise false. +**/ +#if defined(__cplusplus) && defined(NTV2_BUILDING_DRIVER) +extern "C" +{ +#endif +AJAExport bool SetVPIDFromSpec (ULWord * const pOutVPID, + const VPIDSpec * const pInVPIDSpec); + +#if defined(__cplusplus) && defined(NTV2_BUILDING_DRIVER) +} +#endif + +#endif // NTV2VPIDFROMSPEC_H + diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/src/lin/ntv2linuxdriverinterface.h b/build_dependencies/aja/include/ajalibraries/ajantv2/src/lin/ntv2linuxdriverinterface.h new file mode 100644 index 0000000..3e661fe --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/src/lin/ntv2linuxdriverinterface.h @@ -0,0 +1,165 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2linuxdriverinterface.h + @brief Declares the CNTV2LinuxDriverInterface class. + @copyright (C) 2003-2021 AJA Video Systems, Inc. +**/ +#ifndef NTV2LINUXDRIVERINTERFACE_H +#define NTV2LINUXDRIVERINTERFACE_H + +#include "ntv2driverinterface.h" +#include "ntv2linuxpublicinterface.h" +#include "ntv2devicefeatures.h" + +#include +#include +#include +#include + +#define CopyMemory(a,b,c) memcpy((a),(b),(c)) + +// oem dma: save locked pages in a stl::vector +#include +typedef std::vector DMA_LOCKED_VEC; + +/** + @brief Linux implementation of CNTV2DriverInterface. +**/ +class CNTV2LinuxDriverInterface : public CNTV2DriverInterface +{ + public: + CNTV2LinuxDriverInterface(); + AJA_VIRTUAL ~CNTV2LinuxDriverInterface(); + + AJA_VIRTUAL bool WriteRegister (const ULWord inRegNum, const ULWord inValue, const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0); + AJA_VIRTUAL bool ReadRegister (const ULWord inRegNum, ULWord & outValue, const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0); +#if !defined(NTV2_DEPRECATE_14_3) + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadRegister (const ULWord inRegNum, ULWord * pOutValue, const ULWord inRegMask = 0xFFFFFFFF, const ULWord inRegShift = 0x0)) + {return pOutValue && ReadRegister(inRegNum, *pOutValue, inRegMask, inRegShift);} +#endif // !defined(NTV2_DEPRECATE_14_3) + + AJA_VIRTUAL bool RestoreHardwareProcampRegisters (void); + + AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine, + const bool inIsRead, + const ULWord inFrameNumber, + ULWord * pFrameBuffer, + const ULWord inOffsetBytes, + const ULWord inTotalByteCount, + const bool inSynchronous = true); + + AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine, + const bool inIsRead, + const ULWord inFrameNumber, + ULWord * pFrameBuffer, + const ULWord inCardOffsetBytes, + const ULWord inTotalByteCount, + const ULWord inNumSegments, + const ULWord inHostPitchPerSeg, + const ULWord inCardPitchPerSeg, + const bool inSynchronous = true); + + AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine, + const NTV2Channel inDMAChannel, + const bool inTarget, + const ULWord inFrameNumber, + const ULWord inCardOffsetBytes, + const ULWord inByteCount, + const ULWord inNumSegments, + const ULWord inSegmentHostPitch, + const ULWord inSegmentCardPitch, + const PCHANNEL_P2P_STRUCT & inP2PData); + + AJA_VIRTUAL bool ConfigureSubscription (const bool bSubscribe, const INTERRUPT_ENUMS eInterruptType, PULWord & hSubcription) + {(void)bSubscribe; (void)eInterruptType; (void)hSubcription; return true;} + AJA_VIRTUAL bool ConfigureInterrupt (const bool bEnable, const INTERRUPT_ENUMS eInterruptType); + AJA_VIRTUAL bool GetInterruptCount (const INTERRUPT_ENUMS eInterrupt, ULWord & outCount); + AJA_VIRTUAL bool WaitForInterrupt (INTERRUPT_ENUMS eInterrupt, ULWord timeOutMs = 68); // default of 68 ms timeout is enough time for 2K at 14.98 HZ + + AJA_VIRTUAL bool AutoCirculate (AUTOCIRCULATE_DATA &autoCircData); + AJA_VIRTUAL bool NTV2Message (NTV2_HEADER * pInOutMessage); + AJA_VIRTUAL bool ControlDriverDebugMessages(NTV2_DriverDebugMessageSet msgSet, + bool enable); + AJA_VIRTUAL bool HevcSendMessage(HevcMessageHeader* pMessage); + + AJA_VIRTUAL bool SetupBoard(void); + + // Driver allocated buffer (DMA performance enhancement, requires + // bigphysarea patch to kernel) + AJA_VIRTUAL bool MapDMADriverBuffer(); + AJA_VIRTUAL bool UnmapDMADriverBuffer(); + + AJA_VIRTUAL bool DmaReadFrameDriverBuffer ( NTV2DMAEngine DMAEngine, ULWord frameNumber, unsigned long dmaBufferFrame, + ULWord bytes, + ULWord downSample, + ULWord linePitch, + ULWord poll); + + AJA_VIRTUAL bool DmaReadFrameDriverBuffer ( NTV2DMAEngine DMAEngine, ULWord frameNumber, unsigned long dmaBufferFrame, + ULWord offsetSrc, + ULWord offsetDest, + ULWord bytes, + ULWord downSample, + ULWord linePitch, + ULWord poll); + + AJA_VIRTUAL bool DmaWriteFrameDriverBuffer (NTV2DMAEngine DMAEngine, ULWord frameNumber, unsigned long dmaBufferFrame, + ULWord bytes, ULWord poll); + AJA_VIRTUAL bool DmaWriteFrameDriverBuffer (NTV2DMAEngine DMAEngine, ULWord frameNumber, unsigned long dmaBufferFrame, + ULWord offsetSrc, ULWord offsetDest, ULWord bytes, ULWord poll); + + // User allocated buffer methods. Not as fast as driverbuffer methods, but no kernel patch required. + AJA_VIRTUAL bool DmaWriteWithOffsets (NTV2DMAEngine DMAEngine, ULWord frameNumber, ULWord * pFrameBuffer, + ULWord offsetSrc, ULWord offsetDest, ULWord bytes); + AJA_VIRTUAL bool DmaReadWithOffsets (NTV2DMAEngine DMAEngine, ULWord frameNumber, ULWord * pFrameBuffer, + ULWord offsetSrc, ULWord offsetDest, ULWord bytes); + +public: +#if !defined(NTV2_DEPRECATE_13_0) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetRelativeVideoPlaybackDelay (ULWord frmDelay)) {(void)frmDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetRelativeVideoPlaybackDelay (ULWord* frmDelay)){(void)frmDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAudioPlaybackPinDelay (ULWord msDelay)) {(void)msDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioPlaybackPinDelay (ULWord* msDelay)) {(void)msDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAudioRecordPinDelay (ULWord msDelay)) {(void)msDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioRecordPinDelay (ULWord* msDelay)) {(void)msDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. +#endif // !defined(NTV2_DEPRECATE_13_0) +#if !defined(NTV2_DEPRECATE_16_0) + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool GetStreamingApplication(ULWord & outAppType, int32_t & outPID)) {return CNTV2DriverInterface::GetStreamingApplication(outAppType,outPID);} ///< @deprecated Deprecated starting in SDK 16.0. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool GetStreamingApplication(ULWord * pAppType, int32_t * pPID)) {return pAppType && pPID ? CNTV2DriverInterface::GetStreamingApplication(*pAppType,*pPID) : false;} ///< @deprecated Deprecated starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapFrameBuffers(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool UnmapFrameBuffers(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapRegisters(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool UnmapRegisters(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool GetBA0MemorySize(ULWord* memSize)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool GetBA1MemorySize(ULWord* memSize)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool GetBA2MemorySize(ULWord* memSize)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool GetBA4MemorySize(ULWord* memSize)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapXena2Flash(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool UnmapXena2Flash(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapDNXRegisters(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool UnmapDNXRegisters(void));///< @deprecated Obsolete starting in SDK 16.0. +#endif // !defined(NTV2_DEPRECATE_16_0) + AJA_VIRTUAL bool GetDMADriverBufferPhysicalAddress(ULWord* physAddr); // Supported! + AJA_VIRTUAL bool GetDMADriverBufferAddress(ULWord** pDMADriverBuffer); // Supported! + AJA_VIRTUAL bool GetDMANumDriverBuffers(ULWord* pNumDmaDriverBuffers); // Supported! + AJA_VIRTUAL bool SetAudioOutputMode(NTV2_GlobalAudioPlaybackMode mode); // Supported! + AJA_VIRTUAL bool GetAudioOutputMode(NTV2_GlobalAudioPlaybackMode* mode);// Supported! + + +protected: // PRIVATE METHODS + AJA_VIRTUAL bool OpenLocalPhysical (const UWord inDeviceIndex); ///< @brief Opens the local/physical device connection. + AJA_VIRTUAL bool CloseLocalPhysical (void); + +protected: // INSTANCE DATA + std::string _bitfileDirectory; + HANDLE _hDevice; +#if !defined(NTV2_DEPRECATE_16_0) + ULWord * _pDMADriverBufferAddress; + ULWord _BA0MemorySize; + ULWord * _pDNXRegisterBaseAddress; + ULWord _BA2MemorySize; + ULWord _BA4MemorySize; // XENA2 only +#endif // !defined(NTV2_DEPRECATE_16_0) +}; // CNTV2LinuxDriverInterface + +#endif // NTV2LINUXDRIVERINTERFACE_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/src/lin/ntv2linuxpublicinterface.h b/build_dependencies/aja/include/ajalibraries/ajantv2/src/lin/ntv2linuxpublicinterface.h new file mode 100644 index 0000000..c07a407 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/src/lin/ntv2linuxpublicinterface.h @@ -0,0 +1,254 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2linuxpublicinterface.h + @brief Types and defines shared between NTV2 user application interface and Linux device driver. + @copyright (C) 2004-2021 AJA Video Systems, Inc. +**/ +#ifndef NTV2LINUXPUBLICINTERFACE_H +#define NTV2LINUXPUBLICINTERFACE_H + +#include "ajatypes.h" +#include "ntv2enums.h" +#include "ntv2publicinterface.h" + +#define NTV2_DEVICE_TYPE 0xBB + +#define NTV2_LINUX_DRIVER_VERSION NTV2DriverVersionEncodedBuildType | NTV2DriverVersionEncode(AJA_NTV2_SDK_VERSION_MAJOR, AJA_NTV2_SDK_VERSION_MINOR, AJA_NTV2_SDK_VERSION_POINT, AJA_NTV2_SDK_BUILD_NUMBER) + + +// Read,Write IOCTL's + // Input: REGISTER_ACCESS structure + // Output: NONE +#define IOCTL_NTV2_WRITE_REGISTER \ + _IOW(NTV2_DEVICE_TYPE, 48, REGISTER_ACCESS) + + // Input: REGISTER_ACCESS structure + // Output: REGISTER_ACCESS structure +#define IOCTL_NTV2_READ_REGISTER \ + _IOWR(NTV2_DEVICE_TYPE, 49 , REGISTER_ACCESS) + +// DMA Ioctls use METHOD_IN_DIRECT ... thus special macro NTV2_MAKE_IN_DIRECT_IOCTL +#define IOCTL_NTV2_DMA_READ_FRAME \ + _IOW(NTV2_DEVICE_TYPE, 146,NTV2_DMA_CONTROL_STRUCT) + +#define IOCTL_NTV2_DMA_WRITE_FRAME \ + _IOW(NTV2_DEVICE_TYPE, 147,NTV2_DMA_CONTROL_STRUCT) + +#define IOCTL_NTV2_DMA_READ_FRAME_SEGMENT \ + _IOW(NTV2_DEVICE_TYPE, 148,NTV2_DMA_SEGMENT_CONTROL_STRUCT) + +#define IOCTL_NTV2_DMA_WRITE_FRAME_SEGMENT \ + _IOW(NTV2_DEVICE_TYPE, 149,NTV2_DMA_SEGMENT_CONTROL_STRUCT) + +// DMA Ioctls use METHOD_IN_DIRECT ... thus special macro NTV2_MAKE_IN_DIRECT_IOCTL +#define IOCTL_NTV2_DMA_READ \ + _IOW(NTV2_DEVICE_TYPE, 175,NTV2_DMA_CONTROL_STRUCT) + +#define IOCTL_NTV2_DMA_WRITE \ + _IOW(NTV2_DEVICE_TYPE, 176,NTV2_DMA_CONTROL_STRUCT) + +#define IOCTL_NTV2_DMA_READ_SEGMENT \ + _IOW(NTV2_DEVICE_TYPE, 177,NTV2_DMA_SEGMENT_CONTROL_STRUCT) + +#define IOCTL_NTV2_DMA_WRITE_SEGMENT \ + _IOW(NTV2_DEVICE_TYPE, 178,NTV2_DMA_SEGMENT_CONTROL_STRUCT) + +#define IOCTL_NTV2_DMA_P2P \ + _IOW(NTV2_DEVICE_TYPE, 179,NTV2_DMA_P2P_CONTROL_STRUCT) + + +// Interrupt control (enable, disable, get count) +// +#define IOCTL_NTV2_INTERRUPT_CONTROL \ + _IOW(NTV2_DEVICE_TYPE, 220, NTV2_INTERRUPT_CONTROL_STRUCT) + +// Wait for interrupt +// +#define IOCTL_NTV2_WAITFOR_INTERRUPT \ + _IOW(NTV2_DEVICE_TYPE, 221, NTV2_WAITFOR_INTERRUPT_STRUCT) + +// Control debug messages. +// +#define IOCTL_NTV2_CONTROL_DRIVER_DEBUG_MESSAGES \ + _IOW(NTV2_DEVICE_TYPE, 230, NTV2_CONTROL_DRIVER_DEBUG_MESSAGES_STRUCT) + +// Put board interrupts and LEDs in known state +// +#define IOCTL_NTV2_SETUP_BOARD \ + _IO(NTV2_DEVICE_TYPE, 231) + +// Reload procamp hardware registers from software copy after ADC chip reset +#define IOCTL_NTV2_RESTORE_HARDWARE_PROCAMP_REGISTERS \ + _IO(NTV2_DEVICE_TYPE, 232) + +// +// Downloaded Xilinx bitfile management IOCTLs +// +// +#define IOCTL_NTV2_SET_BITFILE_INFO \ + _IOWR(NTV2_DEVICE_TYPE, 240, BITFILE_INFO_STRUCT) + +#define IOCTL_NTV2_GET_BITFILE_INFO \ + _IOWR(NTV2_DEVICE_TYPE, 241, BITFILE_INFO_STRUCT) + +// +// Autocirculate IOCTLs +// +// +#define IOCTL_NTV2_AUTOCIRCULATE_CONTROL \ + _IOW(NTV2_DEVICE_TYPE, 250, AUTOCIRCULATE_DATA) + +#define IOCTL_NTV2_AUTOCIRCULATE_STATUS \ + _IOWR(NTV2_DEVICE_TYPE, 251, AUTOCIRCULATE_STATUS_STRUCT) + +#define IOCTL_NTV2_AUTOCIRCULATE_FRAMESTAMP \ + _IOWR(NTV2_DEVICE_TYPE, 252, AUTOCIRCULATE_FRAME_STAMP_COMBO_STRUCT) + +#define IOCTL_NTV2_AUTOCIRCULATE_TRANSFER \ + _IOWR(NTV2_DEVICE_TYPE, 253, AUTOCIRCULATE_TRANSFER_COMBO_STRUCT) + +#define IOCTL_NTV2_AUTOCIRCULATE_CAPTURETASK \ + _IOWR(NTV2_DEVICE_TYPE, 254, AUTOCIRCULATE_FRAME_STAMP_COMBO_STRUCT) + +#define IOCTL_AJANTV2_MESSAGE \ + _IOWR(NTV2_DEVICE_TYPE, 255, AUTOCIRCULATE_STATUS) + +// +// UART Write/Read IOCTLs +// +#define IOCTL_NTV2_WRITE_UART_TX \ + _IOWR(NTV2_DEVICE_TYPE, 201, NTV2_UART_STRUCT) + +#if 0 /* not yet */ +#define IOCTL_NTV2_READ_UART_RX \ + _IOWR(NTV2_DEVICE_TYPE, 202, NTV2_UART_STRUCT) +#endif + + +// When adding new IOCTLs, note that the number is only 8 bits. +// So don't go above 255. + +// Structure used to request an address range +typedef struct _MAP_MEMORY { + void* Address; + ULWord Length; +} MAP_MEMORY, *PMAP_MEMORY; + + +typedef struct { + ULWord RegisterNumber; + ULWord RegisterValue; + ULWord RegisterMask; + ULWord RegisterShift; +} REGISTER_ACCESS, *PREGISTER_ACCESS; + +// Virtual registers +#include "ntv2virtualregisters.h" + +// Structure used to request a DMA transfer +typedef struct +{ + NTV2DMAEngine engine; + NTV2Channel dmaChannel; + ULWord frameNumber; // 0-NUM_FRAMEBUFFERS-1 + PULWord frameBuffer; // if small integer, then interpreted as DMA driver buffer # in + // driver(i.e. GetDMABufferAddress) + ULWord frameOffsetSrc; // For Audio DMA, we want to write from a specific location within the 'frame' + ULWord frameOffsetDest; // For Audio DMA, we want to write to a specific location within the 'frame' + ULWord numBytes; // number of bytes to transfer + ULWord downSample; // applies only to KHD, used for 1/4 size preview + ULWord linePitch; // applies only if downSample true, gets every linePitch lines + ULWord poll; // if poll = true it doesn't block, needs to be checked manually +} NTV2_DMA_CONTROL_STRUCT, *P_NTV2_DMA_CONTROL_STRUCT; + +// Structure used to request a DMA transfer +typedef struct +{ + NTV2DMAEngine engine; + NTV2Channel dmaChannel; + ULWord frameNumber; // 0-NUM_FRAMEBUFFERS-1 + PULWord frameBuffer; // if small integer, then interpreted as DMA driver buffer # in + // driver(i.e. GetDMABufferAddress) + ULWord frameOffsetSrc; // For Audio DMA, we want to write from a specific location within the 'frame' + ULWord frameOffsetDest; // For Audio DMA, we want to write to a specific location within the 'frame' + ULWord numBytes; // number of bytes to transfer + ULWord poll; // if poll = true it doesn't block, needs to be checked manually + ULWord videoNumSegments; // partial segment transfer - number of segment of size numBytes + ULWord videoSegmentHostPitch; // + ULWord videoSegmentCardPitch; // +} NTV2_DMA_SEGMENT_CONTROL_STRUCT, *P_NTV2_DMA_SEGMENT_CONTROL_STRUCT; + +// Structure used to request a P2P transfer +typedef struct { + bool bRead; // True for a Target operation, false for a Transfer + NTV2DMAEngine dmaEngine; // engine for transfer + NTV2Channel dmaChannel; // frame buffer channel for message + ULWord ulFrameNumber; // frame number for target/transfer + ULWord ulFrameOffset; // offset into frame to start transfer + ULWord ulVidNumBytes; // transfer size in bytes + ULWord ulVidNumSegments; // number of video segments to transfer + ULWord ulVidSegmentHostPitch; // segment host pitch + ULWord ulVidSegmentCardPitch; // segment card pitch + ULWord64 ullVideoBusAddress; // frame buffer bus address + ULWord64 ullMessageBusAddress; // message register bus address (0 if not required) + ULWord ulVideoBusSize; // size of the video aperture (bytes) + ULWord ulMessageData; // message data (write to message bus address to complete video transfer) +} NTV2_DMA_P2P_CONTROL_STRUCT, *P_NTV2_DMA_P2P_CONTROL_STRUCT; + +// Structure to enable/disable interrupts +typedef struct +{ + INTERRUPT_ENUMS eInterruptType; // Which interrupt to enable/disable. Not all interrupts supported. + ULWord enable; // 0: disable, nonzero: enable + ULWord interruptCount; // In: interrupt type. Out: interrupt count +} NTV2_INTERRUPT_CONTROL_STRUCT, *P_NTV2_INTERRUPT_CONTROL_STRUCT; + +// Structure to wait for interrupts +typedef struct +{ + INTERRUPT_ENUMS eInterruptType; // Which interrupt to wait on. + ULWord timeOutMs; // Timeout in milliseconds + ULWord success; // On return, nonzero if interrupt occured +} NTV2_WAITFOR_INTERRUPT_STRUCT, *P_NTV2_WAITFOR_INTERRUPT_STRUCT; + +// Structure to control driver debug messages +typedef struct +{ + NTV2_DriverDebugMessageSet msgSet; // Which set of message to turn on/off + bool enable; // If true, turn messages on + ULWord success;// On return, nonzero on failure +} NTV2_CONTROL_DRIVER_DEBUG_MESSAGES_STRUCT, *P_NTV2_CONTROL_DRIVER_DEBUG_MESSAGES_STRUCT; + +typedef struct +{ + NTV2Crosspoint channelSpec;// Which channel + AUTOCIRCULATE_TRANSFER_STRUCT acTransfer; // Transfer ctl + AUTOCIRCULATE_TRANSFER_STATUS_STRUCT acStatus; // Results + NTV2RoutingTable acXena2RoutingTable; // Xena2 crosspoint table + AUTOCIRCULATE_TASK_STRUCT acTask; // driver tasks +} AUTOCIRCULATE_TRANSFER_COMBO_STRUCT, *P_AUTOCIRCULATE_TRANSFER_COMBO_STRUCT; + +typedef struct +{ + FRAME_STAMP_STRUCT acFrameStamp; // frame stamp + AUTOCIRCULATE_TASK_STRUCT acTask; // driver tasks +} AUTOCIRCULATE_FRAME_STAMP_COMBO_STRUCT, *P_AUTOCIRCULATE_FRAME_STAMP_COMBO_STRUCT; + +/* +typedef struct +{ + ULWord requestedByteCount; // number of bytes to write OR MAX number of bytes to read + ULWord actualByteCount; // actual number of byte successfully written or read + UByte bytes[]; // WRITE: an array of bytes to write of size requestedByteCount + // READ: an empty array of MAX size requestedByteCount into which the read goes +} NTV2_UART_STRUCT, *P_NTV2_UART_STRUCT; +*/ + +// Driver buffers are numbered 0 .. whatever +#define ntv2DMADriverbuffer(n) (n) + + +#define IOCTL_HEVC_MESSAGE \ + _IOWR(NTV2_DEVICE_TYPE, 120, unsigned long) + +#endif diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/src/mac/ntv2macdriverinterface.h b/build_dependencies/aja/include/ajalibraries/ajantv2/src/mac/ntv2macdriverinterface.h new file mode 100644 index 0000000..d338e7e --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/src/mac/ntv2macdriverinterface.h @@ -0,0 +1,153 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2macdriverinterface.h + @brief Declares the MacOS-specific flavor of CNTV2DriverInterface. + @copyright (C) 2007-2021 AJA Video Systems, Inc. +**/ + +#ifndef NTV2MACDRIVERINTERFACE_H +#define NTV2MACDRIVERINTERFACE_H + + +#include "ntv2publicinterface.h" +#include "ntv2macpublicinterface.h" +#include "ntv2driverinterface.h" + + +/** + @brief A Mac-specific implementation of CNTV2DriverInterface. +**/ +class CNTV2MacDriverInterface : public CNTV2DriverInterface +{ + /** + @name Construction, destruction, assignment + **/ + ///@{ + public: + CNTV2MacDriverInterface(); ///< @brief My default constructor. + AJA_VIRTUAL ~CNTV2MacDriverInterface(); ///< @brief My destructor. + ///@} + + /** + @name Overloaded Methods + **/ + ///@{ + AJA_VIRTUAL bool WriteRegister (const ULWord inRegNum, const ULWord inValue, const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0); + AJA_VIRTUAL bool ReadRegister (const ULWord inRegNum, ULWord & outValue, const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0); + + AJA_VIRTUAL bool AcquireStreamForApplication (ULWord inApplicationType, int32_t inProcessID); + AJA_VIRTUAL bool ReleaseStreamForApplication (ULWord inApplicationType, int32_t inProcessID); + AJA_VIRTUAL bool AcquireStreamForApplicationWithReference (ULWord inApplicationType, int32_t inProcessID); + AJA_VIRTUAL bool ReleaseStreamForApplicationWithReference (ULWord inApplicationType, int32_t inProcessID); + AJA_VIRTUAL bool SetStreamingApplication (const ULWord appType, const int32_t pid); + AJA_VIRTUAL bool GetStreamingApplication (ULWord & outAppType, int32_t & outProcessID); + AJA_VIRTUAL bool SetDefaultDeviceForPID (const int32_t pid); + AJA_VIRTUAL bool IsDefaultDeviceForPID (const int32_t pid); + + AJA_VIRTUAL bool WaitForInterrupt (const INTERRUPT_ENUMS type, const ULWord timeout = 50); + AJA_VIRTUAL bool GetInterruptCount (const INTERRUPT_ENUMS eInterrupt, ULWord & outCount); + AJA_VIRTUAL bool WaitForChangeEvent (UInt32 timeout = 0); + AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine, + const bool inIsRead, + const ULWord inFrameNumber, + ULWord * pFrameBuffer, + const ULWord inOffsetBytes, + const ULWord inByteCount, + const bool inSynchronous = true); + + AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine, + const bool inIsRead, + const ULWord inFrameNumber, + ULWord * pFrameBuffer, + const ULWord inCardOffsetBytes, + const ULWord inByteCount, + const ULWord inNumSegments, + const ULWord inSegmentHostPitch, + const ULWord inSegmentCardPitch, + const bool inSynchronous = true); + + AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine, + const NTV2Channel inDMAChannel, + const bool inIsTarget, + const ULWord inFrameNumber, + const ULWord inCardOffsetBytes, + const ULWord inByteCount, + const ULWord inNumSegments, + const ULWord inSegmentHostPitch, + const ULWord inSegmentCardPitch, + const PCHANNEL_P2P_STRUCT & inP2PData); + + AJA_VIRTUAL bool AutoCirculate (AUTOCIRCULATE_DATA & autoCircData); + AJA_VIRTUAL bool NTV2Message (NTV2_HEADER * pInMessage); + AJA_VIRTUAL bool ControlDriverDebugMessages (NTV2_DriverDebugMessageSet /*msgSet*/, bool /*enable*/) {return false;} + AJA_VIRTUAL bool RestoreHardwareProcampRegisters (void); + ///@} + +#if !defined(NTV2_DEPRECATE_14_3) + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadRegister (const ULWord inRegNum, ULWord * pOutValue, const ULWord inRegMask = 0xFFFFFFFF, const ULWord inRegShift = 0x0)) + {return pOutValue ? ReadRegister(inRegNum, *pOutValue, inRegMask, inRegShift) : false;} +#endif // !defined(NTV2_DEPRECATE_14_3) +#if !defined(NTV2_DEPRECATE_15_6) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetUserModeDebugLevel (ULWord level)); ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetUserModeDebugLevel (ULWord* level)); ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetKernelModeDebugLevel (ULWord level));///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetKernelModeDebugLevel (ULWord* level));///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetUserModePingLevel (ULWord level)); ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetUserModePingLevel (ULWord* level)); ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetKernelModePingLevel (ULWord level)); ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetKernelModePingLevel (ULWord* level)); ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetLatencyTimerValue (ULWord value)); ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetLatencyTimerValue (ULWord* value)); ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetDebugFilterStrings (const char* includeString,const char* excludeString)); ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetDebugFilterStrings (char* includeString,char* excludeString)); ///< @deprecated Obsolete starting after SDK 15.5. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool LockFormat (void)); ///< @deprecated Obsolete after SDK 15.5. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetQuickTimeTime (UInt32 *time, UInt32 *scale)); // Formerly called "GetTime" which shadowed CNTV2KonaFlashProgram::GetTime +#endif // !defined(NTV2_DEPRECATE_15_6) +#if !defined(NTV2_DEPRECATE_16_0) + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool GetStreamingApplication(ULWord * pAppType, int32_t * pPID)) {return pAppType && pPID ? GetStreamingApplication(*pAppType,*pPID) : false;} ///< @deprecated Deprecated starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool SystemControl(void* dataPtr, SystemControlCode systemControlCode)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(void Sleep(int)) {} ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapFrameBuffers(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool UnmapFrameBuffers(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapRegisters(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool UnmapRegisters(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapXena2Flash(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool UnmapXena2Flash(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(ULWord GetPCISlotNumber(void) const); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapMemory(const MemoryType memType, void **memPtr)); ///< @deprecated Obsolete starting in SDK 16.0. +#endif // !defined(NTV2_DEPRECATE_16_0) + + AJA_VIRTUAL bool SetAudioOutputMode(NTV2_GlobalAudioPlaybackMode mode); + AJA_VIRTUAL bool GetAudioOutputMode(NTV2_GlobalAudioPlaybackMode* mode); + + AJA_VIRTUAL bool StartDriver (DriverStartPhase phase); + AJA_VIRTUAL bool SystemStatus( void* dataPtr, SystemStatusCode systemStatusCode ); + AJA_VIRTUAL bool KernelLog( void* dataPtr, UInt32 dataSize ); + AJA_VIRTUAL bool ConfigureInterrupt( bool /*bEnable*/, INTERRUPT_ENUMS /*eInterruptType*/ ) {return true;} + +public: + static const std::string & GetIOServiceName (void); // For internal use only +#if !defined(NTV2_DEPRECATE_14_3) + static void SetDebugLogging (const uint64_t inWhichUserClientCommands); +#endif // NTV2_DEPRECATE_14_3 + static void DumpDeviceMap (void); + static UWord GetConnectionCount (void); + static ULWord GetConnectionChecksum (void); + +protected: + AJA_VIRTUAL bool OpenLocalPhysical (const UWord inDeviceIndex); + AJA_VIRTUAL bool CloseLocalPhysical (void); + +private: + AJA_VIRTUAL io_connect_t GetIOConnect (const bool inDoNotAllocate = false) const; // For internal use only + + // 64 bit thunking - only for structures that contain pointers + AJA_VIRTUAL void CopyTo_AUTOCIRCULATE_DATA_64 (AUTOCIRCULATE_DATA *p, AUTOCIRCULATE_DATA_64 *p64); + AJA_VIRTUAL void CopyTo_AUTOCIRCULATE_DATA (AUTOCIRCULATE_DATA_64 *p64, AUTOCIRCULATE_DATA *p); + AJA_VIRTUAL void CopyTo_AUTOCIRCULATE_TRANSFER_STRUCT_64 (AUTOCIRCULATE_TRANSFER_STRUCT *p, AUTOCIRCULATE_TRANSFER_STRUCT_64 *p64); + AJA_VIRTUAL void CopyTo_AUTOCIRCULATE_TASK_STRUCT_64 (AUTOCIRCULATE_TASK_STRUCT *p, AUTOCIRCULATE_TASK_STRUCT_64 *p64); + AJA_VIRTUAL void CopyTo_AUTOCIRCULATE_TRANSFER_STRUCT (AUTOCIRCULATE_TRANSFER_STRUCT_64 *p64, AUTOCIRCULATE_TRANSFER_STRUCT *p); + +}; // CNTV2MacDriverInterface + +#endif // NTV2MACDRIVERINTERFACE_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/src/mac/ntv2macpublicinterface.h b/build_dependencies/aja/include/ajalibraries/ajantv2/src/mac/ntv2macpublicinterface.h new file mode 100644 index 0000000..cab4f90 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/src/mac/ntv2macpublicinterface.h @@ -0,0 +1,194 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2macpublicinterface.h + @brief Declares MacOS-only enums used by the Mac driver and the SDK. + @copyright (C) 2012-2021 AJA Video Systems, Inc. All rights reserved. +**/ + +#ifndef NTV2MACPUBLICINTERFACE_H +#define NTV2MACPUBLICINTERFACE_H + +#if !defined (NTV2_BUILDING_DRIVER) + #include // Defines IOReturn +#endif + + +// Our custom driver IOReturn codes: +const IOReturn kNTV2DriverBadDMA = 0x04430011; // Bad dmaEngine number +const IOReturn kNTV2DriverDMABusy = 0x04430012; // Selected DMA busy or none available +const IOReturn kNTV2DriverParamErr = 0x04430013; // Bad parameter (out of range) +const IOReturn kNTV2DriverPgmXilinxErr = 0x04430014; // Xilinx programming error - see system log for details +const IOReturn kNTV2DriverNotReadyErr = 0x04430015; // Xilinx not programmed yet +const IOReturn kNTV2DriverPrepMemErr = 0x04430016; // Error preparing memory (no room), +const IOReturn kNTV2DriverPgmPPCErr = 0x04430017; // PPC programming error - see system log for details +const IOReturn kNTV2DriverDMATooLarge = 0x04430018; // DMA transfer is too large, or completing (dataPtr not found), + // or attempt to use outside of range +const IOReturn kNTV2DriverBadHeaderTag = 0x04430019; // Bad header tag +const IOReturn kNTV2UnknownStructType = 0x0443001A; // Unknown struct type +const IOReturn kNTV2HeaderVersionErr = 0x0443001B; // Bad or unsupported header version +const IOReturn kNTV2DriverBadTrailerTag= 0x0443001C; // Bad trailer tag +const IOReturn kNTV2DriverMapperErr = 0x0443001D; // Failure while mapping NTV2_POINTERs +const IOReturn kNTV2DriverUnmapperErr = 0x0443001E; // Failure while unmapping NTV2_POINTERs +const IOReturn kNTV2DriverMsgConvErr = 0x0443001F; // NTV2Message conversion failure + + +// Driver command function codes +typedef enum +{ + kDriverReadRegister = 0, + kDriverWriteRegister = 1, + kDriverGetDrvrVersion = 2, // Unsupported starting in 15.0 + kDriverStartDriver = 3, + kDriverAcquireStreamForApplication = 4, + kDriverReleaseStreamForApplication = 5, + kDriverSetStreamForApplication = 6, + kDriverGetStreamForApplication = 7, + kDriverLockFormat = 8, + kDriverSetAVSyncPattern = 9, // Unsupported starting in 15.2 + kDriverTriggerAVSync = 10, // Unsupported starting in 15.2 + kDriverWaitForInterrupt = 11, + kDriverGetInterruptCount = 12, + kDriverWaitForChangeEvent = 13, + kDriverGetTime = 14, + kDriverDMATransfer = 15, + kDriverRestoreProcAmpRegisters = 16, + kDriverSetBitFileInformation = 17, // Unsupported starting in 12.4 + kDriverGetBitFileInformation = 18, // Unsupported starting in 12.4 + kDriverSetDebugFilterStrings = 19, + kDriverGetDebugFilterStrings = 20, + kDriverAutoCirculateControl = 21, + kDriverAutoCirculateStatus = 22, + kDriverAutoCirculateTransfer = 23, + kDriverAutoCirculateFramestamp = 24, + kDriverSetDefaultDeviceForPID = 25, + kDriverIsDefaultDeviceForPID = 26, + kDriverSystemControl = 27, + kDriverSystemStatus = 28, + kDriverDMATransferEx = 29, + kDriverAcquireStreamForApplicationWithReference = 30, + kDriverReleaseStreamForApplicationWithReference = 31, + kDriverKernelLog = 32, + kDriverReadAudioBuffer = 33, // Unsupported starting in 15.2 + kDriverNTV2Message = 34, // Added in 12.0 -- all new driver functionality goes thru this NTV2Message call + kNumberUserClientCommands // number of driver commands +} UserClientCommandCodes; + + +// Memory types for IOConnectMapMemory + +typedef enum +{ + kRegisterMemory, + kFrameBufferMemory, + kXena2FlashMemory, + + kNumberMemoryType // number of Memory types +} MemoryType; + +typedef enum +{ + kInterruptOutputVertical= 1, + kInterruptInput1Vertical, + kInterruptInput2Vertical, + kInterruptAudio, + kInterruptAudioOutWrap, + kInterruptAudioInWrap, + + kInterruptDMA1, + kInterruptDMA2, + kInterruptDMA3, + kInterruptDMA4 +} InterruptType; + +typedef enum +{ + kDMANone = 0, // Use PIO + kDMA1 = 1, + kDMA2 = 2, + kDMA3 = 3, + kDMA4 = 4, + kDMAAuto = 99 // Auto DMA selection +} DMAEngine; + + +// Virtual registers +#include "ntv2virtualregisters.h" + +#define AUDIO_MAX_SAMPLING_RATE_PER_MS 48 + +// Some IoHD specific registers +enum +{ + // isoch global + kRegIoHDGlobalStatus = 2048, + kRegIoHDGlobalControl = 2049, + kRegLocalRegBaseAddrHi = 2050, // our local base register used for delivery of interrupts + kRegLocalRegBaseAddrLo = 2051, // our local base register used for delivery of interrupts + + // ischo ch1 video + kRegIsochVideoCh1Status = 2052, + kRegIsochVideoCh1Control = 2053, + kRegIsochVideoCh1Packets = 2054, + + // isoch ch1 audio + kRegIsochAudioCh1Status = 2056, // hardwired to be the audio playback channel + kRegIsochAudioCh1Control = 2057, + kRegIsochAudioCh1Packets = 2058, + + // isoch ch2 audio + kRegIsochAudioCh2Status = 2060, // hardwired to be the audio capture channel + kRegIsochAudioCh2Control = 2061, + kRegIsochAudioCh2Packets = 2062, + + // misc + kRegFireWireErrors = 2064, // Read - crc errors [0:15], runt packets [16:31] + kRegAudioBufferSize = 2065, // audio buffer size + kRegAudioPlaybackControl = 2066, // audio playuback control + + // AV bitfile select + kRegAVBitFileCSR = 2068, // AV bitfile control and status - currently loaded AV bitfile (read / write) + kRegBitFileBusy = 2069, // Set true when busy during bitfile loading (read only) + kRegGetBitFileInfoSelect = 2070, // which bitfile we want info (write only) + kRegUserState1 = 2071, // contains user state info (Primary/Secondary format, Input select) + + kRegVideoDelay = 2072, // video delay register + + // firmware updates + kRegUpdateControl = 2112, // Update control register + //kRegUpdateSoftwareVersion = 2113, // Software version + //kRegUpdateProductVersion = 2114, // Product version + kRegUpdateBitFileCommand = 2115, // Which bitfile will be updated (write only) + kRegUpdateCRC = 2116, // CRC register + kRegUpdateStatus = 2117, // Status register + kRegSerialNumber = 2118, // Serial register 2 quadlet, 8 bytes + kRegUpdateData = 2120, // data 128(0x80) quadlets, or 512(0x200) bytes, thru 0x8d0 + + // NOTE: THIS VALUE HAS TO MATCH WHAT IS RETURNED BY NTV2DeviceGetMaxRegisterNumber + kRegIoHDLast = 2624 +}; + + +// isoch streams (channels) +enum IsochStreamType +{ + kIsochVideoStream = 0, + kIsochAudioPlaybackStream = 1, + kIsochAudioCaptureStream = 2, + kIsochMaxStreams = 3 +}; + +// update register values +enum +{ + //kMaskStandBusyStatus + kStandAloneNormalStatus = 0, + kStandAloneBusyStatus = 1, + + // kMaskStandAloneMode + kStandAloneNoOp = 0, + kStandAloneFactoryBurn = 1, + kStandAloneUserBurn = 2, + kStandAlonePatternBurn = 4 +}; + +#endif // NTV2MACPUBLICINTERFACE_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/src/win/ntv2windriverinterface.h b/build_dependencies/aja/include/ajalibraries/ajantv2/src/win/ntv2windriverinterface.h new file mode 100644 index 0000000..be42171 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/src/win/ntv2windriverinterface.h @@ -0,0 +1,138 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2windriverinterface.h + @brief Declares the MSWindows-specific flavor of CNTV2DriverInterface. + @copyright (C) 2003-2021 AJA Video Systems, Inc. +**/ +#ifndef NTV2WINDRIVERINTERFACE_H +#define NTV2WINDRIVERINTERFACE_H + +#include "ajaexport.h" +#include "ajatypes.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "psapi.h" + +#include "ntv2driverinterface.h" +#include "ntv2winpublicinterface.h" +#include "ntv2devicefeatures.h" +#include + + +/** + @brief Physical device implementations of ::CNTV2DriverInterface methods through AJA Windows driver. +**/ +class AJAExport CNTV2WinDriverInterface : public CNTV2DriverInterface +{ + public: + CNTV2WinDriverInterface(); ///< @brief My default constructor. + virtual ~CNTV2WinDriverInterface(); ///< @brief My default destructor. + + public: + AJA_VIRTUAL bool WriteRegister (const ULWord inRegNum, const ULWord inValue, const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0); ///< @brief Physical device implementation of CNTV2DriverInterface::WriteRegister. + AJA_VIRTUAL bool ReadRegister (const ULWord inRegNum, ULWord & outValue, const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0); ///< @brief Physical device implementation of CNTV2DriverInterface::ReadRegister. +#if !defined(NTV2_DEPRECATE_14_3) + AJA_VIRTUAL inline NTV2_DEPRECATED_f(bool ReadRegister (const ULWord inRegNum, ULWord * pOutValue, const ULWord inRegMask = 0xFFFFFFFF, const ULWord inRegShift = 0x0)) + {return pOutValue && ReadRegister(inRegNum, *pOutValue, inRegMask, inRegShift);} +#endif // NTV2_DEPRECATE_14_3 + AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine, + const bool inIsRead, + const ULWord inFrameNumber, + ULWord * pFrameBuffer, + const ULWord inOffsetBytes, + const ULWord inByteCount, + const bool inSynchronous = true); + + AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine, + const bool inIsRead, + const ULWord inFrameNumber, + ULWord * pFrameBuffer, + const ULWord inCardOffsetBytes, + const ULWord inByteCount, + const ULWord inNumSegments, + const ULWord inSegmentHostPitch, + const ULWord inSegmentCardPitch, + const bool inSynchronous = true); + + AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine, + const NTV2Channel inDMAChannel, + const bool inIsTarget, + const ULWord inFrameNumber, + const ULWord inCardOffsetBytes, + const ULWord inByteCount, + const ULWord inNumSegments, + const ULWord inSegmentHostPitch, + const ULWord inSegmentCardPitch, + const PCHANNEL_P2P_STRUCT & inP2PData); + + AJA_VIRTUAL bool ConfigureInterrupt (const bool bEnable, const INTERRUPT_ENUMS eInterruptType); + AJA_VIRTUAL bool ConfigureSubscription (const bool bSubscribe, const INTERRUPT_ENUMS eInterruptType, PULWord & hSubcription); + AJA_VIRTUAL bool GetInterruptCount (const INTERRUPT_ENUMS eInterrupt, ULWord & outCount); + AJA_VIRTUAL bool WaitForInterrupt (const INTERRUPT_ENUMS eInterruptType, const ULWord timeOutMs = 50); + + AJA_VIRTUAL bool AutoCirculate (AUTOCIRCULATE_DATA &autoCircData); + AJA_VIRTUAL bool NTV2Message (NTV2_HEADER * pInMessage); + AJA_VIRTUAL bool HevcSendMessage (HevcMessageHeader* pMessage); + AJA_VIRTUAL bool ControlDriverDebugMessages(NTV2_DriverDebugMessageSet msgSet, bool enable) {(void)msgSet; (void)enable; return false;} + +#if !defined(NTV2_DEPRECATE_13_0) + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetRelativeVideoPlaybackDelay (ULWord frmDelay)) {(void)frmDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetRelativeVideoPlaybackDelay (ULWord* frmDelay)) {(void)frmDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAudioPlaybackPinDelay (ULWord msDelay)) {(void)msDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioPlaybackPinDelay (ULWord* msDelay)) {(void)msDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool SetAudioRecordPinDelay (ULWord msDelay)) {(void)msDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. + AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetAudioRecordPinDelay (ULWord* msDelay)) {(void)msDelay; return false;} ///< @deprecated Obsolete starting in SDK 13.0. +#endif // !defined(NTV2_DEPRECATE_13_0) + AJA_VIRTUAL bool SetAudioOutputMode (NTV2_GlobalAudioPlaybackMode mode); + AJA_VIRTUAL bool GetAudioOutputMode (NTV2_GlobalAudioPlaybackMode* mode); + + // Management of downloaded Xilinx bitfile + AJA_VIRTUAL bool DriverGetBitFileInformation (BITFILE_INFO_STRUCT & outBitfileInfo, const NTV2BitFileType inBitfileType = NTV2_VideoProcBitFile); + AJA_VIRTUAL bool DriverSetBitFileInformation (const BITFILE_INFO_STRUCT & inBitfileInfo); + + AJA_VIRTUAL bool RestoreHardwareProcampRegisters (void); + +#if !defined(NTV2_DEPRECATE_16_0) + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool SetStrictTiming(ULWord strictTiming)) {(void)strictTiming; return false;} ///< @deprecated Deprecated starting in SDK 16.0. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool GetStrictTiming(ULWord* strictTiming)){(void)strictTiming; return false;} ///< @deprecated Deprecated starting in SDK 16.0. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool GetStreamingApplication(ULWord & outAppType, int32_t & outPID)) {return CNTV2DriverInterface::GetStreamingApplication(outAppType,outPID);} ///< @deprecated Deprecated starting in SDK 16.0. + AJA_VIRTUAL inline NTV2_SHOULD_BE_DEPRECATED(bool GetStreamingApplication(ULWord * pAppType, int32_t * pPID)) {return pAppType && pPID ? CNTV2DriverInterface::GetStreamingApplication(*pAppType,*pPID) : false;} ///< @deprecated Deprecated starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapFrameBuffers(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool UnmapFrameBuffers(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapRegisters(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool UnmapRegisters(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapXena2Flash(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool UnmapXena2Flash(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool MapMemory(PVOID pvUserVa, ULWord ulNumBytes, bool bMap, ULWord* ulUser = NULL)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool DmaUnlock(void)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool CompleteMemoryForDMA(ULWord * pFrameBuffer)); ///< @deprecated Obsolete starting in SDK 16.0. + AJA_VIRTUAL NTV2_SHOULD_BE_DEPRECATED(bool PrepareMemoryForDMA(ULWord * pFrameBuffer, const ULWord ulNumBytes)); ///< @deprecated Obsolete starting in SDK 16.0. +#endif // !defined(NTV2_DEPRECATE_16_0) + + // PRIVATE INSTANCE METHODS + protected: + AJA_VIRTUAL bool OpenLocalPhysical (const UWord inDeviceIndex); + AJA_VIRTUAL bool CloseLocalPhysical (void); + + // MEMBER DATA + protected: + PSP_DEVICE_INTERFACE_DETAIL_DATA _pspDevIFaceDetailData; + SP_DEVINFO_DATA _spDevInfoData; + HDEVINFO _hDevInfoSet; + HANDLE _hDevice; + GUID _GUID_PROPSET; + ULWord _previousAudioState; + ULWord _previousAudioSelection; +#if !defined(NTV2_DEPRECATE_16_0) + typedef std::vector DMA_LOCKED_VEC; + DMA_LOCKED_VEC _vecDmaLocked; // OEM save locked memory addresses in vector +#endif // !defined(NTV2_DEPRECATE_16_0) +}; // CNTV2WinDriverInterface + +#endif // NTV2WINDRIVERINTERFACE_H diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/src/win/ntv2winpublicinterface.h b/build_dependencies/aja/include/ajalibraries/ajantv2/src/win/ntv2winpublicinterface.h new file mode 100644 index 0000000..b2a5f0e --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/src/win/ntv2winpublicinterface.h @@ -0,0 +1,419 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2winpublicinterface.h + @brief Defines & structs shared between user-space and Windows kernel driver. + @copyright (C) 2003-2021 AJA Video Systems, Inc. +**/ +#ifndef NTV2WINPUBLICINTERFACE_H +#define NTV2WINPUBLICINTERFACE_H + + +//This file includes all the necessary defines, enums etc... to access the +//AJA Video custom kernel streaming property set(s) + +#include "ntv2publicinterface.h" +#include "ks.h" + +#ifdef KSD +//{3280A641-5159-4f43-B55D-E05ABB47C350} +#define STATIC_AJAVIDEO_PROPSET\ + 0x3280A641L, 0x5159, 0x4f43, 0xB5, 0x5D, 0xE0, 0x5A, 0xBB, 0x47, 0xC3, 0x50 +DEFINE_GUIDSTRUCT("3280A641-5159-4f43-B55D-E05ABB47C350", AJAVIDEO_PROPSET); +#define AJAVIDEO_PROPSET DEFINE_GUIDNAMED(AJAVIDEO_PROPSET) + + + +#elif defined KHD + +//{84963F56-67FC-461c-8040-CC891B87195B} +#define STATIC_AJAVIDEO_PROPSET\ + 0x84963f56, 0x67fc, 0x461c, 0x80, 0x40, 0xcc, 0x89, 0x1b, 0x87, 0x19, 0x5b +DEFINE_GUIDSTRUCT("84963F56-67FC-461c-8040-CC891B87195B", AJAVIDEO_PROPSET); +#define AJAVIDEO_PROPSET DEFINE_GUIDNAMED(AJAVIDEO_PROPSET) + +#elif defined XENA2 + +// {2BFA1669-17F7-4cf9-8E05-500B8CB81497} +#define STATIC_AJAVIDEO_PROPSET\ + 0x2bfa1669, 0x17f7, 0x4cf9, 0x8e, 0x5, 0x50, 0xb, 0x8c, 0xb8, 0x14, 0x97 +DEFINE_GUIDSTRUCT("2BFA1669-17F7-4cf9-8E05-500B8CB81497", AJAVIDEO_PROPSET); +#define AJAVIDEO_PROPSET DEFINE_GUIDNAMED(AJAVIDEO_PROPSET) + +#endif + +#define IOCTL_AJAPROPS_GETSETREGISTER CTL_CODE(FILE_DEVICE_UNKNOWN, 0x600, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_GETSETLOGLEVEL CTL_CODE(FILE_DEVICE_UNKNOWN, 0x601, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_MAPMEMORY CTL_CODE(FILE_DEVICE_UNKNOWN, 0x602, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_INTERRUPTS CTL_CODE(FILE_DEVICE_UNKNOWN, 0x603, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_SUBSCRIPTIONS CTL_CODE(FILE_DEVICE_UNKNOWN, 0x604, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_DMA CTL_CODE(FILE_DEVICE_UNKNOWN, 0x605, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_AUTOCIRC_CONTROL CTL_CODE(FILE_DEVICE_UNKNOWN, 0x606, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_AUTOCIRC_STATUS CTL_CODE(FILE_DEVICE_UNKNOWN, 0x607, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_AUTOCIRC_FRAME CTL_CODE(FILE_DEVICE_UNKNOWN, 0x608, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_AUTOCIRC_TRANSFER CTL_CODE(FILE_DEVICE_UNKNOWN, 0x609, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_DT_CONFIGURE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x60A, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_NEWSUBSCRIPTIONS CTL_CODE(FILE_DEVICE_UNKNOWN, 0x60B, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_AUTOCIRC_TRANSFER_EX CTL_CODE(FILE_DEVICE_UNKNOWN, 0x60C, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_DMA_EX CTL_CODE(FILE_DEVICE_UNKNOWN, 0x60D, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_AUTOCIRC_TRANSFER_EX2 CTL_CODE(FILE_DEVICE_UNKNOWN, 0x60E, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_AUTOCIRC_FRAME_EX2 CTL_CODE(FILE_DEVICE_UNKNOWN, 0x60F, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_AUTOCIRC_CAPTURE_TASK CTL_CODE(FILE_DEVICE_UNKNOWN, 0x610, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_GETSETBITFILEINFO CTL_CODE(FILE_DEVICE_UNKNOWN, 0x611, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_AUTOCIRC_CONTROL_EX CTL_CODE(FILE_DEVICE_UNKNOWN, 0x612, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAPROPS_DMA_P2P CTL_CODE(FILE_DEVICE_UNKNOWN, 0x613, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJANTV2_MESSAGE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x614, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AJAHEVC_MESSAGE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x615, METHOD_BUFFERED, FILE_ANY_ACCESS) + + + + // Explicit values are attached to these values, + // to try to prevent anyone inadvertently changing old members (risking incompatibility with older apps) + // when adding new members! +typedef enum { + KSPROPERTY_AJAPROPS_GETSETREGISTER = 0x0, // RW + KSPROPERTY_AJAPROPS_GETSETLOGLEVEL = 0x01, // RW + KSPROPERTY_AJAPROPS_MAPMEMORY = 0x02, + KSPROPERTY_AJAPROPS_INTERRUPTS = 0x03, + KSPROPERTY_AJAPROPS_SUBSCRIPTIONS = 0x04, + KSPROPERTY_AJAPROPS_DMA = 0x05, + KSPROPERTY_AJAPROPS_AUTOCIRC_CONTROL = 0x06, + KSPROPERTY_AJAPROPS_AUTOCIRC_STATUS = 0x07, + KSPROPERTY_AJAPROPS_AUTOCIRC_FRAME = 0x08, + KSPROPERTY_AJAPROPS_AUTOCIRC_TRANSFER = 0x09, + KSPROPERTY_AJAPROPS_DT_CONFIGURE = 0x0A, + KSPROPERTY_AJAPROPS_NEWSUBSCRIPTIONS = 0x0B, // needed for 64 bit windows. + KSPROPERTY_AJAPROPS_AUTOCIRC_TRANSFER_EX = 0x0C, + KSPROPERTY_AJAPROPS_DMA_EX = 0x0D, + KSPROPERTY_AJAPROPS_AUTOCIRC_TRANSFER_EX2 = 0x0E, + KSPROPERTY_AJAPROPS_AUTOCIRC_FRAME_EX2 = 0x0F, + KSPROPERTY_AJAPROPS_AUTOCIRC_CAPTURE_TASK = 0x10, + KSPROPERTY_AJAPROPS_GETSETBITFILEINFO = 0x011, // attempt to maintain compatibility between application and driver versions. + KSPROPERTY_AJAPROPS_AUTOCIRC_CONTROL_EX = 0x12, + KSPROPERTY_AJAPROPS_DMA_P2P = 0x13, + + // DURIAN + KSPROPERTY_AJAPROPS_DT_GET_XENA_DXT_FIRMWARE_DESIRED = 0x20, + KSPROPERTY_AJAPROPS_DT_ESTABLISH_XENA_DXT_FIRMWARE_HD = 0x021, + KSPROPERTY_AJAPROPS_DT_ESTABLISH_XENA_DXT_FIRMWARE_SD = 0x022, + KSPROPERTY_AJAPROPS_DT_GETSETVIDEOCAPTUREPINCONNECTED = 0x023, + KSPROPERTY_AJAPROPS_DT_GETSETAUDIOCAPTUREPINCONNECTED = 0x024, + KSPROPERTY_AJAPROPS_DT_GETSETAUDIOMUX0 = 0x025, + + +} KSPROPERTY_AJAPROPS; + +typedef struct { //this is the structure used for the KSPROPERTY_AJAPROPS_GETSETREGISTER property. + KSPROPERTY Property; + ULONG RegisterID; // ID of the targeted register. + ULONG ulRegisterValue; // For Read, set by the driver on the way out, for Write set by the requestor on the way in! + ULONG ulRegisterMask; // For post AND + ULONG ulRegisterShift; // For pre OR +} KSPROPERTY_AJAPROPS_GETSETREGISTER_S, *PKSPROPERTY_AJAPROPS_GETSETREGISTER_S; + +//add any other required structures for other properties here! + +// Structure used to request an address range for memory mapping +typedef enum _MAP_MEMORY_TYPE { + NTV2_MAPMEMORY_FRAMEBUFFER = 0, + NTV2_MAPMEMORY_REGISTER = 1, + NTV2_MAPMEMORY_PCIFLASHPROGRAM = 2, +} MAP_MEMORY_TYPE, *PMAP_MEMORY_TYPE; + +typedef struct { + void* Address; + ULONG Length; +} MAP_MEMORY, *PMAP_MEMORY; + +typedef struct { + void* POINTER_32 Address; + ULONG Length; +} MAP_MEMORY_32, *PMAP_MEMORY_32; + +// Memory map property structure - includes MAP_MEMORY structure +typedef struct { + KSPROPERTY Property; // boilerplate Properties stuff + MAP_MEMORY mapMemory; // set by kernel if mapping, set by user if unmapping + UByte bMapType; // true if un/map registers (BA0), false if un/map framebuffer (BA1) +} KSPROPERTY_AJAPROPS_MAPMEMORY_S, *PKSPROPERTY_AJAPROPS_MAPMEMORY_S; + +// Memory map property structure - includes MAP_MEMORY structure +typedef struct { + KSPROPERTY Property; // boilerplate Properties stuff + MAP_MEMORY_32 mapMemory; // set by kernel if mapping, set by user if unmapping + UByte bMapType; // true if un/map registers (BA0), false if un/map framebuffer (BA1) +} KSPROPERTY_AJAPROPS_MAPMEMORY_S_32, *PKSPROPERTY_AJAPROPS_MAPMEMORY_S_32; + +// Interrupt property structure - includes INTERRUPT_ENUMS +typedef struct { + KSPROPERTY Property; // boilerplate Properties stuff + ULONG ulMask; // used only by GetCurrentInterruptMask() + INTERRUPT_ENUMS eInterrupt; // specifies the interrupt type +} KSPROPERTY_AJAPROPS_INTERRUPTS_S, *PKSPROPERTY_AJAPROPS_INTERRUPTS_S; + + +////////////////////////////////////////////////////////////////////////////////////// +// Subscription property structure - includes INTERRUPT_ENUMS +typedef struct { + KSPROPERTY Property; // boilerplate Properties stuff + HANDLE * pHandle; // address of userspace created notification event + INTERRUPT_ENUMS eInterrupt; // specifies subscription type + ULONG ulIntCount; // set by kernel in method getInterruptCount() +} KSPROPERTY_AJAPROPS_SUBSCRIPTIONS_S, *PKSPROPERTY_AJAPROPS_SUBSCRIPTIONS_S; + +typedef struct { + KSPROPERTY Property; // boilerplate Properties stuff + HANDLE * POINTER_32 pHandle; // address of userspace created notification event + INTERRUPT_ENUMS eInterrupt; // specifies subscription type + ULONG ulIntCount; // set by kernel in method getInterruptCount() +} KSPROPERTY_AJAPROPS_SUBSCRIPTIONS_S_32, *PKSPROPERTY_AJAPROPS_SUBSCRIPTIONS_S_32; + +////////////////////////////////////////////////////////////////////////////////////// +// New Subscription property structure - includes INTERRUPT_ENUMS +/// Added to support 64 bit driver. +typedef struct { + KSPROPERTY Property; // boilerplate Properties stuff + HANDLE Handle; // address of userspace created notification event + INTERRUPT_ENUMS eInterrupt; // specifies subscription type + ULONG ulIntCount; // set by kernel in method getInterruptCount() +} KSPROPERTY_AJAPROPS_NEWSUBSCRIPTIONS_S, *PKSPROPERTY_AJAPROPS_NEWSUBSCRIPTIONS_S; + +typedef struct { + KSPROPERTY Property; // boilerplate Properties stuff + VOID * POINTER_32 Handle; // address of userspace created notification event + INTERRUPT_ENUMS eInterrupt; // specifies subscription type + ULONG ulIntCount; // set by kernel in method getInterruptCount() +} KSPROPERTY_AJAPROPS_NEWSUBSCRIPTIONS_S_32, *PKSPROPERTY_AJAPROPS_NEWSUBSCRIPTIONS_S_32; + +//////////////////////////////////////////////////////////////////////////////////// +// DMA + +typedef struct { + KSPROPERTY Property; // boilerplate Properties stuff + NTV2DMAEngine dmaEngine; + PVOID pvVidUserVa; // void pointer to user virtual address + ULWord ulFrameNumber; + ULWord ulVidNumBytes; // transfer size in bytes + ULWord ulFrameOffset; // offset into frame to start transfer + PULWord pulAudUserVa; + ULWord ulAudNumBytes; + ULWord ulAudStartSample; + bool bSync; // if true, block in kernel until DMA complete +} KSPROPERTY_AJAPROPS_DMA_S, *PKSPROPERTY_AJAPROPS_DMA_S; + +typedef struct { + KSPROPERTY Property; // boilerplate Properties stuff + NTV2DMAEngine dmaEngine; + void* POINTER_32 pvVidUserVa; // void pointer to user virtual address + ULWord ulFrameNumber; + ULWord ulVidNumBytes; // transfer size in bytes + ULWord ulFrameOffset; // offset into frame to start transfer + ULWord* POINTER_32 pulAudUserVa; + ULWord ulAudNumBytes; + ULWord ulAudStartSample; + bool bSync; // if true, block in kernel until DMA complete +} KSPROPERTY_AJAPROPS_DMA_S_32, *PKSPROPERTY_AJAPROPS_DMA_S_32; + +typedef struct { + KSPROPERTY Property; // boilerplate Properties stuff + NTV2DMAEngine dmaEngine; + PVOID pvVidUserVa; // void pointer to user virtual address + ULWord ulFrameNumber; + ULWord ulVidNumBytes; // transfer size in bytes + ULWord ulFrameOffset; // offset into frame to start transfer + PULWord pulAudUserVa; + ULWord ulAudNumBytes; + ULWord ulAudStartSample; + ULWord ulVidNumSegments; + ULWord ulVidSegmentHostPitch; + ULWord ulVidSegmentCardPitch; + bool bSync; // if true, block in kernel until DMA complete +} KSPROPERTY_AJAPROPS_DMA_EX_S, *PKSPROPERTY_AJAPROPS_DMA_EX_S; + +typedef struct { + KSPROPERTY Property; // boilerplate Properties stuff + NTV2DMAEngine dmaEngine; + void* POINTER_32 pvVidUserVa; // void pointer to user virtual address + ULWord ulFrameNumber; + ULWord ulVidNumBytes; // transfer size in bytes + ULWord ulFrameOffset; // offset into frame to start transfer + ULWord* POINTER_32 pulAudUserVa; + ULWord ulAudNumBytes; + ULWord ulAudStartSample; + ULWord ulVidNumSegments; + ULWord ulVidSegmentHostPitch; + ULWord ulVidSegmentCardPitch; + bool bSync; // if true, block in kernel until DMA complete +} KSPROPERTY_AJAPROPS_DMA_EX_S_32, *PKSPROPERTY_AJAPROPS_DMA_EX_S_32; + +typedef struct { + KSPROPERTY Property; // boilerplate Properties stuff + NTV2DMAEngine dmaEngine; // engine for transfer + NTV2Channel dmaChannel; // frame buffer channel for message + ULWord ulFrameNumber; // frame number for target/transfer + ULWord ulFrameOffset; // offset into frame to start transfer + ULWord ulVidNumBytes; // transfer size in bytes + ULWord ulVidNumSegments; // number of video segments to transfer + ULWord ulVidSegmentHostPitch; // segment host pitch + ULWord ulVidSegmentCardPitch; // segment card pitch + ULWord64 ullVideoBusAddress; // frame buffer bus address + ULWord64 ullMessageBusAddress; // message register bus address (0 if not required) + ULWord ulVideoBusSize; // size of the video aperture (bytes) + ULWord ulMessageData; // message data (write to message bus address to complete video transfer) +} KSPROPERTY_AJAPROPS_DMA_P2P_S, *PKSPROPERTY_AJAPROPS_DMA_P2P_S; + +//////////////////////////////////////////////////////////////////////////////////// +// AutoCirculate +//////////////////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////////////////// +// Control +typedef struct { + KSPROPERTY Property; + AUTO_CIRC_COMMAND eCommand; + NTV2Crosspoint channelSpec; + LWord lVal1; + LWord lVal2; + LWord lVal3; + bool bVal1; + bool bVal2; + bool bVal3; + bool bVal4; + bool bVal5; + bool bVal6; + bool bVal7; + bool bVal8; +} KSPROPERTY_AJAPROPS_AUTOCIRC_CONTROL_S, *PKSPROPERTY_AJAPROPS_AUTOCIRC_CONTROL_S; + +typedef struct { + KSPROPERTY Property; + AUTO_CIRC_COMMAND eCommand; + NTV2Crosspoint channelSpec; + LWord lVal1; + LWord lVal2; + LWord lVal3; + LWord lVal4; + LWord lVal5; + LWord lVal6; + LWord lVal7; + LWord lVal8; + LWord lVal9; + LWord lVal10; + bool bVal1; + bool bVal2; + bool bVal3; + bool bVal4; + bool bVal5; + bool bVal6; + bool bVal7; + bool bVal8; + bool bVal9; + bool bVal10; + bool bVal11; + bool bVal12; + bool bVal13; + bool bVal14; +} KSPROPERTY_AJAPROPS_AUTOCIRC_CONTROL_EX_S, *PKSPROPERTY_AJAPROPS_AUTOCIRC_CONTROL_EX_S; + +///////////////////////////////////////////////////////////////////////////////////// +// GetAutoCirculate +typedef struct { + KSPROPERTY Property; + AUTO_CIRC_COMMAND eCommand; + NTV2Crosspoint channelSpec; + AUTOCIRCULATE_STATUS_STRUCT autoCircStatus; +} KSPROPERTY_AJAPROPS_AUTOCIRC_STATUS_S, *PKSPROPERTY_AJAPROPS_AUTOCIRC_STATUS_S; + +///////////////////////////////////////////////////////////////////////////////////////// +// GetFrameStamp +typedef struct { + KSPROPERTY Property; + AUTO_CIRC_COMMAND eCommand; + NTV2Crosspoint channelSpec; + LWord lFrameNum; + FRAME_STAMP_STRUCT frameStamp; +} KSPROPERTY_AJAPROPS_AUTOCIRC_FRAME_S, *PKSPROPERTY_AJAPROPS_AUTOCIRC_FRAME_S; + +typedef struct { + KSPROPERTY Property; + AUTO_CIRC_COMMAND eCommand; + NTV2Crosspoint channelSpec; + LWord lFrameNum; + FRAME_STAMP_STRUCT frameStamp; + AUTOCIRCULATE_TASK_STRUCT acTask; +} KSPROPERTY_AJAPROPS_AUTOCIRC_FRAME_EX2_S, *PKSPROPERTY_AJAPROPS_AUTOCIRC_FRAME_EX2_S; + +typedef struct { + KSPROPERTY Property; + AUTO_CIRC_COMMAND eCommand; + NTV2Crosspoint channelSpec; + LWord lFrameNum; + FRAME_STAMP_STRUCT frameStamp; + AUTOCIRCULATE_TASK_STRUCT_32 acTask; +} KSPROPERTY_AJAPROPS_AUTOCIRC_FRAME_EX2_S_32, *PKSPROPERTY_AJAPROPS_AUTOCIRC_FRAME_EX2_S_32; + +////////////////////////////////////////////////////////////////////////////////////////////// +// Transfer +typedef struct { + KSPROPERTY Property; + AUTO_CIRC_COMMAND eCommand; + AUTOCIRCULATE_TRANSFER_STRUCT acTransfer; + AUTOCIRCULATE_TRANSFER_STATUS_STRUCT acStatus; +} KSPROPERTY_AJAPROPS_AUTOCIRC_TRANSFER_S, *PKSPROPERTY_AJAPROPS_AUTOCIRC_TRANSFER_S; + +typedef struct { + KSPROPERTY Property; + AUTO_CIRC_COMMAND eCommand; + AUTOCIRCULATE_TRANSFER_STRUCT_32 acTransfer; + AUTOCIRCULATE_TRANSFER_STATUS_STRUCT acStatus; +} KSPROPERTY_AJAPROPS_AUTOCIRC_TRANSFER_S_32, *PKSPROPERTY_AJAPROPS_AUTOCIRC_TRANSFER_S_32; + +////////////////////////////////////////////////////////////////////////////////////////////// +// TransferEx - Extended version for Xena2.... +typedef struct { + KSPROPERTY Property; + AUTO_CIRC_COMMAND eCommand; + AUTOCIRCULATE_TRANSFER_STRUCT acTransfer; + AUTOCIRCULATE_TRANSFER_STATUS_STRUCT acStatus; + NTV2RoutingTable acTransferRoute; +} KSPROPERTY_AJAPROPS_AUTOCIRC_TRANSFER_EX_S, *PKSPROPERTY_AJAPROPS_AUTOCIRC_TRANSFER_EX_S; + +typedef struct { + KSPROPERTY Property; + AUTO_CIRC_COMMAND eCommand; + AUTOCIRCULATE_TRANSFER_STRUCT_32 acTransfer; + AUTOCIRCULATE_TRANSFER_STATUS_STRUCT acStatus; + NTV2RoutingTable acTransferRoute; +} KSPROPERTY_AJAPROPS_AUTOCIRC_TRANSFER_EX_S_32, *PKSPROPERTY_AJAPROPS_AUTOCIRC_TRANSFER_EX_S_32; + +////////////////////////////////////////////////////////////////////////////////////////////// +// TransferEx2 - Extended version for autocirculate tasks.... +typedef struct { + KSPROPERTY Property; + AUTO_CIRC_COMMAND eCommand; + AUTOCIRCULATE_TRANSFER_STRUCT acTransfer; + AUTOCIRCULATE_TRANSFER_STATUS_STRUCT acStatus; + NTV2RoutingTable acTransferRoute; + AUTOCIRCULATE_TASK_STRUCT acTask; +} KSPROPERTY_AJAPROPS_AUTOCIRC_TRANSFER_EX2_S, *PKSPROPERTY_AJAPROPS_AUTOCIRC_TRANSFER_EX2_S; + +typedef struct { + KSPROPERTY Property; + AUTO_CIRC_COMMAND eCommand; + AUTOCIRCULATE_TRANSFER_STRUCT_32 acTransfer; + AUTOCIRCULATE_TRANSFER_STATUS_STRUCT acStatus; + NTV2RoutingTable acTransferRoute; + AUTOCIRCULATE_TASK_STRUCT_32 acTask; +} KSPROPERTY_AJAPROPS_AUTOCIRC_TRANSFER_EX2_S_32, *PKSPROPERTY_AJAPROPS_AUTOCIRC_TRANSFER_EX2_S_32; + +// Get/SetBitFileInformation +typedef struct { + KSPROPERTY Property; + BITFILE_INFO_STRUCT bitFileInfoStruct; +} KSPROPERTY_AJAPROPS_GETSETBITFILEINFO_S, *PKSPROPERTY_AJAPROPS_GETSETBITFILEINFO_S; + +typedef enum { + PERFCOUNTER_TIMESTAMP_100NS, + PERFCOUNTER_TIMESTAMP_RAW, +} PerfCounterTimestampMode; + +#endif diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/utilityfiles/public/ntv2firmwareinstallerthread.h b/build_dependencies/aja/include/ajalibraries/ajantv2/utilityfiles/public/ntv2firmwareinstallerthread.h new file mode 100644 index 0000000..08e549d --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/utilityfiles/public/ntv2firmwareinstallerthread.h @@ -0,0 +1,140 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2firmwareinstallerthread.h + @brief Declaration of CNTV2FirmwareInstallerThread class. + @copyright (C) 2014-2021 AJA Video Systems, Inc. All rights reserved. +**/ +#ifndef __NTV2FIRMWAREINSTALLERTHREAD_H__ +#define __NTV2FIRMWAREINSTALLERTHREAD_H__ + +#include "ntv2card.h" +#include "ntv2devicescanner.h" +#include "ajabase/system/thread.h" + + +const int kFirmwareUpdateCheckFailed (999); + + +/** + @brief Compares the on-device firmware with the device's corresponding on-disk bitfile firmware, and indicates + if an update is required or not. + @note This function looks in the host-specific "well known location" for the device's firmware file. + @param[in] inDeviceInfo A constant reference to a valid NTV2DeviceInfo struct that represents an attached and + powered-on device. + @return Zero (false) if the on-device firmware date exactly matches the on-disk bitfile firmware date. + +1 if the on-device firmware date is newer than the on-disk bitfile firmware date. + -1 if the on-device firmware date is older than the on-disk bitfile firmware date. + kFirmwareUpdateCheckFailed if unable to compare due to an error. +**/ +int NeedsFirmwareUpdate (const NTV2DeviceInfo & inDeviceInfo); + + +/** + @brief Compares the on-device firmware with the device's corresponding on-disk bitfile firmware, and indicates + if an update is required or not. + @note This function looks in the host-specific "well known location" for the device's firmware file. + @param[in] inDeviceInfo A constant reference to a valid NTV2DeviceInfo struct that represents an attached and + powered-on device. + @param[out] outInfo Receives a human-readable string that explains why the result was non-zero. + @return Zero (false) if the on-device firmware date exactly matches the on-disk bitfile firmware date. + +1 if the on-device firmware date is newer than the on-disk bitfile firmware date. + -1 if the on-device firmware date is older than the on-disk bitfile firmware date. + kFirmwareUpdateCheckFailed if unable to compare due to an error. +**/ +int NeedsFirmwareUpdate (const NTV2DeviceInfo & inDeviceInfo, std::string & outInfo); + + +/** + @brief I am an AJAThread that installs firmware from a given bitfile on the local host into a specific AJA device. + @details To use, simply construct with an NTV2DeviceInfo that identifies the target device, and a string containing + a path (relative or absolute) to the bitfile, then call ThreadRun. You can periodically poll it by calling + Active(), or ask for a human-readable status string by calling GetStatusString(). When finished, call + IsUpdateSuccessful() to find out if the installation succeeded. +**/ +class CNTV2FirmwareInstallerThread : public AJAThread +{ + // Instance Methods + public: + /** + @brief Constructs me for a given device and bitfile. + @param[in] inDeviceInfo Specifies the device to be flashed. + @param[in] inBitfilePath Specifies the path (relative or absolute) to the firmware bitfile to install. + @param[in] inVerbose If true (the default), emit detailed messages to the standard output stream when + flashing has started and when it has successfully completed; otherwise, don't. + **/ + explicit CNTV2FirmwareInstallerThread (const NTV2DeviceInfo & inDeviceInfo, + const std::string & inBitfilePath, + const bool inVerbose = true, + const bool inForce = false); + + explicit CNTV2FirmwareInstallerThread (const NTV2DeviceInfo & inDeviceInfo, + const std::string & inDRFilesPath, + const NTV2DeviceID inDesiredID, + const bool inVerbose); + + virtual inline ~CNTV2FirmwareInstallerThread () {} + + /** + @brief Starts the thread to erase, flash and verify the firmware update. + @return AJA_STATUS_SUCCESS if successful; otherwise other values upon failure. + **/ + virtual AJAStatus ThreadRun (void); + + // Accessors + /** + @return A constant reference to a string containing the bitfile path that was specified when I was constructed. + **/ + virtual inline const std::string & GetBitfilePath (void) const {return m_bitfilePath;} + + /** + @return True only if the device was successfully flashed. + **/ + virtual inline bool IsUpdateSuccessful (void) const {return m_updateSuccessful;} + + /** + @return A string containing a human-readable status message based on the current installation state. + **/ + virtual std::string GetStatusString (void) const; + + /** + @return An integer value representing the current progress of the current in-progress installation. + Divide this value by the result of GetProgressMax() to obtain a percentage. + @note This function should only be called if the thread is still active. + **/ + virtual uint32_t GetProgressValue (void) const; + + /** + @return An integer value representing the maximum progress value of the current in-progress installation. + Divide this value into the result of GetProgressValue() to obtain a percentage. + @note This function should only be called if the thread is still active. + **/ + virtual uint32_t GetProgressMax (void) const; + + protected: + virtual void InternalUpdateStatus (void) const; + /** + @return True if the MCS bitfile can be flashed onto the IP device; otherwise false. + **/ + virtual bool ShouldUpdateIPDevice (const NTV2DeviceID inDeviceID, const std::string & designName) const; + + private: + CNTV2FirmwareInstallerThread (); // hidden + CNTV2FirmwareInstallerThread (const CNTV2FirmwareInstallerThread & inObj); // hidden + virtual CNTV2FirmwareInstallerThread & operator = (const CNTV2FirmwareInstallerThread & inObj); // hidden + + // Instance Data + protected: + const NTV2DeviceInfo m_deviceInfo; ///< @brief Device info passed to me at construction + NTV2DeviceID m_desiredID; ///< @brief Desired dynamic reconfig profile + std::string m_bitfilePath; ///< @brief Absolute path to bitfile on host that's to be flashed into device + std::string m_drFilesPath; ///< @brief Path to group of dynamic reconfig files + bool m_updateSuccessful; ///< @brief Initially False, is set True if firmware successfully installed + const bool m_verbose; ///< @brief Verbose logging to cout/cerr? + const bool m_forceUpdate; ///< @brief Force the install of the bitfile + const bool m_useDynamicReconfig; ///< @brief Use dyanmic reconfig + mutable CNTV2Card m_device; ///< @brief Talks to the AJA device + mutable SSC_GET_FIRMWARE_PROGRESS_STRUCT m_statusStruct; ///< @brief Firmware update progress + +}; // CNTV2FirmwareInstallerThread + +#endif // __NTV2FIRMWAREINSTALLERTHREAD_H__ diff --git a/build_dependencies/aja/include/ajalibraries/ajantv2/utilityfiles/public/ntv2hevcfirmwareinstallerthread.h b/build_dependencies/aja/include/ajalibraries/ajantv2/utilityfiles/public/ntv2hevcfirmwareinstallerthread.h new file mode 100644 index 0000000..ce01715 --- /dev/null +++ b/build_dependencies/aja/include/ajalibraries/ajantv2/utilityfiles/public/ntv2hevcfirmwareinstallerthread.h @@ -0,0 +1,208 @@ +/* SPDX-License-Identifier: MIT */ +/** + @file ntv2hevcfirmwareinstallerthread.h + @brief Declaration of CNTV2HEVCFirmwareInstallerThread class. + @copyright (C) 2015-2021 AJA Video Systems, Inc. All rights reserved. +**/ +#ifndef __NTV2HEVCFIRMWAREINSTALLERTHREAD_H__ +#define __NTV2HEVCFIRMWAREINSTALLERTHREAD_H__ + +#include "ntv2card.h" +#include "ntv2devicescanner.h" +#include "ajabase/system/thread.h" + +// Bar offsets +#define BAR0_OFFSET (0xF1E00000) +#define BAR2_OFFSET (0x08000000) +#define BAR5_OFFSET (0xF0000000) + +// PCIE LINK Register +#define PCIE_BOOT_FLAG (0x00000000) + +// HSIO SYSOC Register +#define HSIO_SYSOC_BASE_ADDR (0xF1E00000) +#define PCIE_INT_REG_SET_OFFSET (0x00000090) + +// SRAM +#define SRAM_BASE_ADDR (0x01000000) +#define SRAM_BOOT_OFFSET (0x00000000) +#define SRAM_LOAD_OFFSET (0x00000400) +#define SRAM_DATA_OFFSET (0x00004000) +#define SRAM_STAT_FLAG (0x00000004) +#define SRAM_RESET_OFFSET (0x00003E00) +#define SRAM_MODE_FLAG (0x00003F00) +#define SRAM_STOP_FLAG (0x00003F10) +#define SRAM_CMND_FLAG (0x00003F20) +#define SRAM_LOAD_FLAG (0x00003F30) +#define SRAM_BOOT_MAX_SIZE (0x00000400) +#define SRAM_LOAD_MAX_SIZE (0x00003000) +#define SRAM_DATA_MAX_SIZE (0x00018000) +#define SRAM_BOOTCHECK_ADDR (0xFFF69020) + +// DRAM +#define DRAM_PARM_OFFSET (0x00005000) +#define DRAM_PARM_MAX_SIZE (0x00001000) + +#define SECTOR_SIZE (128 << 10) +#define WR_DATA_SIZE (0x200) +#define WR_FUNC_SIZE (0x2CC) +#define RD_DATA_SIZE (0x40) +#define RD_FUNC_SIZE (0x0C + 0x40) +#define RD_FUNC_DATA (0x0C) + +#define PERCENT_PROGRESS_START() do { printf(" 0%% "); fflush(stdout); pp = 0; } while (0) +#define PERCENT_PROGRESS() do { px = (double)(dataSize - remainSize) * 100 / dataSize; if (px > pp) { printf("\r%3d%% ", px); fflush(stdout); pp = px; } } while (0) +#define PERCENT_PROGRESS_END() do { printf("\r100%%\n"); fflush(stdout); } while (0) + +typedef enum +{ + HEVC_ERR_NONE, + HEVC_ERR_OPEN, + HEVC_ERR_READ, + HEVC_ERR_WRITE, + HEVC_ERR_SIZE, + HEVC_ERR_VERIFY, + HEVC_ERR_NOT_BOOTED, + HEVC_ERR_BOOT, + HEVC_ERR_STOP, + HEVC_ERR_RECOVERED, + HEVC_ERR_LOAD, + HEVC_ERR_OFFSET, + HEVC_ERR_DEVICEID, + HEVC_ERR_NOT_LOADED, + HEVC_ERR_ALREADY_LOADED, + HEVC_ERR_BUSY, + HEVC_ERR_ERASE, + HEVC_ERR_PROGRAM, + HEVC_ERR_STATE +} HEVCError; + +// Flash Parameters +typedef struct +{ + char device_name[64]; + uint32_t device_id[2]; + uint32_t device_size; +} M31FlashParams; + +class CNTV2HEVCFirmwareInstallerThread : public AJAThread +{ + // Instance Methods + public: + + virtual AJAStatus ThreadInit (void); + + /** + @brief Constructs me for a given device and bitfile. + @param[in] inDeviceInfo Specifies the device to be flashed. + @param[in] inBitfilePath Specifies the path (relative or absolute) to the firmware bitfile to install. + @param[in] inVerbose If true (the default), emit detailed messages to the standard output stream when + flashing has started and when it has successfully completed; otherwise, don't. + **/ + explicit CNTV2HEVCFirmwareInstallerThread (const NTV2DeviceInfo & inDeviceInfo, + const std::string & inBitfilePath, + const bool inVerbose = true); + virtual inline ~CNTV2HEVCFirmwareInstallerThread () {} + + /** + @brief Starts the thread to erase, flash and verify the firmware update. + @return AJA_STATUS_SUCCESS if successful; otherwise other values upon failure. + **/ + virtual AJAStatus ThreadRun (void); + + // Accessors + /** + @brief Returns a constant reference to the bitfile path that was specified when I was constructed. + @return A constant reference to a string containing the bitfile path that was specified when I was constructed. + **/ + virtual inline const std::string & GetBitfilePath (void) const {return m_bitfilePath;} + + /** + @brief Returns true only if the device was successfully flashed. + @return True only if the device was successfully flashed. + **/ + virtual inline bool IsUpdateSuccessful (void) const {return m_updateSuccessful;} + + /** + @brief Returns a string containing a human-readable status message based on the current installation state. + @return A string containing a human-readable status message based on the current installation state. + **/ + virtual std::string GetStatusString (void) const; + + /** + @brief Returns the current progress value of the current in-progress installation. To compute a percentage, + divide the value returned from this function by the value returned by GetProgressMax(). + @return An integer value representing the current progress of the current in-progress installation. + @note This function should only be called if the thread is still active. + **/ + virtual uint32_t GetProgressValue (void) const; + + /** + @brief Returns the maximum progress value of the current in-progress installation. To compute a percentage, + divide the value returned from GetProgressValue() by the value returned by this function. + @return An integer value representing the current progress percentage of the current in-progress installation. + @note This function should only be called if the thread is still active. + **/ + virtual uint32_t GetProgressMax (void) const; + + protected: + virtual void InternalUpdateStatus (void) const; + + private: + CNTV2HEVCFirmwareInstallerThread (); // hidden + CNTV2HEVCFirmwareInstallerThread (const CNTV2HEVCFirmwareInstallerThread & inObj); // hidden + virtual CNTV2HEVCFirmwareInstallerThread & operator = (const CNTV2HEVCFirmwareInstallerThread & inObj); // hidden + + // Support routines, moved over from the Fujitsu maintenance application. + + private: + bool WriteVerify32(uint32_t offset, uint32_t val); + uint32_t Flash16WaitReady(uint32_t barOffset, uint32_t pos); + uint32_t Flash16ReadDeviceId(uint32_t barOffset, uint32_t pos); + uint32_t Flash16ChipErase(uint32_t barOffset, uint32_t pos); + uint32_t Flash16SectorErase(uint32_t barOffset, uint32_t pos, uint32_t off); + uint32_t Flash16WriteBuffer512(uint32_t barOffset, uint32_t pos, uint32_t off, uint32_t *buf); + uint32_t Flash16Read64(uint32_t barOffset, uint32_t pos, uint32_t off); + uint32_t ReadDeviceId(uint32_t barOffset, uint32_t pos); + void IdentifyFlash(uint32_t barOffset, M31FlashParams *flash); + + public: + uint32_t StatusCheck(uint32_t address, uint32_t checkValue, uint32_t timeout, bool isEqual, bool dotUpdate); + bool IsBooted(); + HEVCError Check(); + HEVCError Boot(); + HEVCError Stop(); + HEVCError LoadFlash(); + HEVCError ChipErase(); + HEVCError SectorErase(uint32_t offset, uint32_t dataSize); + HEVCError Program(char* fileName, uint32_t flashOffset, uint32_t fileOffset, uint32_t length); + HEVCError FlashDump(char* fileName, uint32_t offset, uint32_t dataSize); + HEVCError LoadDram(); + HEVCError DramTest(uint32_t offset, uint32_t size, uint32_t blockSize, uint32_t buf0, uint32_t buf1); + HEVCError BinVerify(char* fileName, uint32_t fileOffset, uint32_t compareSize, uint32_t bar, uint32_t offset, uint32_t timeout); + HEVCError FlashMainModeCommon(); + + HEVCError FlashMode(char* fileName, uint32_t offset, uint32_t versionOffset); + HEVCError FlashMCPU(char* fileName, uint32_t reset); + HEVCError FlashSystem(char* fileName, char* configName, ULWord flashOffset, ULWord fileOffset, ULWord length); + bool WriteRegisterBar4(ULWord address, ULWord value, ULWord mask = 0xffffffff, ULWord shift = 0); + + // Instance Data + protected: + const NTV2DeviceInfo m_deviceInfo; ///< Device info passed to me at construction + std::string m_bitfilePath; ///< Absolute path to bitfile on host that's to be flashed into device + bool m_updateSuccessful; ///< Initially False, is set True if firmware successfully installed + const bool m_verbose; ///< Verbose logging to cout/cerr? + mutable CNTV2Card m_device; ///< Talks to the AJA device + mutable SSC_GET_FIRMWARE_PROGRESS_STRUCT m_statusStruct; ///< Firmware update progress + + uint64_t m_updateTime; + uint32_t m_dataBuf[SRAM_DATA_MAX_SIZE / 4]; + uint32_t m_tempBuf[SRAM_DATA_MAX_SIZE / 4]; + M31FlashParams m_flash; + + HevcDeviceInfo m_hevcInfo; +}; // HEVCFirmwareInstallerThread + + +#endif // __NTV2HEVCFIRMWAREINSTALLERTHREAD_H__ diff --git a/build_dependencies/aja/lib/libajantv2.a b/build_dependencies/aja/lib/libajantv2.a new file mode 100644 index 0000000..5324121 Binary files /dev/null and b/build_dependencies/aja/lib/libajantv2.a differ diff --git a/cef_binary_5060_linux64.tar.xz b/cef_binary_5060_linux64.tar.xz new file mode 100644 index 0000000..3e6f244 Binary files /dev/null and b/cef_binary_5060_linux64.tar.xz differ diff --git a/obs-studio/debian/changelog b/debian/changelog similarity index 66% rename from obs-studio/debian/changelog rename to debian/changelog index 7470201..09e0c42 100644 --- a/obs-studio/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +obs-studio (100:29.0.2-99pika1) kinetic; urgency=medium + + * New Upstream release + + -- Ward Nakchbandi Sat, 01 Oct 2022 14:50:00 +0200 + obs-studio (100:28.0.0-99pika1) kinetic; urgency=medium * Rebrand to PikaOS diff --git a/obs-studio/debian/compat b/debian/compat similarity index 100% rename from obs-studio/debian/compat rename to debian/compat diff --git a/obs-studio/debian/control b/debian/control similarity index 100% rename from obs-studio/debian/control rename to debian/control diff --git a/obs-studio/debian/copyright b/debian/copyright similarity index 100% rename from obs-studio/debian/copyright rename to debian/copyright diff --git a/obs-studio/debian/patches/6207.patch b/debian/patches/6207.patch similarity index 99% rename from obs-studio/debian/patches/6207.patch rename to debian/patches/6207.patch index 5c6f6b4..e34c456 100644 --- a/obs-studio/debian/patches/6207.patch +++ b/debian/patches/6207.patch @@ -1,4 +1,4 @@ -From 03f4e81cb5e8f993dc86d77c88b496a3e6342b57 Mon Sep 17 00:00:00 2001 +From 5ef5ef7f4ae3afa4b41a89c6e1a07d17ec9aec19 Mon Sep 17 00:00:00 2001 From: Dimitris Papaioannou Date: Sun, 26 Jun 2022 17:14:24 +0300 Subject: [PATCH] linux-pipewire: Add PipeWire audio captures @@ -7,11 +7,11 @@ Subject: [PATCH] linux-pipewire: Add PipeWire audio captures plugins/linux-pipewire/CMakeLists.txt | 6 +- plugins/linux-pipewire/data/locale/en-US.ini | 6 + plugins/linux-pipewire/linux-pipewire.c | 5 + - .../pipewire-audio-capture-app.c | 939 ++++++++++++++++++ + .../pipewire-audio-capture-app.c | 938 ++++++++++++++++++ .../pipewire-audio-capture-device.c | 543 ++++++++++ plugins/linux-pipewire/pipewire-audio.c | 582 +++++++++++ plugins/linux-pipewire/pipewire-audio.h | 172 ++++ - 7 files changed, 2252 insertions(+), 1 deletion(-) + 7 files changed, 2251 insertions(+), 1 deletion(-) create mode 100644 plugins/linux-pipewire/pipewire-audio-capture-app.c create mode 100644 plugins/linux-pipewire/pipewire-audio-capture-device.c create mode 100644 plugins/linux-pipewire/pipewire-audio.c @@ -80,10 +80,10 @@ index fea91254ac19..0307fed6f0ca 100644 diff --git a/plugins/linux-pipewire/pipewire-audio-capture-app.c b/plugins/linux-pipewire/pipewire-audio-capture-app.c new file mode 100644 -index 000000000000..7aa192ae0c61 +index 000000000000..e14677367bf8 --- /dev/null +++ b/plugins/linux-pipewire/pipewire-audio-capture-app.c -@@ -0,0 +1,939 @@ +@@ -0,0 +1,938 @@ +/* pipewire-audio-capture-apps.c + * + * Copyright 2022 Dimitris Papaioannou @@ -527,10 +527,9 @@ index 000000000000..7aa192ae0c61 + PW_KEY_NODE_NAME, "OBS Studio", PW_KEY_NODE_DESCRIPTION, + "OBS App Audio Capture Sink", PW_KEY_FACTORY_NAME, + "support.null-audio-sink", PW_KEY_MEDIA_CLASS, -+ "Audio/Sink/Virtual", PW_KEY_NODE_WANT_DRIVER, "true", -+ PW_KEY_NODE_DRIVER, "false", PW_KEY_NODE_PAUSE_ON_IDLE, "false", -+ PW_KEY_NODE_VIRTUAL, "true", SPA_KEY_AUDIO_POSITION, position, -+ NULL); ++ "Audio/Sink/Virtual", PW_KEY_NODE_ALWAYS_PROCESS, "true", ++ PW_KEY_NODE_PAUSE_ON_IDLE, "false", PW_KEY_NODE_VIRTUAL, "true", ++ SPA_KEY_AUDIO_POSITION, position, NULL); + + pw_properties_setf(sink_props, PW_KEY_AUDIO_CHANNELS, "%u", channels); + @@ -1574,7 +1573,7 @@ index 000000000000..b493f862e584 +} diff --git a/plugins/linux-pipewire/pipewire-audio.c b/plugins/linux-pipewire/pipewire-audio.c new file mode 100644 -index 000000000000..f50c31b8c11e +index 000000000000..77a690579f95 --- /dev/null +++ b/plugins/linux-pipewire/pipewire-audio.c @@ -0,0 +1,582 @@ @@ -2012,9 +2011,9 @@ index 000000000000..f50c31b8c11e +{ + return pw_properties_new( + PW_KEY_NODE_NAME, "OBS Studio", PW_KEY_NODE_DESCRIPTION, -+ "OBS Audio Capture", PW_KEY_APP_NAME, "OBS Studio", -+ PW_KEY_MEDIA_TYPE, "Audio", PW_KEY_MEDIA_CATEGORY, "Capture", -+ PW_KEY_MEDIA_ROLE, "Production", PW_KEY_NODE_WANT_DRIVER, ++ "OBS Audio Capture", PW_KEY_MEDIA_TYPE, "Audio", ++ PW_KEY_MEDIA_CATEGORY, "Capture", PW_KEY_MEDIA_ROLE, ++ "Production", PW_KEY_NODE_WANT_DRIVER, + want_driver ? "true" : "false", PW_KEY_STREAM_CAPTURE_SINK, + capture_sink ? "true" : "false", NULL); +} @@ -2338,3 +2337,4 @@ index 000000000000..fc196826f46d +void pipewire_audio_capture_load(void); +void pipewire_audio_capture_app_load(void); +/* ------------------------------------------------- */ + diff --git a/obs-studio/debian/patches/7206.patch b/debian/patches/7206.patch similarity index 77% rename from obs-studio/debian/patches/7206.patch rename to debian/patches/7206.patch index 3e609ad..d2abc78 100644 --- a/obs-studio/debian/patches/7206.patch +++ b/debian/patches/7206.patch @@ -1,4 +1,4 @@ -From e2a95d65caa1a08fa18e3ceecdae26e3b658c74f Mon Sep 17 00:00:00 2001 +From 7ac1d462af1be795569e0d5c8f79871901e5d6e0 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Sun, 28 Aug 2022 10:15:16 +0200 Subject: [PATCH] obs-ffmpeg: Make AMF encoder work on Linux @@ -8,32 +8,36 @@ Only the fallback encoders are available (no texture support). Requires AMD proprietary Vulkan driver, using different driver will be detected on startup and the encoders disabled. --- - plugins/obs-ffmpeg/CMakeLists.txt | 3 +- + plugins/obs-ffmpeg/CMakeLists.txt | 3 + .../obs-ffmpeg/obs-amf-test/CMakeLists.txt | 11 +- - .../obs-amf-test/obs-amf-test-linux.cpp | 135 ++++++++++++++++++ + .../obs-amf-test/obs-amf-test-linux.cpp | 140 ++++++++++++++++++ plugins/obs-ffmpeg/obs-ffmpeg.c | 10 +- plugins/obs-ffmpeg/texture-amf-opts.hpp | 2 +- - plugins/obs-ffmpeg/texture-amf.cpp | 74 +++++++++- - 6 files changed, 223 insertions(+), 12 deletions(-) + plugins/obs-ffmpeg/texture-amf.cpp | 81 +++++++++- + 6 files changed, 236 insertions(+), 11 deletions(-) create mode 100644 plugins/obs-ffmpeg/obs-amf-test/obs-amf-test-linux.cpp diff --git a/plugins/obs-ffmpeg/CMakeLists.txt b/plugins/obs-ffmpeg/CMakeLists.txt -index 98b88876d13d..83d61c218a75 100644 +index 681a057..35cb1ea 100644 --- a/plugins/obs-ffmpeg/CMakeLists.txt +++ b/plugins/obs-ffmpeg/CMakeLists.txt -@@ -112,8 +112,9 @@ if(OS_WINDOWS) - jim-nvenc.h jim-nvenc-helpers.c obs-ffmpeg.rc) +@@ -119,11 +119,14 @@ if(OS_WINDOWS) + obs-ffmpeg.rc) elseif(OS_POSIX AND NOT OS_MACOS) + add_subdirectory(obs-amf-test) + find_package(Libva REQUIRED) find_package(Libpci REQUIRED) -- target_sources(obs-ffmpeg PRIVATE obs-ffmpeg-vaapi.c) + target_sources(obs-ffmpeg PRIVATE vaapi-utils.c + vaapi-utils.h) + target_link_libraries(obs-ffmpeg PRIVATE Libva::va Libva::drm LIBPCI::LIBPCI) + target_sources(obs-ffmpeg PRIVATE texture-amf.cpp) - target_link_libraries(obs-ffmpeg PRIVATE LIBPCI::LIBPCI) ++ target_link_libraries(obs-ffmpeg PRIVATE LIBPCI::LIBPCI) endif() + setup_plugin_target(obs-ffmpeg) diff --git a/plugins/obs-ffmpeg/obs-amf-test/CMakeLists.txt b/plugins/obs-ffmpeg/obs-amf-test/CMakeLists.txt -index 85347e73dfea..034b4cc3b053 100644 +index 85347e7..034b4cc 100644 --- a/plugins/obs-ffmpeg/obs-amf-test/CMakeLists.txt +++ b/plugins/obs-ffmpeg/obs-amf-test/CMakeLists.txt @@ -3,8 +3,15 @@ project(obs-amf-test) @@ -56,14 +60,15 @@ index 85347e73dfea..034b4cc3b053 100644 diff --git a/plugins/obs-ffmpeg/obs-amf-test/obs-amf-test-linux.cpp b/plugins/obs-ffmpeg/obs-amf-test/obs-amf-test-linux.cpp new file mode 100644 -index 000000000000..263103b7104b +index 0000000..018486e --- /dev/null +++ b/plugins/obs-ffmpeg/obs-amf-test/obs-amf-test-linux.cpp -@@ -0,0 +1,135 @@ +@@ -0,0 +1,140 @@ +#include "../external/AMF/include/core/Factory.h" +#include "../external/AMF/include/core/Trace.h" +#include "../external/AMF/include/components/VideoEncoderVCE.h" +#include "../external/AMF/include/components/VideoEncoderHEVC.h" ++#include "../external/AMF/include/components/VideoEncoderAV1.h" + +#include +#include @@ -77,6 +82,7 @@ index 000000000000..263103b7104b + bool is_amd = false; + bool supports_avc = false; + bool supports_hevc = false; ++ bool supports_av1 = false; +}; + +static AMFFactory *amf_factory = nullptr; @@ -116,6 +122,7 @@ index 000000000000..263103b7104b + caps.is_amd = true; + caps.supports_avc = has_encoder(amf_context, AMFVideoEncoderVCE_AVC); + caps.supports_hevc = has_encoder(amf_context, AMFVideoEncoder_HEVC); ++ caps.supports_av1 = has_encoder(amf_context, AMFVideoEncoder_AV1); + + return true; +} @@ -188,6 +195,8 @@ index 000000000000..263103b7104b + caps.supports_avc ? "true" : "false"); + printf("supports_hevc=%s\n", + caps.supports_hevc ? "true" : "false"); ++ printf("supports_av1=%s\n", ++ caps.supports_av1 ? "true" : "false"); + } + + return 0; @@ -196,12 +205,12 @@ index 000000000000..263103b7104b + return 0; +} diff --git a/plugins/obs-ffmpeg/obs-ffmpeg.c b/plugins/obs-ffmpeg/obs-ffmpeg.c -index 1d1131d1355f..08d234aab6aa 100644 +index 1677e08..4bb870a 100644 --- a/plugins/obs-ffmpeg/obs-ffmpeg.c +++ b/plugins/obs-ffmpeg/obs-ffmpeg.c -@@ -294,6 +294,9 @@ static bool vaapi_supported(void) +@@ -322,6 +322,9 @@ static bool nvenc_supported(bool *out_h264, bool *out_hevc, bool *out_av1) #ifdef _WIN32 - extern void jim_nvenc_load(bool h264, bool hevc); + extern void jim_nvenc_load(bool h264, bool hevc, bool av1); extern void jim_nvenc_unload(void); +#endif + @@ -209,7 +218,7 @@ index 1d1131d1355f..08d234aab6aa 100644 extern void amf_load(void); extern void amf_unload(void); #endif -@@ -356,7 +359,7 @@ bool obs_module_load(void) +@@ -391,7 +394,7 @@ bool obs_module_load(void) #endif } @@ -218,7 +227,7 @@ index 1d1131d1355f..08d234aab6aa 100644 amf_load(); #endif -@@ -380,8 +383,11 @@ void obs_module_unload(void) +@@ -409,8 +412,11 @@ void obs_module_unload(void) obs_ffmpeg_unload_logging(); #endif @@ -232,10 +241,10 @@ index 1d1131d1355f..08d234aab6aa 100644 #endif } diff --git a/plugins/obs-ffmpeg/texture-amf-opts.hpp b/plugins/obs-ffmpeg/texture-amf-opts.hpp -index b8270290955d..3cc4e1cd19d0 100644 +index b1c37d2..d28e3f7 100644 --- a/plugins/obs-ffmpeg/texture-amf-opts.hpp +++ b/plugins/obs-ffmpeg/texture-amf-opts.hpp -@@ -261,7 +261,7 @@ static void amf_apply_opt(amf_base *enc, obs_option *opt) +@@ -321,7 +321,7 @@ static void amf_apply_opt(amf_base *enc, obs_option *opt) val = atoi(opt->value); } @@ -245,10 +254,10 @@ index b8270290955d..3cc4e1cd19d0 100644 bool bool_val = (bool)val; set_amf_property(enc, wname, bool_val); diff --git a/plugins/obs-ffmpeg/texture-amf.cpp b/plugins/obs-ffmpeg/texture-amf.cpp -index a0e7a8a16cfa..2a73def3ab30 100644 +index 92e57e0..8c648ce 100644 --- a/plugins/obs-ffmpeg/texture-amf.cpp +++ b/plugins/obs-ffmpeg/texture-amf.cpp -@@ -19,12 +19,15 @@ +@@ -20,6 +20,7 @@ #include "external/AMF/include/core/Factory.h" #include "external/AMF/include/core/Trace.h" @@ -256,7 +265,8 @@ index a0e7a8a16cfa..2a73def3ab30 100644 #include #include #include - +@@ -27,6 +28,8 @@ + #include #include #include +#endif @@ -264,7 +274,7 @@ index a0e7a8a16cfa..2a73def3ab30 100644 #include #include #include -@@ -55,8 +58,10 @@ struct amf_error { +@@ -57,8 +60,10 @@ struct amf_error { struct handle_tex { uint32_t handle; @@ -275,7 +285,7 @@ index a0e7a8a16cfa..2a73def3ab30 100644 }; struct adapter_caps { -@@ -71,7 +76,7 @@ static std::map caps; +@@ -74,7 +79,7 @@ static std::map caps; static bool h264_supported = false; static AMFFactory *amf_factory = nullptr; static AMFTrace *amf_trace = nullptr; @@ -284,7 +294,7 @@ index a0e7a8a16cfa..2a73def3ab30 100644 static uint64_t amf_version = 0; /* ========================================================================= */ -@@ -118,9 +123,11 @@ struct amf_base { +@@ -122,9 +127,11 @@ struct amf_base { virtual void init() = 0; }; @@ -297,7 +307,7 @@ index a0e7a8a16cfa..2a73def3ab30 100644 struct amf_texencode : amf_base, public AMFSurfaceObserver { volatile bool destroying = false; -@@ -157,6 +164,7 @@ struct amf_texencode : amf_base, public AMFSurfaceObserver { +@@ -161,6 +168,7 @@ struct amf_texencode : amf_base, public AMFSurfaceObserver { throw amf_error("InitDX11 failed", res); } }; @@ -305,7 +315,7 @@ index a0e7a8a16cfa..2a73def3ab30 100644 struct amf_fallback : amf_base, public AMFSurfaceObserver { volatile bool destroying = false; -@@ -184,9 +192,21 @@ struct amf_fallback : amf_base, public AMFSurfaceObserver { +@@ -188,9 +196,21 @@ struct amf_fallback : amf_base, public AMFSurfaceObserver { void init() override { @@ -327,7 +337,7 @@ index a0e7a8a16cfa..2a73def3ab30 100644 } }; -@@ -236,6 +256,7 @@ static void set_amf_property(amf_base *enc, const wchar_t *name, const T &value) +@@ -249,6 +269,7 @@ static void set_amf_property(amf_base *enc, const wchar_t *name, const T &value) /* ------------------------------------------------------------------------- */ /* Implementation */ @@ -335,7 +345,7 @@ index a0e7a8a16cfa..2a73def3ab30 100644 static HMODULE get_lib(const char *lib) { HMODULE mod = GetModuleHandleA(lib); -@@ -382,6 +403,7 @@ static void get_tex_from_handle(amf_texencode *enc, uint32_t handle, +@@ -395,6 +416,7 @@ static void get_tex_from_handle(amf_texencode *enc, uint32_t handle, *km_out = km.Detach(); *tex_out = tex.Detach(); } @@ -343,7 +353,7 @@ index a0e7a8a16cfa..2a73def3ab30 100644 static constexpr amf_int64 macroblock_size = 16; -@@ -548,6 +570,7 @@ static void amf_encode_base(amf_base *enc, AMFSurface *amf_surf, +@@ -640,6 +662,7 @@ static void amf_encode_base(amf_base *enc, AMFSurface *amf_surf, static bool amf_encode_tex(void *data, uint32_t handle, int64_t pts, uint64_t lock_key, uint64_t *next_key, encoder_packet *packet, bool *received_packet) @@ -351,7 +361,7 @@ index a0e7a8a16cfa..2a73def3ab30 100644 try { amf_texencode *enc = (amf_texencode *)data; ID3D11DeviceContext *context = enc->context; -@@ -624,6 +647,18 @@ try { +@@ -716,6 +739,18 @@ try { *received_packet = false; return false; } @@ -370,15 +380,15 @@ index a0e7a8a16cfa..2a73def3ab30 100644 static buf_t alloc_buf(amf_fallback *enc) { -@@ -1247,6 +1282,7 @@ static void amf_avc_create_internal(amf_base *enc, obs_data_t *settings) +@@ -1406,6 +1441,7 @@ static void amf_avc_create_internal(amf_base *enc, obs_data_t *settings) static void *amf_avc_create_texencode(obs_data_t *settings, obs_encoder_t *encoder) +#ifdef _WIN32 try { - check_texture_encode_capability(encoder, false); + check_texture_encode_capability(encoder, amf_codec_type::AVC); -@@ -1269,6 +1305,12 @@ try { +@@ -1428,6 +1464,12 @@ try { blog(LOG_ERROR, "[texture-amf-h264] %s: %s", __FUNCTION__, err); return obs_encoder_create_rerouted(encoder, "h264_fallback_amf"); } @@ -391,15 +401,15 @@ index a0e7a8a16cfa..2a73def3ab30 100644 static void *amf_avc_create_fallback(obs_data_t *settings, obs_encoder_t *encoder) -@@ -1579,6 +1621,7 @@ static void amf_hevc_create_internal(amf_base *enc, obs_data_t *settings) +@@ -1748,6 +1790,7 @@ static void amf_hevc_create_internal(amf_base *enc, obs_data_t *settings) static void *amf_hevc_create_texencode(obs_data_t *settings, obs_encoder_t *encoder) +#ifdef _WIN32 try { - check_texture_encode_capability(encoder, true); + check_texture_encode_capability(encoder, amf_codec_type::HEVC); -@@ -1601,6 +1644,12 @@ try { +@@ -1770,6 +1813,12 @@ try { blog(LOG_ERROR, "[texture-amf-h265] %s: %s", __FUNCTION__, err); return obs_encoder_create_rerouted(encoder, "h265_fallback_amf"); } @@ -412,9 +422,30 @@ index a0e7a8a16cfa..2a73def3ab30 100644 static void *amf_hevc_create_fallback(obs_data_t *settings, obs_encoder_t *encoder) -@@ -1675,9 +1724,16 @@ static void register_hevc() - /* ========================================================================= */ - /* Global Stuff */ +@@ -2047,6 +2096,7 @@ static void amf_av1_create_internal(amf_base *enc, obs_data_t *settings) + + static void *amf_av1_create_texencode(obs_data_t *settings, + obs_encoder_t *encoder) ++#ifdef _WIN32 + try { + check_texture_encode_capability(encoder, amf_codec_type::AV1); + +@@ -2069,6 +2119,12 @@ try { + blog(LOG_ERROR, "[texture-amf-av1] %s: %s", __FUNCTION__, err); + return obs_encoder_create_rerouted(encoder, "av1_fallback_amf"); + } ++#else ++{ ++ UNUSED_PARAMETER(settings); ++ return obs_encoder_create_rerouted(encoder, "av1_fallback_amf"); ++} ++#endif + + static void *amf_av1_create_fallback(obs_data_t *settings, + obs_encoder_t *encoder) +@@ -2159,9 +2215,16 @@ static bool enum_luids(void *param, uint32_t idx, uint64_t luid) + return true; + } +#ifdef _WIN32 +#define OBS_AMF_TEST "obs-amf-test.exe" @@ -429,7 +460,7 @@ index a0e7a8a16cfa..2a73def3ab30 100644 HMODULE amf_module_test; /* Check if the DLL is present before running the more expensive */ -@@ -1687,11 +1743,17 @@ try { +@@ -2171,17 +2234,25 @@ try { if (!amf_module_test) throw "No AMF library"; FreeLibrary(amf_module_test); @@ -441,14 +472,23 @@ index a0e7a8a16cfa..2a73def3ab30 100644 +#endif /* ----------------------------------- */ - /* Check for AVC/HEVC support */ + /* Check for supported codecs */ - BPtr test_exe = os_get_executable_path_ptr("obs-amf-test.exe"); + BPtr test_exe = os_get_executable_path_ptr(OBS_AMF_TEST); + std::stringstream cmd; std::string caps_str; - os_process_pipe_t *pp = os_process_pipe_create(test_exe, "r"); -@@ -1748,12 +1810,12 @@ try { + cmd << test_exe; +- enum_graphics_device_luids(enum_luids, &cmd); + ++#ifdef _WIN32 ++ enum_graphics_device_luids(enum_luids, &cmd); ++#endif + os_process_pipe_t *pp = os_process_pipe_create(cmd.str().c_str(), "r"); + if (!pp) + throw "Failed to launch the AMF test process I guess"; +@@ -2240,12 +2311,12 @@ try { /* ----------------------------------- */ /* Init AMF */ @@ -463,7 +503,7 @@ index a0e7a8a16cfa..2a73def3ab30 100644 if (!init) throw "Failed to get AMFInit address"; -@@ -1765,7 +1827,7 @@ try { +@@ -2257,7 +2328,7 @@ try { if (res != AMF_OK) throw amf_error("GetTrace failed", res); @@ -472,4 +512,6 @@ index a0e7a8a16cfa..2a73def3ab30 100644 amf_module, AMF_QUERY_VERSION_FUNCTION_NAME); if (!get_ver) throw "Failed to get AMFQueryVersion address"; +-- +2.39.0 diff --git a/debian/patches/8293.patch b/debian/patches/8293.patch new file mode 100644 index 0000000..d48f3c7 --- /dev/null +++ b/debian/patches/8293.patch @@ -0,0 +1,85 @@ +diff --git a/plugins/linux-pipewire/pipewire.c b/plugins/linux-pipewire/pipewire.c +index 444259b965c12..d1ff3e33fc410 100644 +--- a/plugins/linux-pipewire/pipewire.c ++++ b/plugins/linux-pipewire/pipewire.c +@@ -144,6 +144,41 @@ static void update_pw_versions(obs_pipewire *obs_pw, const char *version) + blog(LOG_WARNING, "[pipewire] failed to parse server version"); + } + ++static uint32_t calc_spa_enumformat_buffer_size(obs_pipewire *obs_pw) ++{ ++ // from spa/pod/pod.h ++ uint32_t spa_pod_object_size = sizeof(struct spa_pod_object); ++ uint32_t spa_pod_prop_size = sizeof(struct spa_pod_prop); ++ uint32_t spa_pod_value_size = 1 * sizeof(uint64_t); ++ uint32_t spa_pod_choice_size = 2 * sizeof(uint64_t); ++ // This is counted from the build_format function ++ uint32_t n_objects = 0; ++ uint32_t n_props = 0; ++ uint32_t n_values = 0; ++ uint32_t n_choices = 0; ++ uint32_t size; ++ ++ for (size_t i = 0; i < obs_pw->format_info.num; i++) { ++ if (obs_pw->format_info.array[i].modifiers.num == 0) ++ continue; ++ n_objects += 1; ++ n_props += 5 + 1; ++ n_values += 9 + 2 + obs_pw->format_info.array[i].modifiers.num; ++ n_choices += 2 + 1; ++ } ++ for (size_t i = 0; i < obs_pw->format_info.num; i++) { ++ n_objects += 1; ++ n_props += 5; ++ n_values += 9; ++ n_choices += 2; ++ } ++ size = n_objects * spa_pod_object_size + n_props * spa_pod_prop_size + ++ n_values * spa_pod_value_size + n_choices * spa_pod_choice_size; ++ blog(LOG_DEBUG, "[pipewire]: calculated spa enumFormat buffer size %u", ++ size); ++ return size; ++} ++ + static void teardown_pipewire(obs_pipewire *obs_pw) + { + if (obs_pw->thread_loop) { +@@ -338,6 +373,10 @@ static bool build_format_params(obs_pipewire *obs_pw, + obs_pw->format_info.array[i].spa_format, + obs_pw->format_info.array[i].modifiers.array, + obs_pw->format_info.array[i].modifiers.num); ++ if (!params[params_count - 1]) { ++ blog(LOG_ERROR, "[pipewire] Failed to format param"); ++ return false; ++ } + } + + build_shm: +@@ -345,6 +384,10 @@ static bool build_format_params(obs_pipewire *obs_pw, + params[params_count++] = build_format( + pod_builder, &obs_pw->video_info, + obs_pw->format_info.array[i].spa_format, NULL, 0); ++ if (!params[params_count - 1]) { ++ blog(LOG_ERROR, "[pipewire] Failed to format param"); ++ return false; ++ } + } + *param_list = params; + *n_params = params_count; +@@ -451,7 +494,7 @@ static void renegotiate_format(void *data, uint64_t expirations) + + pw_thread_loop_lock(obs_pw->thread_loop); + +- uint8_t params_buffer[2048]; ++ uint8_t params_buffer[calc_spa_enumformat_buffer_size(obs_pw)]; + struct spa_pod_builder pod_builder = + SPA_POD_BUILDER_INIT(params_buffer, sizeof(params_buffer)); + uint32_t n_params; +@@ -897,7 +940,7 @@ void obs_pipewire_connect_stream(obs_pipewire *obs_pw, int pipewire_node, + struct spa_pod_builder pod_builder; + const struct spa_pod **params = NULL; + uint32_t n_params; +- uint8_t params_buffer[2048]; ++ uint8_t params_buffer[calc_spa_enumformat_buffer_size(obs_pw)]; + + pw_thread_loop_lock(obs_pw->thread_loop); diff --git a/obs-studio/debian/patches/add-plugins.patch b/debian/patches/add-plugins.patch similarity index 100% rename from obs-studio/debian/patches/add-plugins.patch rename to debian/patches/add-plugins.patch diff --git a/obs-studio/debian/patches/encoder-rename.patch b/debian/patches/encoder-rename.patch similarity index 64% rename from obs-studio/debian/patches/encoder-rename.patch rename to debian/patches/encoder-rename.patch index aa5ece7..43fef35 100644 --- a/obs-studio/debian/patches/encoder-rename.patch +++ b/debian/patches/encoder-rename.patch @@ -1,21 +1,21 @@ -diff --git a/plugins/obs-x264/obs-x264.c b/plugins/obs-x264/obs-x264.c -index efcb8e42e..37acf579a 100644 ---- a/plugins/obs-x264/obs-x264.c -+++ b/plugins/obs-x264/obs-x264.c -@@ -68,7 +68,7 @@ struct obs_x264 { - static const char *obs_x264_getname(void *unused) - { - UNUSED_PARAMETER(unused); -- return "x264"; -+ return "CPU: x264"; - } - - static void obs_x264_stop(void *data); - diff --git a/plugins/obs-ffmpeg/jim-nvenc.c b/plugins/obs-ffmpeg/jim-nvenc.c -index 578da63b1..1a509a236 100644 +From 323db1c9072aa1338a00dc0ddd35c655bf1e4918 Mon Sep 17 00:00:00 2001 +From: GloriousEggroll +Date: Mon, 16 Jan 2023 11:30:15 -0700 +Subject: [PATCH] encoder rename + +--- + plugins/obs-ffmpeg/jim-nvenc.c | 4 ++-- + plugins/obs-ffmpeg/obs-ffmpeg-av1.c | 4 ++-- + plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c | 4 ++-- + plugins/obs-ffmpeg/texture-amf.cpp | 4 ++-- + plugins/obs-x264/obs-x264.c | 2 +- + 5 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/plugins/obs-ffmpeg/jim-nvenc.c b/plugins/obs-ffmpeg/jim-nvenc.c +index 7b247c8..5c4be0f 100644 --- a/plugins/obs-ffmpeg/jim-nvenc.c +++ b/plugins/obs-ffmpeg/jim-nvenc.c -@@ -213,14 +213,14 @@ static void nv_texture_free(struct nvenc_data *enc, struct nv_texture *nvtex) +@@ -227,14 +227,14 @@ static void nv_texture_free(struct nvenc_data *enc, struct nv_texture *nvtex) static const char *h264_nvenc_get_name(void *type_data) { UNUSED_PARAMETER(type_data); @@ -32,33 +32,11 @@ index 578da63b1..1a509a236 100644 } #endif -diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c b/plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c -index 4792c2d08..9ba731288 100644 ---- a/plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c -+++ b/plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c -@@ -39,7 +39,7 @@ struct nvenc_encoder { - DARRAY(uint8_t) sei; - }; - --#define ENCODER_NAME_H264 "NVIDIA NVENC H.264 (FFmpeg)" -+#define ENCODER_NAME_H264 "GPU: Nvidia NVENC H.264" - static const char *h264_nvenc_getname(void *unused) - { - UNUSED_PARAMETER(unused); -@@ -47,7 +47,7 @@ static const char *h264_nvenc_getname(void *unused) - } - - #ifdef ENABLE_HEVC --#define ENCODER_NAME_HEVC "NVIDIA NVENC HEVC (FFmpeg)" -+#define ENCODER_NAME_HEVC "GPU: Nvidia NVENC H.265/HEVC" - static const char *hevc_nvenc_getname(void *unused) - { - UNUSED_PARAMETER(unused); diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-av1.c b/plugins/obs-ffmpeg/obs-ffmpeg-av1.c -index 27ffcc3e9..e1f1a15b1 100644 +index de7e237..7ea3cf7 100644 --- a/plugins/obs-ffmpeg/obs-ffmpeg-av1.c +++ b/plugins/obs-ffmpeg/obs-ffmpeg-av1.c -@@ -36,13 +36,13 @@ struct av1_encoder { +@@ -41,13 +41,13 @@ struct av1_encoder { static const char *aom_av1_getname(void *unused) { UNUSED_PARAMETER(unused); @@ -74,21 +52,42 @@ index 27ffcc3e9..e1f1a15b1 100644 } static void av1_video_info(void *data, struct video_scale_info *info) +diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c b/plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c +index f0f7747..b5f5d0d 100644 +--- a/plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c ++++ b/plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c +@@ -43,7 +43,7 @@ struct nvenc_encoder { + extern bool ubuntu_20_04_nvenc_fallback; + #endif +-#define ENCODER_NAME_H264 "NVIDIA NVENC H.264 (FFmpeg)" ++#define ENCODER_NAME_H264 "GPU: Nvidia NVENC H.264" + static const char *h264_nvenc_getname(void *unused) + { + UNUSED_PARAMETER(unused); +@@ -51,7 +51,7 @@ static const char *h264_nvenc_getname(void *unused) + } + + #ifdef ENABLE_HEVC +-#define ENCODER_NAME_HEVC "NVIDIA NVENC HEVC (FFmpeg)" ++#define ENCODER_NAME_HEVC "GPU: Nvidia NVENC H.265/HEVC" + static const char *hevc_nvenc_getname(void *unused) + { + UNUSED_PARAMETER(unused); diff --git a/plugins/obs-ffmpeg/texture-amf.cpp b/plugins/obs-ffmpeg/texture-amf.cpp -index 8fa565ee6..5d2aa6786 100644 +index 7916cf8..92e57e0 100644 --- a/plugins/obs-ffmpeg/texture-amf.cpp +++ b/plugins/obs-ffmpeg/texture-amf.cpp -@@ -1063,7 +1063,7 @@ static obs_properties_t *amf_hevc_properties(void *unused) +@@ -1173,7 +1173,7 @@ static obs_properties_t *amf_av1_properties(void *unused) static const char *amf_avc_get_name(void *) { -- return "AMD HW H.264"; +- return "AMD HW H.264 (AVC)"; + return "GPU: AMD AMF H.264"; } - static inline int get_avc_preset(amf_base *enc, obs_data_t *settings) -@@ -1391,7 +1391,7 @@ static void register_avc() + static inline int get_avc_preset(amf_base *enc, const char *preset) +@@ -1508,7 +1508,7 @@ static void register_avc() static const char *amf_hevc_get_name(void *) { @@ -96,4 +95,20 @@ index 8fa565ee6..5d2aa6786 100644 + return "GPU: AMD AMF H.265/HEVC"; } - static inline int get_hevc_preset(amf_base *enc, obs_data_t *settings) + static inline int get_hevc_preset(amf_base *enc, const char *preset) +diff --git a/plugins/obs-x264/obs-x264.c b/plugins/obs-x264/obs-x264.c +index 3955dff..b60e990 100644 +--- a/plugins/obs-x264/obs-x264.c ++++ b/plugins/obs-x264/obs-x264.c +@@ -68,7 +68,7 @@ struct obs_x264 { + static const char *obs_x264_getname(void *unused) + { + UNUSED_PARAMETER(unused); +- return "x264"; ++ return "CPU: x264"; + } + + static void obs_x264_stop(void *data); +-- +2.39.0 + diff --git a/obs-studio/debian/patches/remove-ffmpeg-vaapi.patch b/debian/patches/remove-ffmpeg-vaapi.patch similarity index 79% rename from obs-studio/debian/patches/remove-ffmpeg-vaapi.patch rename to debian/patches/remove-ffmpeg-vaapi.patch index 0e514d7..736c06d 100644 --- a/obs-studio/debian/patches/remove-ffmpeg-vaapi.patch +++ b/debian/patches/remove-ffmpeg-vaapi.patch @@ -1,20 +1,20 @@ -From dd40eb73326bbcf70cac226d217a91fb8dc3884d Mon Sep 17 00:00:00 2001 +From 8b0bcee759f9460ea72cc5eebd4be7664b0f4389 Mon Sep 17 00:00:00 2001 From: GloriousEggroll -Date: Mon, 22 Aug 2022 03:34:53 -0600 -Subject: [PATCH] remove deprecated ffmpeg vaapi +Date: Mon, 16 Jan 2023 10:40:23 -0700 +Subject: [PATCH] remove obs-ffmpeg-vaapi --- - plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c | 730 -------------------------- - plugins/obs-ffmpeg/obs-ffmpeg.c | 18 - - 2 files changed, 748 deletions(-) + plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c | 812 -------------------------- + plugins/obs-ffmpeg/obs-ffmpeg.c | 31 - + 2 files changed, 843 deletions(-) delete mode 100644 plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c b/plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c deleted file mode 100644 -index 53beb0f96..000000000 +index ee0e557..0000000 --- a/plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c +++ /dev/null -@@ -1,730 +0,0 @@ +@@ -1,812 +0,0 @@ -/****************************************************************************** - Copyright (C) 2016 by Hugh Bailey - @@ -55,10 +55,11 @@ index 53beb0f96..000000000 - -#include - +-#include "vaapi-utils.h" -#include "obs-ffmpeg-formats.h" - -#define do_log(level, format, ...) \ -- blog(level, "[FFMPEG VAAPI encoder: '%s'] " format, \ +- blog(level, "[FFmpeg VAAPI encoder: '%s'] " format, \ - obs_encoder_get_name(enc->encoder), ##__VA_ARGS__) - -#define warn(format, ...) do_log(LOG_WARNING, format, ##__VA_ARGS__) @@ -94,7 +95,7 @@ index 53beb0f96..000000000 -static const char *vaapi_getname(void *unused) -{ - UNUSED_PARAMETER(unused); -- return "FFMPEG VAAPI H.264"; +- return "FFmpeg VAAPI H.264"; -} - -static inline bool valid_format(enum video_format format) @@ -161,6 +162,7 @@ index 53beb0f96..000000000 - enc->vframe->height = enc->context->height; - enc->vframe->colorspace = enc->context->colorspace; - enc->vframe->color_range = enc->context->color_range; +- enc->vframe->chroma_location = enc->context->chroma_sample_location; - - ret = av_frame_get_buffer(enc->vframe, base_get_alignment()); - if (ret < 0) { @@ -267,30 +269,37 @@ index 53beb0f96..000000000 - enc->context->height = obs_encoder_get_height(enc->encoder); - - enc->context->time_base = (AVRational){voi->fps_den, voi->fps_num}; -- enc->context->pix_fmt = obs_to_ffmpeg_video_format(info.format); +- const enum AVPixelFormat pix_fmt = +- obs_to_ffmpeg_video_format(info.format); +- enc->context->pix_fmt = pix_fmt; - enc->context->color_range = info.range == VIDEO_RANGE_FULL - ? AVCOL_RANGE_JPEG - : AVCOL_RANGE_MPEG; - +- enum AVColorSpace colorspace = AVCOL_SPC_UNSPECIFIED; - switch (info.colorspace) { - case VIDEO_CS_601: - enc->context->color_trc = AVCOL_TRC_SMPTE170M; - enc->context->color_primaries = AVCOL_PRI_SMPTE170M; -- enc->context->colorspace = AVCOL_SPC_SMPTE170M; +- colorspace = AVCOL_SPC_SMPTE170M; - break; - case VIDEO_CS_DEFAULT: - case VIDEO_CS_709: - enc->context->color_trc = AVCOL_TRC_BT709; - enc->context->color_primaries = AVCOL_PRI_BT709; -- enc->context->colorspace = AVCOL_SPC_BT709; +- colorspace = AVCOL_SPC_BT709; - break; - case VIDEO_CS_SRGB: - enc->context->color_trc = AVCOL_TRC_IEC61966_2_1; - enc->context->color_primaries = AVCOL_PRI_BT709; -- enc->context->colorspace = AVCOL_SPC_BT709; +- colorspace = AVCOL_SPC_BT709; - break; - } - +- enc->context->colorspace = colorspace; +- enc->context->chroma_sample_location = +- determine_chroma_location(pix_fmt, colorspace); +- - if (keyint_sec > 0) { - enc->context->gop_size = - keyint_sec * voi->fps_num / voi->fps_den; @@ -528,8 +537,9 @@ index 53beb0f96..000000000 - -static void vaapi_defaults(obs_data_t *settings) -{ -- obs_data_set_default_string(settings, "vaapi_device", -- "/dev/dri/renderD128"); +- const char *device = vaapi_get_h264_default_device(); +- +- obs_data_set_default_string(settings, "vaapi_device", device); - obs_data_set_default_int(settings, "profile", - FF_PROFILE_H264_CONSTRAINED_BASELINE); - obs_data_set_default_int(settings, "level", 40); @@ -537,9 +547,67 @@ index 53beb0f96..000000000 - obs_data_set_default_int(settings, "keyint_sec", 0); - obs_data_set_default_int(settings, "bf", 0); - obs_data_set_default_int(settings, "rendermode", 0); -- obs_data_set_default_string(settings, "rate_control", "CBR"); - obs_data_set_default_int(settings, "qp", 20); - obs_data_set_default_int(settings, "maxrate", 0); +- +- int drm_fd = -1; +- VADisplay va_dpy = vaapi_open_device(&drm_fd, device, "vaapi_defaults"); +- if (!va_dpy) +- return; +- +- if (vaapi_device_rc_supported(VAProfileH264ConstrainedBaseline, va_dpy, +- VA_RC_CBR, device)) +- obs_data_set_default_string(settings, "rate_control", "CBR"); +- else if (vaapi_device_rc_supported(VAProfileH264ConstrainedBaseline, +- va_dpy, VA_RC_VBR, device)) +- obs_data_set_default_string(settings, "rate_control", "VBR"); +- else +- obs_data_set_default_string(settings, "rate_control", "CQP"); +- +- vaapi_close_device(&drm_fd, va_dpy); +-} +- +-static bool vaapi_device_modified(obs_properties_t *ppts, obs_property_t *p, +- obs_data_t *settings) +-{ +- UNUSED_PARAMETER(p); +- +- const char *device = obs_data_get_string(settings, "vaapi_device"); +- int drm_fd = -1; +- VADisplay va_dpy = +- vaapi_open_device(&drm_fd, device, "vaapi_device_modified"); +- int profile = obs_data_get_int(settings, "profile"); +- obs_property_t *rc_p = obs_properties_get(ppts, "rate_control"); +- +- obs_property_list_clear(rc_p); +- +- if (!va_dpy || !vaapi_display_h264_supported(va_dpy, device)) +- goto fail; +- +- switch (profile) { +- case FF_PROFILE_H264_CONSTRAINED_BASELINE: +- profile = VAProfileH264ConstrainedBaseline; +- break; +- case FF_PROFILE_H264_MAIN: +- profile = VAProfileH264Main; +- break; +- case FF_PROFILE_H264_HIGH: +- profile = VAProfileH264High; +- break; +- } +- +- if (vaapi_device_rc_supported(profile, va_dpy, VA_RC_CBR, device)) +- obs_property_list_add_string(rc_p, "CBR (default)", "CBR"); +- +- if (vaapi_device_rc_supported(profile, va_dpy, VA_RC_VBR, device)) +- obs_property_list_add_string(rc_p, "VBR", "VBR"); +- +- if (vaapi_device_rc_supported(profile, va_dpy, VA_RC_CQP, device)) +- obs_property_list_add_string(rc_p, "CQP", "CQP"); +- +-fail: +- vaapi_close_device(&drm_fd, va_dpy); +- return true; -} - -static bool rate_control_modified(obs_properties_t *ppts, obs_property_t *p, @@ -634,6 +702,10 @@ index 53beb0f96..000000000 - bool name_found = get_device_name_from_pci( - pacc, pci_slot, namebuf, - sizeof(namebuf)); +- +- if (!vaapi_device_h264_supported(path)) +- continue; +- - if (!name_found) - obs_property_list_add_string(list, path, - path); @@ -646,12 +718,21 @@ index 53beb0f96..000000000 - os_closedir(by_path_dir); - } - if (obs_property_list_item_count(list) == 0) { -- char path[32] = "/dev/dri/renderD1"; +- char path[32]; - for (int i = 28;; i++) { -- sprintf(path, "/dev/dri/renderD1%d", i); +- snprintf(path, sizeof(path), "/dev/dri/renderD1%d", i); - if (access(path, F_OK) == 0) { -- char card[128] = "Card: "; -- sprintf(card, "Card%d: %s", i - 28, path); +- char card[128]; +- int ret = snprintf(card, sizeof(card), +- "Card%d: %s", i - 28, path); +- if (ret >= (int)sizeof(card)) +- blog(LOG_DEBUG, +- "obs-ffmpeg-vaapi: A format truncation may have occurred." +- " This can be ignored since it is quite improbable."); +- +- if (!vaapi_device_h264_supported(path)) +- continue; +- - obs_property_list_add_string(list, card, path); - } else { - break; @@ -659,6 +740,8 @@ index 53beb0f96..000000000 - } - } - +- obs_property_set_modified_callback(list, vaapi_device_modified); +- - list = obs_properties_add_list(props, "profile", - obs_module_text("Profile"), - OBS_COMBO_TYPE_LIST, @@ -668,6 +751,8 @@ index 53beb0f96..000000000 - obs_property_list_add_int(list, "Main", FF_PROFILE_H264_MAIN); - obs_property_list_add_int(list, "High", FF_PROFILE_H264_HIGH); - +- obs_property_set_modified_callback(list, vaapi_device_modified); +- - list = obs_properties_add_list(props, "level", obs_module_text("Level"), - OBS_COMBO_TYPE_LIST, - OBS_COMBO_FORMAT_INT); @@ -686,9 +771,6 @@ index 53beb0f96..000000000 - obs_module_text("RateControl"), - OBS_COMBO_TYPE_LIST, - OBS_COMBO_FORMAT_STRING); -- obs_property_list_add_string(list, "CBR (default)", "CBR"); -- obs_property_list_add_string(list, "CQP", "CQP"); -- obs_property_list_add_string(list, "VBR", "VBR"); - - obs_property_set_modified_callback(list, rate_control_modified); - @@ -746,12 +828,12 @@ index 53beb0f96..000000000 - -#endif diff --git a/plugins/obs-ffmpeg/obs-ffmpeg.c b/plugins/obs-ffmpeg/obs-ffmpeg.c -index 1d1131d13..189e62b0a 100644 +index f1884c7..1677e08 100644 --- a/plugins/obs-ffmpeg/obs-ffmpeg.c +++ b/plugins/obs-ffmpeg/obs-ffmpeg.c -@@ -38,10 +38,6 @@ extern struct obs_encoder_info aom_av1_encoder_info; - #define LIBAVUTIL_VAAPI_AVAILABLE - #endif +@@ -43,10 +43,6 @@ extern struct obs_encoder_info hevc_nvenc_encoder_info; + extern struct obs_encoder_info svt_av1_encoder_info; + extern struct obs_encoder_info aom_av1_encoder_info; -#ifdef LIBAVUTIL_VAAPI_AVAILABLE -extern struct obs_encoder_info vaapi_encoder_info; @@ -760,34 +842,64 @@ index 1d1131d13..189e62b0a 100644 #ifndef __APPLE__ static const char *nvenc_check_name = "nvenc_check"; -@@ -283,14 +279,6 @@ static bool nvenc_supported(bool *out_h264, bool *out_hevc) +@@ -322,19 +318,6 @@ static bool nvenc_supported(bool *out_h264, bool *out_hevc, bool *out_av1) #endif -#ifdef LIBAVUTIL_VAAPI_AVAILABLE --static bool vaapi_supported(void) +-static bool h264_vaapi_supported(void) -{ - const AVCodec *vaenc = avcodec_find_encoder_by_name("h264_vaapi"); -- return !!vaenc; +- +- if (!vaenc) +- return false; +- +- /* NOTE: If default device is NULL, it means there is no device +- * that support H264. */ +- return vaapi_get_h264_default_device() != NULL; -} -#endif -- + #ifdef _WIN32 - extern void jim_nvenc_load(bool h264, bool hevc); - extern void jim_nvenc_unload(void); -@@ -360,12 +348,6 @@ bool obs_module_load(void) + extern void jim_nvenc_load(bool h264, bool hevc, bool av1); +@@ -412,20 +395,6 @@ bool obs_module_load(void) amf_load(); #endif --#if !defined(_WIN32) && defined(LIBAVUTIL_VAAPI_AVAILABLE) -- if (vaapi_supported()) { -- blog(LOG_INFO, "FFMPEG VAAPI supported"); +-#ifdef LIBAVUTIL_VAAPI_AVAILABLE +- const char *libva_env = getenv("LIBVA_DRIVER_NAME"); +- if (!!libva_env) +- blog(LOG_WARNING, +- "LIBVA_DRIVER_NAME variable is set," +- " this could prevent FFmpeg VAAPI from working correctly"); +- +- if (h264_vaapi_supported()) { +- blog(LOG_INFO, "FFmpeg VAAPI H264 encoding supported"); - obs_register_encoder(&vaapi_encoder_info); +- } else { +- blog(LOG_INFO, "FFmpeg VAAPI H264 encoding not supported"); - } -#endif #endif #if ENABLE_FFMPEG_LOGGING +diff --git a/plugins/obs-ffmpeg/CMakeLists.txt b/plugins/obs-ffmpeg/CMakeLists.txt +index 9671ef9..c3d7e77 100644 +--- a/plugins/obs-ffmpeg/CMakeLists.txt ++++ b/plugins/obs-ffmpeg/CMakeLists.txt +diff --git a/plugins/obs-ffmpeg/CMakeLists.txt b/plugins/obs-ffmpeg/CMakeLists.txt +index 9671ef9..30c4547 100644 +--- a/plugins/obs-ffmpeg/CMakeLists.txt ++++ b/plugins/obs-ffmpeg/CMakeLists.txt +@@ -121,7 +121,7 @@ if(OS_WINDOWS) + elseif(OS_POSIX AND NOT OS_MACOS) + find_package(Libva REQUIRED) + find_package(Libpci REQUIRED) +- target_sources(obs-ffmpeg PRIVATE obs-ffmpeg-vaapi.c vaapi-utils.c ++ target_sources(obs-ffmpeg PRIVATE vaapi-utils.c + vaapi-utils.h) + target_link_libraries(obs-ffmpeg PRIVATE Libva::va LIBPCI::LIBPCI) + endif() -- -2.37.2 +2.39.0 diff --git a/obs-studio/debian/patches/series b/debian/patches/series similarity index 88% rename from obs-studio/debian/patches/series rename to debian/patches/series index 651ef4c..dfb47e5 100644 --- a/obs-studio/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ +8293.patch 6207.patch 7206.patch add-plugins.patch diff --git a/obs-studio/debian/rules b/debian/rules similarity index 92% rename from obs-studio/debian/rules rename to debian/rules index 7a83ee8..be7c9fe 100755 --- a/obs-studio/debian/rules +++ b/debian/rules @@ -7,5 +7,5 @@ AJA_DIR := $(BASE_DIR)/build_dependencies/aja %: dh $@ --with quilt override_dh_auto_configure: - dh_auto_configure -- -DOBS_VERSION_OVERRIDE="28.0.0" -DBUILD_FOR_PPA=ON -DTWITCH_CLIENTID='unla3~mb`xq9`1dhr?1lhhg`65mah0' -DTWITCH_HASH='2D4A98C454B4B0B6' -DRESTREAM_CLIENTID='ml6b16ec(n9?1#9g?m#>9f0,gnkojhhd;oh6' -DRESTREAM_HASH='2DE8E8C514397EE9' -DYOUTUBE_CLIENTID='153066229607$$;a7mw2ig756r?vc