9.1.1.3 Workflow

  1. Create an FREQM device instance struct, which will be associated with a FREQM peripheral hardware instance.
    static struct freqm_module freqm_instance;
    
    Note: Device instance structures shall never go out of scope when in use.
  2. Create a new function configure_freqm(), which will be used to configure the overall FREQM peripheral.
    void configure_freqm(void)
    
  3. Create an FREQM peripheral configuration structure that will be filled out to set the module configuration.
    struct freqm_config config_freqm;
    
  4. Fill the FREQM peripheral configuration structure with the default module configuration values.
    freqm_get_config_defaults(&config_freqm);
    
  5. Initialize the FREQM peripheral and associate it with the software instance structure that was defined previously.
    freqm_init(&freqm_instance, FREQM, &config_freqm);
    
  6. Enable the now initialized FREQM peripheral.
    freqm_enable(&freqm_instance);