rfLPC
A low level library for using NXP's LPC17xx SoC. Config is given for MBED prototyping board
pinconf.h File Reference

Multi-purpose pins configuration made easy. More...

#include <stdint.h>
#include "nxp/LPC17xx.h"

Go to the source code of this file.

Macros

#define RFLPC_PIN_MAKE(port, pin)   ((port) << 5 | (pin))
 Can be used to create a rflpc_pin_t from a port index and a pin index.
 
#define RFLPC_PIN_GET_PORT(pin)   (((pin) >> 5) & 0x7)
 Returns the X part of the PX_Y form pin description (i.e. More...
 
#define RFLPC_PIN_GET_PIN(pin)   ((pin) & 0x1F)
 Returns the Y part of the PX_Y form pin description (i.e. More...
 

Typedefs

typedef uint8_t rflpc_pin_t
 Represents a pin. More...
 

Enumerations

enum  {
  RFLPC_PIN_P0_0,
  RFLPC_PIN_P0_1,
  RFLPC_PIN_P0_2,
  RFLPC_PIN_P0_3,
  RFLPC_PIN_P0_4,
  RFLPC_PIN_P0_5,
  RFLPC_PIN_P0_6,
  RFLPC_PIN_P0_7,
  RFLPC_PIN_P0_8,
  RFLPC_PIN_P0_9,
  RFLPC_PIN_P0_10,
  RFLPC_PIN_P0_11,
  RFLPC_PIN_P0_12,
  RFLPC_PIN_P0_13,
  RFLPC_PIN_P0_14,
  RFLPC_PIN_P0_15,
  RFLPC_PIN_P0_16,
  RFLPC_PIN_P0_17,
  RFLPC_PIN_P0_18,
  RFLPC_PIN_P0_19,
  RFLPC_PIN_P0_20,
  RFLPC_PIN_P0_21,
  RFLPC_PIN_P0_22,
  RFLPC_PIN_P0_23,
  RFLPC_PIN_P0_24,
  RFLPC_PIN_P0_25,
  RFLPC_PIN_P0_26,
  RFLPC_PIN_P0_27,
  RFLPC_PIN_P0_28,
  RFLPC_PIN_P0_29,
  RFLPC_PIN_P0_30,
  RFLPC_PIN_P0_31,
  RFLPC_PIN_P1_0 = RFLPC_PIN_MAKE(1,0),
  RFLPC_PIN_P1_1,
  RFLPC_PIN_P1_2,
  RFLPC_PIN_P1_3,
  RFLPC_PIN_P1_4,
  RFLPC_PIN_P1_5,
  RFLPC_PIN_P1_6,
  RFLPC_PIN_P1_7,
  RFLPC_PIN_P1_8,
  RFLPC_PIN_P1_9,
  RFLPC_PIN_P1_10,
  RFLPC_PIN_P1_11,
  RFLPC_PIN_P1_12,
  RFLPC_PIN_P1_13,
  RFLPC_PIN_P1_14,
  RFLPC_PIN_P1_15,
  RFLPC_PIN_P1_16,
  RFLPC_PIN_P1_17,
  RFLPC_PIN_P1_18,
  RFLPC_PIN_P1_19,
  RFLPC_PIN_P1_20,
  RFLPC_PIN_P1_21,
  RFLPC_PIN_P1_22,
  RFLPC_PIN_P1_23,
  RFLPC_PIN_P1_24,
  RFLPC_PIN_P1_25,
  RFLPC_PIN_P1_26,
  RFLPC_PIN_P1_27,
  RFLPC_PIN_P1_28,
  RFLPC_PIN_P1_29,
  RFLPC_PIN_P1_30,
  RFLPC_PIN_P1_31,
  RFLPC_PIN_P2_0 = RFLPC_PIN_MAKE(2,0),
  RFLPC_PIN_P2_1,
  RFLPC_PIN_P2_2,
  RFLPC_PIN_P2_3,
  RFLPC_PIN_P2_4,
  RFLPC_PIN_P2_5,
  RFLPC_PIN_P2_6,
  RFLPC_PIN_P2_7,
  RFLPC_PIN_P2_8,
  RFLPC_PIN_P2_9,
  RFLPC_PIN_P2_10,
  RFLPC_PIN_P2_11,
  RFLPC_PIN_P2_12,
  RFLPC_PIN_P2_13,
  RFLPC_PIN_P3_25 = RFLPC_PIN_MAKE(3,25),
  RFLPC_PIN_P3_26,
  RFLPC_PIN_P4_28 = RFLPC_PIN_MAKE(4,28),
  RFLPC_PIN_P4_29
}
 Shortcuts macro for all pins.
 
enum  rflpc_pin_mode_t {
  RFLPC_PIN_MODE_RESISTOR_PULL_UP,
  RFLPC_PIN_MODE_REPEATER,
  RFLPC_PIN_MODE_RESISTOR_NONE,
  RFLPC_PIN_MODE_RESISTOR_PULL_DOWN
}
 Pin mode. More...
 

Functions

void rflpc_pin_set (rflpc_pin_t pin, int function, rflpc_pin_mode_t mode, int opendrain)
 Sets the operational mode for a given pin on a given port. More...
 

Detailed Description

Multi-purpose pins configuration made easy.

Definition in file pinconf.h.