Atmel Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
External oscillator frequency detection

A software service to estimate an oscillator frequency using a known oscillator (external or internal) as a reference.

Functions

uint32_t freq_detect_start (void)
 Detects the frequency. More...
 

External routine used to detect frequency

void freq_detect_iface_ref_cnt_reset (void)
 Callback used to reset the counter of the reference's oscillator. More...
 
int freq_detect_iface_ref_cnt_value (void)
 Callback used to read the counter value of the reference's oscillator. More...
 
void freq_detect_iface_target_cnt_reset (void)
 Callback used to reset the counter of the target oscillator. More...
 
int freq_detetc_iface_target_cnt_value (void)
 Callback used to read the counter value of the target oscillator. More...
 

void freq_detect_iface_ref_cnt_reset ( void  )

Callback used to reset the counter of the reference's oscillator.

Referenced by freq_detect_start().

int freq_detect_iface_ref_cnt_value ( void  )

Callback used to read the counter value of the reference's oscillator.

Referenced by freq_detect_start().

void freq_detect_iface_target_cnt_reset ( void  )

Callback used to reset the counter of the target oscillator.

Referenced by freq_detect_start().

uint32_t freq_detect_start ( void  )

Detects the frequency.

Returns
The frequency in Hz or 0 if no detection.

References abs, freq_detect_iface_ref_cnt_reset(), freq_detect_iface_ref_cnt_value(), freq_detect_iface_target_cnt_reset(), freq_detetc_iface_target_cnt_value(), and i.

int freq_detetc_iface_target_cnt_value ( void  )

Callback used to read the counter value of the target oscillator.

Referenced by freq_detect_start().