diff --git a/Arduino/libraries/RBL_nRF8001/RBL_nRF8001.h b/Arduino/libraries/RBL_nRF8001/RBL_nRF8001.h index 4246f4a..55490fb 100644 --- a/Arduino/libraries/RBL_nRF8001/RBL_nRF8001.h +++ b/Arduino/libraries/RBL_nRF8001/RBL_nRF8001.h @@ -22,7 +22,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #include /* Put the nRF8001 setup in the RAM of the nRF8001.*/ -#include "services.h" +#include "RBL_services.h" /* Include the services_lock.h to put the setup in the OTP memory of the nRF8001. This would mean that the setup cannot be changed once put in. However this removes the need to do the setup of the nRF8001 on every reset.*/ diff --git a/Arduino/libraries/RBL_nRF8001/examples/BLEControllerSketch/Boards.h b/Arduino/libraries/RBL_nRF8001/examples/BLEControllerSketch/Boards.h index 52ac994..c88f0ef 100644 --- a/Arduino/libraries/RBL_nRF8001/examples/BLEControllerSketch/Boards.h +++ b/Arduino/libraries/RBL_nRF8001/examples/BLEControllerSketch/Boards.h @@ -20,105 +20,105 @@ #endif /* - Firmata Hardware Abstraction Layer - -Firmata is built on top of the hardware abstraction functions of Arduino, -specifically digitalWrite, digitalRead, analogWrite, analogRead, and -pinMode. While these functions offer simple integer pin numbers, Firmata -needs more information than is provided by Arduino. This file provides -all other hardware specific details. To make Firmata support a new board, -only this file should require editing. - -The key concept is every "pin" implemented by Firmata may be mapped to -any pin as implemented by Arduino. Usually a simple 1-to-1 mapping is -best, but such mapping should not be assumed. This hardware abstraction -layer allows Firmata to implement any number of pins which map onto the -Arduino implemented pins in almost any arbitrary way. - - -General Constants: - -These constants provide basic information Firmata requires. - -TOTAL_PINS: The total number of pins Firmata implemented by Firmata. - Usually this will match the number of pins the Arduino functions - implement, including any pins pins capable of analog or digital. - However, Firmata may implement any number of pins. For example, - on Arduino Mini with 8 analog inputs, 6 of these may be used - for digital functions, and 2 are analog only. On such boards, - Firmata can implement more pins than Arduino's pinMode() - function, in order to accommodate those special pins. The - Firmata protocol supports a maximum of 128 pins, so this - constant must not exceed 128. - -TOTAL_ANALOG_PINS: The total number of analog input pins implemented. - The Firmata protocol allows up to 16 analog inputs, accessed - using offsets 0 to 15. Because Firmata presents the analog - inputs using different offsets than the actual pin numbers - (a legacy of Arduino's analogRead function, and the way the - analog input capable pins are physically labeled on all - Arduino boards), the total number of analog input signals - must be specified. 16 is the maximum. - -VERSION_BLINK_PIN: When Firmata starts up, it will blink the version - number. This constant is the Arduino pin number where a - LED is connected. - - -Pin Mapping Macros: - -These macros provide the mapping between pins as implemented by -Firmata protocol and the actual pin numbers used by the Arduino -functions. Even though such mappings are often simple, pin -numbers received by Firmata protocol should always be used as -input to these macros, and the result of the macro should be -used with with any Arduino function. - -When Firmata is extended to support a new pin mode or feature, -a pair of macros should be added and used for all hardware -access. For simple 1:1 mapping, these macros add no actual -overhead, yet their consistent use allows source code which -uses them consistently to be easily adapted to all other boards -with different requirements. - -IS_PIN_XXXX(pin): The IS_PIN macros resolve to true or non-zero - if a pin as implemented by Firmata corresponds to a pin - that actually implements the named feature. - -PIN_TO_XXXX(pin): The PIN_TO macros translate pin numbers as - implemented by Firmata to the pin numbers needed as inputs - to the Arduino functions. The corresponding IS_PIN macro - should always be tested before using a PIN_TO macro, so - these macros only need to handle valid Firmata pin - numbers for the named feature. - - -Port Access Inline Funtions: - -For efficiency, Firmata protocol provides access to digital -input and output pins grouped by 8 bit ports. When these -groups of 8 correspond to actual 8 bit ports as implemented -by the hardware, these inline functions can provide high -speed direct port access. Otherwise, a default implementation -using 8 calls to digitalWrite or digitalRead is used. - -When porting Firmata to a new board, it is recommended to -use the default functions first and focus only on the constants -and macros above. When those are working, if optimized port -access is desired, these inline functions may be extended. -The recommended approach defines a symbol indicating which -optimization to use, and then conditional complication is -used within these functions. - -readPort(port, bitmask): Read an 8 bit port, returning the value. - port: The port number, Firmata pins port*8 to port*8+7 - bitmask: The actual pins to read, indicated by 1 bits. - -writePort(port, value, bitmask): Write an 8 bit port. - port: The port number, Firmata pins port*8 to port*8+7 - value: The 8 bit value to write - bitmask: The actual pins to write, indicated by 1 bits. -*/ + Firmata Hardware Abstraction Layer + + Firmata is built on top of the hardware abstraction functions of Arduino, + specifically digitalWrite, digitalRead, analogWrite, analogRead, and + pinMode. While these functions offer simple integer pin numbers, Firmata + needs more information than is provided by Arduino. This file provides + all other hardware specific details. To make Firmata support a new board, + only this file should require editing. + + The key concept is every "pin" implemented by Firmata may be mapped to + any pin as implemented by Arduino. Usually a simple 1-to-1 mapping is + best, but such mapping should not be assumed. This hardware abstraction + layer allows Firmata to implement any number of pins which map onto the + Arduino implemented pins in almost any arbitrary way. + + + General Constants: + + These constants provide basic information Firmata requires. + + TOTAL_PINS: The total number of pins Firmata implemented by Firmata. + Usually this will match the number of pins the Arduino functions + implement, including any pins pins capable of analog or digital. + However, Firmata may implement any number of pins. For example, + on Arduino Mini with 8 analog inputs, 6 of these may be used + for digital functions, and 2 are analog only. On such boards, + Firmata can implement more pins than Arduino's pinMode() + function, in order to accommodate those special pins. The + Firmata protocol supports a maximum of 128 pins, so this + constant must not exceed 128. + + TOTAL_ANALOG_PINS: The total number of analog input pins implemented. + The Firmata protocol allows up to 16 analog inputs, accessed + using offsets 0 to 15. Because Firmata presents the analog + inputs using different offsets than the actual pin numbers + (a legacy of Arduino's analogRead function, and the way the + analog input capable pins are physically labeled on all + Arduino boards), the total number of analog input signals + must be specified. 16 is the maximum. + + VERSION_BLINK_PIN: When Firmata starts up, it will blink the version + number. This constant is the Arduino pin number where a + LED is connected. + + + Pin Mapping Macros: + + These macros provide the mapping between pins as implemented by + Firmata protocol and the actual pin numbers used by the Arduino + functions. Even though such mappings are often simple, pin + numbers received by Firmata protocol should always be used as + input to these macros, and the result of the macro should be + used with with any Arduino function. + + When Firmata is extended to support a new pin mode or feature, + a pair of macros should be added and used for all hardware + access. For simple 1:1 mapping, these macros add no actual + overhead, yet their consistent use allows source code which + uses them consistently to be easily adapted to all other boards + with different requirements. + + IS_PIN_XXXX(pin): The IS_PIN macros resolve to true or non-zero + if a pin as implemented by Firmata corresponds to a pin + that actually implements the named feature. + + PIN_TO_XXXX(pin): The PIN_TO macros translate pin numbers as + implemented by Firmata to the pin numbers needed as inputs + to the Arduino functions. The corresponding IS_PIN macro + should always be tested before using a PIN_TO macro, so + these macros only need to handle valid Firmata pin + numbers for the named feature. + + + Port Access Inline Funtions: + + For efficiency, Firmata protocol provides access to digital + input and output pins grouped by 8 bit ports. When these + groups of 8 correspond to actual 8 bit ports as implemented + by the hardware, these inline functions can provide high + speed direct port access. Otherwise, a default implementation + using 8 calls to digitalWrite or digitalRead is used. + + When porting Firmata to a new board, it is recommended to + use the default functions first and focus only on the constants + and macros above. When those are working, if optimized port + access is desired, these inline functions may be extended. + The recommended approach defines a symbol indicating which + optimization to use, and then conditional complication is + used within these functions. + + readPort(port, bitmask): Read an 8 bit port, returning the value. + port: The port number, Firmata pins port*8 to port*8+7 + bitmask: The actual pins to read, indicated by 1 bits. + + writePort(port, value, bitmask): Write an 8 bit port. + port: The port number, Firmata pins port*8 to port*8+7 + value: The 8 bit value to write + bitmask: The actual pins to write, indicated by 1 bits. + */ /*============================================================================== * Board Specific Configuration @@ -162,7 +162,7 @@ writePort(port, value, bitmask): Write an 8 bit port. #define PIN_TO_DIGITAL(p) (p) #define PIN_TO_ANALOG(p) ((p) - FIRST_ANALOG_PIN) #define PIN_TO_PWM(p) PIN_TO_DIGITAL(p) -#define PIN_TO_SERVO(p) (p) +#define PIN_TO_SERVO(p) (p) // old Arduinos diff --git a/Arduino/libraries/RBL_nRF8001/services.h b/Arduino/libraries/RBL_nRF8001/services.h deleted file mode 100644 index 7a05ab5..0000000 --- a/Arduino/libraries/RBL_nRF8001/services.h +++ /dev/null @@ -1,164 +0,0 @@ -/* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved. -* -* The information contained herein is property of Nordic Semiconductor ASA. -* Terms and conditions of usage are described in detail in NORDIC -* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. -* -* Licensees are granted free, non-transferable use of the information. NO -* WARRANTY of ANY KIND is provided. This heading must NOT be removed from -* the file. -*/ - -/** -* This file is autogenerated by nRFgo Studio 1.14.1.2369 -*/ - -#ifndef SETUP_MESSAGES_H__ -#define SETUP_MESSAGES_H__ - -#include "hal_platform.h" -#include "aci.h" -#define PIPE_GAP_DEVICE_NAME_SET 1 -#define PIPE_UART_OVER_BTLE_UART_RX_RX 2 -#define PIPE_UART_OVER_BTLE_UART_TX_TX 3 -#define PIPE_DEVICE_INFORMATION_HARDWARE_REVISION_STRING_SET 4 - -#define NUMBER_OF_PIPES 4 - -#define SERVICES_PIPE_TYPE_MAPPING_CONTENT {\ - {ACI_STORE_LOCAL, ACI_SET}, \ - {ACI_STORE_LOCAL, ACI_RX}, \ - {ACI_STORE_LOCAL, ACI_TX}, \ - {ACI_STORE_LOCAL, ACI_SET}, \ -} - -#define GAP_PPCP_MAX_CONN_INT 0x12 /**< Maximum connection interval as a multiple of 1.25 msec , 0xFFFF means no specific value requested */ -#define GAP_PPCP_MIN_CONN_INT 0x6 /**< Minimum connection interval as a multiple of 1.25 msec , 0xFFFF means no specific maximum*/ -#define GAP_PPCP_SLAVE_LATENCY 0 -#define GAP_PPCP_CONN_TIMEOUT 0xa /** Connection Supervision timeout multiplier as a multiple of 10msec, 0xFFFF means no specific value requested */ - -#define NB_SETUP_MESSAGES 21 -#define SETUP_MESSAGES_CONTENT {\ - {0x00,\ - {\ - 0x07,0x06,0x00,0x00,0x03,0x02,0x41,0xd7,\ - },\ - },\ - {0x00,\ - {\ - 0x1f,0x06,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x04,0x01,0x01,0x00,0x00,0x06,0x00,0x00,\ - 0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ - },\ - },\ - {0x00,\ - {\ - 0x1f,0x06,0x10,0x1c,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ - 0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x03,0x90,0x01,0xff,\ - },\ - },\ - {0x00,\ - {\ - 0x1f,0x06,0x10,0x38,0xff,0xff,0x02,0x58,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x00,0x00,\ - 0x00,0x10,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,\ - },\ - },\ - {0x00,\ - {\ - 0x05,0x06,0x10,0x54,0x00,0x00,\ - },\ - },\ - {0x00,\ - {\ - 0x1f,0x06,0x20,0x00,0x04,0x04,0x02,0x02,0x00,0x01,0x28,0x00,0x01,0x00,0x18,0x04,0x04,0x05,0x05,0x00,\ - 0x02,0x28,0x03,0x01,0x0e,0x03,0x00,0x00,0x2a,0x04,0x14,0x0a,\ - },\ - },\ - {0x00,\ - {\ - 0x1f,0x06,0x20,0x1c,0x0a,0x00,0x03,0x2a,0x00,0x01,0x42,0x4c,0x45,0x20,0x53,0x68,0x69,0x65,0x6c,0x64,\ - 0x04,0x04,0x05,0x05,0x00,0x04,0x28,0x03,0x01,0x02,0x05,0x00,\ - },\ - },\ - {0x00,\ - {\ - 0x1f,0x06,0x20,0x38,0x01,0x2a,0x06,0x04,0x03,0x02,0x00,0x05,0x2a,0x01,0x01,0x00,0x00,0x04,0x04,0x05,\ - 0x05,0x00,0x06,0x28,0x03,0x01,0x02,0x07,0x00,0x04,0x2a,0x06,\ - },\ - },\ - {0x00,\ - {\ - 0x1f,0x06,0x20,0x54,0x04,0x09,0x08,0x00,0x07,0x2a,0x04,0x01,0x06,0x00,0x12,0x00,0x00,0x00,0x0a,0x00,\ - 0x04,0x04,0x02,0x02,0x00,0x08,0x28,0x00,0x01,0x01,0x18,0x04,\ - },\ - },\ - {0x00,\ - {\ - 0x1f,0x06,0x20,0x70,0x04,0x10,0x10,0x00,0x09,0x28,0x00,0x01,0x1e,0x94,0x8d,0xf1,0x48,0x31,0x94,0xba,\ - 0x75,0x4c,0x3e,0x50,0x00,0x00,0x3d,0x71,0x04,0x04,0x13,0x13,\ - },\ - },\ - {0x00,\ - {\ - 0x1f,0x06,0x20,0x8c,0x00,0x0a,0x28,0x03,0x01,0x04,0x0b,0x00,0x1e,0x94,0x8d,0xf1,0x48,0x31,0x94,0xba,\ - 0x75,0x4c,0x3e,0x50,0x03,0x00,0x3d,0x71,0x44,0x10,0x14,0x00,\ - },\ - },\ - {0x00,\ - {\ - 0x1f,0x06,0x20,0xa8,0x00,0x0b,0x00,0x03,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x13,\ - },\ - },\ - {0x00,\ - {\ - 0x1f,0x06,0x20,0xc4,0x13,0x00,0x0c,0x28,0x03,0x01,0x10,0x0d,0x00,0x1e,0x94,0x8d,0xf1,0x48,0x31,0x94,\ - 0xba,0x75,0x4c,0x3e,0x50,0x02,0x00,0x3d,0x71,0x14,0x00,0x14,\ - },\ - },\ - {0x00,\ - {\ - 0x1f,0x06,0x20,0xe0,0x00,0x00,0x0d,0x00,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x46,0x14,\ - },\ - },\ - {0x00,\ - {\ - 0x1f,0x06,0x20,0xfc,0x03,0x02,0x00,0x0e,0x29,0x02,0x01,0x00,0x00,0x04,0x04,0x02,0x02,0x00,0x0f,0x28,\ - 0x00,0x01,0x0a,0x18,0x04,0x04,0x05,0x05,0x00,0x10,0x28,0x03,\ - },\ - },\ - {0x00,\ - {\ - 0x1c,0x06,0x21,0x18,0x01,0x02,0x11,0x00,0x27,0x2a,0x04,0x04,0x09,0x01,0x00,0x11,0x2a,0x27,0x01,0x0a,\ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ - },\ - },\ - {0x00,\ - {\ - 0x1f,0x06,0x40,0x00,0x2a,0x00,0x01,0x00,0x80,0x04,0x00,0x03,0x00,0x00,0x00,0x03,0x02,0x00,0x08,0x04,\ - 0x00,0x0b,0x00,0x00,0x00,0x02,0x02,0x00,0x02,0x04,0x00,0x0d,\ - },\ - },\ - {0x00,\ - {\ - 0x0f,0x06,0x40,0x1c,0x00,0x0e,0x2a,0x27,0x01,0x00,0x80,0x04,0x00,0x11,0x00,0x00,\ - },\ - },\ - {0x00,\ - {\ - 0x13,0x06,0x50,0x00,0x1e,0x94,0x8d,0xf1,0x48,0x31,0x94,0xba,0x75,0x4c,0x3e,0x50,0x00,0x00,0x3d,0x71,\ - },\ - },\ - {0x00,\ - {\ - 0x0f,0x06,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ - },\ - },\ - {0x00,\ - {\ - 0x06,0x06,0xf0,0x00,0x03,0x6a,0x44,\ - },\ - },\ -} - -#endif