aboutsummaryrefslogtreecommitdiffstats
path: root/src/avr/gpio.h
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@chown.ath.cx>2018-07-08 00:03:00 +0200
committerKevinOConnor <kevin@koconnor.net>2018-07-08 09:25:11 -0400
commitebd9035325fc3f4ca8e40b06804f3834bbea5a28 (patch)
treef97b8996cfb021ea9fc71382743187869ff8518a /src/avr/gpio.h
parent5c7c8c984b582304d1f1c36de0f1d9bacbd8d42d (diff)
downloadkutter-ebd9035325fc3f4ca8e40b06804f3834bbea5a28.tar.gz
kutter-ebd9035325fc3f4ca8e40b06804f3834bbea5a28.tar.xz
kutter-ebd9035325fc3f4ca8e40b06804f3834bbea5a28.zip
SPI: introduce spi_prepare function
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>
Diffstat (limited to 'src/avr/gpio.h')
-rw-r--r--src/avr/gpio.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/avr/gpio.h b/src/avr/gpio.h
index 515e4c9a..2f769cb9 100644
--- a/src/avr/gpio.h
+++ b/src/avr/gpio.h
@@ -39,6 +39,7 @@ struct spi_config {
uint8_t spcr, spsr;
};
struct spi_config spi_setup(uint32_t bus, uint8_t mode, uint32_t rate);
+void spi_prepare(struct spi_config config);
void spi_transfer(struct spi_config config, uint8_t receive_data
, uint8_t len, uint8_t *data);