16 #include "simpletools.h" 19 #define MMA7455_writeMask 1 << 6 // Write mask for setting bit 6 22 int MMA7455_pinDat, MMA7455_pinClk, MMA7455_pinEn;
23 int MMA7455_gRangeVal;
26 void MMA7455_writeByte(
unsigned char address,
unsigned char value)
29 int cmd = address | MMA7455_writeMask;
30 shift_out(MMA7455_pinDat, MMA7455_pinClk, MSBFIRST, 7, cmd);
31 shift_out(MMA7455_pinDat, MMA7455_pinClk, MSBFIRST, 1, 0b0);
32 shift_out(MMA7455_pinDat, MMA7455_pinClk, MSBFIRST, 8, value);