aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* tmc2208: Initial support for configuring TMC2208 driversKevin O'Connor2018-08-272-1/+251
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Add support for gpio_x_reset()Kevin O'Connor2018-08-272-12/+28
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pru: Add wrappers for gpio_x_reset()Kevin O'Connor2018-08-272-0/+14
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* simulator: Add support for gpio_x_reset()Kevin O'Connor2018-08-272-0/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* samd21: Add support for gpio_x_reset()Kevin O'Connor2018-08-272-15/+37
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam4e8e: Add support for gpio_x_reset()Kevin O'Connor2018-08-272-30/+38
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3x8e: Add support for gpio_x_reset()Kevin O'Connor2018-08-272-19/+35
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Add support for gpio_x_reset()Kevin O'Connor2018-08-272-15/+44
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Add support for gpio_x_reset()Kevin O'Connor2018-08-272-12/+26
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Don't require 2ms pad in sched_add_timer()Kevin O'Connor2018-08-271-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Disable HAVE_GPIO_BITBANGING on atmega168Kevin O'Connor2018-08-271-1/+1
| | | | | | | The atmega168 doesn't have enough flash space to fit all features - disable the "bit banging" interfaces to make room. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* samd21: Enable HAVE_GPIO_BITBANGINGKevin O'Connor2018-08-271-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Rename HAVE_USER_INTERFACE to HAVE_GPIO_BITBANGINGKevin O'Connor2018-08-277-7/+7
| | | | | | | Rename the HAVE_USER_INTERFACE definition in preparation for other "bit banging" interfaces. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam4e8e: Use local copy of bossac for flashingKevin O'Connor2018-08-271-3/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3x8e: Use local copy of bossac for flashingKevin O'Connor2018-08-271-3/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam4e8e: Fix bug in sam4e gpio.c (#563)Florian Heilmann2018-08-242-5/+14
| | | | | The bank_id was calculated erroneously. Also unify gpio_in_setup and gpio_out_setup a bit. Also disable make flash for the sam4e8e port as it currently references a version of bossac that is not present on all systems. Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
* samd21: Fix description of bootloader offsetKevin O'Connor2018-08-081-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam4e8e: Add the SAM4e8e portFlorian Heilmann2018-08-089-0/+780
| | | | | | | | This can be flashed to e.g. the duet wifi using bossac. It requires a later version as is currently included in the klipper repo (1.8 vs. 1.2). Comms are currently via UART0 only, USB serial is still TBD Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
* samd21: Minor fixes to usbserialKevin O'Connor2018-08-081-7/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* samd21: Add support for USBKevin O'Connor2018-08-073-0/+237
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* samd21: Add support for gpio pinsKevin O'Connor2018-08-073-0/+110
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* samd21: Initial support for SAMD21 micro-controllersKevin O'Connor2018-08-079-0/+351
| | | | | | Add initial support for the Atmel SAMD21 micro-controllers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_irq: Enhance clear_active_irq() so it works on cortex-m0Kevin O'Connor2018-08-061-2/+3
| | | | | | | Minor rework of the assembler so that it does not require thumb-2 instructions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Allow USB endpoint ids to be board specificKevin O'Connor2018-08-065-9/+26
| | | | | | | | It's common for boards to have restrictions on the type of each endpoint. So, make it possible for the board to select the endpoint ids for each endpoint. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Use common cmsis-core filesKevin O'Connor2018-08-061-2/+2
| | | | | | | No need to include separate cmsis files from the mbed project - the standard CMSIS_5 files work fine. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3x8e: Use SAM3X CMSIS files instead of arduino CMSIS filesKevin O'Connor2018-08-061-6/+6
| | | | | | | | | Update the sam3x8e port use the most recent SAM3X CMSIS files from Atmel. The Atmel files appear to have a more consistent license and it is unclear if there were Arduino specific changes in the CMSIS files obtained from the Arduino repo. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* thermocouple: Minor fixesKevin O'Connor2018-07-251-6/+5
| | | | | | | | | | Send the temperature before checking for an out of range error (that makes it easier to debug). The query_thermocouple clock parameter is unpredictable and a value of zero can't be used to disable the query - use rest_ticks instead. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* thermocouple: Add support for MAX6675 chipRicardo Amezquita2018-07-241-3/+21
| | | | | | | The MAX6675 chip has a different read sequence than the MAX31855 chip. Signed-off-by: Ricardo Amézquita <ramezquitao@cihologramas.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* thermocouple: Add initial support for common SPI temperature sensing chipsKevin O'Connor2018-07-244-2/+197
| | | | | Signed-off-by: Petri Honkala <cruwaller@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* linux: Add support for bi-directional SPI communicationRicardo Amezquita2018-07-242-5/+33
| | | | | Signed-off-by: Ricardo Amézquita <ramezquitao@cihologramas.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Add support for SPIKevin O'Connor2018-07-184-0/+91
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atmega1284p: Add choice between UART0 or UART1 to KconfigPascal Albert2018-07-131-1/+12
| | | | Signed-off-by: Pascal Albert <lucky@foxserver.org>
* spidev: Minor rework to spidev_transfer()Kevin O'Connor2018-07-111-7/+7
| | | | | | | Gcc does a better job of inlining code if spidev_transfer() is reworked slightly. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3x8e: Configure spi transfer in spi_prepare()Kevin O'Connor2018-07-111-2/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Configure spi transfer in spi_prepare()Kevin O'Connor2018-07-111-4/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* simulator: Rework dummy simulator code to user timer_irq / serial_irqKevin O'Connor2018-07-116-109/+165
| | | | | | | | | Change the simulator to use the generic timer_irq.c and serial_irq.c code for (dummy) timer and io handling. This is just to make the code a better example for other developers (most micro-controllers will use the timer_irq.c and serial_irq.c code). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: implement spi_prepareGrigori Goronzy2018-07-081-3/+2
| | | | | | | | | | | | | | | | | | Implement spi_prepare to fix the undefined behavior on SPI transaction start. Tested with the following command sequence: allocate_oids count=2 config_spi oid=0 bus=0 pin=PA8 mode=3 rate=1000000 shutdown_msg= config_spi oid=1 bus=0 pin=PA8 mode=1 rate=1000000 shutdown_msg= spi_send oid=0 data=30313233343536373839 spi_transfer oid=1 data=3031 Discussion about this here: https://github.com/KevinOConnor/klipper/pull/453#issuecomment-403131149 Signed-off-by: Grigori Goronzy <greg@chown.ath.cx>
* SPI: introduce spi_prepare functionGrigori Goronzy2018-07-0811-0/+30
| | | | | | | | | | | | | | | | The SPI interface needs to be enabled and configured to the correct settings of a given oid before CS is asserted. The new function spi_prepare() allows ports to do that. This port only introduces the new function in all ports with no implementation and adds the call to the Klipper generic firmware code. That means everything still works as before. Ports need to be changed to fix the underlying issue. Discussion about the motivation here: https://github.com/KevinOConnor/klipper/pull/453#issuecomment-403131149 Signed-off-by: Grigori Goronzy <greg@chown.ath.cx>
* stm32f1: add SPI supportGrigori Goronzy2018-07-074-0/+118
| | | | | | | | | Add basic SPI support and associated documentation. v2: remove baud rate check, fix baud rate calculations v3: finish transaction with BSY check, disable SPI when not in use Signed-off-by: Grigori Goronzy <greg@chown.ath.cx>
* sam3x8e: Read from the SPI_RDR on SPI send even if no data neededKevin O'Connor2018-07-051-8/+9
| | | | | | Be sure to read the SPI_RDR as that clears the RDRF flag. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* adccmds: Add support for min/max temperature check filteringKevin O'Connor2018-07-021-3/+12
| | | | | | | | | | | Extend the ADC out of range check so that it is possible to sample multiple times before going into a shutdown state. This reduces the chance that measurement noise will cause an error. In an actual over temperature (or under temperature event) it is expected that the sensor will consistently report the problem, so extra checks for an additional second or two should not substantially increase risk. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buttons: Add initial support for detecting button pressesKevin O'Connor2018-06-302-1/+161
| | | | | | | Add mcu support for periodically polling for a button press. Add host code support for registering buttons and invoking callbacks for them. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcp4451: Add initial support for programming the mcp4451 on lpc176xKevin O'Connor2018-06-292-1/+101
| | | | | | Add support for programming smoothieboard current. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Cleanup whitespace errorsKevin O'Connor2018-06-281-4/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: fix ADC pin listGrigori Goronzy2018-06-271-1/+1
| | | | | | | For some reason, the upper two pin definitions were missing. Found while writing the port documentation. Signed-off-by: Grigori Goronzy <greg@chown.ath.cx>
* gpiocmds: Add update_digital_out commandKevin O'Connor2018-06-271-0/+15
| | | | | | | Add a command that can immediately set the value of a digital output pin created with config_digital_out. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Don't set SS high on spi_init()Kevin O'Connor2018-06-271-1/+3
| | | | | | | | | | The AVR requires that the SS pin be an output pin for correct SPI operation. Some boards use the SS pin to control devices separate from SPI, however. Don't change the output level if the pin is already an output, and prefer setting it low if it is not already an output pin. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pru: Disable ADC reading directly from the PRUKevin O'Connor2018-06-271-1/+1
| | | | | | | | The PRU code size has grown too close to the maximum - remove the ADC code to reduce its overall size. (On the beaglebone, the Linux process can, and typically does, do the ADC reading.) Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lcd_st7920: Use a longer delay at the start of each command/dataKevin O'Connor2018-06-221-9/+27
| | | | | | | | | | | It appears the st7920 requires a longer delay when switching from command to data mode (and vice-versa). Slower MCUs don't show a problem because the klipper command processing time results in a sufficient delay. However, some of the faster MCUs can process klipper commands fast enough that the next st7920 transfer is sent too fast. Add an additional delay to account for this. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Build with LCD supportKevin O'Connor2018-06-181-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>