37 #include "hal_platform.h" 39 #ifdef HAL_GPC_MODULE_ENABLED 70 #ifdef HAL_GPC_FEATURE_ADVANCED_CONFIG 138 #ifdef HAL_GPC_FEATURE_ADVANCED_CONFIG 229 #ifdef HAL_GPC_FEATURE_ADVANCED_CONFIG 236 typedef void (*hal_gpc_callback_t)(
void *user_data);
246 #ifdef HAL_GPC_FEATURE_ADVANCED_CONFIG 249 HAL_GPC_CLOCK_26MHZ = 0,
250 HAL_GPC_CLOCK_32KHZ = 1,
287 #ifdef HAL_GPC_FEATURE_ADVANCED_CONFIG 290 hal_gpc_clock_t clock_source;
293 } hal_gpc_advanced_config_t;
363 #ifdef HAL_GPC_FEATURE_ADVANCED_CONFIG hal_gpc_running_status_t
define GPC busy status
Definition: hal_gpc.h:270
hal_gpc_edge_t edge
Specify GPC capture edge,HAL_GPC_EDGE_RAISING or HAL_GPC_EDGE_FALLING.
Definition: hal_gpc.h:284
The GPC is busy.
Definition: hal_gpc.h:272
The GPC is idle.
Definition: hal_gpc.h:271
No error occurred during the function call.
Definition: hal_gpc.h:266
hal_gpc_status_t hal_gpc_get_and_clear_count(hal_gpc_port_t gpc_port, uint32_t *count)
Get the current count value, then clear count register to 0.
A wrong GPC port.
Definition: hal_gpc.h:264
An invalid parameter.
Definition: hal_gpc.h:265
hal_gpc_status_t hal_gpc_get_running_status(hal_gpc_port_t gpc_port, hal_gpc_running_status_t *running_state)
To get the port that you specified is idle or busy.
hal_gpc_status_t
This enum define GPC function status.
Definition: hal_gpc.h:262
hal_gpc_status_t hal_gpc_disable(hal_gpc_port_t gpc_port)
Disable the GPC module, after that the GPC stop capturing the pulses.
hal_gpc_status_t hal_gpc_deinit(hal_gpc_port_t gpc_port)
Deinitilize the GPC.
This structure defines the initial configuration structure.
Definition: hal_gpc.h:283
hal_gpc_port_t
gpc port
Definition: hal_platform.h:847
A GPC function ERROR occured.
Definition: hal_gpc.h:263
Set the GPC raising edge.
Definition: hal_gpc.h:257
Set the falling edge.
Definition: hal_gpc.h:258
hal_gpc_status_t hal_gpc_init(hal_gpc_port_t gpc_port, const hal_gpc_config_t *gpc_config)
This function is used to initialize the GPC base environment.
hal_gpc_edge_t
This enum define GPC caputure edge.
Definition: hal_gpc.h:256
hal_gpc_status_t hal_gpc_enable(hal_gpc_port_t gpc_port)
Enable the GPC module, after that the GPC can start to capture the pulses.