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.
Fork of Sean_AdiSense1000_V21 by
inc/ble_interface/bl652.h@36:4aded4b4f060, 2018-10-25 (annotated)
- Committer:
- nfathurr
- Date:
- Thu Oct 25 08:59:30 2018 +0000
- Revision:
- 36:4aded4b4f060
- Parent:
- 34:029fc3b83f78
modified output into one line
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nfathurr | 34:029fc3b83f78 | 1 | #ifndef __BL652_H_ |
nfathurr | 34:029fc3b83f78 | 2 | #define __BL652_H_ |
nfathurr | 34:029fc3b83f78 | 3 | |
nfathurr | 34:029fc3b83f78 | 4 | |
nfathurr | 34:029fc3b83f78 | 5 | /******************************************************************************/ |
nfathurr | 34:029fc3b83f78 | 6 | /* Include Files */ |
nfathurr | 34:029fc3b83f78 | 7 | /******************************************************************************/ |
nfathurr | 34:029fc3b83f78 | 8 | |
nfathurr | 34:029fc3b83f78 | 9 | #include <stdint.h> |
nfathurr | 34:029fc3b83f78 | 10 | |
nfathurr | 34:029fc3b83f78 | 11 | /******************************************************************************/ |
nfathurr | 34:029fc3b83f78 | 12 | /* BLE parameters */ |
nfathurr | 34:029fc3b83f78 | 13 | /******************************************************************************/ |
nfathurr | 34:029fc3b83f78 | 14 | |
nfathurr | 34:029fc3b83f78 | 15 | //size of buffers used |
nfathurr | 34:029fc3b83f78 | 16 | #define BLE_PACKET_SIZE 20 |
nfathurr | 34:029fc3b83f78 | 17 | |
nfathurr | 34:029fc3b83f78 | 18 | //parameters for da14580 |
nfathurr | 34:029fc3b83f78 | 19 | #define RESET_LENGTH 10 //ms |
nfathurr | 34:029fc3b83f78 | 20 | |
nfathurr | 34:029fc3b83f78 | 21 | #define BLE_TX_PACKET_DELAY 100 //ms |
nfathurr | 34:029fc3b83f78 | 22 | |
nfathurr | 34:029fc3b83f78 | 23 | #define AT_COMMAND_DELIMITER '\r' |
nfathurr | 34:029fc3b83f78 | 24 | |
nfathurr | 34:029fc3b83f78 | 25 | #define AT_COMMAND_ERROR "ERROR" |
nfathurr | 34:029fc3b83f78 | 26 | |
nfathurr | 34:029fc3b83f78 | 27 | |
nfathurr | 34:029fc3b83f78 | 28 | /******************************************************************************/ |
nfathurr | 34:029fc3b83f78 | 29 | /* Function Prototypes */ |
nfathurr | 34:029fc3b83f78 | 30 | /******************************************************************************/ |
nfathurr | 34:029fc3b83f78 | 31 | |
nfathurr | 34:029fc3b83f78 | 32 | //boot BLE module |
nfathurr | 34:029fc3b83f78 | 33 | uint32_t Bl652_Boot( void ); |
nfathurr | 34:029fc3b83f78 | 34 | |
nfathurr | 34:029fc3b83f78 | 35 | //Write to BLE over UART |
nfathurr | 34:029fc3b83f78 | 36 | uint32_t Bl652_Write( char *txBuffer, uint32_t byteCount ); |
nfathurr | 34:029fc3b83f78 | 37 | |
nfathurr | 34:029fc3b83f78 | 38 | //Read from BLE over UART |
nfathurr | 34:029fc3b83f78 | 39 | uint32_t Bl652_Read( char *rxBuffer, uint32_t byteCount ); |
nfathurr | 34:029fc3b83f78 | 40 | |
nfathurr | 34:029fc3b83f78 | 41 | //setup for callback based read |
nfathurr | 34:029fc3b83f78 | 42 | uint32_t Bl652_SetupReadCb( void *rxBuffer, uint32_t maxSize, volatile bool *bMessageReadFlag ); |
nfathurr | 34:029fc3b83f78 | 43 | |
nfathurr | 34:029fc3b83f78 | 44 | //clear read callback |
nfathurr | 34:029fc3b83f78 | 45 | uint32_t Bl652_ClearCb( void ); |
nfathurr | 34:029fc3b83f78 | 46 | |
nfathurr | 34:029fc3b83f78 | 47 | //wait until BLE is awake |
nfathurr | 34:029fc3b83f78 | 48 | uint32_t Bl652_WaitUntilAvailable( void ); |
nfathurr | 34:029fc3b83f78 | 49 | |
nfathurr | 34:029fc3b83f78 | 50 | uint32_t Bl652_Printf(const char *format, ...); |
nfathurr | 34:029fc3b83f78 | 51 | |
nfathurr | 34:029fc3b83f78 | 52 | #endif |