Microchip® Advanced Software Framework

gclk.h File Reference

SAM Generic Clock Driver.

Copyright (c) 2012-2020 Microchip Technology Inc. and its subsidiaries.

#include <compiler.h>

Data Structures

struct  system_gclk_chan_config
 Generic Clock configuration structure. More...
 
struct  system_gclk_gen_config
 Generic Clock Generator configuration structure. More...
 

Enumerations

enum  gclk_generator {
  GCLK_GENERATOR_0,
  GCLK_GENERATOR_1,
  GCLK_GENERATOR_2,
  GCLK_GENERATOR_3,
  GCLK_GENERATOR_4,
  GCLK_GENERATOR_5,
  GCLK_GENERATOR_6,
  GCLK_GENERATOR_7,
  GCLK_GENERATOR_8,
  GCLK_GENERATOR_9,
  GCLK_GENERATOR_10,
  GCLK_GENERATOR_11,
  GCLK_GENERATOR_12,
  GCLK_GENERATOR_13,
  GCLK_GENERATOR_14,
  GCLK_GENERATOR_15,
  GCLK_GENERATOR_16
}
 List of available GCLK generators. More...
 

Functions

Generic Clock Management
void system_gclk_init (void)
 Initializes the GCLK driver. More...
 
Generic Clock Management (Generators)
static void system_gclk_gen_get_config_defaults (struct system_gclk_gen_config *const config)
 Initializes a Generic Clock Generator configuration structure to defaults. More...
 
void system_gclk_gen_set_config (const uint8_t generator, struct system_gclk_gen_config *const config)
 Writes a Generic Clock Generator configuration to the hardware module. More...
 
void system_gclk_gen_enable (const uint8_t generator)
 Enables a Generic Clock Generator that was previously configured. More...
 
void system_gclk_gen_disable (const uint8_t generator)
 Disables a Generic Clock Generator that was previously enabled. More...
 
bool system_gclk_gen_is_enabled (const uint8_t generator)
 Determins if the specified Generic Clock Generator is enabled. More...
 
Generic Clock Management (Channels)
static void system_gclk_chan_get_config_defaults (struct system_gclk_chan_config *const config)
 Initializes a Generic Clock configuration structure to defaults. More...
 
void system_gclk_chan_set_config (const uint8_t channel, struct system_gclk_chan_config *const config)
 Writes a Generic Clock configuration to the hardware module. More...
 
void system_gclk_chan_enable (const uint8_t channel)
 Enables a Generic Clock that was previously configured. More...
 
void system_gclk_chan_disable (const uint8_t channel)
 Disables a Generic Clock that was previously enabled. More...
 
bool system_gclk_chan_is_enabled (const uint8_t channel)
 Determins if the specified Generic Clock channel is enabled. More...
 
void system_gclk_chan_lock (const uint8_t channel)
 Locks a Generic Clock channel from further configuration writes. More...
 
bool system_gclk_chan_is_locked (const uint8_t channel)
 Determins if the specified Generic Clock channel is locked. More...
 
Generic Clock Frequency Retrieval
uint32_t system_gclk_gen_get_hz (const uint8_t generator)
 Retrieves the clock frequency of a Generic Clock generator. More...
 
uint32_t system_gclk_chan_get_hz (const uint8_t channel)
 Retrieves the clock frequency of a Generic Clock channel. More...