
The MCR20A Wireless UART application functions as an wireless UART bridge between two (one-to-one) or several (one to many) boards. The application can be used with both a TERM, or with software that is capable of opening a serial port and writing to or reading from it. The characters sent or received are not necessarily ASCII printable characters.
Dependencies: fsl_phy_mcr20a fsl_smac mbed-rtos mbed
Fork of mcr20_wireless_uart by
By default, the application uses broadcast addresses for OTA communication. This way, the application can be directly downloaded and run without any user intervention. The following use case assumes no changes have been done to the project.
- Two (or more) MCR20A platforms (plugged into the FRDM-K64F Freescale Freedom Development platform) have to be connected to the PC using the mini/micro-USB cables.
- The code must be downloaded on the platforms via CMSIS-DAP (or other means).
- After that, two or more TERM applications must be opened, and the serial ports must be configured with the same baud rate as the one in the project (default baud rate is 115200). Other necessary serial configurations are 8 bit, no parity, and 1 stop bit.
- To start the setup, each platform must be reset, and one of the (user) push buttons found on the MCR20A platform must be pressed. The user can press any of the non-reset buttons on the FRDM-K64F Freescale Freedom Development platform as well. *This initiates the state machine of the application so user can start.
Documentation
SMAC Demo Applications User Guide
Diff: FXOS8700Q_TapDetector/FXOS8700Q_TD.h
- Revision:
- 18:b02fc0e53df8
- Parent:
- 17:52cfd7db8da3
- Child:
- 19:71b793021c78
--- a/FXOS8700Q_TapDetector/FXOS8700Q_TD.h Wed Mar 18 18:52:47 2015 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,163 +0,0 @@ -/* Copyright (c) 2010-2011 mbed.org, MIT License -* -* Permission is hereby granted, free of charge, to any person obtaining a copy of this software -* and associated documentation files (the "Software"), to deal in the Software without -* restriction, including without limitation the rights to use, copy, modify, merge, publish, -* distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in all copies or -* substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING -* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef FXOS8700Q_H -#define FXOS8700Q_H - -#include "mbed.h" -// FXOS8700CQ I2C address -#define FXOS8700CQ_SLAVE_ADDR0 (0x1E<<1) // with pins SA0=0, SA1=0 -#define FXOS8700CQ_SLAVE_ADDR1 (0x1D<<1) // with pins SA0=1, SA1=0 -#define FXOS8700CQ_SLAVE_ADDR2 (0x1C<<1) // with pins SA0=0, SA1=1 -#define FXOS8700CQ_SLAVE_ADDR3 (0x1F<<1) // with pins SA0=1, SA1=1 -// FXOS8700CQ internal register addresses -#define FXOS8700Q_STATUS 0x00 -#define FXOS8700Q_OUT_X_MSB 0x01 -#define FXOS8700Q_OUT_Y_MSB 0x03 -#define FXOS8700Q_OUT_Z_MSB 0x05 -#define FXOS8700Q_M_OUT_X_MSB 0x33 -#define FXOS8700Q_M_OUT_Y_MSB 0x35 -#define FXOS8700Q_M_OUT_Z_MSB 0x37 -#define FXOS8700Q_WHOAMI 0x0D -#define FXOS8700Q_XYZ_DATA_CFG 0x0E -#define FXOS8700Q_CTRL_REG1 0x2A -#define FXOS8700Q_M_CTRL_REG1 0x5B -#define FXOS8700Q_M_CTRL_REG2 0x5C -#define FXOS8700Q_WHOAMI_VAL 0xC7 - - -/** -* MMA8451Q accelerometer example -* -* @code -* #include "mbed.h" -* #include "FXOS8700Q.h" -* -* -* int main(void) { -* -* FXOS8700Q combo( A4, A5, FXOS8700Q_I2C_ADDRESS0); -* PwmOut rled(LED_RED); -* PwmOut gled(LED_GREEN); -* PwmOut bled(LED_BLUE); -* -* while (true) { -* rled = 1.0 - combo(acc.getAccX()); -* gled = 1.0 - combo(acc.getAccY()); -* bled = 1.0 - combo(acc.getAccZ()); -* wait(0.1); -* } -* } -* @endcode -*/ - -class FXOS8700Q -{ -public: - /** - * FXOS8700Q constructor - * - * @param sda SDA pin - * @param sdl SCL pin - * @param addr addr of the I2C peripheral - */ - - FXOS8700Q(PinName sda, PinName scl, int addr); - - /** - * FXOS8700Q destructor - */ - ~FXOS8700Q(); - - /** - * Get the value of the WHO_AM_I register - * - * @returns WHO_AM_I value - */ - uint8_t getWhoAmI(); - - /** - * Get X axis acceleration - * - * @returns X axis acceleration - */ - float getAccX(); - - /** - * Get Y axis acceleration - * - * @returns Y axis acceleration - */ - float getAccY(); - - /** - * Get Z axis acceleration - * - * @returns Z axis acceleration - */ - float getAccZ(); - - /** - * Get XYZ axis acceleration in G's - * - * @param res array where acceleration data will be stored - */ - void getAccAllAxis(float * res); - - /** - * Get XYZ axis magnetic readings in micro-teslas - * - * @param res array where acceleration data will be stored - */ - void getMagAllAxis(float * res); - - /** - * Get XYZ axis acceleration, signed 16 bit values - * - * @param res array where acceleration data will be stored - */ - void AccXYZraw(int16_t * d); - - /** - * Get XYZ axis magnetometer readings, signed 16 bit values - * - * @param res array where acceleration data will be stored - */ - void MagXYZraw(int16_t * d); - - /** - * Read FXOS8700Q internal registers - * - * @param Register Address - * @param Pointer to whare results will be stored - * @param Number of registers to read - */ - void readRegs(int addr, uint8_t * data, int len); - - void writeRegs(uint8_t * data, int len); - -private: - I2C m_i2c; - int m_addr; - - - int16_t getAccAxis(uint8_t addr); - -}; - -#endif