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: max32625pico maxim-dev mbed-rtos USBDevice
Fork of PICO_USB_I2C_SPI by
Diff: main.cpp
- Revision:
- 9:e59eb5f5ce32
- Parent:
- 8:9b85634550c7
- Child:
- 10:a3f06fa13bda
--- a/main.cpp Wed Dec 14 19:53:25 2016 +0000 +++ b/main.cpp Thu Dec 15 03:57:28 2016 +0000 @@ -13,13 +13,17 @@ // Virtual serial port over USB USBSerial microUSB; -// Serial Interface Adapter -SerialInterface serInt; +// Hardware serial port over DAPLink +Serial daplink(P2_1, P2_0); // Serial Interfaces I2C i2c(P3_4, P3_5); SPI spi(P5_1, P5_2, P5_0); DigitalInOut gpio[] = {P5_3, P5_4, P5_5, P5_6, P3_0, P3_1, P3_2, P3_3}; +AnalogIn ain[] = {AIN_0, AIN_1, AIN_2, AIN_3, AIN_4, AIN_5, AIN_6, AIN_7}; + +// Serial Interface Adapter +SerialInterface serInt(i2c, spi); // Threads Thread threadUSB; @@ -63,8 +67,6 @@ void uart_thread() { -// Hardware serial port over DAPLink - Serial daplink(P2_1, P2_0); char obuf[UART_MAX_RESP_LENGTH+1]; char ibuf[UART_MAX_CMD_LENGTH+1]; int i = 0; @@ -107,7 +109,7 @@ pegasus.init(MAX32630FTHR::VIO_3V3); // Serial Interface Setup - serInt.init(&i2c, &spi, gpio); + serInt.init(gpio, ain); gpio[0].write(1); gpio[0].output();