cp3bt13 National Semiconductor Corporation, cp3bt13 Datasheet - Page 157

no-image

cp3bt13

Manufacturer Part Number
cp3bt13
Description
Cp3bt13 Reprogrammable Connectivity Processor With Bluetooth-r And Can Interfaces
Manufacturer
National Semiconductor Corporation
Datasheet
}
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
; NAME: ACBStartX
;
;
; PARAMETERS:
;
;
;
; CALLS:
;
; RETURNED: error/success
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
UWORD
{
KBD_OUT |= BIT0; // OScope marker
acb->ACBctl1
return (ACB_NOERR);
ACB_T
UWORD
acb =
if (acb->ACBcst & ACBBB && !(acb->ACBst & ACBMASTER))
acb->ACBctl1
Timeout =
while (!(acb->ACBst & ACBSDAST) && Timeout--)
{
}
if (!Timeout)
acb->ACBsda =
Timeout =
while (!(acb->ACBst & ACBSDAST) &&
}
if (!Timeout)
else if (acb->ACBst & ACBNEGACK)
else {
}
ACBStartX (UBYTE Slave, UBYTE R_nW, UWORD Count)
return (ACBERR_NOTMASTER);
if (acb->ACBst & ACBBER) {
}
return (ACBERR_NOTMASTER);
!(acb->ACBst & ACBNEGACK)&&
--Timeout) {
if (acb->ACBst & ACBBER) {
}
return (ACBERR_TIMEOUT);
return (ACBERR_NEGACK);
return (ACB_NOERR);
*acb;
Timeout;
(ACB_T*)ACB_ADDRESS;
acb->ACBst
return (ACBERR_COLLISION);
acb->ACBst
return (ACBERR_COLLISION);
UBYTE
UBYTE
UWORD
100;
1000;
|=
Initiates an ACB bus transaction by sending the Start bit, followed by the Slave address
and R/W flag.
|=
Slave | R_nW;
ACBSTOP;
Slave
R_nW
Count
ACBSTART;
|=
|=
ACBBER;
ACBBER;
-
-
-
Checks for any ACB errors throughout this sequence and returns status.
I2C address of Slave device
Read/Write flag (0x01 or 0x00)
Desired number of bytes (read/write)
/* Send STOP bit
/* Return success status....
/* Get address of ACB module
/* If Bus is Busy and we’re NOT the Master, return err
/* If we’re good to go, send Start condition
/* Check if we’re the Bus Master with timeout
/* Related to bus error problem
/* If collision occurs, clear error and return status
/* If timeout, we must NOT be the Master...signal error */
/* Now, send the address and R/W flag...
/* Send address and R/W flag
/* Failsafe for lockup
/* Wait for address to be sent and ACK’d
/* If a bus error occurs while sending address, clear
/* the error flag and return error status
/* If timeout, signal error
/* Or if Slave does not reply, report busy/error
/* Otherwise return success
157
www.national.com
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/

Related parts for cp3bt13