int tiva_timer_configure(void) { static bool initialized = false; int ret = OK; /* Check if we have already initialized */ if (!initialized) { struct tiva_gptm32config_s timer_config; timer_config.cmn.gptm = 0; timer_config.cmn.mode = TIMER32_MODE_PERIODIC; timer_config.cmn.alternate = false; timer_config.config.flags = TIMER_FLAG_COUNTUP; timer_config.config.handler = 0; timer_config.config.arg = 0; ret = tiva_timer_initialize(CONFIG_EXAMPLES_TIMER_DEVNAME, &timer_config); if (ret < 0) { syslog(LOG_ERR, "ERROR: Failed to register timer driver: %d\n", ret); } /* now we are initialized */ initialized = true; } return ret; }
int tm4c_bringup(void) { int ret = OK; #ifdef HAVE_AT24 /* Initialize the AT24 driver */ ret = tm4c_at24_automount(AT24_MINOR); if (ret < 0) { syslog(LOG_ERR, "ERROR: tm4c_at24_automount failed: %d\n", ret); return ret; } #endif /* HAVE_AT24 */ #ifdef CONFIG_TIVA_TIMER /* Initialize the timer driver */ ret = tiva_timer_initialize(); if (ret < 0) { syslog(LOG_ERR, "ERROR: tiva_timer_initialize failed: %d\n", ret); return ret; } #endif /* CONFIG_TIVA_TIMER */ return ret; }
int tm4c_bringup(void) { #if defined(HAVE_TMP100) || defined(HAVE_TIMER) int ret; #endif /* Register I2C drivers on behalf of the I2C tool */ tm4c_i2ctool(); #ifdef HAVE_TMP100 /* Initialize and register the TMP-100 Temperature Sensor driver. */ ret = tiva_tmp100_initialize(TMP100_DEVNAME); if (ret < 0) { dbg("ERROR: Failed to initialize TMP100 driver: %d\n", ret); } #endif #ifdef HAVE_TIMER /* Initialize the timer driver */ ret = tiva_timer_initialize(); if (ret < 0) { dbg("ERROR: Failed to initialize timer driver: %d\n", ret); } #endif return OK; }
int tm4c_bringup(void) { #ifdef HAVE_TIMER int ret; #endif #ifdef HAVE_TIMER /* Initialize the timer driver */ ret = tiva_timer_initialize(); if (ret < 0) { dbg("ERROR: Failed to initialize timer driver: %d\n", ret); } #endif return OK; }
int tm4c_bringup(void) { #ifdef HAVE_TIMER int ret; #endif /* Register I2C drivers on behalf of the I2C tool */ tm4c_i2ctool(); #ifdef HAVE_TIMER /* Initialize the timer driver */ ret = tiva_timer_initialize(); if (ret < 0) { dbg("ERROR: Failed to initialize timer driver: %d\n", ret); } #endif return OK; }