gonzui


Format: Advanced Search

mtkernel_3/device/adc/adc.hbare sourcepermlink (0.00 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    Device Driver for micro T-Kernel for 亮T-Kernel 3.00.05
    4:  *
    5:  *    Copyright (C) 2020-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/11.
   10:  *
   11:  *----------------------------------------------------------------------
   12:  */
   13: 
   14: /*
   15:  *      adc.h
   16:  *      A/D converter device driver 
   17:  *      Driver local definition
   18: */
   19: 
   20: #ifndef __DEV_ADC_H__
   21: #define __DEV_ADC_H__
   22: 
   23: #include "../common/drvif/msdrvif.h"
   24: #include "../include/dev_adc.h"
   25: #include "adc_cnf.h"
   26: 
   27: /*----------------------------------------------------------------------*/
   28: /* Hardware dependent definition
   29:  */
   30: #ifdef CPU_TMPM367FDFG
   31: #include "sysdepend/tx03_m367/adc_m367.h"
   32: #endif  /* CPU_TMPM367FDFG */
   33: #ifdef CPU_RX231
   34: #include "sysdepend/rx231/adc_rx231.h"
   35: #endif  /* CPU_RX231 */
   36: #ifdef CPU_STM32L4
   37: #include "sysdepend/stm32l4/adc_stm32l4.h"
   38: #endif  /* CPU_STM32L4 */
   39: #ifdef CPU_RZA2M
   40: #include "sysdepend/rza2m/adc_rza2m.h"
   41: #endif  /* CPU_RZA2M */
   42: 
   43: /*----------------------------------------------------------------------*/
   44: /* Device driver Control block
   45:  */
   46: typedef struct {
   47:         UW     unit;               /* Unit No. */
   48:         UINT   omode;            /* Open mode */
   49: 
   50:         /* Attribute data */
   51:         ID     evtmbfid;   /* MBF ID for event notification */
   52: } T_ADC_DCB;
   53: 
   54: /*----------------------------------------------------------------------*/
   55: /* Device driver low-level interface
   56:  */
   57: 
   58: /* The following functions are defined in the system-dependent part. */
   59: IMPORT W dev_adc_llctl( UW, INT, UW, UW, UW*);  /* Low-Level device control */
   60: IMPORT ER dev_adc_llinit( T_ADC_DCB*);          /* Low-level device initialization */
   61: 
   62: /* Low-level device control command */
   63: typedef enum {
   64:         LLD_ADC_OPEN,
   65:         LLD_ADC_CLOSE,
   66:         LLD_ADC_READ,
   67:         LLD_ADC_RSIZE,
   68: } T_LLD_ADC_CMD;
   69: 
   70: #endif          /* __DEV_ADC_H__ */