Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:03

0001 /**
0002  * @file
0003  *
0004  * @ingroup RTEMSBSPsARMLPC176X
0005  *
0006  * @brief API definitions of the Watchdog driver for the lpc176x bsp in RTEMS.
0007  */
0008 
0009 /*
0010  * Copyright (c) 2014 Taller Technologies.
0011  *
0012  * @author  Boretto Martin    (martin.boretto@tallertechnologies.com)
0013  * @author  Diaz Marcos (marcos.diaz@tallertechnologies.com)
0014  * @author  Lenarduzzi Federico  (federico.lenarduzzi@tallertechnologies.com)
0015  * @author  Daniel Chicco  (daniel.chicco@tallertechnologies.com)
0016  *
0017  * The license and distribution terms for this file may be
0018  * found in the file LICENSE in this distribution or at
0019  * http://www.rtems.org/license/LICENSE.
0020  */
0021 
0022 #ifndef LIBBSP_ARM_LPC176X_WATCHDOG_DEFS_H
0023 #define LIBBSP_ARM_LPC176X_WATCHDOG_DEFS_H
0024 
0025 #include <rtems/score/cpu.h>
0026 #include <bsp.h>
0027 #include <bspopts.h>
0028 #include <bsp/utility.h>
0029 #include <bsp/irq.h>
0030 #include <bsp/common-types.h>
0031 
0032 #ifdef __cplusplus
0033 extern "C" {
0034 #endif /* __cplusplus */
0035 
0036 #define LPC176X_WDMOD_BASE 0x40000000U
0037 #define LPC176X_WDFEED_CON 0XAAU
0038 #define LPC176X_WDFEED_CFG 0X55U
0039 #define LPC176X_WD_PRESCALER_DIVISOR 4000000U
0040 #define LPC176X_WWDT_MOD_WDEN BSP_BIT32( 0 )
0041 #define LPC176X_WWDT_MOD_WDRESET BSP_BIT32( 1 )
0042 #define LPC176X_WWDT_MOD_WDTOF BSP_BIT32( 2 )
0043 #define LPC176X_WWDT_MOD_WDINT BSP_BIT32( 3 )
0044 #define LPC176X_WWDT_CLKSEL_WDSEL_IRC 0x0U
0045 #define LPC176X_WWDT_CLKSEL_WDSEL_PCLK 0x1U
0046 #define LPC176X_WWDT_CLKSEL_WDSEL_RTC 0x2U
0047 #define LPC176X_WD_INTERRUPT_VECTOR_NUMBER 0U
0048 #define LPC176X_WDMOD ( *(volatile uint32_t *) ( LPC176X_WDMOD_BASE + 0x00U ) )
0049 #define LPC176X_WDTC ( *(volatile uint32_t *) ( LPC176X_WDMOD_BASE + 0x04U ) )
0050 #define LPC176X_WDFEED ( *(volatile uint32_t *) ( LPC176X_WDMOD_BASE + \
0051                                                   0x08U ) )
0052 #define LPC176X_WDTV ( *(volatile uint32_t *) ( LPC176X_WDMOD_BASE + 0x0CU ) )
0053 #define LPC176X_WDCLKSEL ( *(volatile uint32_t *) ( LPC176X_WDMOD_BASE + \
0054                                                     0x10U ) )
0055 
0056 /**
0057  * @brief A function that attends an interruption for a watchdog.
0058  */
0059 typedef rtems_interrupt_handler lpc176x_wd_isr_funct;
0060 
0061 #ifdef __cplusplus
0062 }
0063 #endif /* __cplusplus */
0064 
0065 #endif  /* LIBBSP_ARM_LPC176X_WATCHDOG_DEFS_H */