forked from Imagelibrary/rtems
Added default mc68681 register access routines.
This commit is contained in:
@@ -67,45 +67,45 @@ extern console_fns mc68681_fns_polled;
|
|||||||
* Default register access routines
|
* Default register access routines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
unsigned8 mc68681_default_read_register(
|
unsigned8 mc68681_get_register( /* registers are at 1 byte boundaries */
|
||||||
unsigned32 ulCtrlPort,
|
unsigned32 ulCtrlPort, /* and accessed as bytes */
|
||||||
unsigned8 ucRegNum
|
unsigned8 ucRegNum
|
||||||
);
|
);
|
||||||
|
|
||||||
void mc68681_default_write_register(
|
void mc68681_set_register(
|
||||||
unsigned32 ulCtrlPort,
|
unsigned32 ulCtrlPort,
|
||||||
unsigned8 ucRegNum,
|
unsigned8 ucRegNum,
|
||||||
unsigned8 ucData
|
unsigned8 ucData
|
||||||
);
|
);
|
||||||
|
|
||||||
unsigned8 mc68681_default_read_register_with_multiplier_2(
|
unsigned8 mc68681_get_register_2( /* registers are at 2 byte boundaries */
|
||||||
unsigned32 ulCtrlPort,
|
unsigned32 ulCtrlPort, /* and accessed as bytes */
|
||||||
unsigned8 ucRegNum
|
unsigned8 ucRegNum
|
||||||
);
|
);
|
||||||
|
|
||||||
void mc68681_default_write_register_with_multiplier_2(
|
void mc68681_set_register_2(
|
||||||
unsigned32 ulCtrlPort,
|
unsigned32 ulCtrlPort,
|
||||||
unsigned8 ucRegNum,
|
unsigned8 ucRegNum,
|
||||||
unsigned8 ucData
|
unsigned8 ucData
|
||||||
);
|
);
|
||||||
|
|
||||||
unsigned8 mc68681_default_read_register_with_multiplier_4(
|
unsigned8 mc68681_get_register_4( /* registers are at 4 byte boundaries */
|
||||||
unsigned32 ulCtrlPort,
|
unsigned32 ulCtrlPort, /* and accessed as bytes */
|
||||||
unsigned8 ucRegNum
|
unsigned8 ucRegNum
|
||||||
);
|
);
|
||||||
|
|
||||||
void mc68681_default_write_register_with_multiplier_4(
|
void mc68681_set_register_4(
|
||||||
unsigned32 ulCtrlPort,
|
unsigned32 ulCtrlPort,
|
||||||
unsigned8 ucRegNum,
|
unsigned8 ucRegNum,
|
||||||
unsigned8 ucData
|
unsigned8 ucData
|
||||||
);
|
);
|
||||||
|
|
||||||
unsigned8 mc68681_default_read_register_with_multiplier_8(
|
unsigned8 mc68681_get_register_8( /* registers are at 8 byte boundaries */
|
||||||
unsigned32 ulCtrlPort,
|
unsigned32 ulCtrlPort, /* and accessed as bytes */
|
||||||
unsigned8 ucRegNum
|
unsigned8 ucRegNum
|
||||||
);
|
);
|
||||||
|
|
||||||
void mc68681_default_write_register_with_multiplier_8(
|
void mc68681_set_register_8(
|
||||||
unsigned32 ulCtrlPort,
|
unsigned32 ulCtrlPort,
|
||||||
unsigned8 ucRegNum,
|
unsigned8 ucRegNum,
|
||||||
unsigned8 ucData
|
unsigned8 ucData
|
||||||
|
|||||||
61
c/src/lib/libchip/serial/mc68681_reg.c
Normal file
61
c/src/lib/libchip/serial/mc68681_reg.c
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the mc68681 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are only byte-aligned (no address gaps)
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <rtems.h>
|
||||||
|
|
||||||
|
#ifndef _MC68681_MULTIPLIER
|
||||||
|
#define _MC68681_MULTIPLIER 1
|
||||||
|
#define _MC68681_NAME(_X) _X
|
||||||
|
#define _MC68681_TYPE unsigned8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
|
||||||
|
(_MC68681_TYPE *)((_base) + ((_reg) * _MC68681_MULTIPLIER ))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MC68681 Get Register Routine
|
||||||
|
*/
|
||||||
|
|
||||||
|
unsigned8 _MC68681_NAME(mc68681_get_register)(
|
||||||
|
unsigned32 ulCtrlPort,
|
||||||
|
unsigned8 ucRegNum
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_Z85C30_TYPE *port;
|
||||||
|
|
||||||
|
port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
|
||||||
|
|
||||||
|
return *port;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MC68681 Set Register Routine
|
||||||
|
*/
|
||||||
|
|
||||||
|
void _MC68681_NAME(mc68681_set_register)(
|
||||||
|
unsigned32 ulCtrlPort,
|
||||||
|
unsigned8 ucRegNum,
|
||||||
|
unsigned8 ucData
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_Z85C30_TYPE *port;
|
||||||
|
|
||||||
|
port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
|
||||||
|
|
||||||
|
*port = ucData;
|
||||||
|
}
|
||||||
23
c/src/lib/libchip/serial/mc68681_reg2.c
Normal file
23
c/src/lib/libchip/serial/mc68681_reg2.c
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the mc68681 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 16-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _MC68681_MULTIPLIER 2
|
||||||
|
#define _MC68681_NAME(_X) _X##_2
|
||||||
|
|
||||||
|
#include "mc68681_reg.c"
|
||||||
|
|
||||||
23
c/src/lib/libchip/serial/mc68681_reg4.c
Normal file
23
c/src/lib/libchip/serial/mc68681_reg4.c
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the mc68681 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 64-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _MC68681_MULTIPLIER 4
|
||||||
|
#define _MC68681_NAME(_X) _X##_4
|
||||||
|
|
||||||
|
#include "mc68681_reg.c"
|
||||||
|
|
||||||
23
c/src/lib/libchip/serial/mc68681_reg8.c
Normal file
23
c/src/lib/libchip/serial/mc68681_reg8.c
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the mc68681 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 32-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _MC68681_MULTIPLIER 8
|
||||||
|
#define _MC68681_NAME(_X) _X##_8
|
||||||
|
|
||||||
|
#include "mc68681_reg.c"
|
||||||
|
|
||||||
@@ -67,45 +67,45 @@ extern console_fns mc68681_fns_polled;
|
|||||||
* Default register access routines
|
* Default register access routines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
unsigned8 mc68681_default_read_register(
|
unsigned8 mc68681_get_register( /* registers are at 1 byte boundaries */
|
||||||
unsigned32 ulCtrlPort,
|
unsigned32 ulCtrlPort, /* and accessed as bytes */
|
||||||
unsigned8 ucRegNum
|
unsigned8 ucRegNum
|
||||||
);
|
);
|
||||||
|
|
||||||
void mc68681_default_write_register(
|
void mc68681_set_register(
|
||||||
unsigned32 ulCtrlPort,
|
unsigned32 ulCtrlPort,
|
||||||
unsigned8 ucRegNum,
|
unsigned8 ucRegNum,
|
||||||
unsigned8 ucData
|
unsigned8 ucData
|
||||||
);
|
);
|
||||||
|
|
||||||
unsigned8 mc68681_default_read_register_with_multiplier_2(
|
unsigned8 mc68681_get_register_2( /* registers are at 2 byte boundaries */
|
||||||
unsigned32 ulCtrlPort,
|
unsigned32 ulCtrlPort, /* and accessed as bytes */
|
||||||
unsigned8 ucRegNum
|
unsigned8 ucRegNum
|
||||||
);
|
);
|
||||||
|
|
||||||
void mc68681_default_write_register_with_multiplier_2(
|
void mc68681_set_register_2(
|
||||||
unsigned32 ulCtrlPort,
|
unsigned32 ulCtrlPort,
|
||||||
unsigned8 ucRegNum,
|
unsigned8 ucRegNum,
|
||||||
unsigned8 ucData
|
unsigned8 ucData
|
||||||
);
|
);
|
||||||
|
|
||||||
unsigned8 mc68681_default_read_register_with_multiplier_4(
|
unsigned8 mc68681_get_register_4( /* registers are at 4 byte boundaries */
|
||||||
unsigned32 ulCtrlPort,
|
unsigned32 ulCtrlPort, /* and accessed as bytes */
|
||||||
unsigned8 ucRegNum
|
unsigned8 ucRegNum
|
||||||
);
|
);
|
||||||
|
|
||||||
void mc68681_default_write_register_with_multiplier_4(
|
void mc68681_set_register_4(
|
||||||
unsigned32 ulCtrlPort,
|
unsigned32 ulCtrlPort,
|
||||||
unsigned8 ucRegNum,
|
unsigned8 ucRegNum,
|
||||||
unsigned8 ucData
|
unsigned8 ucData
|
||||||
);
|
);
|
||||||
|
|
||||||
unsigned8 mc68681_default_read_register_with_multiplier_8(
|
unsigned8 mc68681_get_register_8( /* registers are at 8 byte boundaries */
|
||||||
unsigned32 ulCtrlPort,
|
unsigned32 ulCtrlPort, /* and accessed as bytes */
|
||||||
unsigned8 ucRegNum
|
unsigned8 ucRegNum
|
||||||
);
|
);
|
||||||
|
|
||||||
void mc68681_default_write_register_with_multiplier_8(
|
void mc68681_set_register_8(
|
||||||
unsigned32 ulCtrlPort,
|
unsigned32 ulCtrlPort,
|
||||||
unsigned8 ucRegNum,
|
unsigned8 ucRegNum,
|
||||||
unsigned8 ucData
|
unsigned8 ucData
|
||||||
|
|||||||
61
c/src/libchip/serial/mc68681_reg.c
Normal file
61
c/src/libchip/serial/mc68681_reg.c
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the mc68681 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are only byte-aligned (no address gaps)
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <rtems.h>
|
||||||
|
|
||||||
|
#ifndef _MC68681_MULTIPLIER
|
||||||
|
#define _MC68681_MULTIPLIER 1
|
||||||
|
#define _MC68681_NAME(_X) _X
|
||||||
|
#define _MC68681_TYPE unsigned8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
|
||||||
|
(_MC68681_TYPE *)((_base) + ((_reg) * _MC68681_MULTIPLIER ))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MC68681 Get Register Routine
|
||||||
|
*/
|
||||||
|
|
||||||
|
unsigned8 _MC68681_NAME(mc68681_get_register)(
|
||||||
|
unsigned32 ulCtrlPort,
|
||||||
|
unsigned8 ucRegNum
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_Z85C30_TYPE *port;
|
||||||
|
|
||||||
|
port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
|
||||||
|
|
||||||
|
return *port;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MC68681 Set Register Routine
|
||||||
|
*/
|
||||||
|
|
||||||
|
void _MC68681_NAME(mc68681_set_register)(
|
||||||
|
unsigned32 ulCtrlPort,
|
||||||
|
unsigned8 ucRegNum,
|
||||||
|
unsigned8 ucData
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_Z85C30_TYPE *port;
|
||||||
|
|
||||||
|
port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
|
||||||
|
|
||||||
|
*port = ucData;
|
||||||
|
}
|
||||||
23
c/src/libchip/serial/mc68681_reg2.c
Normal file
23
c/src/libchip/serial/mc68681_reg2.c
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the mc68681 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 16-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _MC68681_MULTIPLIER 2
|
||||||
|
#define _MC68681_NAME(_X) _X##_2
|
||||||
|
|
||||||
|
#include "mc68681_reg.c"
|
||||||
|
|
||||||
23
c/src/libchip/serial/mc68681_reg4.c
Normal file
23
c/src/libchip/serial/mc68681_reg4.c
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the mc68681 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 64-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _MC68681_MULTIPLIER 4
|
||||||
|
#define _MC68681_NAME(_X) _X##_4
|
||||||
|
|
||||||
|
#include "mc68681_reg.c"
|
||||||
|
|
||||||
23
c/src/libchip/serial/mc68681_reg8.c
Normal file
23
c/src/libchip/serial/mc68681_reg8.c
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the mc68681 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 32-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _MC68681_MULTIPLIER 8
|
||||||
|
#define _MC68681_NAME(_X) _X##_8
|
||||||
|
|
||||||
|
#include "mc68681_reg.c"
|
||||||
|
|
||||||
Reference in New Issue
Block a user