Common triggering Functions for multiple SAR instances

group group_sar_functions_trig

This set of functions is for initialization and usage of SAR common settings and simultaneous triggering.

Functions

cy_en_sar_status_t Cy_SAR_CommonInit(PASS_Type *base, const cy_stc_sar_common_config_t *trigConfig)

Initialize common SAR configuration registers.

    cy_en_sar_status_t status;

    const cy_stc_sar_common_config_t config =
    {
    /* .pwrUpDelay              */  0UL,                                    
    /* .scanCount               */  16UL,                                   
    /* .simultControl           */  CY_SAR_SAR0 | CY_SAR_SAR1,              
    /* .simultTrigSource        */  CY_SAR_SAR0,                            
    /* .simultTrigEvent         */  CY_SAR_SIMULT_TRIG_EVENT_EDGE,          
    /* .simultTrigSync          */  CY_SAR_SIMULT_TRIG_SYNC_SAR_CLOCK,      
    /* .simultSamplesPerTrigger */  CY_SAR_SIMULT_TRIG_SAMPLE_SCAN_CNT,     
    /* .simultEOSIntrSelect     */  CY_SAR_SIMULT_TRIG_INTR_EOS             
    };

    status = Cy_SAR_CommonInit(PASS, &config);

    if (CY_SAR_SUCCESS != status)
    {
        /* Insert error handling */
    }
Return

Function Usage

Parameters
  • base: Pointer to structure describing PASS registers.

  • trigConfig: Pointer to structure containing configuration data. See cy_stc_sar_common_config_t.