Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MAX5715
Diff: main.cpp
- Revision:
- 5:e9594321c488
- Parent:
- 4:00b24a55a098
- Child:
- 6:0bfe0d990850
diff -r 00b24a55a098 -r e9594321c488 main.cpp --- a/main.cpp Wed May 08 22:11:37 2019 +0000 +++ b/main.cpp Thu May 16 19:05:16 2019 +0000 @@ -36,7 +36,10 @@ #include "mbed.h" //#include "max32625.h" #include "MAX5715.h" -#include "USBSerial.h" + +// optional: serial port +//#include "USBSerial.h" +Serial serial(USBTX, USBRX); // tx, rx // example code board support //MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3); @@ -44,26 +47,27 @@ //DigitalOut gLED(LED2); //DigitalOut bLED(LED3); // -// Arduino connector port definitions (MAX32625MBED shown) -// optional: uncomment these lines, update port definitions for other target board -// #define A0 AIN_0 -// #define A1 AIN_1 -// #define A2 AIN_2 -// #define A3 AIN_3 -// #define D0 P0_0 -// #define D1 P0_1 -// #define D2 P0_2 -// #define D3 P0_3 -// #define D4 P0_4 -// #define D5 P0_5 -// #define D6 P0_6 -// #define D7 P0_7 +// Arduino "shield" connector port definitions (MAX32625MBED shown) +#if defined(TARGET_MAX32625MBED) +#define A0 AIN_0 +#define A1 AIN_1 +#define A2 AIN_2 +#define A3 AIN_3 +#define D0 P0_0 +#define D1 P0_1 +#define D2 P0_2 +#define D3 P0_3 +#define D4 P0_4 +#define D5 P0_5 +#define D6 P0_6 +#define D7 P0_7 #define D8 P1_4 #define D9 P1_5 -// #define D10 P1_3 -// #define D11 P1_1 -// #define D12 P1_2 -// #define D13 P1_0 +#define D10 P1_3 +#define D11 P1_1 +#define D12 P1_2 +#define D13 P1_0 +#endif // example code declare SPI interface #if defined(TARGET_MAX32625MBED) @@ -92,6 +96,16 @@ // example code main function int main() { + // example code: serial port banner message +#if defined(TARGET_MAX32625MBED) + serial.printf("MAX32625MBED "); +#elif defined(TARGET_MAX32600MBED) + serial.printf("MAX32600MBED "); +#elif defined(TARGET_NUCLEO_F446RE) + serial.printf("NUCLEO_F446RE "); +#endif + serial.printf("MAX5715BOB\r\n"); + //MAX5715 dac(spi, spi_cs, MAX5715::MAX5715_IC); //dac.Init();