aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* spi_software: Implementation of software spiKevin O'Connor2019-02-134-5/+128
| | | | | Signed-off-by: Matt Janus <FragginRight@variabl.es> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Add support for hard pwm via PWM controllerKevin O'Connor2019-02-134-3/+106
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Fix typo in header guardKevin O'Connor2019-02-131-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Enable ADC support for samd51 devices (#1204)Florian Heilmann2019-02-083-19/+100
| | | | | | * adc: Enable ADC support for samd51 devices Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
* atsam: Configure the atsam sram matrix registerKevin O'Connor2019-02-071-0/+11
| | | | | | | | The sram matrix configuration is, bizarrely, configured with a slow default. It will typically add an extra wait state to every memory access. Set the matrix sram controller to improve the performance. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* debugcmds: Add support for reading/writing 32bit valuesKevin O'Connor2019-02-071-29/+25
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Convert code to use armcm_timerKevin O'Connor2019-02-064-123/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Use internal functions for early USB gpio toggleKevin O'Connor2019-02-063-6/+24
| | | | | | | Avoid using the "low-level" library timing utilities. This is in preparation for using SysTick as part of the timer implementation. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Convert code to use armcm_timerKevin O'Connor2019-02-064-67/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Convert code to use armcm_timerKevin O'Connor2019-02-064-190/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Convert SAMD51 to use armcm_timerKevin O'Connor2019-02-063-75/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_timer: Add a generic timer mechanism for ARM CortexM3/M4 chipsKevin O'Connor2019-02-061-0/+136
| | | | | | | | | | | | The ARM CortexM3 (and later) chips almost always have a 32bit timer in the "Debug and Watch Trace" (DWT) unit which resides within the cpu core itself. This timer is generally faster to access than timers located on the chip's peripheral bus. When combined with the standard ARM SysTick timer it provides a (generally) portable mechanism to implement Klipper's software timer mechanism. It's generally also faster than using the vendor specific timers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Initial support for SAMD51Kevin O'Connor2019-01-2816-61/+432
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Add a get_pclock_frequency() helper functionKevin O'Connor2019-01-285-7/+13
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Select the 8K bootloader by defaultKevin O'Connor2019-01-281-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Pass the power management id to enable_pclock()Kevin O'Connor2019-01-289-32/+33
| | | | | | | Pass the power management id instead of the APBCMASK bit to the enable_pclock() function. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Clarify clock generation codeKevin O'Connor2019-01-281-30/+35
| | | | | | | Implement gen_clock() and route_pclock() helpers in an effort to make the code more readable. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usbserial: Allow USB ids to be specified via KconfigKevin O'Connor2019-01-252-7/+21
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* simulator: Fix simulator buildKevin O'Connor2019-01-251-0/+3
| | | | | | Commit b6ccd268 inadvertently broke the simulator build - fix it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Only prompt for CLEAR_PRESCALER and SIMULAVR with LOW_LEVEL_OPTIONSKevin O'Connor2019-01-251-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Move SERIAL_BAUD to src/Kconfig and show with LOW_LEVEL_OPTIONSKevin O'Connor2019-01-257-24/+8
| | | | | | | | Move the definition of SERIAL_BAUD to the main src/Kconfig file. Only show this as an option if the user selects the ability to configure low-level options. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Rename AVR_SERIAL and AVR_USBSERIAL to SERIAL and USBSERIALKevin O'Connor2019-01-252-8/+8
| | | | | | | Rename the config options to be more consistent with other architectures. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Add support for the SAM3X8C micro-controllerKevin O'Connor2019-01-223-0/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Add support for USB on SAM3XKevin O'Connor2019-01-195-26/+268
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Add MACH_SAM3X, MACH_SAM4, MACH_SAM4E, MACH_SAM4S definitionsKevin O'Connor2019-01-188-46/+64
| | | | | | | Add additional Kconfig definitions to make it easier to select the correct code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Implement a median filter on ADC readingsKevin O'Connor2019-01-142-19/+69
| | | | | | | The lpc176x ADC is extremely noisy. Implement a 5 order median filter on each ADC read to weed out obviously incorrect readings. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Add mechanism for entering the bootloader from a USB signalKevin O'Connor2019-01-131-0/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* adccmds: Run gpio_adc_setup() before oid_alloc()Kevin O'Connor2019-01-131-1/+2
| | | | | | | | Order the adc config code so that a shutdown from gpio_adc_setup() doesn't result in analog_in_shutdown() running on a 'struct analog_in' that hasn't yet been configured. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* src: Rename source folders for atsam and atsamd architecturesFlorian Heilmann2019-01-1233-74/+80
| | | Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
* stepper: Fix bug when using a non-zero CONFIG_STEP_DELAY on AVRKevin O'Connor2019-01-111-1/+1
| | | | | | | | Make sure to explicitly cast to 32bit integers when doing math on 16bit integers that require the extra precision as the AVR uses a 16bit int. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Support configuring the stepper pulse length from KconfigKevin O'Connor2019-01-093-15/+41
| | | | | | | Allow the stepper pulse length to be configured at compile time from the Kconfig menu system. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* i2ccmds: Pass the i2c address as a 7-bit number (0-127)Kevin O'Connor2019-01-074-7/+5
| | | | | | | | | | | | | | | | The sam3 i2c code and the linux code use a 7-bit i2c address, while the avr, lpc176x, and samd21 i2c code uses an 8-bit address with the least significant bit always zero. A similar issue occurred in the host code (sx1509.py and replicape.py use 7-bit addresses while uc1701.py and mcp4451.py use 8-bit addresses). Consistently use 7-bit addresses in all the code. This breaks compatibility between host and mcu software, so make a change to the config_i2c command to force users to synchronize software updates. This also breaks common Smoothieboard configs, so update the mcp4451 code to validate the i2c_address. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3: Implement board reset via SAM RSTC hardwareKevin O'Connor2019-01-071-1/+6
| | | | | | | Use the RSTC hardware block to perform a full reset on a "reset" command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3: Add USB support for the SAM4 "UDP" hardwareKevin O'Connor2019-01-076-2/+256
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3: Add support for sam4s8c chipsKevin O'Connor2019-01-0710-8/+222
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3: Add additional SPI and USART buses to spi.cKevin O'Connor2019-01-071-0/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3: Merge sam4e_spi.c into spi.cKevin O'Connor2019-01-074-163/+193
| | | | | | Determine at runtime if the SPI or USART devices should be used. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3: Add enable_pclock() helper functionKevin O'Connor2019-01-0710-22/+32
| | | | | | Add a helper function to enable peripheral clocks. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3: Enable i2c on sam3x8eKevin O'Connor2019-01-073-17/+16
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3: Merge sam4e8e support into sam3 codeKevin O'Connor2019-01-0723-551/+125
| | | | | | | Most of the peripherals on the sam4e8e are similar to the ones on the sam3x8e mcu. Merge the code together and use just one code directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lib: Rename lib/cmsis-sam4e/ to lib/sam4e/Kevin O'Connor2019-01-071-8/+5
| | | | | | This is in preparation for merging the sam3 and sam4 code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3: Rename src/sam3x8e to src/sam3Kevin O'Connor2019-01-0711-10/+10
| | | | | | | This is in preparation for merging sam3 and sam4 code into one directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam4e8e: Move the sam4 cache setup to its own sam4_cache.c fileKevin O'Connor2019-01-073-7/+17
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam4e8e: Use just a single 'chan' member in 'struct gpio_adc'Kevin O'Connor2019-01-072-61/+47
| | | | | | | Remove the 'pin' and 'afec' variables from 'struct gpio_adc'. This is in preparation to merge the sam3x8e and sam4e8e code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam4e8e: Move ADC code to new file afec.cKevin O'Connor2019-01-074-212/+219
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam4e8e: Rename gpio_set_peripheral() to gpio_peripheral()Kevin O'Connor2019-01-075-27/+24
| | | | | | | Use the same definition for gpio_peripheral() that the sam3x8e code uses. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam4e8e: Move gpio_set_peripheral() definition from gpio.h to internal.hKevin O'Connor2019-01-076-38/+51
| | | | | | | | Use internal.h in a similar way to the internal.h in sam3x8e. Also, move the twi pin definitions from internal.h to i2c.c (as they are only used there). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3x8e: Move adc support to a new adc.c fileKevin O'Connor2019-01-073-85/+93
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3x8e: Pass the gpio id directly to gpio_peripheral()Kevin O'Connor2019-01-074-9/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3x8e: Add an internal.h header file with local definitionsKevin O'Connor2019-01-075-15/+23
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>