source: rtems/c/src/lib/libbsp/arm/lpc176x/include/watchdog-defs.h @ 19260fb

4.115
Last change on this file since 19260fb was 19260fb, checked in by Martin Boretto <martin.boretto@…>, on Jun 9, 2014 at 2:27:18 PM

bsp/lpc176x: New BSP

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/**
2 * @file watchdog-defs.h
3 *
4 * @ingroup lpc176x
5 *
6 * @brief API definitions of the Watchdog driver for the lpc176x bsp in RTEMS.
7 */
8
9/*
10 * Copyright (c) 2014 Taller Technologies.
11 *
12 * @author  Boretto Martin    (martin.boretto@tallertechnologies.com)
13 * @author  Diaz Marcos (marcos.diaz@tallertechnologies.com)
14 * @author  Lenarduzzi Federico  (federico.lenarduzzi@tallertechnologies.com)
15 * @author  Daniel Chicco  (daniel.chicco@tallertechnologies.com)
16 *
17 * The license and distribution terms for this file may be
18 * found in the file LICENSE in this distribution or at
19 * http://www.rtems.com/license/LICENSE.
20 */
21
22#ifndef LIBBSP_ARM_LPC176X_WATCHDOG_DEFS_H
23#define LIBBSP_ARM_LPC176X_WATCHDOG_DEFS_H
24
25#include <rtems/score/cpu.h>
26#include <bsp.h>
27#include <bspopts.h>
28#include <bsp/utility.h>
29#include <bsp/irq.h>
30#include <bsp/common-types.h>
31
32#ifdef __cplusplus
33extern "C" {
34#endif /* __cplusplus */
35
36#define LPC176X_WDMOD_BASE 0x40000000U
37#define LPC176X_WDFEED_CON 0XAAU
38#define LPC176X_WDFEED_CFG 0X55U
39#define LPC176X_WD_PRESCALER_DIVISOR 4000000U
40#define LPC176X_WWDT_MOD_WDEN BSP_BIT32( 0 )
41#define LPC176X_WWDT_MOD_WDRESET BSP_BIT32( 1 )
42#define LPC176X_WWDT_MOD_WDTOF BSP_BIT32( 2 )
43#define LPC176X_WWDT_MOD_WDINT BSP_BIT32( 3 )
44#define LPC176X_WWDT_CLKSEL_WDSEL_IRC 0x0U
45#define LPC176X_WWDT_CLKSEL_WDSEL_PCLK 0x1U
46#define LPC176X_WWDT_CLKSEL_WDSEL_RTC 0x2U
47#define LPC176X_WD_INTERRUPT_VECTOR_NUMBER 0U
48#define LPC176X_WDMOD ( *(volatile uint32_t *) ( LPC176X_WDMOD_BASE + 0x00U ) )
49#define LPC176X_WDTC ( *(volatile uint32_t *) ( LPC176X_WDMOD_BASE + 0x04U ) )
50#define LPC176X_WDFEED ( *(volatile uint32_t *) ( LPC176X_WDMOD_BASE + \
51                                                  0x08U ) )
52#define LPC176X_WDTV ( *(volatile uint32_t *) ( LPC176X_WDMOD_BASE + 0x0CU ) )
53#define LPC176X_WDCLKSEL ( *(volatile uint32_t *) ( LPC176X_WDMOD_BASE + \
54                                                    0x10U ) )
55
56/**
57 * @brief A function that attends an interruption for a watchdog.
58 */
59typedef rtems_interrupt_handler lpc176x_wd_isr_funct;
60
61#ifdef __cplusplus
62}
63#endif /* __cplusplus */
64
65#endif  /* LIBBSP_ARM_LPC176X_WATCHDOG_DEFS_H */
Note: See TracBrowser for help on using the repository browser.