Skip to content

Pass ssel PinName to spi_init() for hardware assisted SSEL control. #930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libraries/mbed/api/SPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ class SPI {
* @param mosi SPI Master Out, Slave In pin
* @param miso SPI Master In, Slave Out pin
* @param sclk SPI Clock pin
* @param ssel SPI Clock 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
*
Expand Down
4 changes: 2 additions & 2 deletions libraries/mbed/common/SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

namespace mbed {

SPI::SPI(PinName mosi, PinName miso, PinName sclk, PinName _unused) :
SPI::SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel) :
_spi(),
_bits(8),
_mode(0),
_hz(1000000) {
spi_init(&_spi, mosi, miso, sclk, NC);
spi_init(&_spi, mosi, miso, sclk, ssel);
spi_format(&_spi, _bits, _mode, 0);
spi_frequency(&_spi, _hz);
}
Expand Down