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 Definitions types used by some devices in common.
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_COMMON_TYPES_H
0023 #define LIBBSP_ARM_LPC176X_COMMON_TYPES_H
0024 
0025 #ifdef __cplusplus
0026 extern "C" {
0027 #endif /* __cplusplus */
0028 
0029 /**
0030  * @brief A pin of the board.
0031  */
0032 typedef uint32_t lpc176x_pin_number;
0033 
0034 /**
0035  * @brief Microseconds representation.
0036  */
0037 typedef uint32_t lpc176x_microseconds;
0038 
0039 /**
0040  * @brief lpc176x module representation.
0041  *
0042  * Enumerated type to define the set of modules for a lpc176x board.
0043  */
0044 typedef enum {
0045   LPC176X_MODULE_WD,
0046   LPC176X_MODULE_ADC,
0047   LPC176X_MODULE_CAN_0,
0048   LPC176X_MODULE_CAN_1,
0049   LPC176X_MODULE_ACCF,
0050   LPC176X_MODULE_DAC,
0051   LPC176X_MODULE_GPDMA,
0052   LPC176X_MODULE_GPIO,
0053   LPC176X_MODULE_I2S,
0054   LPC176X_MODULE_MCI,
0055   LPC176X_MODULE_MCPWM,
0056   LPC176X_MODULE_PCB,
0057   LPC176X_MODULE_PWM_0,
0058   LPC176X_MODULE_PWM_1,
0059   LPC176X_MODULE_QEI,
0060   LPC176X_MODULE_RTC,
0061   LPC176X_MODULE_SYSCON,
0062   LPC176X_MODULE_TIMER_0,
0063   LPC176X_MODULE_TIMER_1,
0064   LPC176X_MODULE_TIMER_2,
0065   LPC176X_MODULE_TIMER_3,
0066   LPC176X_MODULE_UART_0,
0067   LPC176X_MODULE_UART_1,
0068   LPC176X_MODULE_UART_2,
0069   LPC176X_MODULE_UART_3,
0070   LPC176X_MODULE_USB
0071 } lpc176x_module;
0072 
0073 /**
0074  * @brief Defines all the clock modules.
0075  *
0076  * Enumerated type to define the set of clock modules for a lpc176x board.
0077  */
0078 typedef enum {
0079   LPC176X_MODULE_PCLK_DEFAULT = 0x4U,
0080   LPC176X_MODULE_CCLK = 0x1U,
0081   LPC176X_MODULE_CCLK_2 = 0x2U,
0082   LPC176X_MODULE_CCLK_4 = 0x0U,
0083   LPC176X_MODULE_CCLK_6 = 0x3U,
0084   LPC176X_MODULE_CCLK_8 = 0x3U
0085 } lpc176x_module_clock;
0086 
0087 /**
0088  * @brief Fast Input/Output registers representation.
0089  */
0090 typedef struct {
0091   /**
0092    * @brief Direction control register.
0093    */
0094   uint32_t dir;
0095   uint32_t reserved[ 3U ];
0096   /**
0097    * @brief Mask register for port.
0098    */
0099   uint32_t mask;
0100   /**
0101    * @brief Pinvalue register using 'mask'.
0102    */
0103   uint32_t pin;
0104   /**
0105    * @brief Output Set register using 'mask'.
0106    */
0107   uint32_t set;
0108   /**
0109    * @brief Output Clear register using 'maks'.
0110    */
0111   uint32_t clr;
0112 } lpc176x_fio;
0113 
0114 #ifdef __cplusplus
0115 }
0116 #endif /* __cplusplus */
0117 
0118 #endif /* LIBBSP_ARM_LPC176X_COMMON_TYPES_H */