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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/lpc176x/misc/io.c

    r6a941e3 r7b35a36  
    3434  LPC176X_MODULE_ENTRY( LPC176X_MODULE_CAN_0, 1, 1, 13 ),
    3535  LPC176X_MODULE_ENTRY( LPC176X_MODULE_CAN_1, 1, 1, 14 ),
     36  LPC176X_MODULE_ENTRY(LPC176X_MODULE_ACCF, 0, 1, 15),
    3637  LPC176X_MODULE_ENTRY( LPC176X_MODULE_DAC, 0, 1, 11 ),
    3738  LPC176X_MODULE_ENTRY( LPC176X_MODULE_GPDMA, 1, 1, 29 ),
     
    7172}
    7273
     74void lpc176x_pin_set_mode(
     75  const uint32_t             pin,
     76  const lpc176x_pin_mode mode
     77)
     78{
     79  assert( pin <= LPC176X_IO_INDEX_MAX
     80    && mode < LPC176X_PIN_MODE_COUNT );
     81  const uint32_t           pin_selected = LPC176X_PIN_SELECT( pin );
     82  volatile uint32_t *const pinmode = &LPC176X_PINMODE[ pin_selected ];
     83  const uint32_t           shift = LPC176X_PIN_SELECT_SHIFT( pin );
     84  *pinmode = SET_FIELD( *pinmode, mode,
     85    LPC176X_PIN_SELECT_MASK << shift, shift );
     86}
     87
    7388/**
    7489 * @brief Checks if the module has power.
Note: See TracChangeset for help on using the changeset viewer.