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.
Revision 2:81f5716e32f7, committed 2018-08-21
- Comitter:
- mcm
- Date:
- Tue Aug 21 15:44:32 2018 +0000
- Parent:
- 1:ba1b5b4001f7
- Commit message:
- cs pin was forgotten, now the chip selects works as expected.
Changed in this revision
MCP41XXX_42XXX.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/MCP41XXX_42XXX.cpp Tue Aug 21 15:26:49 2018 +0000 +++ b/MCP41XXX_42XXX.cpp Tue Aug 21 15:44:32 2018 +0000 @@ -62,7 +62,9 @@ /* Make the command byte and the new wiper value, update the register then */ cmd[0] = (char)( MCP41XXX_42XXX_COMMAND_WRITE_DATA | myChannel ); cmd[1] = (char)myWiperValue.Dn; + _cs = 0; mySPI_status = _spi.write ( &cmd[0], sizeof( cmd )/sizeof( cmd[0] ), &cmd[0], 0 ); + _cs = 1; @@ -108,7 +110,9 @@ /* Make the command byte, the new wiper value does not take place, update the register then */ cmd[0] = (char)( MCP41XXX_42XXX_COMMAND_SHUTDOWN | myChannel ); cmd[1] = 0; + _cs = 0; mySPI_status = _spi.write ( &cmd[0], sizeof( cmd )/sizeof( cmd[0] ), &cmd[0], 0 ); + _cs = 1;