gonzui


Format: Advanced Search

mtkernel_3/kernel/sysdepend/iote_stm32l4/devinit.cbare sourcepermlink (0.02 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    micro T-Kernel 3.00.04
    4:  *
    5:  *    Copyright (C) 2006-2021 by Ken Sakamura.
    6:  *    This software is distributed under the T-License 2.2.
    7:  *----------------------------------------------------------------------
    8:  *
    9:  *    Released by TRON Forum(http://www.tron.org) at 2021/05/17.
   10:  *
   11:  *----------------------------------------------------------------------
   12:  */
   13: 
   14: #include <sys/machine.h>
   15: #ifdef IOTE_STM32L4
   16: 
   17: /*
   18:  *      devinit.c (STM32L4 IoT-Engine)
   19:  *      Device-Dependent Initialization
   20:  */
   21: 
   22: #include <sys/sysdef.h>
   23: #include <tm/tmonitor.h>
   24: #include <tk/device.h>
   25: 
   26: #include "kernel.h"
   27: #include "sysdepend.h"
   28: 
   29: /* ------------------------------------------------------------------------ */
   30: 
   31: /*
   32:  * Initialization before micro T-Kernel starts
   33:  */
   34: 
   35: EXPORT ER knl_init_device( void )
   36: {
   37:         return E_OK;
   38: }
   39: 
   40: /* ------------------------------------------------------------------------ */
   41: /*
   42:  * Start processing after T-Kernel starts
   43:  *      Called from the initial task contexts.
   44:  */
   45: EXPORT ER knl_start_device( void )
   46: {
   47: 
   48: #if USE_SDEV_DRV        // Use sample driver
   49:         ER     err;
   50: 
   51:         /* A/D Converter unit.0 "adca" */
   52:         #if DEVCNF_USE_ADC
   53:                 err = dev_init_adc(0);
   54:                 if(err < E_OK) return err;
   55:         #endif
   56: 
   57:         /* I2C unit.0 "iica" */
   58:         #if DEVCNF_USE_IIC
   59:                 err = dev_init_i2c(0);
   60:                 if(err < E_OK) return err;
   61:         #endif
   62: 
   63:         /* Serial ch.2 "serb" */
   64:         #if DEVCNF_USE_SER
   65:                 err = dev_init_ser(1);
   66:                 if(err < E_OK) return err;
   67:         #endif
   68: 
   69: #endif
   70: 
   71:         return E_OK;
   72: }
   73: 
   74: #if USE_SHUTDOWN
   75: /* ------------------------------------------------------------------------ */
   76: /*
   77:  * System finalization
   78:  *      Called just before system shutdown.
   79:  *      Execute finalization that must be done before system shutdown.
   80:  */
   81: EXPORT ER knl_finish_device( void )
   82: {
   83:         return E_OK;
   84: }
   85: 
   86: #endif /* USE_SHUTDOWN */
   87: 
   88: #endif /* IOTE_STM32L4 */