Interrupt Functions

group group_ctdac_functions_interrupts

This set of functions is related to the CTDAC interrupt.

Functions

__STATIC_INLINE uint32_t Cy_CTDAC_GetInterruptStatus (const CTDAC_Type *base)

Return the interrupt status which gets set by the hardware when the CTDAC_VAL_NXT register value is transferred to the CTDAC_VAL register.

Once set, the CTDAC_VAL_NXT register is ready to accept a new value.

note

Interrupts are available in all update modes except Direct write.

    /* Scenario: The CTDAC has interrupts enabled. Retrieve the interrupt
     * status to determine if the CTDAC is ready to accept a new value. */
    
    uint8_t intrStatus;
    
    /* Get the interrupt status for a specific CTDAC instance on the device. */
    intrStatus = Cy_CTDAC_GetInterruptStatus(CTDAC0);

    /* If the interrupt status is 1, the CTDAC is ready to accept a new value. */
    if (1UL == intrStatus)
    {
        /* Set the next value to output. */
    }
Return

  • 0: Value not moved from CTDAC_VAL_NXT to CTDAC_VAL

  • 1: Value moved from CTDAC_VAL_NXT to CTDAC_VAL

Function Usage

Parameters
  • base: Pointer to structure describing registers

__STATIC_INLINE void Cy_CTDAC_ClearInterrupt (CTDAC_Type *base)

Clear the interrupt that was set by the hardware when the CTDAC_VAL_NXT register value is transferred to the CTDAC_VAL register.

The interrupt must be cleared with this function so that the hardware can set subsequent interrupts and those interrupts can be forwarded to the interrupt controller, if enabled.

note

Interrupts are available in all update modes except Direct write.

Return

None

Parameters
  • base: Pointer to structure describing registers

__STATIC_INLINE void Cy_CTDAC_SetInterrupt (CTDAC_Type *base)

Force the CTDAC interrupt to trigger using software.

note

Interrupts are available in all update modes except Direct write.

Return

None

Parameters
  • base: Pointer to structure describing registers

__STATIC_INLINE void Cy_CTDAC_SetInterruptMask (CTDAC_Type *base, uint32_t mask)

Configure the CTDAC interrupt to be forwarded to the CPU interrupt controller.

note

Interrupts are available in all update modes except Direct write.

    /* Scenario: DMA will be used to update the DAC value. Disable the CTDAC interrupt. */
    
    Cy_CTDAC_SetInterruptMask(CTDAC0, 0UL);
    
Return

None

Function Usage

Parameters
  • base: Pointer to structure describing registers

  • mask: The CTDAC only has one interrupt so the mask is one bit.

    • 0: Disable CTDAC interrupt request (will not be forwarded to CPU interrupt controller)

    • 1: Enable CTDAC interrupt request (will be forwarded to CPU interrupt controller)

__STATIC_INLINE uint32_t Cy_CTDAC_GetInterruptMask (const CTDAC_Type *base)

Return whether the CTDAC interrupt is forwarded to the CPU interrupt controller as configured by Cy_CTDAC_SetInterruptMask.

note

Interrupts are available in all update modes except Direct write.

Return

The CTDAC only has one interrupt so the return value is either 0 or 1.

  • 0: Interrupt output not forwarded to CPU interrupt controller

  • 1: Interrupt output forwarded to CPU interrupt controller

Parameters
  • base: Pointer to structure describing registers

__STATIC_INLINE uint32_t Cy_CTDAC_GetInterruptStatusMasked (const CTDAC_Type *base)

Return the bitwise AND of Cy_CTDAC_GetInterruptStatus and Cy_CTDAC_SetInterruptMask.

When high, the DAC interrupt is asserted and the interrupt is forwarded to the CPU interrupt controller.

note

Interrupts are available in all update modes except Direct write.

Return

  • 0: Value not moved from CTDAC_VAL_NXT to CTDAC_VAL or not masked

  • 1: Value moved from CTDAC_VAL_NXT to CTDAC_VAL and masked

Parameters
  • base: Pointer to structure describing registers