[a1f514f] | 1 | /* |
---|
| 2 | * This file contains the definitions for the following real-time clocks: |
---|
| 3 | * |
---|
| 4 | * + Mostek M48T08 |
---|
[a3d3d9a] | 5 | * + Mostek M48T18 |
---|
[a1f514f] | 6 | * + Dallas Semiconductor DS1643 |
---|
| 7 | * |
---|
[08311cc3] | 8 | * COPYRIGHT (c) 1989-1999. |
---|
[a1f514f] | 9 | * On-Line Applications Research Corporation (OAR). |
---|
| 10 | * |
---|
| 11 | * The license and distribution terms for this file may be |
---|
| 12 | * found in the file LICENSE in this distribution or at |
---|
[c499856] | 13 | * http://www.rtems.org/license/LICENSE. |
---|
[a1f514f] | 14 | */ |
---|
| 15 | |
---|
| 16 | #ifndef __LIBCHIP_M48T08_h |
---|
| 17 | #define __LIBCHIP_M48T08_h |
---|
| 18 | |
---|
| 19 | /* |
---|
| 20 | * Register indices |
---|
| 21 | */ |
---|
| 22 | |
---|
| 23 | #define M48T08_CONTROL 0 |
---|
| 24 | #define M48T08_SECOND 1 |
---|
| 25 | #define M48T08_MINUTE 2 |
---|
| 26 | #define M48T08_HOUR 3 |
---|
| 27 | #define M48T08_DAY_OF_WEEK 4 |
---|
| 28 | #define M48T08_DATE 5 |
---|
| 29 | #define M48T08_MONTH 6 |
---|
| 30 | #define M48T08_YEAR 7 |
---|
[a3d3d9a] | 31 | |
---|
[866c9dd5] | 32 | /* |
---|
| 33 | * Driver function table |
---|
| 34 | */ |
---|
| 35 | |
---|
| 36 | extern rtc_fns m48t08_fns; |
---|
| 37 | |
---|
[c95e927] | 38 | /* |
---|
| 39 | * Default register access routines |
---|
| 40 | */ |
---|
| 41 | |
---|
[ee4f57d] | 42 | uint32_t m48t08_get_register( /* registers are at 1 byte boundaries */ |
---|
[e2b4891] | 43 | uintptr_t ulCtrlPort, /* and accessed as bytes */ |
---|
[ee4f57d] | 44 | uint8_t ucRegNum |
---|
[c95e927] | 45 | ); |
---|
| 46 | |
---|
| 47 | void m48t08_set_register( |
---|
[e2b4891] | 48 | uintptr_t ulCtrlPort, |
---|
[ee4f57d] | 49 | uint8_t ucRegNum, |
---|
| 50 | uint32_t ucData |
---|
[c95e927] | 51 | ); |
---|
| 52 | |
---|
[ee4f57d] | 53 | uint32_t m48t08_get_register_2( /* registers are at 2 byte boundaries */ |
---|
[e2b4891] | 54 | uintptr_t ulCtrlPort, /* and accessed as bytes */ |
---|
[ee4f57d] | 55 | uint8_t ucRegNum |
---|
[c95e927] | 56 | ); |
---|
| 57 | |
---|
| 58 | void m48t08_set_register_2( |
---|
[e2b4891] | 59 | uintptr_t ulCtrlPort, |
---|
[ee4f57d] | 60 | uint8_t ucRegNum, |
---|
| 61 | uint32_t ucData |
---|
[c95e927] | 62 | ); |
---|
| 63 | |
---|
[ee4f57d] | 64 | uint32_t m48t08_get_register_4( /* registers are at 4 byte boundaries */ |
---|
[e2b4891] | 65 | uintptr_t ulCtrlPort, /* and accessed as bytes */ |
---|
[ee4f57d] | 66 | uint8_t ucRegNum |
---|
[c95e927] | 67 | ); |
---|
| 68 | |
---|
| 69 | void m48t08_set_register_4( |
---|
[e2b4891] | 70 | uintptr_t ulCtrlPort, |
---|
[ee4f57d] | 71 | uint8_t ucRegNum, |
---|
| 72 | uint32_t ucData |
---|
[c95e927] | 73 | ); |
---|
| 74 | |
---|
[ee4f57d] | 75 | uint32_t m48t08_get_register_8( /* registers are at 8 byte boundaries */ |
---|
[e2b4891] | 76 | uintptr_t ulCtrlPort, /* and accessed as bytes */ |
---|
[ee4f57d] | 77 | uint8_t ucRegNum |
---|
[c95e927] | 78 | ); |
---|
| 79 | |
---|
| 80 | void m48t08_set_register_8( |
---|
[e2b4891] | 81 | uintptr_t ulCtrlPort, |
---|
[ee4f57d] | 82 | uint8_t ucRegNum, |
---|
| 83 | uint32_t ucData |
---|
[c95e927] | 84 | ); |
---|
| 85 | |
---|
[a1f514f] | 86 | #endif |
---|
| 87 | /* end of include file */ |
---|