Classes | Enumerations | Functions
Generic Clock Management
Collaboration diagram for Generic Clock Management:

Classes

struct  genclk_config
 Hardware representation of a set of generic clock parameters. More...
 

Enumerations

enum  genclk_source {
  GENCLK_PCK_SRC_SLCK_RC = 0, GENCLK_PCK_SRC_SLCK_XTAL = 1, GENCLK_PCK_SRC_SLCK_BYPASS = 2, GENCLK_PCK_SRC_MAINCK_4M_RC = 3,
  GENCLK_PCK_SRC_MAINCK_8M_RC = 4, GENCLK_PCK_SRC_MAINCK_12M_RC = 5, GENCLK_PCK_SRC_MAINCK_XTAL = 6, GENCLK_PCK_SRC_MAINCK_BYPASS = 7,
  GENCLK_PCK_SRC_PLLACK = 8, GENCLK_PCK_SRC_MCK = 9
}
 Generic clock source ID. More...
 

Functions

static void genclk_config_defaults (struct genclk_config *p_cfg, uint32_t ul_id)
 
static void genclk_config_read (struct genclk_config *p_cfg, uint32_t ul_id)
 
static void genclk_config_write (const struct genclk_config *p_cfg, uint32_t ul_id)
 
static void genclk_disable (uint32_t ul_id)
 
static void genclk_enable (const struct genclk_config *p_cfg, uint32_t ul_id)
 
static void genclk_enable_config (unsigned int id, enum genclk_source src, unsigned int divider)
 Enable the configuration defined by src and divider for the generic clock identified by id. More...
 

Generic clock configuration

static void genclk_enable_source (enum genclk_source e_src)
 Enable the source clock src used by a generic clock. More...
 

Programmable Clock Identifiers (PCK)

#define GENCLK_PCK_0   0
 PCK0 ID. More...
 
#define GENCLK_PCK_1   1
 PCK1 ID. More...
 
#define GENCLK_PCK_2   2
 PCK2 ID. More...
 

Programmable Clock Prescalers (PCK)

enum  genclk_divider {
  GENCLK_PCK_PRES_1 = PMC_PCK_PRES(0), GENCLK_PCK_PRES_2 = PMC_PCK_PRES(1), GENCLK_PCK_PRES_4 = PMC_PCK_PRES(2), GENCLK_PCK_PRES_8 = PMC_PCK_PRES(3),
  GENCLK_PCK_PRES_16 = PMC_PCK_PRES(4), GENCLK_PCK_PRES_32 = PMC_PCK_PRES(5), GENCLK_PCK_PRES_64 = PMC_PCK_PRES(6)
}
 

Programmable Clock Source and Prescaler configuration

static void genclk_config_set_source (struct genclk_config *p_cfg, enum genclk_source e_src)
 Select a new source clock src in configuration cfg. More...
 
static void genclk_config_set_divider (struct genclk_config *p_cfg, uint32_t e_divider)
 

Detailed Description

Generic clocks are configurable clocks which run outside the system clock domain. They are often connected to peripherals which have an asynchronous component running independently of the bus clock, e.g. USB controllers, low-power timers and RTCs, etc.

Note that not all platforms have support for generic clocks; on such platforms, this API will not be available.

Macro Definition Documentation

◆ GENCLK_PCK_0

#define GENCLK_PCK_0   0

PCK0 ID.

Definition at line 58 of file same70/genclk.h.

◆ GENCLK_PCK_1

#define GENCLK_PCK_1   1

PCK1 ID.

Definition at line 59 of file same70/genclk.h.

◆ GENCLK_PCK_2

#define GENCLK_PCK_2   2

PCK2 ID.

Definition at line 60 of file same70/genclk.h.

Enumeration Type Documentation

◆ genclk_divider

Enumerator
GENCLK_PCK_PRES_1 

Set PCK clock prescaler to 1.

GENCLK_PCK_PRES_2 

Set PCK clock prescaler to 2.

GENCLK_PCK_PRES_4 

Set PCK clock prescaler to 4.

GENCLK_PCK_PRES_8 

Set PCK clock prescaler to 8.

GENCLK_PCK_PRES_16 

Set PCK clock prescaler to 16.

GENCLK_PCK_PRES_32 

Set PCK clock prescaler to 32.

GENCLK_PCK_PRES_64 

Set PCK clock prescaler to 64.

Definition at line 84 of file same70/genclk.h.

◆ genclk_source

Generic clock source ID.

Each generic clock may be generated from a different clock source. These are the available alternatives provided by the chip.

Enumerator
GENCLK_PCK_SRC_SLCK_RC 

Internal 32kHz RC oscillator as PCK source clock.

GENCLK_PCK_SRC_SLCK_XTAL 

External 32kHz crystal oscillator as PCK source clock.

GENCLK_PCK_SRC_SLCK_BYPASS 

External 32kHz bypass oscillator as PCK source clock.

GENCLK_PCK_SRC_MAINCK_4M_RC 

Internal 4MHz RC oscillator as PCK source clock.

GENCLK_PCK_SRC_MAINCK_8M_RC 

Internal 8MHz RC oscillator as PCK source clock.

GENCLK_PCK_SRC_MAINCK_12M_RC 

Internal 12MHz RC oscillator as PCK source clock.

GENCLK_PCK_SRC_MAINCK_XTAL 

External crystal oscillator as PCK source clock.

GENCLK_PCK_SRC_MAINCK_BYPASS 

External bypass oscillator as PCK source clock.

GENCLK_PCK_SRC_PLLACK 

Use PLLACK as PCK source clock.

GENCLK_PCK_SRC_MCK 

Use Master Clk as PCK source clock.

Definition at line 66 of file same70/genclk.h.

Function Documentation

◆ genclk_config_defaults()

static void genclk_config_defaults ( struct genclk_config p_cfg,
uint32_t  ul_id 
)
inlinestatic

Definition at line 100 of file same70/genclk.h.

◆ genclk_config_read()

static void genclk_config_read ( struct genclk_config p_cfg,
uint32_t  ul_id 
)
inlinestatic

Definition at line 107 of file same70/genclk.h.

◆ genclk_config_set_divider()

static void genclk_config_set_divider ( struct genclk_config p_cfg,
uint32_t  e_divider 
)
inlinestatic

Definition at line 155 of file same70/genclk.h.

◆ genclk_config_set_source()

void genclk_config_set_source ( struct genclk_config p_cfg,
enum genclk_source  e_src 
)
inlinestatic

Select a new source clock src in configuration cfg.

Definition at line 122 of file same70/genclk.h.

◆ genclk_config_write()

static void genclk_config_write ( const struct genclk_config p_cfg,
uint32_t  ul_id 
)
inlinestatic

Definition at line 113 of file same70/genclk.h.

◆ genclk_disable()

static void genclk_disable ( uint32_t  ul_id)
inlinestatic

Definition at line 170 of file same70/genclk.h.

◆ genclk_enable()

static void genclk_enable ( const struct genclk_config p_cfg,
uint32_t  ul_id 
)
inlinestatic

Definition at line 164 of file same70/genclk.h.

◆ genclk_enable_config()

static void genclk_enable_config ( unsigned int  id,
enum genclk_source  src,
unsigned int  divider 
)
inlinestatic

Enable the configuration defined by src and divider for the generic clock identified by id.

Parameters
idThe ID of the generic clock.
srcThe source clock of the generic clock.
dividerThe divider used to generate the generic clock.

Definition at line 176 of file genclk.h.

◆ genclk_enable_source()

void genclk_enable_source ( enum genclk_source  e_src)
inlinestatic

Enable the source clock src used by a generic clock.

Definition at line 175 of file same70/genclk.h.



inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:18:00