[cd58d82] | 1 | /* |
---|
| 2 | * |
---|
| 3 | * COPYRIGHT (c) 1989-1998. |
---|
| 4 | * On-Line Applications Research Corporation (OAR). |
---|
| 5 | * Copyright assigned to U.S. Government, 1994. |
---|
| 6 | * |
---|
| 7 | * The license and distribution terms for this file may be |
---|
| 8 | * found in the file LICENSE in this distribution or at |
---|
| 9 | * http://www.OARcorp.com/rtems/license.html. |
---|
| 10 | * |
---|
| 11 | * $Id$ |
---|
| 12 | */ |
---|
| 13 | |
---|
| 14 | #ifndef _MC68681_H_ |
---|
| 15 | #define _MC68681_H_ |
---|
| 16 | |
---|
| 17 | #ifdef __cplusplus |
---|
| 18 | extern "C" { |
---|
| 19 | #endif |
---|
| 20 | |
---|
[ab2dbd7] | 21 | /* |
---|
| 22 | * These are just used in the interface between this driver and |
---|
[7deeb16] | 23 | * the read/write register routines when accessing the first |
---|
| 24 | * control port. |
---|
[ab2dbd7] | 25 | */ |
---|
| 26 | |
---|
[7deeb16] | 27 | #define MC68681_STATUS 1 |
---|
[e3c59dd] | 28 | #define MC68681_RX_BUFFER 3 |
---|
[7deeb16] | 29 | |
---|
[790d421] | 30 | #define MC68681_MODE 0 |
---|
[7deeb16] | 31 | #define MC68681_CLOCK_SELECT 1 |
---|
| 32 | #define MC68681_COMMAND 2 |
---|
| 33 | #define MC68681_TX_BUFFER 3 |
---|
[ab2dbd7] | 34 | |
---|
[790d421] | 35 | /* |
---|
| 36 | * Data Port bit map configuration |
---|
[8b2492f] | 37 | * |
---|
| 38 | * D0 : Baud Rate Set Selection |
---|
| 39 | * D1 - D2 : Extended Baud Rate Setting |
---|
[790d421] | 40 | */ |
---|
| 41 | |
---|
[8b2492f] | 42 | #define MC68681_DATA_BAUD_RATE_SET_1 0 /* ACR[7] = 0 */ |
---|
| 43 | #define MC68681_DATA_BAUD_RATE_SET_2 1 /* ACR[7] = 1 */ |
---|
| 44 | |
---|
| 45 | #define MC68681_XBRG_IGNORED (0 << 1) |
---|
| 46 | #define MC68681_XBRG_ENABLED (1 << 1) |
---|
| 47 | #define MC68681_XBRG_DISABLED (2 << 1) |
---|
| 48 | #define MC68681_XBRG_MASK (3 << 1) |
---|
| 49 | |
---|
| 50 | /* |
---|
| 51 | * Custom baud rate table information |
---|
| 52 | */ |
---|
| 53 | |
---|
| 54 | typedef unsigned char mc68681_baud_t; |
---|
| 55 | typedef mc68681_baud_t mc68681_baud_table_t[RTEMS_TERMIOS_NUMBER_BAUD_RATES]; |
---|
| 56 | |
---|
| 57 | #define MC68681_BAUD_NOT_VALID 0xFF |
---|
[790d421] | 58 | |
---|
[cd58d82] | 59 | /* |
---|
| 60 | * Driver function table |
---|
| 61 | */ |
---|
[ab2dbd7] | 62 | |
---|
[cd58d82] | 63 | extern console_fns mc68681_fns; |
---|
| 64 | extern console_fns mc68681_fns_polled; |
---|
| 65 | |
---|
[49370cd] | 66 | /* |
---|
| 67 | * Default register access routines |
---|
| 68 | */ |
---|
| 69 | |
---|
[cce9322] | 70 | unsigned8 mc68681_get_register( /* registers are at 1 byte boundaries */ |
---|
| 71 | unsigned32 ulCtrlPort, /* and accessed as bytes */ |
---|
[49370cd] | 72 | unsigned8 ucRegNum |
---|
| 73 | ); |
---|
| 74 | |
---|
[cce9322] | 75 | void mc68681_set_register( |
---|
[49370cd] | 76 | unsigned32 ulCtrlPort, |
---|
| 77 | unsigned8 ucRegNum, |
---|
| 78 | unsigned8 ucData |
---|
| 79 | ); |
---|
| 80 | |
---|
[cce9322] | 81 | unsigned8 mc68681_get_register_2( /* registers are at 2 byte boundaries */ |
---|
| 82 | unsigned32 ulCtrlPort, /* and accessed as bytes */ |
---|
[49370cd] | 83 | unsigned8 ucRegNum |
---|
| 84 | ); |
---|
| 85 | |
---|
[cce9322] | 86 | void mc68681_set_register_2( |
---|
[49370cd] | 87 | unsigned32 ulCtrlPort, |
---|
| 88 | unsigned8 ucRegNum, |
---|
| 89 | unsigned8 ucData |
---|
| 90 | ); |
---|
| 91 | |
---|
[cce9322] | 92 | unsigned8 mc68681_get_register_4( /* registers are at 4 byte boundaries */ |
---|
| 93 | unsigned32 ulCtrlPort, /* and accessed as bytes */ |
---|
[49370cd] | 94 | unsigned8 ucRegNum |
---|
| 95 | ); |
---|
| 96 | |
---|
[cce9322] | 97 | void mc68681_set_register_4( |
---|
[49370cd] | 98 | unsigned32 ulCtrlPort, |
---|
| 99 | unsigned8 ucRegNum, |
---|
| 100 | unsigned8 ucData |
---|
| 101 | ); |
---|
| 102 | |
---|
[cce9322] | 103 | unsigned8 mc68681_get_register_8( /* registers are at 8 byte boundaries */ |
---|
| 104 | unsigned32 ulCtrlPort, /* and accessed as bytes */ |
---|
[49370cd] | 105 | unsigned8 ucRegNum |
---|
| 106 | ); |
---|
| 107 | |
---|
[cce9322] | 108 | void mc68681_set_register_8( |
---|
[49370cd] | 109 | unsigned32 ulCtrlPort, |
---|
| 110 | unsigned8 ucRegNum, |
---|
| 111 | unsigned8 ucData |
---|
| 112 | ); |
---|
| 113 | |
---|
| 114 | |
---|
[cd58d82] | 115 | #ifdef __cplusplus |
---|
| 116 | } |
---|
| 117 | #endif |
---|
| 118 | |
---|
| 119 | #endif /* _MC68681_H_ */ |
---|