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:b0d8ca64cb0f, committed 2011-03-10
- Comitter:
- Veino
- Date:
- Thu Mar 10 16:07:16 2011 +0000
- Parent:
- 1:663ebf72b607
- Commit message:
- v1.1, some typos fixed
Changed in this revision
| SCA61T.cpp | Show annotated file Show diff for this revision Revisions of this file |
| SCA61T.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/SCA61T.cpp Thu Feb 24 10:36:11 2011 +0000
+++ b/SCA61T.cpp Thu Mar 10 16:07:16 2011 +0000
@@ -24,13 +24,13 @@
// ** Class
-int sel;
+static int sel;
-SCA61T::SCA61T(PinName mosi, PinName miso, PinName sclk, PinName cbs, int device_sel)
+SCA61T::SCA61T(PinName mosi, PinName miso, PinName sclk, PinName csb, int device_sel)
: SPI_m(mosi, miso, sclk)
- , CBS_m(cbs) {
+ , CSB_m(csb) {
sel=device_sel;
- CBS_m=1;
+ CSB_m=1;
SPI_m.frequency(500000);
}
@@ -40,28 +40,28 @@
{
uint8_t reply;
- CBS_m=0;
+ CSB_m=0;
SPI_m.write(reg);
reply = SPI_m.write(0x00);
- CBS_m=1;
+ CSB_m=1;
return reply;
}
void SCA61T::SPI_ReadWord(uint8_t cmd, char* table)
{
- CBS_m=0;
+ CSB_m=0;
SPI_m.write(cmd);
for(int i=0;i<2;i++)
*table++ = SPI_m.write(0x00);
- CBS_m=1;
+ CSB_m=1;
}
void SCA61T::SPI_Command(uint8_t cmd)
{
- CBS_m=0;
+ CSB_m=0;
SPI_m.write(cmd);
- CBS_m=1;
+ CSB_m=1;
}
// ** SCA61T
--- a/SCA61T.h Thu Feb 24 10:36:11 2011 +0000
+++ b/SCA61T.h Thu Mar 10 16:07:16 2011 +0000
@@ -33,7 +33,7 @@
* #include "mbed.h"
* #include "SCA61T.h"
*
-* SCA61T sca61t(p11,p12,p13,p21,0); // MOSI, MISO, SCLK, CBS, device selection
+* SCA61T sca61t(p11,p12,p13,p21,0); // MOSI, MISO, SCLK, CSB, device selection
* // 0=SCA61T-FAHH1G, 1=SCA61T-FA1H1G
* Serial pc(USBTX, USBRX);
*
@@ -51,7 +51,7 @@
class SCA61T {
public:
- SCA61T(PinName mosi, PinName miso, PinName sclk, PinName cbs, int device_sel);
+ SCA61T(PinName mosi, PinName miso, PinName sclk, PinName csb, int device_sel);
~SCA61T() {};
/** Reads the angle
@@ -93,7 +93,7 @@
private:
SPI SPI_m;
- DigitalOut CBS_m;
+ DigitalOut CSB_m;
void SPI_SendByte(uint8_t byte);
uint8_t SPI_ReadReg(uint8_t reg);
SCA61T Inclinometer