
MT-D21E
User Guide
* There are two ways that pins can be mapped. The first is to map pins contiguously
* (no PIO_NOT_A_PIN entries) in the table. This results in the least amount of space
* used by the table. A second method, used by default by the MT-D21E and MT-D11, maps
* Arduino pin numbers to the actual port pin number (ie: Arduino pin 28 = Port A28).
* This only works when there is one port. Because not all port pins are available,
* PIO_NOT_A_PIN entries must be added for these pins and more FLASH space is consumed.
* For an example of both types, see variant.cpp from the MT-D11 variant.
*
* Explanation of PinDescription table:
*
* Port This is the port (ie: PORTA).
* Pin This is the pin (bit) within the port. Valid values are 0-31.
* PinType This indicates what peripheral function the pin can be
* attached to. In most cases, this is PIO_MULTI, which means
* that the pin can be anything listed in the PinAttribute field.
* It can also be set to a specific peripheral. In this case, any
* attempt to configure the pin (using pinPeripheral or pinMode)
* as anything else will fail (and pinPeripheral will return -1).
* This can be used to prevent accidental re-configuration of a
* pin that is configured for only one function (ie: USB D- and
* D+ pins). If a pin is not used or does not exist,
* PIO_NOT_A_PIN must be entered in this field. See WVariant.h
* for valid entries. These entries are also used as a parameter
* to pinPeripheral() with the exception of PIO_NOT_A_PIN and
* PIO_MULTI. The pinMode function now calls pinPeripheral() with
* the desired mode. Note that this field is not used to select
* between the two peripherals possible with each of the SERCOM
* and TIMER functions. PeripheralAttribute is now used for this.
* PeripheralAttribute This is an 8-bit bitfield used for various peripheral
* configuration. It is primarily used to select between the two
* peripherals possible with each of the SERCOM and TIMER
* functions. TIMER pins are individual, while SERCOM uses a
* group of two to four pins. This group of pins can span both
* peripherals. For example, pin 19 (SPI1 SCK) on the MT-D21E
* uses PER_ATTR_SERCOM_ALT while pin 22 (SPI1 MISO) uses
* PER_ATTR_SERCOM_STD. Both TIMER and SERCOM can exist for each
* pin. This bitfield is also used to set the pin drive strength.
* In the future, other attributes (like input buffer
* configuration) may be added. See WVariant.h for valid entries.
* PinAttribute This is a 32-bit bitfield used to list all of the valid
* peripheral functions that a pin can attach to. This includes
* GPIO functions like PIN_ATTR_OUTPUT. Certain attributes are
* shorthand for a combination of other attributes.
* PIN_ATTR_DIGITAL includes all of the GPIO functions, while
* PIN_ATTR_TIMER includes both PIN_ATTR_TIMER_PWM and
* PIN_ATTR_TIMER_CAPTURE (capture is not used yet).
* PIN_ATTR_ANALOG is an alias to PIN_ATTR_ANALOG_ADC. There is
* only one DAC channel, so PIN_ATTR_DAC appears only once. This
* bitfield is useful for limiting a pin to only input related
* functions or output functions. This allows a pin to have a
* more flexible configuration, while restricting the direction
* (ie: to avoid contention). See WVariant.h for valid entries.
* TCChannel This is the TC(C) channel (if any) assigned to the pin. Some
* TC channels are available on multiple pins (ie: TCC0/WO[0] is
* available on pin A4 or pin A8 on the MT-D21E). In general,
* only one pin should be configured (in the pinDescription
* table) per TC channel. See WVariant.h for valid entries.
* The tone library uses TC5 (MT-D21E) or TC2 (MT-D11).
* ADCChannelNumber This is the ADC channel (if any) assigned to the pin. See
* WVariant.h for valid entries.
July 11, 2016
23