RTEMS 6.1-rc6
Loading...
Searching...
No Matches
Data Structures | Enumerator | Variables
Gpt

Data Structures

struct  _gpt_init_config
 Structure to configure the running mode. More...
 

Variables

gpt_clock_source_t _gpt_init_config::clockSource
 
uint32_t _gpt_init_config::divider
 
bool _gpt_init_config::enableFreeRun
 
bool _gpt_init_config::enableRunInWait
 
bool _gpt_init_config::enableRunInStop
 
bool _gpt_init_config::enableRunInDoze
 
bool _gpt_init_config::enableRunInDbg
 
bool _gpt_init_config::enableMode
 

Driver version

enum  _gpt_clock_source {
  kGPT_ClockSource_Off = 0U , kGPT_ClockSource_Periph = 1U , kGPT_ClockSource_HighFreq = 2U , kGPT_ClockSource_Ext = 3U ,
  kGPT_ClockSource_LowFreq = 4U , kGPT_ClockSource_Osc = 5U
}
 List of clock sources. More...
 
enum  _gpt_input_capture_channel { kGPT_InputCapture_Channel1 = 0U , kGPT_InputCapture_Channel2 = 1U }
 List of input capture channel number. More...
 
enum  _gpt_input_operation_mode { kGPT_InputOperation_Disabled = 0U , kGPT_InputOperation_RiseEdge = 1U , kGPT_InputOperation_FallEdge = 2U , kGPT_InputOperation_BothEdge = 3U }
 List of input capture operation mode. More...
 
enum  _gpt_output_compare_channel { kGPT_OutputCompare_Channel1 = 0U , kGPT_OutputCompare_Channel2 = 1U , kGPT_OutputCompare_Channel3 = 2U }
 List of output compare channel number. More...
 
enum  _gpt_output_operation_mode {
  kGPT_OutputOperation_Disconnected = 0U , kGPT_OutputOperation_Toggle = 1U , kGPT_OutputOperation_Clear = 2U , kGPT_OutputOperation_Set = 3U ,
  kGPT_OutputOperation_Activelow = 4U
}
 List of output compare operation mode. More...
 
enum  _gpt_interrupt_enable {
  kGPT_OutputCompare1InterruptEnable = GPT_IR_OF1IE_MASK , kGPT_OutputCompare2InterruptEnable = GPT_IR_OF2IE_MASK , kGPT_OutputCompare3InterruptEnable = GPT_IR_OF3IE_MASK , kGPT_InputCapture1InterruptEnable = GPT_IR_IF1IE_MASK ,
  kGPT_InputCapture2InterruptEnable = GPT_IR_IF2IE_MASK , kGPT_RollOverFlagInterruptEnable = GPT_IR_ROVIE_MASK
}
 List of GPT interrupts. More...
 
enum  _gpt_status_flag {
  kGPT_OutputCompare1Flag = GPT_SR_OF1_MASK , kGPT_OutputCompare2Flag = GPT_SR_OF2_MASK , kGPT_OutputCompare3Flag = GPT_SR_OF3_MASK , kGPT_InputCapture1Flag = GPT_SR_IF1_MASK ,
  kGPT_InputCapture2Flag = GPT_SR_IF2_MASK , kGPT_RollOverFlag = GPT_SR_ROV_MASK
}
 Status flag. More...
 
typedef enum _gpt_clock_source gpt_clock_source_t
 List of clock sources.
 
typedef enum _gpt_input_capture_channel gpt_input_capture_channel_t
 List of input capture channel number.
 
typedef enum _gpt_input_operation_mode gpt_input_operation_mode_t
 List of input capture operation mode.
 
typedef enum _gpt_output_compare_channel gpt_output_compare_channel_t
 List of output compare channel number.
 
typedef enum _gpt_output_operation_mode gpt_output_operation_mode_t
 List of output compare operation mode.
 
typedef enum _gpt_interrupt_enable gpt_interrupt_enable_t
 List of GPT interrupts.
 
typedef enum _gpt_status_flag gpt_status_flag_t
 Status flag.
 
typedef struct _gpt_init_config gpt_config_t
 Structure to configure the running mode.
 
#define FSL_GPT_DRIVER_VERSION   (MAKE_VERSION(2, 0, 4))
 

Initialization and deinitialization

void GPT_Init (GPT_Type *base, const gpt_config_t *initConfig)
 Initialize GPT to reset state and initialize running mode.
 
void GPT_Deinit (GPT_Type *base)
 Disables the module and gates the GPT clock.
 
void GPT_GetDefaultConfig (gpt_config_t *config)
 Fills in the GPT configuration structure with default settings.
 

Detailed Description

Typedef Documentation

◆ gpt_clock_source_t

List of clock sources.

Note
Actual number of clock sources is SoC dependent

Enumeration Type Documentation

◆ _gpt_clock_source

List of clock sources.

Note
Actual number of clock sources is SoC dependent
Enumerator
kGPT_ClockSource_Off 

GPT Clock Source Off.

kGPT_ClockSource_Periph 

GPT Clock Source from Peripheral Clock.

kGPT_ClockSource_HighFreq 

GPT Clock Source from High Frequency Reference Clock.

kGPT_ClockSource_Ext 

GPT Clock Source from external pin.

kGPT_ClockSource_LowFreq 

GPT Clock Source from Low Frequency Reference Clock.

kGPT_ClockSource_Osc 

GPT Clock Source from Crystal oscillator.

◆ _gpt_input_capture_channel

List of input capture channel number.

Enumerator
kGPT_InputCapture_Channel1 

GPT Input Capture Channel1.

kGPT_InputCapture_Channel2 

GPT Input Capture Channel2.

◆ _gpt_input_operation_mode

List of input capture operation mode.

Enumerator
kGPT_InputOperation_Disabled 

Don't capture.

kGPT_InputOperation_RiseEdge 

Capture on rising edge of input pin.

kGPT_InputOperation_FallEdge 

Capture on falling edge of input pin.

kGPT_InputOperation_BothEdge 

Capture on both edges of input pin.

◆ _gpt_interrupt_enable

List of GPT interrupts.

Enumerator
kGPT_OutputCompare1InterruptEnable 

Output Compare Channel1 interrupt enable

kGPT_OutputCompare2InterruptEnable 

Output Compare Channel2 interrupt enable

kGPT_OutputCompare3InterruptEnable 

Output Compare Channel3 interrupt enable

kGPT_InputCapture1InterruptEnable 

Input Capture Channel1 interrupt enable

kGPT_InputCapture2InterruptEnable 

Input Capture Channel1 interrupt enable

kGPT_RollOverFlagInterruptEnable 

Counter rolled over interrupt enable

◆ _gpt_output_compare_channel

List of output compare channel number.

Enumerator
kGPT_OutputCompare_Channel1 

Output Compare Channel1.

kGPT_OutputCompare_Channel2 

Output Compare Channel2.

kGPT_OutputCompare_Channel3 

Output Compare Channel3.

◆ _gpt_output_operation_mode

List of output compare operation mode.

Enumerator
kGPT_OutputOperation_Disconnected 

Don't change output pin.

kGPT_OutputOperation_Toggle 

Toggle output pin.

kGPT_OutputOperation_Clear 

Set output pin low.

kGPT_OutputOperation_Set 

Set output pin high.

kGPT_OutputOperation_Activelow 

Generate a active low pulse on output pin.

◆ _gpt_status_flag

Status flag.

Enumerator
kGPT_OutputCompare1Flag 

Output compare channel 1 event.

kGPT_OutputCompare2Flag 

Output compare channel 2 event.

kGPT_OutputCompare3Flag 

Output compare channel 3 event.

kGPT_InputCapture1Flag 

Input Capture channel 1 event.

kGPT_InputCapture2Flag 

Input Capture channel 2 event.

kGPT_RollOverFlag 

Counter reaches maximum value and rolled over to 0 event.

Function Documentation

◆ GPT_Deinit()

void GPT_Deinit ( GPT_Type base)

Disables the module and gates the GPT clock.

Parameters
baseGPT peripheral base address.

brief Disables the module and gates the GPT clock.

param base GPT peripheral base address.

◆ GPT_GetDefaultConfig()

void GPT_GetDefaultConfig ( gpt_config_t config)

Fills in the GPT configuration structure with default settings.

The default values are:

config->divider = 1U;
config->enableRunInStop = true;
config->enableRunInWait = true;
config->enableRunInDoze = false;
config->enableRunInDbg = false;
config->enableFreeRun = false;
config->enableMode = true;
@ kGPT_ClockSource_Periph
Definition: fsl_gpt.h:35
Definition: deflate.c:114
Parameters
configPointer to the user configuration structure.

brief Fills in the GPT configuration structure with default settings.

The default values are: code config->clockSource = kGPT_ClockSource_Periph; config->divider = 1U; config->enableRunInStop = true; config->enableRunInWait = true; config->enableRunInDoze = false; config->enableRunInDbg = false; config->enableFreeRun = false; config->enableMode = true; endcode param config Pointer to the user configuration structure.

◆ GPT_Init()

void GPT_Init ( GPT_Type base,
const gpt_config_t initConfig 
)

Initialize GPT to reset state and initialize running mode.

Parameters
baseGPT peripheral base address.
initConfigGPT mode setting configuration.

brief Initialize GPT to reset state and initialize running mode.

param base GPT peripheral base address. param initConfig GPT mode setting configuration.

Variable Documentation

◆ clockSource

gpt_clock_source_t _gpt_init_config::clockSource

clock source for GPT module.

◆ divider

uint32_t _gpt_init_config::divider

clock divider (prescaler+1) from clock source to counter.

◆ enableFreeRun

bool _gpt_init_config::enableFreeRun

true: FreeRun mode, false: Restart mode.

◆ enableMode

bool _gpt_init_config::enableMode

true: counter reset to 0 when enabled; false: counter retain its value when enabled.

◆ enableRunInDbg

bool _gpt_init_config::enableRunInDbg

GPT enabled in debug mode.

◆ enableRunInDoze

bool _gpt_init_config::enableRunInDoze

GPT enabled in doze mode.

◆ enableRunInStop

bool _gpt_init_config::enableRunInStop

GPT enabled in stop mode.

◆ enableRunInWait

bool _gpt_init_config::enableRunInWait

GPT enabled in wait mode.