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.
Fork of mbed by
Diff: SPI.h
- Revision:
- 101:7cff1c4259d7
- Parent:
- 98:8ab26030e058
- Child:
- 102:da0ca467f8b5
--- a/SPI.h Wed May 27 08:07:35 2015 +0100 +++ b/SPI.h Tue Jun 09 14:29:26 2015 +0100 @@ -45,10 +45,21 @@ * * #include "mbed.h" * + * // hardware ssel (where applicable) + * //SPI device(p5, p6, p7, p8); // mosi, miso, sclk, ssel + * + * // software ssel * SPI device(p5, p6, p7); // mosi, miso, sclk + * DigitalOut cs(p8); // ssel * * int main() { + * // hardware ssel (where applicable) + * //int response = device.write(0xFF); + * + * // software ssel + * cs = 0; * int response = device.write(0xFF); + * cs = 1; * } * @endcode */ @@ -58,16 +69,14 @@ /** Create a SPI master connected to the specified pins * - * Pin Options: - * (5, 6, 7) or (11, 12, 13) - * * mosi or miso can be specfied as NC if not used * * @param mosi SPI Master Out, Slave In pin * @param miso SPI Master In, Slave Out pin * @param sclk SPI Clock pin + * @param ssel SPI chip select pin */ - SPI(PinName mosi, PinName miso, PinName sclk, PinName _unused=NC); + SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel=NC); /** Configure the data transmission format *