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

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
LIN Bus 2.0 Reference Design
SLAVE_TO_MASTER
EVENT_TRIGGERED constant. Here is an example.
_Frame3:
EVENT_TRIGGERED
Once a frame is declared as event triggered and the frame
is due, the program checks the status register of the frame if
the data is updated. A response is transmitted only if the
data is updated. The main function should set the
bfDATA_READY flag in the status byte. Here is a code snip-
pet that updates the flag if there is a data change. The
Frame3 is event triggered and the buffer for this frame is
BufferFrame3.
PrevValue = PRT2DR;
value at start of main function
while(1)
{
******
******
Some Code
******
******
CurrentValue = PRT2DR;
if (PrevValue != CurrentValue)
{
bfDATA_READY;
}
}
In this example, the PrevValue is a variable that holds some
initial value present in PRT2DR. If there is a change of the
state of PRT2DR, then the bfDATA_READY flag of the
Frame3 status byte is set and the PrevValue variable is
updated with the current value. So the next time Frame3
becomes due, it is transmitted. Also, the firmware clears the
bfDATA_READY flag, so that the frame is transmitted only
when this flag is set by the foreground function, which is
under the condition that the signal for Frame3 has changed.
4.7
The Lin20CoreAPI.asm file has all the library functions
required for the operation of the LIN slave. This section
describes each API function and includes comments about
how to use the function.
l_sys_init
C Prototype: l_u8 l_sys_init (void);
October 25, 2006
Frame3:
db
db
db
db
// Add code to update the Frame’s data
LIN 2.0 Slave Design API
0xFF
SLAVE_TO_MASTER |
BufferFrame3
1
BufferFrame3[0] |=
PrevValue = CurrentValue;
// Initialize Backup
constant
and
Cypress Semiconductor – Rev. **
the
Description: This is a dummy function included in the API
for consistency with the LIN specifications.
Parameters: None.
Returns: Always 0.
l_ifc_init
C Prototype: l_u8 l_ifc_init (void);
Description: Initializes the LIN 2.0 slave node. Loads the
Synchro Reception Configuration and initializes all the
parameters. Call this function in the main function to start
the LIN operation.
Parameters: None.
Returns: Zero if initialization is successful. Non zero for fail-
ure of initialization. But in this library, this function always
returns a zero. The prototype has been maintained for con-
sistency with the LIN 2.0 specification.
l_bytes_rd
C Prototype: void
l_signal_handle,
char* data);
Description: Reads and returns the current value of the
selected bytes in the signal specified by l_signal_handle.
Parameters:
l_signal_handle: Name of the frame from which bytes have
to be read.
start: The offset from where the bytes have to be read.
count: Number of counts to be read.
data: Buffer to which the data have to be read.
Example: For example, if you want to read two bytes from
Frame1 from the third byte of the buffer to another buffer
called TempBuffer, the following code is to be used:
l_bytes_rd(Frame1, 2, 2, TempBuffer);
Note that the third byte of the frame buffer will have an offset
of two. That is why two was used as the offset parameter.
Returns: None.
l_bytes_wr
C Prototype: void
l_signal_handle,
char* data);
Description: Writes to the selected bytes the value from the
specified buffer.
Parameters:
l_u8
l_u8
l_bytes_rd
l_bytes_wr(const
start,
start,
4. Slave Design IP
(const
l_u8
l_u8
count,
count,
char*
char*
39

Related parts for CY3220LINBUS-RD