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 3:4873fd430c38, committed 2015-09-06
- Comitter:
- matsujirushi
- Date:
- Sun Sep 06 05:39:04 2015 +0000
- Parent:
- 2:d0de9c9c66a8
- Commit message:
- Add setProperty().
Changed in this revision
MjSi47xx.cpp | Show annotated file Show diff for this revision Revisions of this file |
MjSi47xx.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r d0de9c9c66a8 -r 4873fd430c38 MjSi47xx.cpp --- a/MjSi47xx.cpp Sun Aug 30 07:32:54 2015 +0000 +++ b/MjSi47xx.cpp Sun Sep 06 05:39:04 2015 +0000 @@ -49,6 +49,17 @@ return true; } +bool MjSi47xx::setProperty(PropertyType property, uint16_t value) +{ + const uint8_t arg[] = { 0x00, property / 0x100, property % 0x100, value / 0x100, value % 0x100, }; + + writeCmd(0x12, arg, sizeof (arg)); // SET_PROPERTY + uint8_t status; + readRes(&status); + + return true; +} + bool MjSi47xx::getIntStatus(bool* stcInt) { if (stcInt == NULL) return false; @@ -161,3 +172,4 @@ i2c->stop(); } +
diff -r d0de9c9c66a8 -r 4873fd430c38 MjSi47xx.h --- a/MjSi47xx.h Sun Aug 30 07:32:54 2015 +0000 +++ b/MjSi47xx.h Sun Sep 06 05:39:04 2015 +0000 @@ -10,11 +10,16 @@ FUNCTION_FM, FUNCTION_AM, }; + + enum PropertyType { + PROPERTY_RX_HARD_MUTE = 0x4001, + }; public: MjSi47xx(I2C* i2c, uint8_t address, DigitalOut* rst_n); void reset(); bool powerUp(FunctionType func); + bool setProperty(PropertyType property, uint16_t value); bool getIntStatus(bool* stcInt); bool fmTuneFrequency(float frequency); bool fmTuneStatus(float* frequency, uint8_t* rssi = NULL, uint8_t* snr = NULL, uint8_t* multipath = NULL);