User manual

PICkit™ Serial Analyzer User’s Guide
DS51647A-page 96 © 2007 Microchip Technology Inc.
10.3.2 PICkitS.Basic.Configure_PICkitSerial(int p_mode, bool p_reset)
Returns: True if successful, False if not
Inputs: p_mode: the communications mode where:
0 = IDLE
1 = I
2
CM
2 = SPI-M
3 = SPI-S
4 = USART-A
5 = USART-SM
6 = USART-SS
7 = I
2
CS
8 = 1
2
CBBM
9 = 1
2
CSBBM
p_reset: whether or not to perform a Reset of the PICkit™ Serial after
changing modes
10.3.3 PICkitS.Basic.There_Is_A_Status_Error(ref uint p_error)
Returns:True if any status error bit is set, False if not
Inputs: Reference to an unsigned int (32-bit)
Description: Looks at the latest Status_Packet data stored in the class library and copies
the Exec status into byte 0, Comm status into byte 1, and comm-mode specific
status (I
2
C, SPI, etc.) into byte 2. Byte 3 is left blank for future use. If any bit in
any of the bytes is set, this indicates an error and a True value is returned.
10.3.4 PICkitS.Basic.Configure_PICkitSerial_For_I2C()
Returns: True if successful, False if not
Inputs:None
Description: Configures PICkit™ Serial control block for I2C_M (I
2
C Master)
communication
10.3.5 PICkitS.Basic.Get_Status_Packet(ref byte[] p_status_packet)
Returns: True if the status packet is successfully updated, False if there is an error
updating the status packet.
Inputs: p_status_packet - Reference to an array of bytes. The array must be at least
65 bytes long to hold the status packet data.
Description: Issues a command to update the Status Packet stored in the class library and
copy it to p_status_packet. Call this function to get detailed information
regarding the status block and control block of the PICkit™ Serial. Refer to
Chapter 9 to see the format of the Status Packet.
10.3.6 PICkitS.Basic.Initialize_PICkitSerial()
Returns: True if successful, False if not
Inputs: None
Description: Attempts to establish communication with PICkit™ Serial Analyzer and initial-
ize communication threads used by class library. If multiple PICkit™ Serial
Analyzers are attached to host PC, function will only initialize first one it finds.
Note: Unless performing certain test routines on the PICkit™ Serial Analyzer, p_reset
should always be TRUE