gonzui


Format: Advanced Search

tkernel_2/include/device/clk.hbare sourcepermlink (0.02 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    T-Kernel 2.0 Software Package
    4:  *
    5:  *    Copyright 2011 by Ken Sakamura.
    6:  *    This software is distributed under the latest version of T-License 2.x.
    7:  *----------------------------------------------------------------------
    8:  *
    9:  *    Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17.
   10:  *    Modified by TRON Forum(http://www.tron.org/) at 2015/06/01.
   11:  *
   12:  *----------------------------------------------------------------------
   13:  */
   14: 
   15: /*
   16:  *      clk.h
   17:  *
   18:  *      Clock driver
   19:  */
   20: 
   21: #ifndef __DEVICE_CLK_H__
   22: #define __DEVICE_CLK_H__
   23: 
   24: #include <basic.h>
   25: #include <tk/devmgr.h>
   26: 
   27: #ifdef __cplusplus
   28: extern "C" {
   29: #endif
   30: 
   31: /* CLOCK/data number */
   32: typedef enum {
   33:         /* Common attribute */
   34:         DN_CKEVENT     = TDN_EVENT,
   35:         /* Individual attribute */
   36:         DN_CKDATETIME  = -100,
   37:         DN_CKAUTOPWON  = -101,
   38:         /* Model-dependent function */
   39:         DN_CKREGISTER  = -200
   40: } ClockDataNo;
   41: 
   42: /* Access of nonvolatile register */
   43: typedef struct {
   44:         W      nreg;                /* Number of accessed registers */
   45:         struct ck_reg {
   46:                 W     regno;      /* Intended register number */
   47:                 UW    data;      /* Intended data */
   48:         } c[1];
   49: } CK_REGS;
   50: #define CK_REGS_SZ(nreg)        ( sizeof(W) + sizeof(struct ck_reg) * (nreg) )
   51: 
   52: /* Calendar date & time definitions */
   53: #ifndef __date_tim__
   54: #define __date_tim__
   55: typedef struct {
   56:         W      d_year;      /* Offset from 1900 (85 -)          */
   57:         W      d_month;     /* Month (1 - 12, 0)                        */
   58:         W      d_day;               /* Day (1 - 31)                              */
   59:         W      d_hour;      /* Hour (0 - 23)                    */
   60:         W      d_min;               /* Minute (0 - 59)                   */
   61:         W      d_sec;               /* Second (0 - 59)                   */
   62:         W      d_week;      /* Week (1 - 54)    (*)Not used        */
   63:         W      d_wday;      /* Day of week ( 0 - 6; 0 is Sunday)        */
   64:         W      d_days;      /* Day (1 - 366)    (*)Not used        */
   65: } DATE_TIM;
   66: #endif /* __date_tim__ */
   67: 
   68: /* Event notification */
   69: typedef T_DEVEVT_ID     ClockEvt;
   70: 
   71: #ifdef __cplusplus
   72: }
   73: #endif
   74: #endif /* __DEVICE_CLK_H__ */