CY3220LINBUS-RD Cypress Semiconductor Corp, CY3220LINBUS-RD Datasheet - Page 28

KIT REF DESIGN LIN BUS

CY3220LINBUS-RD

Manufacturer Part Number
CY3220LINBUS-RD
Description
KIT REF DESIGN LIN BUS
Manufacturer
Cypress Semiconductor Corp
Series
PSoC®r
Datasheet

Specifications of CY3220LINBUS-RD

Main Purpose
Interface, LIN
Embedded
Yes, MCU, 8-Bit
Utilized Ic / Part
CY8C27143, CY8C27443
Processor To Be Evaluated
CY8C27143-24PXI and CY8C27443-24PXI
Interface Type
RS-232
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Other names
428-1926
3. Master Design IP
Example: For example, to write two bytes to Frame1 from
the first byte of the buffer from another buffer called Temp-
Buffer, use this code:
l_bytes_wr(Frame1, 0, 2, TempBuffer);
Note that the first byte of the frame buffer has an offset of
zero. That is why zero was used as the offset parameter.
Returns: None.
l_ifc_read_status
C Prototype: l_u16 l_ifc_read_status(void);
Description: The call returns a 16-bit status word.
Returns: 16-bit status word.
Table 3-3.
Usage: Use this function for the foreground program to
monitor the LIN bus for error conditions. For example, use
this code to trap any errors in the LIN bus:
if((char)l_ifc_read_status() &
bfSTATUS_ERROR_IN_RESPONSE)
{
}
An example 16-bit status word:
0x3202: Here, the MSB indicates the protected ID of the last
frame processed and it is 0x32. Bit 1 of the LSB is set indi-
cating that the last frame transfer succeeded.
l_ifc_irq_disable
C Prototype: void l_ifc_irq_disable(void);
Description: Disables system interrupts.
Parameters: None.
Returns: None.
l_ifc_irq_restore
C Prototype: void l_ifc_irq_restore(void);
Description: Restores system interrupts.
26
Bit 0
Bit 1
Bit 2
Bit 3
Bits 4 to7
Bits 8 to 15
Bit Number
Error in Response: This bit is set whenever there is an error
in the LIN transaction.
Successful Transfer: This bit is set when the last frame was
successfully processed.
Overrun: This bit is set when the last status was not read
before the next update.
Go To Sleep: This bit is set when a go to sleep command
has been received. This bit is also set by the firmware when
a bus idle is detected.
Last Frame Protected ID: This byte has the protected ID of
the frame that was processed last.
// Code to process error
Description
Cypress Semiconductor – Rev. **
Parameters: None.
Returns: None.
l_ifc_goto_sleep
C Prototype: void l_ifc_goto_sleep(void);
Description: This function generates the go to sleep com-
mand on the LIN bus. As described in the LIN bus specifica-
tions, a frame with the protected ID of 0x3C (master
request) and a first data byte of 0x00 is taken by all the
slaves as a go to sleep command. So this function writes the
first byte of the DiagBuffer with 0x00, sets the Schedule
table to point to a master request frame, and calls the
l_sch_tick function to initiate the frame transfer. It waits for
the frame to be completed and then exits.
Parameters: None.
Returns: None.
l_ifc_wake_up
C Prototype: void l_ifc_wake_up(void);
Description: Generates a wakeup command on the bus.
This function sends a 0xF0 on the LIN bus, which simulates
a wakeup call.
Parameters: None.
Returns: None.
3.7.2
In addition to the above functions that are described in the
LIN 2.0 specifications, more functions are added to enable
the polling method to initiate frame transfer. Normally, the
initiation of frames in LIN are interrupt driven. The l_sch_tick
function is called from inside the schedule timer’s ISR.
These functions are useful if using the polling method.
LinMaster_fIsLinReady
C Prototype: BYTE LinMaster_fIsLinReady(void);
Description: Checks if the current frame slot is completed
so that the next frame transfer can be initiated.
Parameters: None.
Returns: Non zero if the current frame slot is complete.
Zero if the current frame slot is not complete.
Example: Use this code to initiate the next frame transfer:
if (LinMaster_fIsLinReady())
current frame slot complete
{
}
LinMaster_ClrReadyFlag
C
(void);
Prototype:
Miscellaneous Core API Functions
void
l_sch_tick();
LIN Bus 2.0 Reference Design
LinMaster_ClrReadyFlag
October 25, 2006
// Check if

Related parts for CY3220LINBUS-RD