Example host software for the Maxim Integrated MAX5715 12-bit 4-channel voltage-output DAC. Hosted on the MAX32625MBED.
Dependencies: MAX5715
Diff: main.cpp
- Revision:
- 4:00b24a55a098
- Parent:
- 3:9db1ff35500e
- Child:
- 5:e9594321c488
--- a/main.cpp Wed May 08 22:09:14 2019 +0000 +++ b/main.cpp Wed May 08 22:11:37 2019 +0000 @@ -66,8 +66,16 @@ // #define D13 P1_0 // example code declare SPI interface -SPI spi(SPI1_MOSI, SPI1_MISO, SPI1_SCK); // mosi, miso, sclk spi1 TARGET_MAX32635MBED: P1_1 P1_2 P1_0 Arduino 10-pin header D11 D12 D13 -DigitalOut spi_cs(SPI1_SS); // TARGET_MAX32635MBED: P1_3 Arduino 10-pin header D10 +#if defined(TARGET_MAX32625MBED) +SPI spi(SPI1_MOSI, SPI1_MISO, SPI1_SCK); // mosi, miso, sclk spi1 TARGET_MAX32625MBED: P1_1 P1_2 P1_0 Arduino 10-pin header D11 D12 D13 +DigitalOut spi_cs(SPI1_SS); // TARGET_MAX32625MBED: P1_3 Arduino 10-pin header D10 +#elif defined(TARGET_MAX32600MBED) +SPI spi(SPI2_MOSI, SPI2_MISO, SPI2_SCK); // mosi, miso, sclk spi1 TARGET_MAX32600MBED: Arduino 10-pin header D11 D12 D13 +DigitalOut spi_cs(SPI2_SS); // Generic: Arduino 10-pin header D10 +#else +SPI spi(D11, D12, D13); // mosi, miso, sclk spi1 TARGET_MAX32600MBED: Arduino 10-pin header D11 D12 D13 +DigitalOut spi_cs(D10); // Generic: Arduino 10-pin header D10 +#endif // example code declare GPIO interface pins DigitalOut LDACb_pin(D9); // Digital Trigger Input to device