source: rtems/c/src/lib/libcpu/powerpc/mpc55xx/include/watchdog.h @ c1188b41

4.115
Last change on this file since c1188b41 was c1188b41, checked in by Sebastian Huber <sebastian.huber@…>, on 08/30/11 at 13:30:09

2011-08-30 Peter Dufault <dufault@…>

  • mpc55xx/misc/flash_support.c: New file.
  • Makefile.am: Reflect change above.
  • mpc55xx/include/mpc55xx.h: Add definitions for the FLASH interface and two memory protect interfaces. Add modifications to eliminate warnings in some of the cache macros.
  • mpc55xx/include/regs.h: Add some structure tag names for some structures that I needed access to. Don't define the ALTCADR for the MPC5554 - it is reserved and acess casues an exception. Hide the C99 designated initializers when compiling with C++. Add some support for the EQADC.
  • mpc55xx/include/esci.h, mpc55xx/include/watchdog.h: Add C++ protection.
  • Property mode set to 100644
File size: 1.3 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup mpc55xx
5 *
6 * @brief Header file for the watchdog timer.
7 */
8
9/*
10 * Copyright (c) 2008
11 * Embedded Brains GmbH
12 * Obere Lagerstr. 30
13 * D-82178 Puchheim
14 * Germany
15 * rtems@embedded-brains.de
16 *
17 * The license and distribution terms for this file may be found in the file
18 * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
19 */
20
21#ifndef LIBCPU_POWERPC_MPC55XX_WATCHDOG_H
22#define LIBCPU_POWERPC_MPC55XX_WATCHDOG_H
23
24#include <stdbool.h>
25
26#include <rtems.h>
27
28#include <libcpu/powerpc-utility.h>
29
30#ifdef __cplusplus
31extern "C" {
32#endif /* __cplusplus */
33
34static inline void mpc55xx_watchdog_clear()
35{
36        PPC_SET_SPECIAL_PURPOSE_REGISTER( BOOKE_TSR, BOOKE_TSR_WIS);
37}
38
39static inline void mpc55xx_watchdog_enable_interrupt( bool enable)
40{
41        if (enable) {
42                PPC_SET_SPECIAL_PURPOSE_REGISTER_BITS( BOOKE_TCR, BOOKE_TCR_WIE);
43        } else {
44                PPC_CLEAR_SPECIAL_PURPOSE_REGISTER_BITS( BOOKE_TCR, BOOKE_TCR_WIE);
45        }
46}
47
48static inline rtems_status_code mpc55xx_watchdog_set_time_base_bit( uint32_t bit)
49{
50        if (bit > 63) {
51                return RTEMS_INVALID_NUMBER;
52        }
53
54        PPC_SET_SPECIAL_PURPOSE_REGISTER_BITS_MASKED(
55                BOOKE_TCR,
56                BOOKE_TCR_WP( bit) | BOOKE_TCR_WPEXT( bit >> 2),
57                BOOKE_TCR_WP_MASK | BOOKE_TCR_WPEXT_MASK
58        );
59
60        return RTEMS_SUCCESSFUL;
61}
62
63#ifdef __cplusplus
64}
65#endif /* __cplusplus */
66
67#endif /* LIBCPU_POWERPC_MPC55XX_WATCHDOG_H */
Note: See TracBrowser for help on using the repository browser.