HW layer for the Nucleo board, it only work with old BLE_API

Dependents:   Hello_BLE F446RE-BLE

Fork of X_NUCLEO_IDB0XA1 by ST

Committer:
mridup
Date:
Wed Nov 12 09:41:31 2014 +0000
Revision:
61:929885305c17
Parent:
58:027c65a54097
Configuration of pinNames according to platforms. Platform.h defines all tested platform pins used for configuration and testing. Device Init configuration parameters.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hemddabral 12:a5d7db4a1e49 1 /* mbed Microcontroller Library
hemddabral 58:027c65a54097 2 * Copyright (c) 2006-2013 ARM Limited
hemddabral 58:027c65a54097 3 *
hemddabral 58:027c65a54097 4 * Licensed under the Apache License, Version 2.0 (the "License");
hemddabral 58:027c65a54097 5 * you may not use this file except in compliance with the License.
hemddabral 58:027c65a54097 6 * You may obtain a copy of the License at
hemddabral 58:027c65a54097 7 *
hemddabral 58:027c65a54097 8 * http://www.apache.org/licenses/LICENSE-2.0
hemddabral 58:027c65a54097 9 *
hemddabral 58:027c65a54097 10 * Unless required by applicable law or agreed to in writing, software
hemddabral 58:027c65a54097 11 * distributed under the License is distributed on an "AS IS" BASIS,
hemddabral 58:027c65a54097 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
hemddabral 58:027c65a54097 13 * See the License for the specific language governing permissions and
hemddabral 58:027c65a54097 14 * limitations under the License.
hemddabral 58:027c65a54097 15 */
hemddabral 58:027c65a54097 16
hemddabral 58:027c65a54097 17
hemddabral 58:027c65a54097 18 // utility functions
hemddabral 58:027c65a54097 19
hemddabral 12:a5d7db4a1e49 20 #ifndef __UTIL_H__
hemddabral 12:a5d7db4a1e49 21 #define __UTIL_H__
hemddabral 12:a5d7db4a1e49 22
mridup 61:929885305c17 23 #include "hal_types.h"
mridup 61:929885305c17 24 #include "mbed.h"
mridup 61:929885305c17 25
hemddabral 16:8aeb0c44869b 26 #define NEED_CONSOLE_OUTPUT 1 /* Set this if you need debug messages on the console;
hemddabral 58:027c65a54097 27 * it will have an impact on code-size and power consumption. */
hemddabral 58:027c65a54097 28
hemddabral 16:8aeb0c44869b 29 #if NEED_CONSOLE_OUTPUT
mridup 17:63059fcb8db2 30 //Serial usb(USBTX, USBRX); // tx, rx
hemddabral 16:8aeb0c44869b 31 extern Serial pc;
hemddabral 16:8aeb0c44869b 32 #define DEBUG(...) { pc.printf(__VA_ARGS__); }
hemddabral 16:8aeb0c44869b 33 #else
hemddabral 16:8aeb0c44869b 34 #define DEBUG(...) /* nothing */
hemddabral 16:8aeb0c44869b 35 #endif /* #if NEED_CONSOLE_OUTPUT */
hemddabral 16:8aeb0c44869b 36
mridup 46:01f97cfcc109 37 #define STORE_LE_16(buf, val) ( ((buf)[0] = (tHalUint8) (val) ) , \
hemddabral 58:027c65a54097 38 ((buf)[1] = (tHalUint8) (val>>8) ) )
mridup 46:01f97cfcc109 39
mridup 46:01f97cfcc109 40 #define STORE_LE_32(buf, val) ( ((buf)[0] = (tHalUint8) (val) ) , \
hemddabral 58:027c65a54097 41 ((buf)[1] = (tHalUint8) (val>>8) ) , \
hemddabral 58:027c65a54097 42 ((buf)[2] = (tHalUint8) (val>>16) ) , \
hemddabral 58:027c65a54097 43 ((buf)[3] = (tHalUint8) (val>>24) ) )
hemddabral 58:027c65a54097 44
mridup 50:898acb5227fc 45 #define COPY_UUID_128(uuid_struct, uuid_15, uuid_14, uuid_13, uuid_12, uuid_11, uuid_10, uuid_9, uuid_8, uuid_7, uuid_6, uuid_5, uuid_4, uuid_3, uuid_2, uuid_1, uuid_0) \
hemddabral 58:027c65a54097 46 do {\
hemddabral 58:027c65a54097 47 uuid_struct[0] = uuid_0; uuid_struct[1] = uuid_1; uuid_struct[2] = uuid_2; uuid_struct[3] = uuid_3; \
mridup 50:898acb5227fc 48 uuid_struct[4] = uuid_4; uuid_struct[5] = uuid_5; uuid_struct[6] = uuid_6; uuid_struct[7] = uuid_7; \
hemddabral 58:027c65a54097 49 uuid_struct[8] = uuid_8; uuid_struct[9] = uuid_9; uuid_struct[10] = uuid_10; uuid_struct[11] = uuid_11; \
hemddabral 58:027c65a54097 50 uuid_struct[12] = uuid_12; uuid_struct[13] = uuid_13; uuid_struct[14] = uuid_14; uuid_struct[15] = uuid_15; \
hemddabral 58:027c65a54097 51 }while(0)
hemddabral 58:027c65a54097 52
hemddabral 58:027c65a54097 53
hemddabral 12:a5d7db4a1e49 54 double getHighPowerAndPALevelValue(int8_t dBMLevel, int8_t& EN_HIGH_POWER, int8_t& PA_LEVEL);
hemddabral 12:a5d7db4a1e49 55
hemddabral 12:a5d7db4a1e49 56 #endif // __UTIL_H__