Struct grand_central_m4::pins::Pins [−][src]
pub struct Pins {Show 87 fields
pub port: Port,
pub tx_led: Pc30<Input<Floating>>,
pub rx_led: Pc31<Input<Floating>>,
pub a0: Pa2<Input<Floating>>,
pub a1: Pa5<Input<Floating>>,
pub a2: Pb3<Input<Floating>>,
pub a3: Pc0<Input<Floating>>,
pub a4: Pc1<Input<Floating>>,
pub a5: Pc2<Input<Floating>>,
pub a6: Pc3<Input<Floating>>,
pub a7: Pb4<Input<Floating>>,
pub a8: Pb5<Input<Floating>>,
pub a9: Pb6<Input<Floating>>,
pub a10: Pb7<Input<Floating>>,
pub a11: Pb8<Input<Floating>>,
pub a12: Pb9<Input<Floating>>,
pub a13: Pa4<Input<Floating>>,
pub a14: Pa6<Input<Floating>>,
pub a15: Pa7<Input<Floating>>,
pub uart0_rx: Pb25<Input<Floating>>,
pub uart0_tx: Pb24<Input<Floating>>,
pub d2: Pc18<Input<Floating>>,
pub d3: Pc19<Input<Floating>>,
pub d4: Pc20<Input<Floating>>,
pub d5: Pc21<Input<Floating>>,
pub d6: Pd20<Input<Floating>>,
pub d7: Pd21<Input<Floating>>,
pub d8: Pb18<Input<Floating>>,
pub d9: Pb2<Input<Floating>>,
pub d10: Pb22<Input<Floating>>,
pub d11: Pb23<Input<Floating>>,
pub d12: Pb0<Input<Floating>>,
pub red_led: Pb1<Input<Floating>>,
pub uart3_tx: Pb16<Input<Floating>>,
pub uart3_rx: Pb17<Input<Floating>>,
pub uart2_tx: Pc22<Input<Floating>>,
pub uart2_rx: Pc23<Input<Floating>>,
pub uart1_tx: Pb12<Input<Floating>>,
pub uart1_rx: Pb13<Input<Floating>>,
pub sda: Pc16<Input<Floating>>,
pub scl: Pc17<Input<Floating>>,
pub d22: Pd12<Input<Floating>>,
pub d23: Pa15<Input<Floating>>,
pub usb_dm: Pa24<Input<Floating>>,
pub usb_dp: Pa25<Input<Floating>>,
pub d26: Pa12<Input<Floating>>,
pub d27: Pa13<Input<Floating>>,
pub d28: Pa14<Input<Floating>>,
pub d29: Pb19<Input<Floating>>,
pub d30: Pa23<Input<Floating>>,
pub d31: Pa22<Input<Floating>>,
pub d32: Pa21<Input<Floating>>,
pub d33: Pa20<Input<Floating>>,
pub d34: Pa19<Input<Floating>>,
pub d35: Pa18<Input<Floating>>,
pub d36: Pa17<Input<Floating>>,
pub d37: Pa16<Input<Floating>>,
pub d38: Pb15<Input<Floating>>,
pub d39: Pb14<Input<Floating>>,
pub d40: Pc13<Input<Floating>>,
pub d41: Pc12<Input<Floating>>,
pub d42: Pc15<Input<Floating>>,
pub d43: Pc14<Input<Floating>>,
pub d44: Pc11<Input<Floating>>,
pub d45: Pc10<Input<Floating>>,
pub d46: Pc6<Input<Floating>>,
pub d47: Pc7<Input<Floating>>,
pub d48: Pc4<Input<Floating>>,
pub d49: Pc5<Input<Floating>>,
pub miso: Pd11<Input<Floating>>,
pub mosi: Pd8<Input<Floating>>,
pub sck: Pd9<Input<Floating>>,
pub ss: Pd10<Input<Floating>>,
pub flash_sck: Pb10<Input<Floating>>,
pub flash_io0: Pa8<Input<Floating>>,
pub flash_io1: Pa9<Input<Floating>>,
pub flash_io2: Pa10<Input<Floating>>,
pub flash_io3: Pa11<Input<Floating>>,
pub flash_cs: Pb11<Input<Floating>>,
pub neopixel: Pc24<Input<Floating>>,
pub sd_mosi: Pb26<Input<Floating>>,
pub sd_sck: Pb27<Input<Floating>>,
pub sd_cs: Pb28<Input<Floating>>,
pub sd_miso: Pb29<Input<Floating>>,
pub swo: Pb30<Input<Floating>>,
pub sd_cd: Pb31<Input<Floating>>,
pub aref: Pa3<Input<Floating>>,
}
Expand description
Maps the pins to their arduino names and the numbers printed on the board.
Fields
port: Port
Opaque port reference
tx_led: Pc30<Input<Floating>>
rx_led: Pc31<Input<Floating>>
RX LED
Yellow USB serial received LED
a0: Pa2<Input<Floating>>
Logic Pins
All logic pins are 3.3V
PWM capable pins are:
- A1, A2, A12, A15.
- D2-D9, D11, D13-D45, D48, D50-D53.
- MISO, MOSI, SCK, SCL, SDA.
Analog 0
This pin is analog input A0 but is also an analog output due to having a DAC (digital-to-analog converter). This is the first DAC, and is ‘independent’ of A1. You can set the raw voltage to anything from 0 to 3.3V, unlike PWM outputs, this is a true analog output.
a1: Pa5<Input<Floating>>
Analog 1
This pin is analog input A1 but is also an analog output due to having a DAC (digital-to-analog converter). This is the second DAC, and is ‘independent’ of A0. You can set the raw voltage to anything from 0 to 3.3V, unlike PWM outputs this is a true analog output.
a2: Pb3<Input<Floating>>
Analog 2-15
These are each analog input as well as digital I/O pins.
a3: Pc0<Input<Floating>>
a4: Pc1<Input<Floating>>
a5: Pc2<Input<Floating>>
a6: Pc3<Input<Floating>>
a7: Pb4<Input<Floating>>
a8: Pb5<Input<Floating>>
a9: Pb6<Input<Floating>>
a10: Pb7<Input<Floating>>
a11: Pb8<Input<Floating>>
a12: Pb9<Input<Floating>>
a13: Pa4<Input<Floating>>
a14: Pa6<Input<Floating>>
a15: Pa7<Input<Floating>>
uart0_rx: Pb25<Input<Floating>>
Digital GPIO Pins
Digital 0:
RX - GPIO #0, also receive (input) pin for Serial0 (hardware UART) unlike the original Mega this is not used by the USB-to-Serial chip so its free to use
mapped as: uart0_rx pin d0 = b25,
uart0_tx: Pb24<Input<Floating>>
Digital 1:
TX - GPIO #1, also transmit (output) pin for Serial0 (hardware UART) unlike the original Mega this is not used by the USB-to-Serial chip so its free to use
mapped as: uar0_tx pin d1 = b24,
d2: Pc18<Input<Floating>>
Digital 2-13
These are general purpose GPIO.
d3: Pc19<Input<Floating>>
d4: Pc20<Input<Floating>>
d5: Pc21<Input<Floating>>
d6: Pd20<Input<Floating>>
d7: Pd21<Input<Floating>>
d8: Pb18<Input<Floating>>
d9: Pb2<Input<Floating>>
d10: Pb22<Input<Floating>>
d11: Pb23<Input<Floating>>
d12: Pb0<Input<Floating>>
red_led: Pb1<Input<Floating>>
Digital 13
Connected to the red LED marked L (see note below) next to the USB jack. Also PWM output.
mapped as: red_led pin d13 = b1,
uart3_tx: Pb16<Input<Floating>>
Digital 14
TX3 - GPIO #14, to maintain compatibility with the Mega pinout this can also be a Serial TX (on SERCOM5)
mapped as: uart3_tx pin d14 = b16,
uart3_rx: Pb17<Input<Floating>>
Digital 15
RX3 - GPIO #15, to maintain compatibility with the Mega pinout this can also be a Serial RX (on SERCOM5)
mapped as: uart3_rx pin d15 = b17,
uart2_tx: Pc22<Input<Floating>>
Digital 16
TX2 - GPIO #16, to maintain compatibility with the Mega pinout this can also be a Serial TX (on SERCOM1)
mapped as: uart2_tx pin d16 = c22,
uart2_rx: Pc23<Input<Floating>>
Digital 17
RX2 - GPIO #17, to maintain compatibility with the Mega pinout this can also be a Serial RX (on SERCOM1)
mapped as: uart2_rx pin d17 = c23,
uart1_tx: Pb12<Input<Floating>>
Digital 18
TX1 - GPIO #18, to maintain compatibility with the Mega pinout this can also be a Serial TX (on SERCOM4)
mapped as: uart1_tx pin d18 = b12,
uart1_rx: Pb13<Input<Floating>>
Digital 19
RX1 - GPIO #19, to maintain compatibility with the Mega pinout this can also be a Serial RX (on SERCOM4)
mapped as: uart1_rx pin d19 = b13,
sda: Pc16<Input<Floating>>
Digital 20
SDA - GPIO #20, and also I2C (Wire) data pin - This is the same as the SDA above
mapped as: sda pin d20 = c16,
scl: Pc17<Input<Floating>>
Digital 21
SCL - GPIO #21, and also I2C (Wire) clock pin - This is the same as the SCL above. The original Mega had this as a separate I2C port but we have lots of SERCOMs and to keep things simple, we tied them together
mapped as: scl pin d21 = c17,
d22: Pd12<Input<Floating>>
Digital 22-23
These are general purpose GPIO.
d23: Pa15<Input<Floating>>
usb_dm: Pa24<Input<Floating>>
usb_dp: Pa25<Input<Floating>>
Digital 25 USB D+
mapped as: usb_dp pin d25 = a25,
d26: Pa12<Input<Floating>>
Parallel Capture Peripheral (PCC) Pins
There’s a ‘camera’ input peripheral you can use with some camera chips to capture video with 14-bit data width. We thought this was neat so we made sure all those pins were available. Here are the PCC pins (left) and the Grand Central M4 pins it’s mapped to. Unlike other peripherals, you cannot mux these signals to other pins!
Digital 26
PCC: DEN1
d27: Pa13<Input<Floating>>
Digital 27
PCC: DEN2
d28: Pa14<Input<Floating>>
Digital 28
PCC: CLK
d29: Pb19<Input<Floating>>
Digital 29
PCC: XCLK
d30: Pa23<Input<Floating>>
Digital 30
PCC: D7
d31: Pa22<Input<Floating>>
Digital 31
PCC: D6
d32: Pa21<Input<Floating>>
Digital 32
PCC: D5
d33: Pa20<Input<Floating>>
Digital 33
PCC: D4
d34: Pa19<Input<Floating>>
Digital 34
PCC: D3
d35: Pa18<Input<Floating>>
Digital 35
PCC: D2
d36: Pa17<Input<Floating>>
Digital 36
PCC: D1
d37: Pa16<Input<Floating>>
Digital 37
PCC: D0
d38: Pb15<Input<Floating>>
Digital 38
PCC: D9
d39: Pb14<Input<Floating>>
Digital 39
PCC: D8
d40: Pc13<Input<Floating>>
Digital 40
PCC: D11
d41: Pc12<Input<Floating>>
Digital 41
PCC: D10
d42: Pc15<Input<Floating>>
Digital 42
PCC: D13
d43: Pc14<Input<Floating>>
Digital 43
PCC: D12
d44: Pc11<Input<Floating>>
Digital 44-49 These are general purpose GPIO.
d45: Pc10<Input<Floating>>
d46: Pc6<Input<Floating>>
d47: Pc7<Input<Floating>>
d48: Pc4<Input<Floating>>
d49: Pc5<Input<Floating>>
miso: Pd11<Input<Floating>>
Hardware SPI
These are the hardware SPI pins, are are connected to the 2x3 header in the middle of the board. you can use them as everyday GPIO pins (but recommend keeping them free as they are best used for hardware SPI connections for high speed.) Digital 50 MISO - This is the same as the header in the middle of the board when used for SPI
mapped as: miso pin d50 = d11,
mosi: Pd8<Input<Floating>>
Digital 51 MOSI -This is the same as the header in the middle of the board when used for SPI
mapped as: mosi pin d51 = d8,
sck: Pd9<Input<Floating>>
Digital 52 SCK -This is the same as the header in the middle of the board when used for SPI
mapped as: sck pin d52 = d9,
ss: Pd10<Input<Floating>>
Digital 52
SS - This is just named SS for back-compatibility with the Mega’s SPI secondary-select pin.
mapped as: SS pin d53 = d10,
flash_sck: Pb10<Input<Floating>>
QSPI Flash
The QSPI Flash is connected to 6 pins that are not brought out on the GPIO pads. This way you don’t have to worry about the SPI flash colliding with other devices on the main SPI connection.
QSPI is neat because it allows you to have 4 data in/out lines instead of just SPI’s single line in and single line out. This means that QSPI is at least 4 times faster. But in reality is at least 10x faster because you can clock the QSPI peripheral much faster than a plain SPI peripheral.
QSPI Flash SCK
flash_io0: Pa8<Input<Floating>>
flash_io1: Pa9<Input<Floating>>
flash_io2: Pa10<Input<Floating>>
flash_io3: Pa11<Input<Floating>>
flash_cs: Pb11<Input<Floating>>
neopixel: Pc24<Input<Floating>>
NeoPixel
The NeoPixel is connected to pin #88. The NeoPixel is powered by the 3.3V power supply but that hasn’t shown to make a big difference in brightness or color. The NeoPixel is also used by the bootloader to let you know if the device has enumerated correctly (green) or USB failure (red).
NeoPixel Pin
sd_mosi: Pb26<Input<Floating>>
sd_sck: Pb27<Input<Floating>>
sd_cs: Pb28<Input<Floating>>
sd_miso: Pb29<Input<Floating>>
swo: Pb30<Input<Floating>>
sd_cd: Pb31<Input<Floating>>
aref: Pa3<Input<Floating>>
Analog Reference Pin