### XMC I2C Peripheral Initialization and Usage Example Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/XMCLib/doc/main_xmc1.txt Shows the typical steps to use the XMC Peripheral Library: include peripheral headers, configure and initialize the I2C channel, set input sources, enable events, start operation, configure GPIO, and manage the peripheral. The example uses XMC_I2C_CH_Init, XMC_I2C_CH_SetInputSource, XMC_I2C_CH_EnableEvent, NVIC functions, XMC_GPIO_SetMode, and XMC_I2C_CH_MasterStart. Note that device-specific peripheral headers are included automatically based on the selected target device. ```c /* Include files */ #include "xmc_gpio.h" #include "xmc_i2c.h" ... int main(void) { /* Peripheral configuration and initialization. */ XMC_I2C_CH_CONFIG_t i2c_cfg; i2c_cfg.baudrate = 400000U; XMC_I2C_CH_Init(XMC_I2C0_CH0, &i2c_cfg); /* Connectivity configuration. */ XMC_I2C_CH_SetInputSource(XMC_I2C0_CH0, XMC_I2C_CH_INPUT_SDA, USIC1_C0_DX0_P2_14); XMC_I2C_CH_SetInputSource(XMC_I2C0_CH0, XMC_I2C_CH_INPUT_SCL, USIC1_C0_DX1_P5_8); /* Event/interrupt configuration. */ XMC_I2C_CH_EnableEvent(XMC_I2C0_CH0, XMC_I2C_CH_EVENT_ARBITRATION_LOST); NVIC_SetPriority(USIC0_0_IRQn, NVIC_GetPriorityGrouping(), 63, 0); NVIC_EnableIRQ(USIC0_0_IRQn); /* Start operation. */ XMC_I2C_CH_Start(XMC_I2C0_CH0); /* IO configuration. */ XMC_GPIO_SetMode(P1_5, XMC_GPIO_MODE_OUTPUT_OPEN_DRAIN | P1_5_AF_U0C0_DOUT0); XMC_GPIO_SetMode(P1_1, XMC_GPIO_MODE_OUTPUT_OPEN_DRAIN | P1_1_AF_U0C0_SCLKOUT); ... /* Manage peripheral */ XMC_I2C_CH_MasterStart(XMC_I2C1_CH0, IO_EXPANDER_ADDRESS, XMC_I2C_CH_CMD_WRITE); while((XMC_I2C_CH_GetStatusFlag(XMC_I2C1_CH0) & XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED) == 0U) { /* wait for ACK */ } XMC_I2C_CH_ClearStatusFlag(XMC_I2C1_CH0, XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED); ... } ``` -------------------------------- ### XMC I2C Peripheral Initialization and Usage Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/XMCLib/doc/main_xmc4.txt Shows the typical sequence for using an XMC I2C peripheral: include headers, configure and initialize the channel, set input sources, enable events, start operation, configure GPIO, and manage the peripheral. The example uses XMC_I2C0_CH0 and XMC_I2C1_CH0 with a baudrate of 400000U and waits for an ACK after a master start. ```c /* Include files */ #include "xmc_gpio.h" #include "xmc_i2c.h" ... int main(void) { /* Peripheral configuration and initialization. */ XMC_I2C_CH_CONFIG_t i2c_cfg; i2c_cfg.baudrate = 400000U; XMC_I2C_CH_Init(XMC_I2C0_CH0, &i2c_cfg); /* Connectivity configuration. */ XMC_I2C_CH_SetInputSource(XMC_I2C0_CH0, XMC_I2C_CH_INPUT_SDA, USIC1_C0_DX0_P2_14); XMC_I2C_CH_SetInputSource(XMC_I2C0_CH0, XMC_I2C_CH_INPUT_SCL, USIC1_C0_DX1_P5_8); /* Event/interrupt configuration. */ XMC_I2C_CH_EnableEvent(XMC_I2C0_CH0, XMC_I2C_CH_EVENT_ARBITRATION_LOST); NVIC_SetPriority(USIC0_0_IRQn, NVIC_GetPriorityGrouping(), 63, 0); NVIC_EnableIRQ(USIC0_0_IRQn); /* Start operation. */ XMC_I2C_CH_Start(XMC_I2C0_CH0); /* IO configuration. */ XMC_GPIO_SetMode(P1_5, XMC_GPIO_MODE_OUTPUT_OPEN_DRAIN | P1_5_AF_U0C0_DOUT0); XMC_GPIO_SetMode(P1_1, XMC_GPIO_MODE_OUTPUT_OPEN_DRAIN | P1_1_AF_U0C0_SCLKOUT); ... /* Manage peripheral */ XMC_I2C_CH_MasterStart(XMC_I2C1_CH0, IO_EXPANDER_ADDRESS, XMC_I2C_CH_CMD_WRITE); while((XMC_I2C_CH_GetStatusFlag(XMC_I2C1_CH0) & XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED) == 0U) { /* wait for ACK */ } XMC_I2C_CH_ClearStatusFlag(XMC_I2C1_CH0, XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED); ... ``` -------------------------------- ### XMC_SCU_StartTempMeasurement Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___s_c_u.html Starts the temperature measurement. ```APIDOC ## XMC_SCU_StartTempMeasurement ### Description Starts the temperature measurement. ### Function Signature ```c void XMC_SCU_StartTempMeasurement(void) ``` ``` -------------------------------- ### Start WDT block Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/page_personalities_reference.html Start the WDT block after declaring the event handlers. The rest of the configurations are performed in the generated code. ```c XMC_WDT_Start(); ``` -------------------------------- ### WDT Event Handler and Start Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/page_personalities_reference.html Declare the WDT event handler and start the block. The configurator registers the handler in generated code; the handler must call XMC_SCU_IRQHandler and XMC_WDT_Service. Then call XMC_WDT_Start to begin the block. ```c void NMI_Handler(void) { XMC_SCU_IRQHandler((uint32_t)SCU_0_IRQn); } void MyWDT_EventHandler(void) { XMC_WDT_Service(); } ``` ```c XMC_WDT_Start(); ``` -------------------------------- ### XMC_SCU_StartTempMeasurement() Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___s_c_u.html Starts die temperature measurement using the internal temperature sensor. It enables the measurement and waits for about 10000 cycles until the result is available. Returns the status of starting the temperature measurement. ```APIDOC ## XMC_SCU_StartTempMeasurement() ### Description Starts die temperature measurement using internal temperature sensor. The API enables die temperature measurement and waits for about 10000 cycles until temperature measurement result is available on _SCU_ANALOG->ANATSEMON_ bit fields. ### Method Function ### Signature void XMC_SCU_StartTempMeasurement(void) ### Parameters None ### Returns - **XMC_SCU_STATUS_t** - Status of starting the temperature measurement. Range: Use type XMC_SCU_STATUS_t to identify the result. XMC_SCU_STATUS_OK - Temperature measurement started successfully. Always returns the above status. ### Related APIs - XMC_SCU_StopTempMeasurement() - XMC_SCU_SetRawTempLimits() - XMC_SCU_GetTemperature() ``` -------------------------------- ### XMC_WDT_Start() Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___w_d_t.html Starts the watchdog timer. Once started, the watchdog must be serviced periodically to prevent a system reset. ```APIDOC ## XMC_WDT_Start() ### Description Starts the watchdog timer. Once started, the watchdog must be serviced periodically to prevent a system reset. ### Method Function ### Signature `void XMC_WDT_Start(void)` ### Parameters None ### Returns None ``` -------------------------------- ### XMC_USBD_SETUP_SIZE Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___u_s_b_d.html The size of USB setup data. ```APIDOC ## XMC_USBD_SETUP_SIZE ### Description The size of USB setup data. ### Definition #define XMC_USBD_SETUP_SIZE (8U) ``` -------------------------------- ### XMC_SPI_CH_Start Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___s_p_i.html Starts the SPI channel. ```APIDOC ## XMC_SPI_CH_Start ### Description Starts the SPI channel. ### Method Function ### Signature void XMC_SPI_CH_Start(XMC_USIC_CH_t *const channel) ### Parameters - **channel** (XMC_USIC_CH_t*) - Required - Pointer to the USIC channel structure. ``` -------------------------------- ### XMC_SCU_StartTemperatureMeasurement Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___s_c_u.html Starts a temperature measurement. ```APIDOC ## XMC_SCU_StartTemperatureMeasurement ### Description Starts a temperature measurement. ### Returns - **XMC_SCU_STATUS_t** - The status of the measurement. ``` -------------------------------- ### XMC_RTC_Start Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___r_t_c.html Starts the RTC. ```APIDOC ## XMC_RTC_Start ### Description Starts the RTC. ### Method Function ### Signature void XMC_RTC_Start(void) ``` -------------------------------- ### XMC_WDT_Start() Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___w_d_t.html Starts the watchdog timer by setting the ENB bit of the CTR register. Invoke this API to start the watchdog after initialization, or to resume the watchdog when paused by invoking XMC_WDT_Stop(). ```APIDOC ## XMC_WDT_Start() ### Description Start the watchdog timer by setting ENB bit of CTR register. Invoke this API to start the watchdog after initialization, or to resume the watchdog when paused by invoking XMC_WDT_Stop(). ### Method Function ### Signature void XMC_WDT_Start(void) ### Parameters None ### Returns None ### Related APIs - XMC_WDT_Init() - XMC_WDT_Stop() ``` -------------------------------- ### XMC_USBD_SETUP_COUNT Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___u_s_b_d.html The number of USB setup packets. ```APIDOC ## XMC_USBD_SETUP_COUNT ### Description The number of USB setup packets. ### Definition #define XMC_USBD_SETUP_COUNT (3U) ``` -------------------------------- ### XMC_USBD_EndpointReadStart Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___u_s_b_d.html Starts a read operation on an endpoint. ```APIDOC ## XMC_USBD_EndpointReadStart ### Description Starts a read operation on an endpoint. ### Method Function ### Signature XMC_USBD_STATUS_t XMC_USBD_EndpointReadStart(const uint8_t ep_addr, uint32_t size) ### Parameters - **ep_addr** (const uint8_t) - Required - The endpoint address. - **size** (uint32_t) - Required - Number of bytes to read. ### Returns - **XMC_USBD_STATUS_t** - Status of the operation. ``` -------------------------------- ### XMC_MATH_CORDIC_TanNB Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___m_a_t_h.html Starts a non-blocking tangent calculation using the CORDIC coprocessor. The result must be retrieved later using the appropriate get function. ```APIDOC ## XMC_MATH_CORDIC_TanNB ### Description Starts a non-blocking tangent calculation using the CORDIC coprocessor. The result must be retrieved later using the appropriate get function. ### Function Signature `void XMC_MATH_CORDIC_TanNB(XMC_MATH_Q0_23_t angle_in_radians)` ### Parameters - **angle_in_radians** (XMC_MATH_Q0_23_t) - Required - Angle in radians in Q0.23 format. ``` -------------------------------- ### XMC_MATH_CORDIC_SinNB Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___m_a_t_h.html Starts a non-blocking sine calculation using the CORDIC coprocessor. The result must be retrieved later using the appropriate get function. ```APIDOC ## XMC_MATH_CORDIC_SinNB ### Description Starts a non-blocking sine calculation using the CORDIC coprocessor. The result must be retrieved later using the appropriate get function. ### Function Signature `void XMC_MATH_CORDIC_SinNB(XMC_MATH_Q0_23_t angle_in_radians)` ### Parameters - **angle_in_radians** (XMC_MATH_Q0_23_t) - Required - Angle in radians in Q0.23 format. ``` -------------------------------- ### Run Doxygen Wizard with xmc1lib.dox Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/XMCLib/doc/Readme.txt Launches the Doxygen GUI wizard with the project configuration file xmc1lib.dox. This is the final step after setting the PATH for the required tools. ```batch "c:\Program Files\doxygen\bin\doxywizard.exe" xmc1lib.dox ``` -------------------------------- ### Set PATH for Graphviz, MSCGEN, and HTML Help Workshop Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/XMCLib/doc/Readme.txt Adds the required tool directories to the PATH environment variable before running Doxygen. Each command appends a tool's bin directory to the existing PATH. ```batch set PATH=C:\Program Files (x86)\Graphviz2.38\bin;%PATH% ``` ```batch set PATH=C:\Program Files (x86)\Mscgen;%PATH% ``` ```batch set PATH=C:\Program Files (x86)\HTML Help Workshop;%PATH% ``` -------------------------------- ### XMC_MATH_CORDIC_TanhNB Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___m_a_t_h.html Starts a non-blocking hyperbolic tangent calculation using the CORDIC coprocessor. The result must be retrieved later using the appropriate get function. ```APIDOC ## XMC_MATH_CORDIC_TanhNB ### Description Starts a non-blocking hyperbolic tangent calculation using the CORDIC coprocessor. The result must be retrieved later using the appropriate get function. ### Function Signature `void XMC_MATH_CORDIC_TanhNB(XMC_MATH_Q0_23_t angle_in_radians)` ### Parameters - **angle_in_radians** (XMC_MATH_Q0_23_t) - Required - Angle in radians in Q0.23 format. ``` -------------------------------- ### XMC_MATH_CORDIC_SinhNB Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___m_a_t_h.html Starts a non-blocking hyperbolic sine calculation using the CORDIC coprocessor. The result must be retrieved later using the appropriate get function. ```APIDOC ## XMC_MATH_CORDIC_SinhNB ### Description Starts a non-blocking hyperbolic sine calculation using the CORDIC coprocessor. The result must be retrieved later using the appropriate get function. ### Function Signature `void XMC_MATH_CORDIC_SinhNB(XMC_MATH_Q0_23_t angle_in_radians)` ### Parameters - **angle_in_radians** (XMC_MATH_Q0_23_t) - Required - Angle in radians in Q0.23 format. ``` -------------------------------- ### XMC_SPI_CH_Start Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___s_p_i.html Starts the SPI channel. ```APIDOC ## XMC_SPI_CH_Start ### Description Starts the SPI channel. ### Method Function ### Signature `void XMC_SPI_CH_Start(XMC_USIC_CH_t *const channel)` ### Parameters - **channel** (XMC_USIC_CH_t*) - Required - Pointer to the USIC channel structure. ``` -------------------------------- ### XMC_ETH_MAC_Init Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___e_t_h___m_a_c.html Initializes the Ethernet MAC. ```APIDOC ## XMC_ETH_MAC_Init ### Description Initializes the Ethernet MAC. ### Method Function ### Signature XMC_ETH_MAC_STATUS_t XMC_ETH_MAC_Init(XMC_ETH_MAC_t *const eth_mac) ### Parameters - **eth_mac** (XMC_ETH_MAC_t*) - Required - Pointer to the Ethernet MAC structure. ### Returns - **XMC_ETH_MAC_STATUS_t** - Status of the initialization. ``` -------------------------------- ### XMC_DAC_CH_GetRampStart() Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___d_a_c.html Gets the ramp start value for a DAC channel by reading the DATA0 bit-field of the DAC0DATA register (channel 0) or DATA1 bit-field of the DAC1DATA register (channel 1). This function should be called when the channel is set to Ramp mode. ```APIDOC ## XMC_DAC_CH_GetRampStart() ### Description Gets the ramp start value by reading the DATA0 bit-field of the DAC0DATA register (for channel 0) or DATA1 bit-field of the DAC1DATA register (for channel 1). If the ramp counter reaches its stop value, it restarts from the start value with the next trigger pulse. ### Method Function ### Signature uint16_t XMC_DAC_CH_GetRampStart(XMC_DAC_t *const dac, const uint8_t channel) ### Parameters - **dac** (XMC_DAC_t *const) - Required - Pointer to an instance of DAC module - **channel** (const uint8_t) - Required - DAC channel number ### Returns uint16_t ### Note Call this API if the channel is set to Ramp mode. ### Related APIs - XMC_DAC_CH_SetRampStart() - XMC_DAC_CH_StartRampMode() - XMC_DAC_CH_GetRampStop() - XMC_DAC_CH_SetRampStop() ``` -------------------------------- ### XMC_USBD_Init Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___u_s_b_d.html Initializes the USB device. ```APIDOC ## XMC_USBD_Init ### Description Initializes the USB device. ### Method Function ### Signature XMC_USBD_STATUS_t XMC_USBD_Init(XMC_USBD_t *obj) ### Parameters - **obj** (XMC_USBD_t *) - Required - Pointer to the USBD object. ### Returns - **XMC_USBD_STATUS_t** - Status of the operation. ``` -------------------------------- ### XMC_CCU8_SLICE_StartConfig Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___c_c_u8.html Configures the start event and start mode for a CCU8 slice. This function sets up how the timer will be started. ```APIDOC ## XMC_CCU8_SLICE_StartConfig ### Description Configures the start event and start mode for a CCU8 slice. This function sets up how the timer will be started. ### Method Function ### Signature void XMC_CCU8_SLICE_StartConfig(XMC_CCU8_SLICE_t *const slice, const XMC_CCU8_SLICE_EVENT_t event, const XMC_CCU8_SLICE_START_MODE_t start_mode) ### Parameters - **slice** (XMC_CCU8_SLICE_t*) - Required - Pointer to the CCU8 slice structure. - **event** (XMC_CCU8_SLICE_EVENT_t) - Required - The event that triggers the start. - **start_mode** (XMC_CCU8_SLICE_START_MODE_t) - Required - The start mode configuration. ### Return Value None ``` -------------------------------- ### XMC_SCU_StartTempMeasurement() Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___s_c_u.html Starts the die temperature sensor measurement. This API initiates a temperature measurement. ```APIDOC ## XMC_SCU_StartTempMeasurement() ### Description Starts the die temperature sensor measurement. This API initiates a temperature measurement. ### Method Function ### Signature `void XMC_SCU_StartTempMeasurement(void)` ``` -------------------------------- ### XMC_ETH_MAC_InitPTPEx Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___e_t_h___m_a_c.html Initializes the PTP module with extended configuration. ```APIDOC ## XMC_ETH_MAC_InitPTPEx ### Description Initializes the PTP module with extended configuration. ### Method Function ### Signature void XMC_ETH_MAC_InitPTPEx(XMC_ETH_MAC_t *const eth_mac, uint32_t config, XMC_ETH_MAC_TIME_t *const time) ### Parameters - **eth_mac** (XMC_ETH_MAC_t*) - Required - Pointer to the Ethernet MAC structure. - **config** (uint32_t) - Required - Configuration value for PTP. - **time** (XMC_ETH_MAC_TIME_t*) - Required - Pointer to a structure for initial time. ``` -------------------------------- ### Enable CCU4 Interrupt and Start Timer Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/page_personalities_reference.html Enable the CCU4 interrupt and start the timer before starting the block. This is used after the interrupt handler is defined. ```c NVIC_EnableIRQ(MyCCU4_SR0_IRQN); XMC_CCU4_SLICE_StartTimer(MyCCU4Slice_HW); ``` -------------------------------- ### XMC_ETH_MAC_GetTxTimeStamp() Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___e_t_h___m_a_c.html Get TX timestamp. The function can be used to get the TX timestamp. ```APIDOC ## XMC_ETH_MAC_GetTxTimeStamp() ### Description Get TX timestamp. The function can be used to get the TX timestamp. ### Function Signature ```c XMC_ETH_MAC_STATUS_t XMC_ETH_MAC_GetTxTimeStamp(XMC_ETH_MAC_t *const eth_mac, XMC_ETH_MAC_TIME_t *const time) ``` ### Parameters - **eth_mac** (XMC_ETH_MAC_t*) - Required - A constant pointer to XMC_ETH_MAC_t, pointing to the ETH MAC base address - **time** (XMC_ETH_MAC_TIME_t*) - Required - A constant pointer to XMC_ETH_MAC_TIME_t, pointing to the TX timestamp ### Returns - XMC_ETH_MAC_STATUS_t - ETH MAC status ``` -------------------------------- ### XMC_USBD_Init() Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___u_s_b_d.html Initializes the USB device to get ready for connection to a USB host. Enables the USB module, sets EP buffer sizes, registers callbacks, configures device mode, and enables interrupts. ```APIDOC ## XMC_USBD_Init() ### Description Initializes the USB device to get ready for connection to a USB host. Enables the USB module, sets the EP buffer sizes, registers the device and EP event callbacks. Initializes the global, device, and FIFO register base addresses. Configures the global AHB, enables the global interrupt and DMA by programming GAHBCFG register. Configures the USB in to device mode and enables the session request protocol by programming GUSBCFG register. Configures the USB device speed to full speed by programming DCFG register. Disconnects the USB device by programming DCTL register. Enables the USB common and device interrupts by programming GINTMSK register. ### Method Function ### Signature XMC_USBD_STATUS_t XMC_USBD_Init(XMC_USBD_t *obj) ### Parameters - **obj** (XMC_USBD_t*) - Required - The pointer to the USB device handle. ### Returns - **XMC_USBD_STATUS_t** - The USB device status. ### Note This API makes the USB device ready to connect to host. The user has to explicitly call the XMC_USBD_DeviceConnect() after the USB initialization to connect to USB host. ### Related APIs - XMC_USBD_DeviceConnect() ``` -------------------------------- ### XMC_USBD_EndpointReadStart() Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___u_s_b_d.html Prepares an endpoint to receive OUT tokens from the USB host. Configures the selected endpoint to receive the specified amount of data from the host. ```APIDOC ## XMC_USBD_EndpointReadStart() ### Description Prepares an endpoint to receive OUT tokens from the USB host. The selected endpoint gets configured, so that it receives the specified amount of data from the host. As part of streaming of OUT data, after reading the current OUT buffer using XMC_USBD_EndpointRead(), user can prepare endpoint for the next OUT packet by using XMC_USBD_EndpointReadStart(). ### Method Function ### Signature XMC_USBD_STATUS_t XMC_USBD_EndpointReadStart(const uint8_t ep_addr, uint32_t size) ### Parameters - **ep_addr** (uint8_t) - Required - The address of the USB endpoint, from which data need to be read. - **size** (uint32_t) - Required - The number of bytes to be read. ### Returns - **XMC_USBD_STATUS_t** - Status of the operation. ### Notes For the data received on OUT EP buffer, use XMC_USBD_EndpointRead(). ### Related APIs - XMC_USBD_EndpointRead() ``` -------------------------------- ### XMC_ETH_MAC_GetRxTimeStamp() Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___e_t_h___m_a_c.html Get RX timestamp. The function can be used to get the RX timestamp. ```APIDOC ## XMC_ETH_MAC_GetRxTimeStamp() ### Description Get RX timestamp. The function can be used to get the RX timestamp. ### Function Signature ```c XMC_ETH_MAC_STATUS_t XMC_ETH_MAC_GetRxTimeStamp(XMC_ETH_MAC_t *const _eth_mac, XMC_ETH_MAC_TIME_t *const _time) ``` ### Parameters - **eth_mac** (XMC_ETH_MAC_t *const) - Required - A constant pointer to XMC_ETH_MAC_t, pointing to the ETH MAC base address - **time** (XMC_ETH_MAC_TIME_t *const) - Required - A constant pointer to XMC_ETH_MAC_TIME_t, pointing to the RX timestamp ### Returns - **XMC_ETH_MAC_STATUS_t** - ETH MAC status ``` -------------------------------- ### XMC_ETH_MAC_InitRxDescriptors Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___e_t_h___m_a_c.html Initializes the receive descriptors. ```APIDOC ## XMC_ETH_MAC_InitRxDescriptors ### Description Initializes the receive descriptors. ### Method Function ### Signature void XMC_ETH_MAC_InitRxDescriptors(XMC_ETH_MAC_t *const eth_mac) ### Parameters - **eth_mac** (XMC_ETH_MAC_t*) - Required - Pointer to the Ethernet MAC structure. ``` -------------------------------- ### XMC_CCU4_SLICE_StartConfig Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___c_c_u4.html Configures the start behavior for the CCU4 slice. This function sets the start mode for the specified event. ```APIDOC ## XMC_CCU4_SLICE_StartConfig ### Description Configures the start behavior for the CCU4 slice. ### Method void ### Parameters - **slice** (XMC_CCU4_SLICE_t *const) - Required - Pointer to the CCU4 slice structure. - **event** (XMC_CCU4_SLICE_EVENT_t) - Required - The event identifier. - **start_mode** (XMC_CCU4_SLICE_START_MODE_t) - Required - The start mode. ``` -------------------------------- ### XMC_BCCU_ConcurrentStartDimming Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___b_c_c_u.html Starts dimming operations concurrently on multiple channels. This function starts dimming for the channels specified by the mask. ```APIDOC ## XMC_BCCU_ConcurrentStartDimming ### Description Starts dimming operations concurrently on multiple channels. This function starts dimming for the channels specified by the mask. ### Method void ### Parameters - **bccu** (XMC_BCCU_t *const) - Required - Pointer to the BCCU module. - **mask** (uint32_t) - Required - Bitmask of channels to start dimming. ### Response No return value. ``` -------------------------------- ### Initialize Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/struct_x_m_c___u_s_b_d___d_r_i_v_e_r__t.html Pointer to XMC_USBD_Init: Initialize USB Device Interface. ```APIDOC ## Initialize ### Description Pointer to XMC_USBD_Init: Initialize USB Device Interface. ### Signature XMC_USBD_STATUS_t (*Initialize)(XMC_USBD_t *obj) ### Parameters - **obj** (XMC_USBD_t*) - Required - Pointer to USB device object ### Returns XMC_USBD_STATUS_t - Status of initialization ``` -------------------------------- ### XMC_ETH_MAC_GetRxFrameSize() Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___e_t_h___m_a_c.html Get RX frame size. The function is used to get the effective length of the RX frame size. ```APIDOC ## XMC_ETH_MAC_GetRxFrameSize() ### Description Get RX frame size. The function is used to get the effective length of the RX frame size. ### Function Signature ```c uint32_t XMC_ETH_MAC_GetRxFrameSize(XMC_ETH_MAC_t *const _eth_mac) ``` ### Parameters - **eth_mac** (XMC_ETH_MAC_t *const) - Required - A constant pointer to XMC_ETH_MAC_t, pointing to the ETH MAC base address ### Returns - **uint32_t** - RX frame size ``` -------------------------------- ### XMC_CCU4_SLICE_StartTimer() Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___c_c_u4.html Starts the timer counting operation by setting the CC4yTCSET.TRBS bit. The slice must be configured and clock provided before starting. ```APIDOC ## XMC_CCU4_SLICE_StartTimer() ### Description Starts the timer counting operation, by setting CC4yTCSET.TRBS bit. It is necessary to have configured the CC4 slice before starting its timer. Before the Timer is started ensure that the clock is provided to the slice. ### Parameters - **slice** (XMC_CCU4_SLICE_t *const) - Required - Constant pointer to CC4 Slice ### Returns None ### Related APIs - XMC_CCU4_SLICE_StopTimer() ``` -------------------------------- ### XMC_POSIF_QD_Init Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___p_o_s_i_f.html Initializes the POSIF Quadrature Decoder with the given configuration. This function sets up the hardware according to the provided config structure. ```APIDOC ## XMC_POSIF_QD_Init ### Description Initializes the POSIF Quadrature Decoder with the given configuration. This function sets up the hardware according to the provided config structure. ### Method Function ### Signature XMC_POSIF_STATUS_t XMC_POSIF_QD_Init(XMC_POSIF_t *const peripheral, const XMC_POSIF_QD_CONFIG_t *const config) ### Parameters - **peripheral** (XMC_POSIF_t*) - Required - Pointer to the POSIF peripheral base address. - **config** (const XMC_POSIF_QD_CONFIG_t*) - Required - Pointer to the configuration structure. ### Returns XMC_POSIF_STATUS_t - Status of the initialization. ``` -------------------------------- ### XMC_CCU4_SLICE_StartConfig() Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___c_c_u4.html Configures the start of the timer on an external event. This function sets up the slice to start the timer when the specified event occurs. ```APIDOC ## XMC_CCU4_SLICE_StartConfig() ### Description Configures the start of the timer on an external event. This function sets up the slice to start the timer when the specified event occurs. ### Method Function ### Endpoint XMC_CCU4_SLICE_StartConfig() ### Parameters - **slice** (XMC_CCU4_SLICE_t*) - Required - Pointer to the slice. - **config** (XMC_CCU4_SLICE_EVENT_CONFIG_t*) - Required - Pointer to the event configuration. ### Response No return value. ``` -------------------------------- ### XMClib Directory Structure Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/XMCLib/doc/main_xmc4.txt Shows the directory layout of the XMClib distribution, including CMSIS/Infineon, Newlib, XMCLib, device-info, docs, props.json, README.md, and RELEASE.md. Useful for understanding where headers, sources, and documentation reside. ```text mtb-xmclib-cat3 - XMClib root directory +-- CMSIS/Infineon - Includes device header files, system and startup files +-- Newlib - C standard library implementation intended for use on embedded systems +-- XMCLib - XMC Peripheral Library API root directory │ +-- doc - Doxygen configuration files to generate documentation │ +-- inc - XMC Peripheral Library API interface files │ +-- src - XMC Peripheral Library API implementation files +-- device-info - Configuration files that defines a resource behavior for ModusToolbox Device Configurator +-- docs - XMC Peripheral Library documentation generated with Doxygen │ +-- xmc1_api_reference_manual.html - XMC Peripheral Library documentation with XMC1 specific information │ +-- xmc4_api_reference_manual.html - XMC Peripheral Library documentation with XMC4 specific information +-- props.json - Device description file for ModusToolbox Device Configurator +-- README.md - Description of the library +-- RELEASE.md - Description of the changes in the release ``` -------------------------------- ### XMC_SCU_CLOCK_StartUsbPll Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___s_c_u.html Starts the USB PLL. This function initializes and starts the USB PLL with the given divider values. ```APIDOC ## XMC_SCU_CLOCK_StartUsbPll ### Description Starts the USB PLL. ### Function Signature ```c void XMC_SCU_CLOCK_StartUsbPll(uint32_t pdiv, uint32_t ndiv) ``` ### Parameters - **pdiv** (uint32_t) - Required - The PLL p-divider value. - **ndiv** (uint32_t) - Required - The PLL n-divider value. ``` -------------------------------- ### XMC_SDMMC_Start Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___s_d_m_m_c.html Starts the SDMMC controller. This function enables the SDMMC interface for operation. ```APIDOC ## XMC_SDMMC_Start ### Description Starts the SDMMC controller. This function enables the SDMMC interface for operation. ### Method Function ### Signature void XMC_SDMMC_Start(XMC_SDMMC_t *const sdmmc) ### Parameters - **sdmmc** (XMC_SDMMC_t*) - Required - Pointer to the SDMMC controller base address. ### Response No return value. ``` -------------------------------- ### XMC_DSD_Start() Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___d_s_d.html Starts the demodulator channel(s) by enabling the run control bit. Multiple channels can be started at once by OR-ing the channel IDs. ```APIDOC ## XMC_DSD_Start() ### Description Starts the demodulator channel(s) by enabling the run control bit. Multiple channels can be started at once by OR-ing the channel IDs. ### Method Function ### Signature void XMC_DSD_Start(XMC_DSD_t *const dsd, const uint32_t channel) ### Parameters - **dsd** (XMC_DSD_t*) - Required - Pointer to an instance of DSD module of type XMC_DSD_t - **channel** (uint32_t) - Required - Channel run control bit register value ### Returns None ### Note All filter blocks are cleared when CHxRUN is set. ### Related APIs - XMC_DSD_Stop() - XMC_DSD_IsChannelStarted() ``` -------------------------------- ### XMC_CCU8_SLICE_StartTimer() Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___c_c_u8.html Starts the timer counting operation by setting the CC8yTCSET.TRBS bit. Requires the CC8 slice to be configured and a clock provided before starting. ```APIDOC ## XMC_CCU8_SLICE_StartTimer() ### Description Starts the timer counting operation, by setting CC8yTCSET.TRBS bit. It is necessary to have configured the CC8 slice before starting its timer. Before the Timer is started ensure that the clock is provided to the slice. ### Method Function ### Signature void XMC_CCU8_SLICE_StartTimer(XMC_CCU8_SLICE_t *const slice) ### Parameters - **slice** (XMC_CCU8_SLICE_t *const) - Required - Constant pointer to CC8 Slice ### Returns None ### Related APIs - XMC_CCU8_SLICE_StopTimer() ``` -------------------------------- ### XMC_ETH_PHY_Init Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___e_t_h___p_h_y.html Initializes the Ethernet PHY with the given configuration. ```APIDOC ## XMC_ETH_PHY_Init ### Description Initializes the Ethernet PHY. ### Method Function ### Signature int32_t XMC_ETH_PHY_Init(XMC_ETH_MAC_t *const eth_mac, uint8_t phy_addr, const XMC_ETH_PHY_CONFIG_t *const config) ### Parameters - **eth_mac** (XMC_ETH_MAC_t*) - Required - Pointer to Ethernet MAC instance - **phy_addr** (uint8_t) - Required - PHY address - **config** (const XMC_ETH_PHY_CONFIG_t*) - Required - Pointer to PHY configuration structure ### Returns int32_t - Status code ``` -------------------------------- ### XMC_BCCU_ConcurrentStartLinearWalk Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___b_c_c_u.html Starts linear walk operations concurrently on multiple channels. This function starts linear walk for the channels specified by the mask. ```APIDOC ## XMC_BCCU_ConcurrentStartLinearWalk ### Description Starts linear walk operations concurrently on multiple channels. This function starts linear walk for the channels specified by the mask. ### Method void ### Parameters - **bccu** (XMC_BCCU_t *const) - Required - Pointer to the BCCU module. - **mask** (uint32_t) - Required - Bitmask of channels to start linear walk. ### Response No return value. ``` -------------------------------- ### XMC_SCU_CLOCK_StartSystemPll Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___s_c_u.html Starts the system PLL. This function initializes and starts the system PLL with the given source, mode, and divider values. ```APIDOC ## XMC_SCU_CLOCK_StartSystemPll ### Description Starts the system PLL. ### Function Signature ```c void XMC_SCU_CLOCK_StartSystemPll(XMC_SCU_CLOCK_SYSPLLCLKSRC_t source, XMC_SCU_CLOCK_SYSPLL_MODE_t mode, uint32_t pdiv, uint32_t ndiv, uint32_t kdiv) ``` ### Parameters - **source** (XMC_SCU_CLOCK_SYSPLLCLKSRC_t) - Required - The PLL clock source. - **mode** (XMC_SCU_CLOCK_SYSPLL_MODE_t) - Required - The PLL mode. - **pdiv** (uint32_t) - Required - The PLL p-divider value. - **ndiv** (uint32_t) - Required - The PLL n-divider value. - **kdiv** (uint32_t) - Required - The PLL k-divider value. ``` -------------------------------- ### XMC_DAC_CH_SetRampStart Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___d_a_c.html Sets the start value for the ramp mode of a DAC channel. This function configures the starting point of the ramp waveform. ```APIDOC ## XMC_DAC_CH_SetRampStart ### Description Sets the start value for the ramp mode of a DAC channel. This function configures the starting point of the ramp waveform. ### Method Function ### Signature void XMC_DAC_CH_SetRampStart(XMC_DAC_t *const dac, const uint8_t channel, const uint16_t start) ### Parameters - **dac** (XMC_DAC_t*) - Required - Pointer to the DAC module base address. - **channel** (uint8_t) - Required - The DAC channel number. - **start** (uint16_t) - Required - The start value for the ramp. ``` -------------------------------- ### XMC_EBU_Init Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___e_b_u.html Initializes the EBU peripheral with the given configuration. ```APIDOC ## XMC_EBU_Init ### Description Initializes the EBU peripheral with the given configuration. ### Method XMC_EBU_STATUS_t ### Signature XMC_EBU_STATUS_t XMC_EBU_Init(XMC_EBU_t *const ebu, const XMC_EBU_CONFIG_t *const config) ### Parameters - **ebu** (XMC_EBU_t*) - Required - Pointer to EBU peripheral registers. - **config** (const XMC_EBU_CONFIG_t*) - Required - Pointer to EBU configuration. ### Returns XMC_EBU_STATUS_t - Initialization status. ``` -------------------------------- ### Initialize Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/struct_x_m_c___u_s_b_h___d_r_i_v_e_r__t.html Initializes the USB host driver with the provided callback functions. ```APIDOC ## Initialize ### Description Initializes the USB host driver with the provided callback functions. ### Method Function pointer ### Signature `int32_t (*Initialize)(XMC_USBH_SignalPortEvent_t cb_port_event, XMC_USBH_SignalPipeEvent_t cb_pipe_event)` ### Parameters - `cb_port_event` (XMC_USBH_SignalPortEvent_t) - Required - Callback for port events. - `cb_pipe_event` (XMC_USBH_SignalPipeEvent_t) - Required - Callback for pipe events. ### Returns `int32_t` - Status code (0 on success, negative on error). ``` -------------------------------- ### XMC_FLASH_ReadBlocks() Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___f_l_a_s_h.html Reads multiple blocks from flash in one shot, starting from the specified address. The read blocks are stored into the locations starting from the data address. ```APIDOC ## XMC_FLASH_ReadBlocks() ### Description Reads multiple blocks from flash in one shot, starting from the specified address. The read blocks are stored into the locations starting from the data address. ### Method Function ### Signature ```c void XMC_FLASH_ReadBlocks(uint32_t *address, uint32_t *data, uint32_t num_blocks) ``` ### Parameters - **address** (uint32_t*) - Required - Pointer to the starting address of flash block from where the read starts. - **data** (uint32_t*) - Required - Pointer to the destination address, where the read data blocks to be stored. - **num_blocks** (uint32_t) - Required - Number of blocks to be read. Range: [1 to (flash size / 16)] ### Returns None ### Related APIs None ``` -------------------------------- ### XMC_POSIF_Start Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___p_o_s_i_f.html Starts the POSIF module. This function enables the module to begin operation. ```APIDOC ## XMC_POSIF_Start ### Description Starts the POSIF module. This function enables the module to begin operation. ### Method Function ### Signature void XMC_POSIF_Start(XMC_POSIF_t *const peripheral) ### Parameters - **peripheral** (XMC_POSIF_t*) - Required - Pointer to the POSIF peripheral base address. ### Returns void ``` -------------------------------- ### XMC_RTC_GetEventStatus() Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___r_t_c.html Gets the RTC periodic and alarm event(s) status. The function reads the bitfields of STSSR register to get the status of RTC events. ```APIDOC ## XMC_RTC_GetEventStatus() ### Description Gets the RTC periodic and alarm event(s) status. The function reads the bitfields of STSSR register to get the status of RTC events. Reading the value of the register STSSR gives the status of the event(s) containing in the XMC_RTC_EVENT_t. ### Method Function ### Signature uint32_t XMC_RTC_GetEventStatus(void) ### Parameters None ### Returns None ### Related APIs - XMC_RTC_ClearEvent() ``` -------------------------------- ### XMC_DAC_CH_StartRampMode Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___d_a_c.html Starts the ramp mode for a DAC channel. This function initializes the channel to generate a ramp waveform from start to stop with the specified trigger and frequency. ```APIDOC ## XMC_DAC_CH_StartRampMode ### Description Starts the ramp mode for a DAC channel. This function initializes the channel to generate a ramp waveform from start to stop with the specified trigger and frequency. ### Method Function ### Signature XMC_DAC_CH_STATUS_t XMC_DAC_CH_StartRampMode(XMC_DAC_t *const dac, const uint8_t channel, const uint16_t start, const uint16_t stop, const XMC_DAC_CH_TRIGGER_t trigger, const uint32_t frequency) ### Parameters - **dac** (XMC_DAC_t*) - Required - Pointer to the DAC module base address. - **channel** (uint8_t) - Required - The DAC channel number. - **start** (uint16_t) - Required - The start value of the ramp. - **stop** (uint16_t) - Required - The stop value of the ramp. - **trigger** (XMC_DAC_CH_TRIGGER_t) - Required - The trigger source. - **frequency** (uint32_t) - Required - The ramp frequency in Hz. ### Returns - **XMC_DAC_CH_STATUS_t** - Status of the operation. ``` -------------------------------- ### XMC_POSIF_Init Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___p_o_s_i_f.html Initializes the POSIF module with the given configuration. ```APIDOC ## XMC_POSIF_Init ### Description Initializes the POSIF module with the given configuration. ### Function Signature void XMC_POSIF_Init(XMC_POSIF_t *const peripheral, const XMC_POSIF_CONFIG_t *const config) ### Parameters - **peripheral** (XMC_POSIF_t*) - Required - Pointer to the POSIF peripheral base address. - **config** (const XMC_POSIF_CONFIG_t*) - Required - Pointer to the POSIF configuration structure. ### Returns void ``` -------------------------------- ### XMC_CCU8_SLICE_StartConfig() Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/group___c_c_u8.html Configures the Start Function of the slice by setting the CC8yCMC.ENDS and CC8yTC.ENDM bits. Maps an external event to the external start function and configures the behavior of the slice upon activation. ```APIDOC ## XMC_CCU8_SLICE_StartConfig() ### Description Configures the Start Function of the slice, by configuring CC8yCMC.ENDS and CC8yTC.ENDM bits. Start function is mapped with one of the 3 events. An external signal can control when a CC8 timer should start. Additionally, the behaviour of the slice upon activation of the start function is configured as well. ### Method Function ### Signature void XMC_CCU8_SLICE_StartConfig(XMC_CCU8_SLICE_t *const slice, const XMC_CCU8_SLICE_EVENT_t event, const XMC_CCU8_SLICE_START_MODE_t start_mode) ### Parameters - **slice** (XMC_CCU8_SLICE_t *const) - Required - Constant pointer to CC8 Slice - **event** (XMC_CCU8_SLICE_EVENT_t) - Required - Map an External event to the External Start Function - **start_mode** (XMC_CCU8_SLICE_START_MODE_t) - Required - Behaviour of slice when the start function is activated ### Returns None ### Related APIs - XMC_CCU8_SLICE_StopConfig() - XMC_CCU8_SLICE_ConfigureEvent() - XMC_CCU8_SLICE_SetInput() ``` -------------------------------- ### XMC_ETH_MAC_InitPTP Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc4_api_reference_manual/html/group___e_t_h___m_a_c.html Initializes the PTP (Precision Time Protocol) module. ```APIDOC ## XMC_ETH_MAC_InitPTP ### Description Initializes the PTP (Precision Time Protocol) module. ### Method Function ### Signature void XMC_ETH_MAC_InitPTP(XMC_ETH_MAC_t *const eth_mac, uint32_t config) ### Parameters - **eth_mac** (XMC_ETH_MAC_t*) - Required - Pointer to the Ethernet MAC structure. - **config** (uint32_t) - Required - Configuration value for PTP. ``` -------------------------------- ### CCU4 SR0 Interrupt Handler Example Source: https://github.com/infineon/mtb-xmclib-cat3/blob/master/docs/xmc1_api_reference_manual/html/page_personalities_reference.html Example of a CCU4 slice interrupt handler that clears the period match event. Use this in application code for xmc4xxx devices after generating the interrupt handler definitions. ```c void MyCCU4_SR0_INTERRUPT_HANDLER(void) { XMC_CCU4_SLICE_ClearEvent(MyCCU4Slice_HW, XMC_CCU4_SLICE_IRQ_ID_PERIOD_MATCH); } ```