Ignore:
Timestamp:
Mar 11, 2015, 7:57:23 PM (6 years ago)
Author:
Martin Galvan <martin.galvan@…>
Branches:
4.11, 5, master
Children:
9f34aa5
Parents:
6a941e3
git-author:
Martin Galvan <martin.galvan@…> (03/11/15 19:57:23)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/20/15 08:16:07)
Message:

Add CAN, PWM, ADC and UART1/2/3 support to the LPC176x BSP.

This patch adds support for the following devices to the LPC176x BSP:

  • CAN
  • PWM
  • ADC

It also adds the probe routines for UART1/2/3 to the console_device_table in console-config.c, and enables UART1 in configure.ac.

Location:
c/src/lib/libbsp/arm/lpc176x/include
Files:
7 added
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/lpc176x/include/common-types.h

    r6a941e3 r7b35a36  
    4747  LPC176X_MODULE_CAN_0,
    4848  LPC176X_MODULE_CAN_1,
     49  LPC176X_MODULE_ACCF,
    4950  LPC176X_MODULE_DAC,
    5051  LPC176X_MODULE_GPDMA,
  • c/src/lib/libbsp/arm/lpc176x/include/io-defs.h

    r6a941e3 r7b35a36  
    4444#define LPC176X_PIN_UART_0_TXD 2U
    4545#define LPC176X_PIN_UART_0_RXD 3U
     46#define LPC176X_PIN_UART_1_TXD 15U
     47#define LPC176X_PIN_UART_1_RXD 16U
     48#define LPC176X_PIN_UART_2_TXD 10U
     49#define LPC176X_PIN_UART_2_RXD 11U
     50#define LPC176X_PIN_UART_3_TXD 0U
     51#define LPC176X_PIN_UART_3_RXD 1U
    4652
    4753#define LPC176X_MODULE_BITS_COUNT 32U
     
    6874}
    6975lpc176x_pin_function;
     76
     77/**
     78 * @brief Defines the pin modes.
     79 *
     80 */
     81typedef enum {
     82  LPC176X_PIN_MODE_PULLUP,
     83  LPC176X_PIN_MODE_REPEATER,
     84  LPC176X_PIN_MODE_NONE,
     85  LPC176X_PIN_MODE_PULLDOWN,
     86  LPC176X_PIN_MODE_COUNT
     87}
     88lpc176x_pin_mode;
    7089
    7190/**
  • c/src/lib/libbsp/arm/lpc176x/include/io.h

    r6a941e3 r7b35a36  
    3232
    3333/**
    34  * @brief Set pin to the selected function.
     34 * @brief Sets pin to the selected function.
    3535 *
    3636 * @param pin The pin to set.
     
    4040  uint32_t             pin,
    4141  lpc176x_pin_function function
     42);
     43
     44/**
     45 * @brief Sets pin to the selected mode.
     46 *
     47 * @param pin The pin to set.
     48 * @param mode Defines the mode to set.
     49 */
     50void lpc176x_pin_set_mode(
     51  const uint32_t             pin,
     52  const lpc176x_pin_mode mode
    4253);
    4354
  • c/src/lib/libbsp/arm/lpc176x/include/lpc176x.h

    r6a941e3 r7b35a36  
    177177#define LPC176X_SCB_CLKOUTCFG_CLKOUTSEL( val ) BSP_FLD32( val, 3, 0 )
    178178#define LPC176X_SCB_CLKOUTCFG_CLKOUTSEL_GET( reg ) BSP_FLD32GET( reg, 3, 0 )
    179 #define LPC176X_SCB_CLKOUTCFG_CLKOUTSEL_SET( reg, val ) BSP_FLD32SET( reg, val, \
    180   3, 0 )
     179#define LPC176X_SCB_CLKOUTCFG_CLKOUTSEL_SET( reg, val ) BSP_FLD32SET( reg, \
     180  val, 3, 0 )
    181181#define LPC176X_SCB_CLKOUTCFG_CLKOUTDIV( val ) BSP_FLD32( val, 7, 4 )
    182182#define LPC176X_SCB_CLKOUTCFG_CLKOUTDIV_GET( reg ) BSP_FLD32GET( reg, 7, 4 )
    183 #define LPC176X_SCB_CLKOUTCFG_CLKOUTDIV_SET( reg, val ) BSP_FLD32SET( reg, val, \
    184   7, 4 )
     183#define LPC176X_SCB_CLKOUTCFG_CLKOUTDIV_SET( reg, val ) BSP_FLD32SET( reg, \
     184  val, 7, 4 )
    185185#define LPC176X_SCB_CLKOUTCFG_CLKOUT_EN BSP_BIT32( 8 )
    186186#define LPC176X_SCB_CLKOUTCFG_CLKOUT_ACT BSP_BIT32( 9 )
Note: See TracChangeset for help on using the changeset viewer.