Kenji Arai / Mbed 2 deprecated BLE_nRF51822_Monitor

Dependencies:   BLE_API mbed nRF51822 nRF51_Vdd

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mon_hw_common.h Source File

mon_hw_common.h

00001 /*
00002  * mbed Headder file for Hardware Monitor
00003  *
00004  *  Copyright (c) 2014 Kenji Arai / JH1PJL
00005  *  http://www.page.sannet.ne.jp/kenjia/index.html
00006  *  http://mbed.org/users/kenjiArai/
00007  *      Created: June       1st, 2014
00008  *      Revised: Nobember   2nd, 2014
00009  *
00010  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
00011  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
00012  * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
00013  * DAMAGES OR OTHER  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00014  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00015  */
00016  
00017  //  Object ----------------------------------------------------------------------------------------
00018 extern Serial pch(USBTX, USBRX);
00019 
00020 //  Definition ------------------------------------------------------------------------------------
00021 #define BAUD_RATE 9600
00022 
00023 #define BAUD(x)             pch.baud(x)
00024 #define GETC(x)             pch.getc(x)
00025 #define PUTC(x)             pch.putc(x)
00026 #define PRINTF(...)         pch.printf(__VA_ARGS__)
00027 #define READABLE(x)         pch.readable(x)
00028 
00029 // Range check status
00030 #define ERR_NOTHING         0
00031 #define ERR_MODIFY_SIZ      1
00032 #define ERR_OUT_OF_RANGE    2
00033 
00034 // Reg. Size
00035 #define SIZE8               8
00036 #define SIZE16              16
00037 #define SIZE32              32
00038 #define SIZE_FULL           32
00039 #define SIZE_X              32
00040 
00041 //  RAM -------------------------------------------------------------------------------------------
00042 extern char linebuf[];
00043 extern int buf_size;
00044 
00045 #if USE_MEM
00046 typedef struct {
00047     int32_t mstr;
00048     int32_t msiz;
00049     int32_t mtmp;
00050     int32_t mold;
00051     uint8_t  mflg;
00052     uint8_t  mbhw;
00053 } MEMO;
00054 static MEMO mem;
00055 #endif
00056 
00057 //  Function prototypes ---------------------------------------------------------------------------
00058 extern void put_rn ( void );
00059 extern void put_r ( void );
00060 extern void put_lin ( void );
00061 extern void put_spc( uint8_t n);
00062 extern void get_line (char *buff, int len);
00063 extern int xatoi (char **str, int32_t *res);