mbd2pmd Adapter Board Library

Dependents:   MBD2PMD_WebServer

This library assigns the proper pins for the mbed LPC1768 with the mbd2pmd adapter board.

  • microSD pins sd(p5, p6, p7, p8 "sd")
  • mux I2C pins mux(p28, p27)

Digital I/O

pmd[8] is an array of pointers to the DigitalInOut objects

IndexNamePmod
0pa11
1pa22
2pa33
3pa44
4pb17
5pb28
6pb39
7pb410

MAX14661 Multiplexer Abstraction

mux_a[17] is an array of integers representing the bit mask of a multiplexer switch arranged in Arduino order

IndexPinName
0p10RX
1p9TX
2p30RD
3p25PWM1
4p24PB1
5p23PB2
6p22PB3
7p21PB4
8p29TD
9p26PWM2
10p14PA1
11p11PA2
12p12PA3
13p13PA4
14p28SDA
15p27SCL
16na0

mux_p[9] is an array of integers representing the bit mask of a multiplexer switch arranged in Pmod order

IndexPinName
0p14PA1
1p11PA2
2p12PA3
3p13PA4
4p24PB1
5p23PB2
6p22PB3
7p21PB4
8na0

mbd2pmd.cpp

Committer:
gsteiert
Date:
2014-05-10
Revision:
0:0b4eb5eb8c18

File content as of revision 0:0b4eb5eb8c18:

/* mbd2pmd Board Driver Library
 *
 */

#include "mbed.h"
#include "mbd2pmd.h"

mbd2pmd::mbd2pmd() :
    mux(p28, p27), sd(p5, p6, p7, p8, "sd"),
    pa1(p14), pa2(p11), pa3(p12), pa4(p13),
    pb1(p24), pb2(p23), pb3(p22), pb4(p21)
{
}

mbd2pmd::~mbd2pmd()
{
}

const int mbd2pmd::mux_a[17] = {RX, TX, RD, PWM1, PB1, PB2, PB3, PB4, TD, PWM2, PA1, PA2, PA3, PA4, SDA, SCL, 0};
const int mbd2pmd::mux_p[9] = {PA1, PA2, PA3, PA4, PB1, PB2, PB3, PB4, 0};

// Initialize Digital IO to inputs with no pullups
void mbd2pmd::init()
{
    pmd[0] = &pa1;
    pmd[1] = &pa2;
    pmd[2] = &pa3;
    pmd[3] = &pa4;
    pmd[4] = &pb1;
    pmd[5] = &pb2;
    pmd[6] = &pb3;
    pmd[7] = &pb4;
    for (int i=0; i < 8; i++) {
        (*pmd[i]).mode(PullNone);
        (*pmd[i]).input();
    }
}