Application Note
41 of 45
001-84858 Rev. *N
2021-03-23
PSoC 4 Programming Using an External Microcontroller (HSSP)
Appendix D: HSSP Functions
17
Appendix D: HSSP Functions
The following tables list the public functions defined in each layer of the HSSP firmware architecture. These
functions are used to communicate between the layers of the HSSP firmware, as
Table 15
Functions in
SWD_PhysicalLayer.h
Function
Description
SetSwdckHigh()
Sets the host SWDCK pin HIGH.
SetSwdioHigh()
Sets the host SWDIO pin HIGH.
SetXresHigh()
Sets the host XRES pin HIGH.
SetSwdckLow()
Sets the host SWDCK pin LOW.
SetSwdioLow()
Sets the host SWDIO pin LOW.
SetXresLow()
Sets the host XRES pin LOW.
SetSwdckCmosOutput()
Configures the host SWDCK pin for CMOS output drive mode.
SetSwdioCmosOutput()
Configures the host SWDIO pin for CMOS output drive mode.
SetXresCmosOutput()
Configures the host XRES pin for CMOS output drive mode.
SetSwdckHizInput()
Configures the host SWDCK pin for high-impedance digital input drive
mode.
SetSwdioHizInput()
Configures the host SWDIO pin for high-impedance digital input drive
mode.
SetXresHizInput()
Configures the host XRES pin for high-impedance digital input drive mode.
ReadSwdio()
Returns the current state of the SWDIO input pin.
Table 16
Functions in
SWD_PacketLayer.h
Function
Description
Swd_WritePacket()
Sends an SWD write packet. This function operates on the global variables
swd_PacketHeader, swd_PacketAck, and swd_PacketData[].
Swd_ReadPacket()
Sends a single SWD read packet. This function operates on the global
variables swd_PacketHeader, swd_PacketAck, and swd_PacketData[]. This
function is used for reading from a specific address.
SwdLineReset()
Resets the SWD line by sending 51 SWDCK clock cycles with SWDIO line
HIGH. Used to acquire the debug access port (DAP) during step 1 of
programming.
Table 17
Functions in
SWD_UpperPacketLayer.h
Function
Description
Read_DAP
Reads a 32-bit data from the specific DAP register and writes it to
Swd_PacketData[].This function uses the Swd_ReadPacket() function to
read the data.
Write_DAP
Writes a 32-bit data to the specific DAP register. This function uses the
Swd_WritePacket() function to write the data.
Read_IO
Reads a 32-bit data from the specified address of the CPU address space.
This function is implemented by using the Read_DAP() and Write_DAP()