|
| 1 | +/* |
| 2 | + * Copyright (c) 2018 MattairTech LLC. All right reserved. |
| 3 | + * |
| 4 | + * This library is free software; you can redistribute it and/or |
| 5 | + * modify it under the terms of the GNU Lesser General Public |
| 6 | + * License as published by the Free Software Foundation; either |
| 7 | + * version 2.1 of the License, or (at your option) any later version. |
| 8 | + * |
| 9 | + * This library is distributed in the hope that it will be useful, |
| 10 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 12 | + * See the GNU Lesser General Public License for more details. |
| 13 | + * |
| 14 | + * You should have received a copy of the GNU Lesser General Public |
| 15 | + * License along with this library; if not, write to the Free Software |
| 16 | + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 17 | + */ |
| 18 | + |
| 19 | +#ifndef _CONFIG_H_ |
| 20 | +#define _CONFIG_H_ |
| 21 | + |
| 22 | +/* Currently, there are only two options in the menu, to enable or disable config.h. |
| 23 | + * When config.h is enabled, comment out lines to disable individual options. |
| 24 | + */ |
| 25 | +#if defined(CONFIG_H_ENABLED) |
| 26 | + |
| 27 | + /* The standard PinDescription table uses 12 bytes per pin. Define PIN_DESCRIPTION_TABLE_SIMPLE |
| 28 | + * to use a more compact format that uses only 4 bytes per pin (currently only available |
| 29 | + * for the D11 chips). In this case, the PinType, PinAttribute, and GCLKCCL columns are not used |
| 30 | + * (they are not required). Additionally, the SetPortPin() and SetExtIntADC() macros are used to |
| 31 | + * pack Port and Pin into the PortPin column, and ExtInt and ADCChannelNumber into the ExtIntADC |
| 32 | + * column. See the variant README.md for more information. Note that external libraries that |
| 33 | + * reference the PinDescription table directly (uncommon) will no longer work. This define can be |
| 34 | + * combined with the PIN_MAP_COMPACT define, which is available in variant.h of the D11 variants. |
| 35 | + * This can save from 10's to over 250 bytes. |
| 36 | + * |
| 37 | + * Note that when using this define, EXTERNAL_INT_15 and the EXTERNAL_INT_NMI are NOT available |
| 38 | + * and only ADC_Channel0 through ADC_Channel14 are available. |
| 39 | + */ |
| 40 | + //#define PIN_DESCRIPTION_TABLE_SIMPLE |
| 41 | + |
| 42 | + /* Define PIN_PERIPHERAL_CHECKS_DISABLED to disable some sanity and other checks at the beginning |
| 43 | + * of pinPeripheral() (ie: out of bounds access, pin isn't usable as PIO, verify hardware peripheral |
| 44 | + * requested actually exists on pin). This saves about 100 bytes. |
| 45 | + */ |
| 46 | + #define PIN_PERIPHERAL_CHECKS_DISABLED |
| 47 | + |
| 48 | + /* Define ADC_NO_INIT_IF_UNUSED and/or REF_NO_INIT_IF_UNUSED to save the code space used by the |
| 49 | + * initialization functions of the ADC, DAC, and REF, if they are not used by the core. Do not |
| 50 | + * set this define if an external library is used for the ADC, DAC, or REF, as that library probably |
| 51 | + * expects the associated hardware to be already initialized. Note that if using a core function |
| 52 | + * (ie: analogWrite()), initialization will still occur automatically. This saves about 350 bytes |
| 53 | + * with ADC_NO_INIT_IF_UNUSED and 50 bytes with DAC_NO_INIT_IF_UNUSED. |
| 54 | + */ |
| 55 | + #define ADC_NO_INIT_IF_UNUSED |
| 56 | + #define DAC_NO_INIT_IF_UNUSED |
| 57 | + |
| 58 | + /* Define DISABLE_ADC_CALIBRATION to disable ADC calibration using the NVM factory values, which |
| 59 | + * occurs during initialization, and save a few bytes. This setting is not generally recommended. |
| 60 | + */ |
| 61 | + //#define DISABLE_ADC_CALIBRATION |
| 62 | + |
| 63 | + /* Define TRUST_RESET_DEFAULTS to avoid writing default values into registers during hardware |
| 64 | + * initialization, saving about 50 bytes (currently). |
| 65 | + */ |
| 66 | + #define TRUST_RESET_DEFAULTS |
| 67 | + |
| 68 | + /* Define NO_ADDITIONAL_GCLKS to disable initialization of GENERIC_CLOCK_GENERATOR_192MHz (D51) and |
| 69 | + * GENERIC_CLOCK_GENERATOR_48MHz (all others), which are currently unused in the core. This currently |
| 70 | + * saves about 48 bytes. |
| 71 | + */ |
| 72 | + #define NO_ADDITIONAL_GCLKS |
| 73 | + |
| 74 | + /* Define NO_OSC_HS_GCLK to disable initialization of GENERIC_CLOCK_GENERATOR_OSC_HS, which is setup |
| 75 | + * to run at 8MHz with the D21, D11, and L21, but is unused by the core. This saves about 30 bytes. |
| 76 | + */ |
| 77 | + #define NO_OSC_HS_GCLK |
| 78 | + |
| 79 | + /* Define NO_DELAY_HIGH_WORD to disable the high word variable (_ulTickCountHighWord) in delay.c, |
| 80 | + * which is used to allow counting beyond the 50-day maximum (for a 32-bit variable counting in |
| 81 | + * milliseconds). This saves about 64 bytes. |
| 82 | + */ |
| 83 | + #define NO_DELAY_HIGH_WORD |
| 84 | +#endif |
| 85 | + |
| 86 | +#endif // _CONFIG_H_ |
0 commit comments