mtkernel_3/kernel/sysdepend/iote_m367/devinit.c | bare source | permlink (0.00 seconds) |
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_M367 16: 17: /* 18: * devinit.c (M367 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.A "adca" & Unit.B "adcb" */ 52: #if DEVCNF_USE_ADC 53: err = dev_init_adc(0); 54: if(err < E_OK) return err; 55: err = dev_init_adc(1); 56: if(err < E_OK) return err; 57: #endif 58: 59: /* I2C SBI1 "iicb" */ 60: #if DEVCNF_USE_IIC 61: err = dev_init_i2c(1); 62: if(err < E_OK) return err; 63: #endif 64: 65: /* Serial UART5 "serb" */ 66: #if DEVCNF_USE_SER 67: err = dev_init_ser(1); 68: if(err < E_OK) return err; 69: #endif 70: 71: #endif 72: 73: return E_OK; 74: } 75: 76: #if USE_SHUTDOWN 77: /* ------------------------------------------------------------------------ */ 78: /* 79: * System finalization 80: * Called just before system shutdown. 81: * Execute finalization that must be done before system shutdown. 82: */ 83: EXPORT ER knl_finish_device( void ) 84: { 85: return E_OK; 86: } 87: 88: #endif /* USE_SHUTDOWN */ 89: 90: #endif /* IOTE_M367 */