AT09253

Workflow

  1. 1.
    Get the default configuration and initialize the module:
    struct ac_config module_cfg;
    ac_get_config_defaults(&module_cfg);
    ac_init(&ac_device, ACIFC, &module_cfg);
    
  2. 2.
    Enable the module:
    ac_enable(&ac_device); 
    
  3. 3.
    Get the default configuration to initialize channel 0:
    #define EXAMPLE_AC_CHANNEL         0
    
    struct ac_ch_config ch_cfg;
    ac_ch_get_config_defaults(&ch_cfg);
    ch_cfg.always_on = true;
    ch_cfg.fast_mode = true;
    ac_ch_set_config(&ac_device, EXAMPLE_AC_CHANNEL, &ch_cfg);
    
  4. 4.
    Start a single comparison:
    ac_user_trigger_single_comparison(&ac_device); 
    
  5. 5.
    Check if the comparison has completed:
    while (!ac_is_comparison_done(&ac_device));