gonzui


Format: Advanced Search

mtkernel_3/include/tk/sysdepend/cpu/stm32l4/syslib.hbare sourcepermlink (0.01 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    micro T-Kernel 3.00.03
    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/03/31.
   10:  *
   11:  *----------------------------------------------------------------------
   12:  */
   13: 
   14: /*
   15:  *      syslib.h
   16:  *
   17:  *      micro T-Kernel System Library  (STM32L4 depended)
   18:  */
   19: 
   20: #ifndef __TK_SYSLIB_CPU_DEPEND_H__
   21: #define __TK_SYSLIB_CPU_DEPEND_H__
   22: 
   23: #include "../core/armv7m/syslib.h"
   24: 
   25: /* ------------------------------------------------------------------------ */
   26: /*
   27:  * Interrupt Control
   28:  */
   29: 
   30: /*
   31:  * Interrupt number
   32:  */
   33: #define MIN_NVIC_INTNO  0                /* Minimum value of NVIC interrupt number */
   34: #define MAX_NVIC_INTNO  (N_INTVEC-1)     /* Maximum value of NVIC interrupt number */
   35: #define MIN_EXTI_INTNO  200              /* Minimum value of EXTI interrupt number */
   36: #define MAX_EXTI_INTNO  239              /* Maximum value of EXTO interrupt number */
   37: 
   38: /*
   39:  * Interrupt mode ( Use SetIntMode )
   40:  */
   41: #define IM_EDGE         0x0000         /* Edge trigger */
   42: #define IM_HI           0x0002           /* Interrupt at rising edge */
   43: #define IM_LOW          0x0001          /* Interrupt at falling edge */
   44: #define IM_BOTH         0x0003         /* Interrupt at both edge */
   45: 
   46: 
   47: /* ------------------------------------------------------------------------ */
   48: /*
   49:  * I/O port access
   50:  *      for memory mapped I/O
   51:  */
   52: Inline void out_w( UW port, UW data )
   53: {
   54:         *(_UW*)port = data;
   55: }
   56: Inline void out_h( UW port, UH data )
   57: {
   58:         *(_UH*)port = data;
   59: }
   60: Inline void out_b( UW port, UB data )
   61: {
   62:         *(_UB*)port = data;
   63: }
   64: 
   65: Inline UW in_w( UW port )
   66: {
   67:         return *(_UW*)port;
   68: }
   69: Inline UH in_h( UW port )
   70: {
   71:         return *(_UH*)port;
   72: }
   73: Inline UB in_b( UW port )
   74: {
   75:         return *(_UB*)port;
   76: }
   77: 
   78: #endif /* __TK_SYSLIB_DEPEND_H__ */