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,
257 HAL_GPC_EDGE_RAISING = 0,
258 HAL_GPC_EDGE_FALLING = 1,
263 HAL_GPC_STATUS_ERROR = -3,
264 HAL_GPC_STATUS_ERROR_PORT = -2,
265 HAL_GPC_STATUS_INVALID_PARAMETER = -1,
266 HAL_GPC_STATUS_OK = 0,
271 HAL_GPC_STATUS_IDLE = 0,
272 HAL_GPC_STATUS_BUSY = 1,
273 } hal_gpc_running_status_t;
287 #ifdef HAL_GPC_FEATURE_ADVANCED_CONFIG 290 hal_gpc_clock_t clock_source;
293 } hal_gpc_advanced_config_t;
308 hal_gpc_status_t hal_gpc_init(hal_gpc_port_t gpc_port,
const hal_gpc_config_t *gpc_config);
318 hal_gpc_status_t hal_gpc_deinit(hal_gpc_port_t gpc_port);
328 hal_gpc_status_t hal_gpc_enable(hal_gpc_port_t gpc_port);
339 hal_gpc_status_t hal_gpc_disable(hal_gpc_port_t gpc_port);
349 hal_gpc_status_t hal_gpc_get_running_status(hal_gpc_port_t gpc_port, hal_gpc_running_status_t *running_state);
359 hal_gpc_status_t hal_gpc_get_and_clear_count(hal_gpc_port_t gpc_port, uint32_t *count);
363 #ifdef HAL_GPC_FEATURE_ADVANCED_CONFIG 371 hal_gpc_status_t hal_gpc_interrupt_enable(hal_gpc_port_t gpc_port);
380 hal_gpc_status_t hal_gpc_interrupt_disable(hal_gpc_port_t gpc_port);
393 hal_gpc_status_t hal_gpc_register_callback(hal_gpc_port_t gpc_port, hal_gpc_callback_t callback,
void *user_data);
404 hal_gpc_status_t hal_gpc_set_threshold(hal_gpc_port_t gpc_port, uint32_t *threshold);
413 hal_gpc_status_t hal_gpc_get_threshold(hal_gpc_port_t gpc_port, uint32_t *threshold);
423 hal_gpc_status_t hal_gpc_advanced_config(hal_gpc_port_t gpc_port,
const hal_gpc_advanced_config_t *gpc_advanced_config);