gonzui


Format: Advanced Search

mtkernel_3/kernel/sysdepend/iote_rx231/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_RX231
   16: 
   17: /*
   18:  *      devinit.c (RX231 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: #if USE_SDEV_DRV        // Use sample driver
   48:         ER     err;
   49: 
   50:         /* A/D Converter "adca" */
   51:         #if DEVCNF_USE_ADC
   52:                 err = dev_init_adc(0);
   53:                 if(err < E_OK) return err;
   54:         #endif
   55: 
   56:         /* SCI6 "serd" */
   57:         #if DEVCNF_USE_IIC
   58:                 err = dev_init_ser(3);
   59:                 if(err < E_OK) return err;
   60:         #endif
   61: 
   62:         /* RIIC0 "iica" */
   63:         #if DEVCNF_USE_SER
   64:                 err = dev_init_i2c(0);
   65:                 if(err < E_OK) return err;
   66:         #endif
   67: 
   68: #endif
   69: 
   70:         return E_OK;
   71: }
   72: 
   73: #if USE_SHUTDOWN
   74: /* ------------------------------------------------------------------------ */
   75: /*
   76:  * System finalization
   77:  *      Called just before system shutdown.
   78:  *      Execute finalization that must be done before system shutdown.
   79:  */
   80: EXPORT ER knl_finish_device( void )
   81: {
   82:         return E_OK;
   83: }
   84: 
   85: #endif /* USE_SHUTDOWN */
   86: 
   87: #endif /* IOTE_RX231 */