CAT2 Peripheral Driver Library

Functions

void Cy_ISOUART_NodeInit (ISOUART_Type *base, const cy_stc_isouart_node_config_t *config)
 Full Init of the iso UART in node mode. More...
 
void Cy_ISOUART_NodeConfigTriggerInt (ISOUART_Type *base, uint8_t trigIntId, cy_en_isouart_event_t trigSrc, cy_en_isouart_event_t primIntSrc, cy_en_isouart_event_t secIntSrc)
 Configure one trigger and interrupt struct. More...
 
__STATIC_INLINE void Cy_ISOUART_NodeSetWdtCount (ISOUART_Type *base, uint16_t counter)
 Updates Wdt down counter by SW. More...
 
__STATIC_INLINE uint16_t Cy_ISOUART_NodeGetWdtCount (const ISOUART_Type *base)
 Get the current Wdt counter value. More...
 
__STATIC_INLINE void Cy_ISOUART_NodeTriggerEMM (ISOUART_Type *base)
 Triggers emergency mode (EMM) signal transmission on the chain. More...
 
__STATIC_INLINE uint8_t Cy_ISOUART_NodeGetClkCounter (ISOUART_Type *base)
 Returns the raw clock counter captured at the last sync frame. More...
 
__STATIC_INLINE cy_en_isouart_wakeup_source_t Cy_ISOUART_NodeGetWakeupSource (const ISOUART_Type *base)
 Get the last wakeup source of the node. More...
 
__STATIC_INLINE bool Cy_ISOUART_NodeGetMasterTopology (const ISOUART_Type *base)
 Get the current master topology configuration. More...
 
uint32_t Cy_ISOUART_NodeGetNumMultiReadA (const ISOUART_Type *base)
 Get the number of reads from base address A after receiving multi-read command. More...
 
uint32_t Cy_ISOUART_NodeGetNumMultiReadB (const ISOUART_Type *base)
 Get the number of reads from base address B after receiving multi-read command. More...
 
void Cy_ISOUART_NodeGetInterfaceConfig (const ISOUART_Type *base, cy_stc_isouart_node_interface_config_t *config)
 Get node interface configuration. More...
 

Detailed Description

Function Documentation

◆ Cy_ISOUART_NodeInit()

void Cy_ISOUART_NodeInit ( ISOUART_Type *  base,
const cy_stc_isouart_node_config_t config 
)

Full Init of the iso UART in node mode.

Parameters
baseThe base address for the iso UART.
configConfiguration options for the iso UART in node mode. See cy_stc_isouart_node_config_t.
Note
This function is valid only for Node.
Warning
This function depends on the SysClk frequency and requires re-initialization if it changes to avoid frame errors. Ensure that CSV events (if enabled) are handled properly and trigger re-initialization if the SysClk source switches to the backup source.
Function Usage
/* Populate Node configuration structure */
const cy_stc_isouart_node_config_t nodeConfig =
{
.crcPolicy = CY_ISOUART_CRC8_SAE_J1850, /* Match host CRC policy. */
.enableBlockId = true, /* Enable if host uses Block ID. */
.useTrig0Emm = false, /* No emergency mode trigger 0. */
.useTrig1Emm = false, /* No emergency mode trigger 1. */
.useTrig2Emm = false, /* No emergency mode trigger 2. */
.useTrig3Emm = false, /* No emergency mode trigger 3. */
.enableMultiReadBC = false, /* Disable broadcast multi-read. */
.baseAddressA = 0UL, /* Base address A for multi-read. */
.baseAddressB = 0UL, /* Base address B for multi-read. */
};
/* Configure iso UART Node to operate */
Cy_ISOUART_NodeInit(ISOUART, &nodeConfig);

◆ Cy_ISOUART_NodeConfigTriggerInt()

void Cy_ISOUART_NodeConfigTriggerInt ( ISOUART_Type *  base,
uint8_t  trigIntId,
cy_en_isouart_event_t  trigSrc,
cy_en_isouart_event_t  primIntSrc,
cy_en_isouart_event_t  secIntSrc 
)

Configure one trigger and interrupt struct.

Parameters
baseThe base address for the iso UART.
trigIntIdThe trigger interrupt ID. The valid range is from 0 to 17.
trigSrcSource of trigger. See cy_en_isouart_event_t.
primIntSrcSource of primary interrupt. See cy_en_isouart_event_t.
secIntSrcSource of secondary interrupt. See cy_en_isouart_event_t.
Note
This function is valid only for Node.
Function Usage
/* Scenario: Configure the iso UART Node interrupt trigger structure and SRAM row attributes.
* This setup enables Primary Access interrupt on write operations to SRAM address 0.
* The interrupt handler (IntrHandler) will process the triggered interrupt.
*/
/* Use trigger structure ID 1 to configure */
const uint8_t intrTrigStructId = 1U;
/* Configure interrupt trigger structure */
intrTrigStructId, /* Trigger structure ID */
CY_ISOUART_EVENT_NONE, /* Trigger source */
CY_ISOUART_EVENT_WRITE, /* Primary interrupt source */
CY_ISOUART_EVENT_NONE); /* Secondary interrupt source */
/* Configure SRAM row attributes for address 0 */
SRAM_ADDRESS, /* SRAM address */
intrTrigStructId, /* Trigger structure ID */
false, /* Invalid address disabled */
false); /* Read protection disabled */

◆ Cy_ISOUART_NodeSetWdtCount()

__STATIC_INLINE void Cy_ISOUART_NodeSetWdtCount ( ISOUART_Type *  base,
uint16_t  counter 
)

Updates Wdt down counter by SW.

The Wdt is normally fed by host via iso UART write command. This function is not mandatory to be called in normal case.

Parameters
baseThe base address for the iso UART.
counterNew counter value.
Note
This function is valid only for Node.
Function Usage
/* Scenario: Refresh the watchdog timer in the main loop to prevent Node from going into Sleep mode. */
for (;;)
{
/* Refresh a 7-bit watchdog timer. */
/* 50 ms delay between watchdog refreshes */
}

◆ Cy_ISOUART_NodeGetWdtCount()

__STATIC_INLINE uint16_t Cy_ISOUART_NodeGetWdtCount ( const ISOUART_Type *  base)

Get the current Wdt counter value.

Parameters
baseThe base address for the iso UART.
Returns
Counter value.
Note
This function is valid only for Node.

◆ Cy_ISOUART_NodeTriggerEMM()

__STATIC_INLINE void Cy_ISOUART_NodeTriggerEMM ( ISOUART_Type *  base)

Triggers emergency mode (EMM) signal transmission on the chain.

Parameters
baseThe base address for the iso UART.
Note
This function is valid only for Node.
Warning
If called during active communication, it could cause a bus clash.

◆ Cy_ISOUART_NodeGetClkCounter()

__STATIC_INLINE uint8_t Cy_ISOUART_NodeGetClkCounter ( ISOUART_Type *  base)

Returns the raw clock counter captured at the last sync frame.

This value is the number of peripheral clock cycles for the sync frame. Divide the returned value by 8 to obtain peripheral clock cycles per bit.

Parameters
baseThe base address for the iso UART.
Returns
Raw clock counter value.
Note
This function is valid only for Node.

◆ Cy_ISOUART_NodeGetWakeupSource()

__STATIC_INLINE cy_en_isouart_wakeup_source_t Cy_ISOUART_NodeGetWakeupSource ( const ISOUART_Type *  base)

Get the last wakeup source of the node.

Parameters
baseThe base address for the iso UART.
Returns
Last wakeup source. See cy_en_isouart_wakeup_source_t.
Note
This function is valid only for Node.
Function Usage
/* Scenario: Get node wakeup source. */
/* Check if wakeup was caused by GPIO or iso UART */
if (CY_ISOUART_WAKEUP_GPIO == wakeupSource)
{
/* Handle GPIO wakeup */
}
else if (CY_ISOUART_WAKEUP_ISOUART == wakeupSource)
{
/* Handle iso UART wakeup */
}

◆ Cy_ISOUART_NodeGetMasterTopology()

__STATIC_INLINE bool Cy_ISOUART_NodeGetMasterTopology ( const ISOUART_Type *  base)

Get the current master topology configuration.

Parameters
baseThe base address for the iso UART.
Returns
Current master topology configuration.
  • true : The topology is MOT (Master On Top).
  • false : The topology is MOB (Master On Bottom).
Note
This function is valid only for Node.
This function does not distinguish between ring and non-ring topologies. It only indicates whether the master is positioned at the top or bottom of the chain.
Function Usage
/* Scenario: Get current master topology. */
/* Master topology check macros */
#define MOT_TOPOLOGY (true)
#define MOB_TOPOLOGY (false)
bool masterTopology = Cy_ISOUART_NodeGetMasterTopology(ISOUART);
/* Check master topology configuration */
if (MOT_TOPOLOGY == masterTopology)
{
/* Handle Master On Top topology */
}
else if (MOB_TOPOLOGY == masterTopology)
{
/* Handle Master On Bottom topology */
}

◆ Cy_ISOUART_NodeGetNumMultiReadA()

uint32_t Cy_ISOUART_NodeGetNumMultiReadA ( const ISOUART_Type *  base)

Get the number of reads from base address A after receiving multi-read command.

Parameters
baseThe base address for the iso UART.
Returns
Number of reads from base address A.
Note
This function is valid only for Node.

◆ Cy_ISOUART_NodeGetNumMultiReadB()

uint32_t Cy_ISOUART_NodeGetNumMultiReadB ( const ISOUART_Type *  base)

Get the number of reads from base address B after receiving multi-read command.

Parameters
baseThe base address for the iso UART.
Returns
Number of reads from base address B.
Note
This function is valid only for Node.

◆ Cy_ISOUART_NodeGetInterfaceConfig()

void Cy_ISOUART_NodeGetInterfaceConfig ( const ISOUART_Type *  base,
cy_stc_isouart_node_interface_config_t config 
)

Get node interface configuration.

Parameters
baseThe base address for the iso UART.
configPointer to a configuration structure to be filled. See cy_stc_isouart_node_interface_config_t
Note
This function is valid only for Node.