FM-test
Dependencies: MODSERIAL mbed-rtos mbed
Fork of Master by
bluetooth.h@3:12e1f116ea42, 2014-09-12 (annotated)
- Committer:
- 9uS7
- Date:
- Fri Sep 12 05:11:39 2014 +0000
- Revision:
- 3:12e1f116ea42
- Parent:
- 2:c610e1a7fbcd
- Child:
- 4:aaaadb45cbd9
hey
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
9uS7 | 0:4f07ba929908 | 1 | #ifndef _INC_MY_BLUETOOTH |
9uS7 | 0:4f07ba929908 | 2 | #define _INC_MY_BLUETOOTH |
9uS7 | 0:4f07ba929908 | 3 | |
9uS7 | 0:4f07ba929908 | 4 | #include "mbed.h" |
9uS7 | 0:4f07ba929908 | 5 | |
9uS7 | 1:e1cfb5850088 | 6 | #define BT_MASTER 0 |
9uS7 | 1:e1cfb5850088 | 7 | #define BT_SLAVE -1 |
9uS7 | 1:e1cfb5850088 | 8 | |
9uS7 | 3:12e1f116ea42 | 9 | #define SYNC_SENSOR 0x10 |
9uS7 | 3:12e1f116ea42 | 10 | #define SYNC_MIC 0x11 |
9uS7 | 3:12e1f116ea42 | 11 | #define SYNC_MOTOR 0x20 |
9uS7 | 3:12e1f116ea42 | 12 | #define SYNC_FM 0x21 |
9uS7 | 3:12e1f116ea42 | 13 | |
9uS7 | 3:12e1f116ea42 | 14 | |
9uS7 | 3:12e1f116ea42 | 15 | |
9uS7 | 3:12e1f116ea42 | 16 | #define PACK_SIZE 20 |
9uS7 | 3:12e1f116ea42 | 17 | |
9uS7 | 0:4f07ba929908 | 18 | typedef union _cvt{ |
9uS7 | 3:12e1f116ea42 | 19 | char byte[4]; |
9uS7 | 3:12e1f116ea42 | 20 | int in; |
9uS7 | 3:12e1f116ea42 | 21 | float fl; |
9uS7 | 0:4f07ba929908 | 22 | } Cvt; |
9uS7 | 0:4f07ba929908 | 23 | |
9uS7 | 1:e1cfb5850088 | 24 | void btSetup(int); //setup(role) role:BT_MASTER or BT_SLAVE |
9uS7 | 0:4f07ba929908 | 25 | |
9uS7 | 3:12e1f116ea42 | 26 | void sync(char, char*, float*); //SYN(option,char_data,float_data); only for MASTER |
9uS7 | 3:12e1f116ea42 | 27 | |
9uS7 | 3:12e1f116ea42 | 28 | void slaveRecieve( void ); |
9uS7 | 3:12e1f116ea42 | 29 | void receiveSensor(float*, float*); |
9uS7 | 3:12e1f116ea42 | 30 | |
9uS7 | 2:c610e1a7fbcd | 31 | //void btLoop(int); //btLoop(role) role:BT_MASTER or BT_SLAVE |
9uS7 | 2:c610e1a7fbcd | 32 | |
9uS7 | 0:4f07ba929908 | 33 | #endif |