From 8d0d2c8e8bb5e9a6917a45a68a91eb4cbfe6bf6e Mon Sep 17 00:00:00 2001 From: Takuya Sasaki Date: Mon, 6 Nov 2023 17:39:37 +0900 Subject: [PATCH] spi: Fix adcs main --- adcs/src/main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/adcs/src/main.c b/adcs/src/main.c index b430bea4..476b5960 100644 --- a/adcs/src/main.c +++ b/adcs/src/main.c @@ -17,7 +17,7 @@ int main(void) struct spi_config config; struct spi_buf tx_buf[1]; struct spi_buf rx_buf[1]; - const struct device *const dev = DEVICE_DT_GET(DT_NODELABEL(spi1)); + const struct device *const dev = DEVICE_DT_GET(DT_NODELABEL(spi3)); /* Request Status Register 1 Instruction */ struct spi_buf_set tx_set = { .buffers = tx_buf, .count = 1 }; @@ -25,7 +25,7 @@ int main(void) /* Enable IMU */ printk("Enable IMU power\n"); - //sc_adcs_power_enable(IMU_PWR); + sc_adcs_power_enable(IMU_PWR); /* Reset */ sys_write32(0x01, 0x50000000 + 0x0004); @@ -40,12 +40,11 @@ int main(void) config.operation = SPI_OP_MODE_MASTER | SPI_LINES_SINGLE | SPI_WORD_SET(8); - //txbuf[0] = 0x81; - txbuf[0] = 0x06; + txbuf[0] = 0x82; tx_buf[0].buf = txbuf; tx_buf[0].len = 1; rx_buf[0].buf = rxbuf; - rx_buf[0].len = 2; + rx_buf[0].len = 1; ret = spi_transceive(dev, &config, &tx_set, &rx_set); if (ret < 0) {