Freelance Electronics Components Distributor
Closed Dec 25th-26th
800-300-1968
We Stock Hard to Find Parts

CS496122-CQZ

Part # CS496122-CQZ
Description 16X16 IC W/DSP C-NET INTERFACE PROC
Category IC
Availability Out of Stock
Qty 0
Qty Price
1 + $26.54252



Technical Document


DISCLAIMER: The information provided herein is solely for informational purposes. Customers must be aware of the suitability of this product for their application, and consider that variable factors such as Manufacturer, Product Category, Date Codes, Pictures and Descriptions may differ from available inventory.

34 ©Copyright 2005 Cirrus Logic, Inc. DS651UM23
Version 2.3
CobraNet Hardware User’s Manual
HMI Reference Code
8.2 HMI Access Code
/*========================================================================
** hmi.c
** CobraNet Host Management Interface example code
** Simple edition
**------------------------------------------------------------------------
** $Header$
** Copyright (c) 2004, Peak Audio, a division of Cirrus Logic, Inc.
**========================================================================*/
#include "hmi.h"
/* variables model HMI state */
long PeekLimit;
long PeekPointer = -1;
long PokeLimit;
long PokePointer = -1;
/* access host port hardware */
#define HMI_BASE 0
unsigned char ReadRegister(
int hmiregister )
{
return *(unsigned char volatile *const) ( hmiregister + HMI_BASE );
}
void WriteRegister(
int hmiregister,
unsigned char value )
{
*(unsigned char volatile *const) ( hmiregister + HMI_BASE ) = value;
}
void SendMessage(
unsigned char message )
{
int msgack = ReadRegister( MSG_D );
/* issue (last byte of) message */
WriteRegister( MSG_D, message );
/* wait for acceptance of message */
while( !( ( msgack ^ ReadRegister( MSG_D ) ) & ( 1 << MSG_TOGGLE_BO ) ) );
}
void SetAddress(
long address )
{
/* translate address */
WriteRegister( MSG_A, ( address & 0xff0000 ) >> 16 );
WriteRegister( MSG_B, ( address & 0xff00 ) >> 8 );
WriteRegister( MSG_C, address & 0xff );
SendMessage( CVR_TRANSLATE_ADDRESS );
/* wait for completion of translate address */
CobraNet Hardware User’s Manual
HMI Reference Code
DS651UM23 ©Copyright 2005 Cirrus Logic, Inc. 35
Version 2.3
while( !( ReadRegister( MSG_D ) & ( 1 << MSG_TRANSLATION_BO ) ) );
/* goto translation */
WriteRegister( MSG_C, MOP_GOTO_TRANSLATION_READ );
SendMessage( CVR_MULTIPLEX_OP );
/* "garbage" read clears data pipeline */
ReadRegister( DATA_D );
/* maintain local pointers */
PeekPointer = PokePointer = address;
PeekLimit = PokeLimit = PeekPointer +
ReadRegister( MSG_C ) + ( ReadRegister( MSG_B ) << 8 );
/* read-only region addressed */
if( !( ReadRegister( MSG_A ) & ( 1 << MSG_WRITABLE_BO ) ) ) {
PokeLimit = PokePointer;
}
}
unsigned long Peek(
long address )
{
if( address != PeekPointer ) {
SetAddress( address );
}
if( PeekPointer >= PeekLimit ) {
throw "Peek addressing error!";
}
unsigned long value = ReadRegister( DATA_A ) << 24;
value += ReadRegister( DATA_B ) << 16;
value += ReadRegister( DATA_C ) << 8;
value += ReadRegister( DATA_D );
PeekPointer++; /* maintain local pointer */
return value;
}
void Poke(
long address,
unsigned long value )
{
if( address != PokePointer ) {
SetAddress( address );
}
if( PokePointer >= PokeLimit ) {
throw "Poke addressing error or read-only!";
}
WriteRegister( DATA_A, (unsigned char) ( ( value >> 24 ) & 0xff ) );
WriteRegister( DATA_B, (unsigned char) ( ( value >> 16 ) & 0xff ) );
WriteRegister( DATA_C, (unsigned char) ( ( value >> 8 ) & 0xff ) );
WriteRegister( DATA_D, (unsigned char) ( value & 0xff ) );
/* maintain local pointers */
PokePointer++;
PeekPointer = -1; /* force SetAddress()next Peek() to freshen data */
}
36 ©Copyright 2005 Cirrus Logic, Inc. DS651UM23
Version 2.3
CobraNet Hardware User’s Manual
HMI Reference Code
8.3 CM-1, CM-2 Auto-detection
The following function is useful for systems that support both the CM-1 and CM-2 or
where a CobraNet interface is an optional add-in.
Detect() returns 0 if no CobraNet interface module is detected, 1 for CM-1 and 2 for CM-2.
int Detect( void ) {
/* check for presence of CM-1 */
MSG_B = 0x55; /* write to CM-1 CVR register */
DATA_A = 0xaa; /* write to unused CM-1 register to flip data bus */
if( MSG_B == 0x55 ) { /* read back CVR */
/* redo same detection with different data */
MSG_B = 0x3c;
DATA_A = 0xc3;
if( MSG_B == 0x3c ) {
return 1; /* CM-1 detected */
}
}
/* check for presence of CM-2 */
/* issue identify command */
MSG_C = MOP_IDENTIFY;
MSG_D = CVR_MULTIPLEX_OP;
int msgack = MSG_D; /* clean pipeline */
msgack = MSG_D;
/* wait for togglebit to flip in response to command */
int tm0 = gettimeofday();
while( !( ( MSG_D ^ toggle ) & ( 1 << MSG_TOGGLE_BO ) ) ) {
int tm1 = gettimeofday();
if( ( tm1 - tm0 ) > time_out ) {
return 0; /* command timed out, no CobraNet interface present */
}
}
int garbage = MSG_D; /* clean pipeline */
/* verify identify results */
if( DATA_A == 'C' ) if( DATA_B == 'S' )
if( DATA_C == ( 18101 >> 8 ) ) if( DATA_D == ( 18101&0xff ) {
return 2; /* CM-2 detected */
}
return 0; /* no interface or non-supported interface */
}
PREVIOUS56789101112131415161718NEXT