MT2523 API Reference  LinkIt SDK v4
Enum
HAL » GPT

Overview

Macros

#define HAL_GPT_MAXIMUM_MS_TIMER_TIME   (130150523)
 The maximum time of millisecond timer.
 

Enumerations

enum  hal_gpt_timer_type_t {
  HAL_GPT_TIMER_TYPE_ONE_SHOT = 0,
  HAL_GPT_TIMER_TYPE_REPEAT = 1
}
 This enum defines the GPT timer type. More...
 
enum  hal_gpt_status_t {
  HAL_GPT_STATUS_ERROR_PORT_USED = -4,
  HAL_GPT_STATUS_ERROR = -3,
  HAL_GPT_STATUS_ERROR_PORT = -2,
  HAL_GPT_STATUS_INVALID_PARAMETER = -1,
  HAL_GPT_STATUS_OK = 0
}
 This enum defines the GPT status. More...
 
enum  hal_gpt_running_status_t {
  HAL_GPT_STOPPED = 0,
  HAL_GPT_RUNNING = 1
}
 This enum defines the GPT running status. More...
 
enum  hal_gpt_port_t {
  HAL_GPT_0 = 0,
  HAL_GPT_1 = 1,
  HAL_GPT_2 = 2,
  HAL_GPT_3 = 3,
  HAL_GPT_4 = 4,
  HAL_GPT_5 = 5,
  HAL_GPT_MAX_PORT
}
 GPT port. More...
 
enum  hal_gpt_clock_source_t {
  HAL_GPT_CLOCK_SOURCE_32K = 0,
  HAL_GPT_CLOCK_SOURCE_1M = 1
}
 GPT clock source. More...
 

Enumeration Type Documentation

GPT clock source.

Enumerator
HAL_GPT_CLOCK_SOURCE_32K 

Set the GPT clock source to 32kHz, 1 tick = 1/32768 second.

HAL_GPT_CLOCK_SOURCE_1M 

Set the GPT clock source to 1MHz, 1 tick = 1 microsecond.

GPT port.

Enumerator
HAL_GPT_0 

GPT port 0: Used for OSTD timer.

HAL_GPT_1 

GPT port 1: User defined.

HAL_GPT_2 

GPT port 2: User defined.

HAL_GPT_3 

GPT port 3: Used for software GPT.

The clock source is 32Khz.

HAL_GPT_4 

GPT port 4: Use to set a microsecond delay and get microsecond free count.

The clock source is 1Mhz

HAL_GPT_5 

GPT port 5: Use to set a millisecond delay and get 1/32Khz free count.

The clock source is 32Khz

HAL_GPT_MAX_PORT 

The total number of GPT ports (invalid GPT port).

This enum defines the GPT running status.

Enumerator
HAL_GPT_STOPPED 

The GPT has stopped.

HAL_GPT_RUNNING 

The GPT is running.

This enum defines the GPT status.

Enumerator
HAL_GPT_STATUS_ERROR_PORT_USED 

The timer has beed used.

HAL_GPT_STATUS_ERROR 

GPT function error occurred.

HAL_GPT_STATUS_ERROR_PORT 

A wrong GPT port is set.

HAL_GPT_STATUS_INVALID_PARAMETER 

An invalid parameter.

HAL_GPT_STATUS_OK 

No error occurred during the function call.

This enum defines the GPT timer type.

Enumerator
HAL_GPT_TIMER_TYPE_ONE_SHOT 

Set the GPT oneshot mode.

HAL_GPT_TIMER_TYPE_REPEAT 

Set the GPT repeat mode.