diff options
| author | Yuval Adam <yuv.adm@gmail.com> | 2014-06-29 12:34:32 +0300 |
|---|---|---|
| committer | Yuval Adam <yuv.adm@gmail.com> | 2014-06-29 12:34:32 +0300 |
| commit | c3e4c9a25c2910d2d66d52215b3406b13d5b23d5 (patch) | |
| tree | added370d1e356901f8579f076e3263fb0464db7 /boards/dk-tm4c129x/ble_central | |
| parent | 990090a4cc9070837d31e66b58d40f0c3d038741 (diff) | |
Add more board models
Diffstat (limited to 'boards/dk-tm4c129x/ble_central')
32 files changed, 7535 insertions, 0 deletions
diff --git a/boards/dk-tm4c129x/ble_central/Makefile b/boards/dk-tm4c129x/ble_central/Makefile new file mode 100644 index 0000000..600c267 --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/Makefile @@ -0,0 +1,94 @@ +#******************************************************************************
+#
+# Makefile - Rules for building the ble central example.
+#
+# Copyright (c) 2013-2014 Texas Instruments Incorporated. All rights reserved.
+# Software License Agreement
+#
+# Texas Instruments (TI) is supplying this software for use solely and
+# exclusively on TI's microcontroller products. The software is owned by
+# TI and/or its suppliers, and is protected under applicable copyright
+# laws. You may not combine this software with "viral" open-source
+# software in order to form a larger program.
+#
+# THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
+# NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
+# NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
+# CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+# DAMAGES, FOR ANY REASON WHATSOEVER.
+#
+# This is part of revision 2.1.0.12573 of the DK-TM4C129X Firmware Package.
+#
+#******************************************************************************
+
+#
+# Defines the part type that this project uses.
+#
+PART=TM4C129XNCZAD
+
+#
+# The base directory for TivaWare.
+#
+ROOT=../../../..
+
+#
+# Include the common make definitions.
+#
+include ${ROOT}/makedefs
+
+#
+# Where to find source files that do not live in this directory.
+#
+VPATH=../drivers
+VPATH+=../../../../utils
+
+#
+# Where to find header files that do not live in the source directory.
+#
+IPATH=..
+IPATH+=../../../..
+
+#
+# The default rule, which causes the ble central example to be built.
+#
+all: ${COMPILER}
+all: ${COMPILER}/ble_central.axf
+
+#
+# The rule to clean out all the build products.
+#
+clean:
+ @rm -rf ${COMPILER} ${wildcard *~}
+
+#
+# The rule to create the target directory.
+#
+${COMPILER}:
+ @mkdir -p ${COMPILER}
+
+#
+# Rules for building the ble central example.
+#
+${COMPILER}/ble_central.axf: ${COMPILER}/ble_central.o
+${COMPILER}/ble_central.axf: ${COMPILER}/frame.o
+${COMPILER}/ble_central.axf: ${COMPILER}/gap.o
+${COMPILER}/ble_central.axf: ${COMPILER}/kentec320x240x16_ssd2119.o
+${COMPILER}/ble_central.axf: ${COMPILER}/pinout.o
+${COMPILER}/ble_central.axf: ${COMPILER}/startup_${COMPILER}.o
+${COMPILER}/ble_central.axf: ${COMPILER}/touch.o
+${COMPILER}/ble_central.axf: ${COMPILER}/uartstdio.o
+${COMPILER}/ble_central.axf: ${COMPILER}/ustdlib.o
+${COMPILER}/ble_central.axf: ${ROOT}/grlib/${COMPILER}/libgr.a
+${COMPILER}/ble_central.axf: ${ROOT}/driverlib/${COMPILER}/libdriver.a
+${COMPILER}/ble_central.axf: ble_central.ld
+SCATTERgcc_ble_central=ble_central.ld
+ENTRY_ble_central=ResetISR
+CFLAGSgcc=-DTARGET_IS_TM4C129_RA0
+
+#
+# Include the automatically generated dependency files.
+#
+ifneq (${MAKECMDGOALS},clean)
+-include ${wildcard ${COMPILER}/*.d} __dummy__
+endif
diff --git a/boards/dk-tm4c129x/ble_central/ble_central.c b/boards/dk-tm4c129x/ble_central/ble_central.c new file mode 100644 index 0000000..3d8b695 --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ble_central.c @@ -0,0 +1,2551 @@ +//*****************************************************************************
+//
+// ble_central.c - Demonstration of BLE central device.
+//
+// Copyright (c) 2013-2014 Texas Instruments Incorporated. All rights reserved.
+// Software License Agreement
+//
+// Texas Instruments (TI) is supplying this software for use solely and
+// exclusively on TI's microcontroller products. The software is owned by
+// TI and/or its suppliers, and is protected under applicable copyright
+// laws. You may not combine this software with "viral" open-source
+// software in order to form a larger program.
+//
+// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
+// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
+// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
+// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+// DAMAGES, FOR ANY REASON WHATSOEVER.
+//
+// This is part of revision 2.1.0.12573 of the DK-TM4C129X Firmware Package.
+//
+//*****************************************************************************
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include <math.h>
+#include "inc/hw_ints.h"
+#include "inc/hw_memmap.h"
+#include "inc/hw_types.h"
+#include "driverlib/debug.h"
+#include "driverlib/gpio.h"
+#include "driverlib/interrupt.h"
+#include "driverlib/sysctl.h"
+#include "driverlib/systick.h"
+#include "driverlib/uart.h"
+#include "driverlib/rom.h"
+#include "driverlib/rom_map.h"
+#include "driverlib/pin_map.h"
+#include "grlib/grlib.h"
+#include "grlib/widget.h"
+#include "drivers/kentec320x240x16_ssd2119.h"
+#include "drivers/frame.h"
+#include "drivers/pinout.h"
+#include "drivers/touch.h"
+#include "utils/uartstdio.h"
+#include "utils/ustdlib.h"
+#include "hci.h"
+
+//*****************************************************************************
+//
+//! \addtogroup example_list
+//! <h1>BLE Central Device Demonstration (ble_central)</h1>
+//!
+//! This application provides a demonstration use of Bluetooth Low Energy
+//! central device by utilizing TI’s BLE CC2540 Evaluation Module and
+//! SesorTags.
+//!
+//! By connecting a CC2540 EM board to the EM header on the TM4C129X development
+//! board, the TM4C129X can communicate with the CC2540 by means of
+//! vendor-specific HCI commands using the UART interface. This application can
+//! discover up to three SensorTag devices, it can connect to any one of them,
+//! perform pairing and bonding, read some sensor data and RSSI data from the
+//! slave, and display the information on the LCD display.
+//!
+//! This application can discover any BLE device although it may not be
+//! able to make a connection to a device other than a SensorTag/CC2540 as the
+//! bonding process will likely fail due to the use of a default passcode.
+//! We have tested this application with SensorTag and CC2540 Development
+//! boards (SmartRF05EB + CC2540 EM) with the SimpleBLEPeripheral
+//! sample application programmed. It can successfully bond with both boards
+//! since the same default passcode is expected. Both SensorTag and CC2540
+//! devices have BLE Stack 1.4.0 release code programmed.
+//!
+//! CC2540 device should be programmed with the HostTestRelease
+//! (Network Processor) application. A hex file containing the this application
+//! can be found in the BLE stack 1.4.0 release under
+//! C:\\...\\BLE-CC254x-1.4.0\\Accessories\\HexFiles\\
+//! CC2540_SmartRF_HostTestRelease_All.hex. Please refer to the Bluetooth Low
+//! Energy CC2540 Development Kit User's Guide for information on how to load
+//! the hex file to the CC2540. This User's Guide can be found in
+//! http://www.ti.com/lit/ug/swru301a/swru301a.pdf
+//!
+//! On the TM4C129X development board, make sure that jumpers PJ0 and PJ1
+//! are connected to the "EM_UART" side which allows UART3 TX and RX signals to
+//! be routed to the EM header. UART3 is used as the communication channel
+//! between the CC2540 device and the TM4C129X device.
+//!
+//! Once the application starts, it will verify the serial connection by
+//! sending the CC2540 device a vendor-specific HCI command, and waiting for the
+//! expected responses within a short time period. Once the physical connection
+//! between TM4C129X and CC2540 is verified, the device will automatically
+//! start to discover BLE peripheral device. If no devices are found within 20
+//! seconds, the application will timeout and display "No Device Found",
+//! otherwise the discovered device names will be shown on the display.
+//! Touching any of the device names will start the process of establishing a
+//! connection with that device. This sample application always tries to make
+//! a secure connection by pairing the device with default passcode "00000".
+//! Upon successfully linking and pairing, application will start querying
+//! sensor data, including IR temperature, ambient temperature, humidity and
+//! RSSI.
+//!
+//! Whe run inside, IR and ambient temperature should typically be in the low
+//! 20s (Celsius). You can place the SensorTag near a hot object (such as a
+//! cup of coffee) to verify that the IR temperature increases. You can move
+//! the SensorTag further from the TM4C129X development board to verify that
+//! its RSSI reading will decrease.
+//!
+//! At any time after the connection is established, you can touch the
+//! "disconnect" button on the bottom of the screen to terminate the
+//! connection with the peripheral device.
+//!
+//! In order to make the SensorTag discoverable by a central device, the
+//! SensorTag needs to be in the discovery mode. The LED in the middle of the
+//! board will blink periodically if the SensorTag is in discovery mode. If the
+//! LED is not blinking, pressing the side button on the SensorTag should
+//! place it in discovery mode. Once it is connected to a central device,
+//! the LED should be off, pressing the side button while it is connected will
+//! terminate the connection and put the SensorTag in discovery mode again.
+//! For more information on SensorTag, please visit
+//! http://processors.wiki.ti.com/index.php/Bluetooth_SensorTag
+//!
+//! Every HCI command and event are output to the UART console for
+//! debugging purpose. The UART terminal should be configured in 115,200 baud,
+//! 8-n-1 mode.
+//!
+//
+//*****************************************************************************
+
+
+//*****************************************************************************
+//
+// A set of flags. The flag bits are defined as follows:
+//
+// 0 -> An indicator that a second has occurred.
+// 1 -> A complete RX Packet has been received.
+// 2 -> Whether to draw a circle or not on the display.
+// 3 -> Sensors on the SensorTag are configured or not.
+//
+//*****************************************************************************
+#define FLAG_EVERY_SECOND 0
+#define FLAG_HCI_MSG_COMPLETE 1
+#define FLAG_DRAW_CIRCLE 2
+#define FLAG_SENSOR_CFGD 3
+static volatile uint32_t g_ui32Flags;
+
+//*****************************************************************************
+//
+// A system tick counter, incremented every SYSTICKMS.
+//
+//*****************************************************************************
+volatile uint32_t g_ui32TickCounter = 0;
+
+//*****************************************************************************
+//
+// The delay count for timeout. It decrements to 1 to indicate timeout. Setting
+// it to 0 means no timeout has been set.
+//
+//*****************************************************************************
+volatile uint32_t g_ui32Delay;
+
+//*****************************************************************************
+//
+// The application's graphics context.
+//
+//*****************************************************************************
+tContext g_sContext;
+
+//*****************************************************************************
+//
+// Flag that informs that the user has requested an action via GUI.
+//
+//*****************************************************************************
+static volatile bool g_bDiscoveryReq = false;
+static volatile bool g_bEstLinkReq = false;
+static volatile bool g_bTermLinkReq = false;
+
+//*****************************************************************************
+//
+// Flag to enable pairing, change to false to diable the pairing.
+//
+//*****************************************************************************
+static bool g_bInitPairReq = true;
+
+//*****************************************************************************
+//
+// The width and height of the LCD display
+//
+//*****************************************************************************
+uint32_t g_ui32Width, g_ui32Height;
+
+//*****************************************************************************
+//
+// The screen offset of the upper left hand corner where we start to draw.
+//
+//*****************************************************************************
+#define X_OFFSET 8
+#define Y_OFFSET 24
+
+
+//*****************************************************************************
+//
+// The maximum number of slaves that we can discover.
+//
+//*****************************************************************************
+#define MAX_SLAVE_NUM 3
+
+//*****************************************************************************
+//
+// The RX receive circular buffer size.
+//
+//*****************************************************************************
+#define BUF_SIZE 128
+
+
+//*****************************************************************************
+//
+// The circular buffer used to store the received HCI message from the CC2540.
+//
+//*****************************************************************************
+typedef struct
+{
+ volatile uint8_t pui8RXBuf[BUF_SIZE];
+ volatile uint8_t ui8Rd;
+ volatile uint8_t ui8Wr;
+ volatile uint8_t ui8Count;
+} tCirBuf;
+
+tCirBuf g_sRxBuf;
+
+//*****************************************************************************
+//
+// The state defination of BLE statemachine.
+//
+//*****************************************************************************
+volatile enum
+{
+ STATE_DEV_INIT,
+ STATE_GET_PARAM,
+ STATE_START_DISCOVERY,
+ STATE_SET_PARAM,
+ STATE_READY_FOR_LINK_REQ,
+ STATE_LINK,
+ STATE_LINKED,
+ STATE_SEND_PASSKEY,
+ STATE_IDLE,
+ STATE_TERM,
+ STATE_TERMED,
+ STATE_ERROR,
+}g_iState = STATE_IDLE;
+
+//*****************************************************************************
+//
+// The paramers of the central device.
+//
+//*****************************************************************************
+uint16_t g_ui16Param[4];
+uint8_t g_ui8ParamWrIdx = 0;
+
+//*****************************************************************************
+//
+// The complete HCI message and its length that we have received from BLE
+// stack.
+//
+//*****************************************************************************
+uint8_t g_pui8Msg[200];
+uint8_t g_ui8MsgLen;
+
+//*****************************************************************************
+//
+// Received Signal Strength Indication(RSSI).
+//
+//*****************************************************************************
+int8_t g_i8RSSI = 0;
+
+//*****************************************************************************
+//
+// Sensor data, IR temperature, humidity etc. Only available on SensorTag
+//
+//*****************************************************************************
+uint8_t g_pui8IRTemp[4]; // RAW data
+uint8_t g_pui8Humidity[4]; // RAW data
+double g_dIRTemp = 0;
+double g_dAmbTemp = 0;
+double g_dHumidity = 0;
+
+//*****************************************************************************
+//
+// The HCI message information, used for verifying expected response from
+// stack.
+//
+//*****************************************************************************
+uint16_t g_ui16CmdStatusOpcode;
+uint16_t g_ui16Event;
+uint16_t g_ui16Handle;
+
+//*****************************************************************************
+//
+// The structure of BLE slave information.
+//
+//*****************************************************************************
+typedef struct
+{
+ //
+ // Device Address
+ //
+ uint8_t pui8Addr[HCI_BDADDR_LEN];
+ //
+ // Address Type
+ //
+ uint8_t ui8AddrType;
+ //
+ // Device Name
+ //
+ char pcName[32];
+ //
+ // Long Term Key Data, used for bonding.
+ //
+ tLTKData sSaveKey;
+} tBLEDeviceInfo;
+
+tBLEDeviceInfo g_psDev[MAX_SLAVE_NUM];
+
+//*****************************************************************************
+//
+// The number of devices discovered.
+//
+//*****************************************************************************
+uint8_t g_ui8DevFound;
+
+//*****************************************************************************
+//
+// The index of device to be connected.
+//
+//*****************************************************************************
+uint8_t g_ui8DevConnect;
+
+//*****************************************************************************
+//
+// The positions of the circles in the animation used while discovering devices
+//
+//*****************************************************************************
+const int32_t g_ppi32CirclePos[][2] =
+{
+ {
+ 12, 0
+ },
+ {
+ 8, -9
+ },
+ {
+ 0, -12
+ },
+ {
+ -8, -9
+ },
+ {
+ -12, 0
+ },
+ {
+ -8, 9
+ },
+ {
+ 0, 12
+ },
+ {
+ 8, 9
+ }
+};
+
+//*****************************************************************************
+//
+// The colors of the circles in the animation used while discovering devices
+//
+//*****************************************************************************
+const uint32_t g_pui32CircleColor[] =
+{
+ 0x111111,
+ 0x333333,
+ 0x555555,
+ 0x777777,
+ 0x999999,
+ 0xbbbbbb,
+ 0xdddddd,
+ 0xffffff,
+};
+
+//*****************************************************************************
+//
+// The current color index for the animation used while discovering devices
+//
+//*****************************************************************************
+uint32_t g_ui32ColorIdx;
+
+//*****************************************************************************
+//
+// The strings that are displayed in the center and bottom of the display
+//
+//*****************************************************************************
+typedef enum
+{
+ iInitializing = 0,
+ iScanning,
+ iScan,
+ iNoBLE,
+ iConnect,
+ iConnecting,
+ iDisconnect,
+ iDisconnecting
+} eDisplayUpdateIdx;
+
+//
+// eDisplayUpdateIdx is used as index to the following table
+//
+static char *ppcString[][2] =
+{ // Middle of screen, Bottom of screen
+ {"Initializing", 0},
+ {"Discovering", "timeout in 20s"},
+ {"No Device Found", "scan"},
+ {"CC2540 EM not present", 0},
+ {0, "scan again"},
+ {0, "connecting" },
+ {0, "disconnect" },
+ {0, "disconnecting"},
+};
+
+//*****************************************************************************
+//
+// Forward reference to local functions.
+//
+//*****************************************************************************
+void DrawCircle(void);
+bool MessageComplete(uint8_t *pui8Buf, uint8_t *pui8Len);
+void HandleTemp(void);
+void HandleHumidity(void);
+void DisplayTemp(uint32_t ui32X, uint32_t ui32Y);
+void DisplayHumidity(uint32_t ui32X, uint32_t ui32Y);
+void DisplayRSSI(uint32_t ui32X, uint32_t ui32Y);
+
+//*****************************************************************************
+//
+// The error routine that is called if the driver library encounters an error.
+//
+//*****************************************************************************
+#ifdef DEBUG
+void
+__error__(char *pcFilename, uint32_t ui32Line)
+{
+}
+#endif
+
+//*****************************************************************************
+//
+// The interrupt handler for the SysTick interrupt.
+//
+//*****************************************************************************
+void
+SysTickIntHandler(void)
+{
+ //
+ // Increment the system tick count.
+ //
+ g_ui32TickCounter++;
+
+ //
+ // After the current message has been processed,
+ // check the message buffer to see if we have received another complete
+ // message.
+ //
+ if(HWREGBITW(&g_ui32Flags, FLAG_HCI_MSG_COMPLETE) == 0)
+ {
+ if(MessageComplete(g_pui8Msg, &g_ui8MsgLen) == true)
+ {
+ HWREGBITW(&g_ui32Flags, FLAG_HCI_MSG_COMPLETE) = 1;
+ }
+ }
+
+ //
+ // Decrement g_ui32Delay to 1, if it is 1 already,
+ // meaning it has timed out.
+ //
+ if(g_ui32Delay > 1)
+ {
+ g_ui32Delay--;
+ }
+
+ //
+ // Draw a circle every 100ms
+ //
+ if(HWREGBITW(&g_ui32Flags, FLAG_DRAW_CIRCLE) == 1)
+ {
+ if(g_ui32TickCounter % 10 == 0)
+ {
+ DrawCircle();
+ }
+ }
+
+ //
+ // set FLAG_EVERY_SECOND every second.
+ // Systick interrupt is every 10ms, so a second is every 100 interrupts.
+ //
+ if(g_ui32TickCounter % 100 == 0)
+ {
+ HWREGBITW(&g_ui32Flags, FLAG_EVERY_SECOND) = 1;
+ }
+}
+
+//*****************************************************************************
+//
+// The UART interrupt handler.
+//
+//*****************************************************************************
+void
+UART3IntHandler(void)
+{
+ uint32_t ui32Status;
+
+ //
+ // Get the interrrupt status.
+ //
+ ui32Status = ROM_UARTIntStatus(UART3_BASE, true);
+
+ //
+ // Clear the asserted interrupts.
+ //
+ ROM_UARTIntClear(UART3_BASE, ui32Status);
+
+ //
+ // Loop while there are characters in the receive FIFO.
+ //
+ while(ROM_UARTCharsAvail(UART3_BASE))
+ {
+ //
+ // Check for buffer overflow case, this shouldn't happen
+ //
+ if((g_sRxBuf.ui8Wr == g_sRxBuf.ui8Rd) && g_sRxBuf.ui8Count)
+ {
+ UARTprintf("\nOF!!! Wr %d, Rd %d, Count %d\n", g_sRxBuf.ui8Wr, g_sRxBuf.ui8Rd, g_sRxBuf.ui8Count);
+ }
+
+ //
+ // Read the next character from the UART and place it in the RX buffer.
+ //
+ g_sRxBuf.pui8RXBuf[g_sRxBuf.ui8Wr++] = UARTCharGetNonBlocking(UART3_BASE);
+
+ //
+ // Check for the RX buffer wrap.
+ //
+ if(g_sRxBuf.ui8Wr >= BUF_SIZE)
+ {
+ g_sRxBuf.ui8Wr = 0;
+ }
+
+ //
+ // Increment the total count.
+ //
+ g_sRxBuf.ui8Count++;
+
+ }
+}
+
+//*****************************************************************************
+//
+// The touch screen driver calls this function to report all state changes.
+//
+//*****************************************************************************
+static int32_t
+TouchCallback(uint32_t ui32Message, int32_t i32X, int32_t i32Y)
+{
+ uint8_t ui8Loop;
+
+ if(ui32Message == WIDGET_MSG_PTR_UP)
+ {
+ //
+ // Check if the bottom of the screen is touched.
+ //
+ if(i32Y >= (200 - 8) && i32Y < (200 + 8))
+ {
+ if( (g_iState == STATE_READY_FOR_LINK_REQ) ||
+ (g_iState == STATE_START_DISCOVERY))
+ {
+ g_bDiscoveryReq = true;
+ }
+ else if(g_iState == STATE_LINKED)
+ {
+ g_bTermLinkReq = true;
+ }
+ }
+
+
+ //
+ // Check if any of three device names is touched when it is ready
+ // to connect
+ //
+ if(g_iState == STATE_READY_FOR_LINK_REQ)
+ {
+ for(ui8Loop = 0; ui8Loop < g_ui8DevFound; ui8Loop++)
+ {
+ if((g_ui8DevFound >= ui8Loop + 1) &&
+ (i32Y >= (60 + 40*ui8Loop - 20)) &&
+ (i32Y < (60 + 40*ui8Loop + 20)))
+ {
+ //
+ // save the device index and
+ // set flag to connect the device.
+ //
+ g_ui8DevConnect = ui8Loop;
+ g_bEstLinkReq = true;
+ break;
+ }
+ }
+ }
+ }
+
+ return(0);
+}
+
+//*****************************************************************************
+//
+// Send a command to the UART.
+//
+//*****************************************************************************
+void
+UARTSend(const uint8_t *pui8Buffer, uint32_t ui32Count)
+{
+ //
+ // Loop while there are more characters to send.
+ //
+ while(ui32Count--)
+ {
+ //
+ // Write the next character to the UART.
+ //
+ ROM_UARTCharPut(UART3_BASE, *pui8Buffer++);
+ }
+}
+
+//*****************************************************************************
+//
+// Simple function to dump the buffer contents to the UART debug port.
+//
+//*****************************************************************************
+void
+DumpBuffer(uint8_t *pui8Buf, uint32_t ui32Len, bool bTX)
+{
+ uint32_t ui32Idx = 0;
+
+ UARTprintf("\n%s: %d\n", (bTX?"TX":"RX"), ui32Len);
+ for(ui32Idx = 0; ui32Idx < ui32Len; ui32Idx++)
+ {
+ if(ui32Idx && (ui32Idx % 16 == 0))
+ {
+ UARTprintf("\n");
+ }
+ UARTprintf("%02x ", pui8Buf[ui32Idx]);
+ }
+ UARTprintf("\n\n");
+}
+
+//*****************************************************************************
+//
+// This function looks in the RX buffer and returns true if there is a complete
+// message, otherwise it returns false. The complete message will be taken out
+// from the RX buffer, and message itself and its length will be returned to
+// to the caller.
+// This function doesn't block, can be called from interrupt context.
+//
+//*****************************************************************************
+bool
+MessageComplete(uint8_t *pui8Buf, uint8_t *pui8Len)
+{
+ uint8_t ui8Idx;
+
+ if(g_sRxBuf.ui8Count < 7 )
+ {
+ //
+ // Minimum size of a message is 7+ bytes
+ //
+ return false;
+ }
+
+ //
+ // Byte 0: Type
+ // 1: EventCode
+ // 2: Data Length
+ // 3: Event LSB
+ // 4: Event MSB
+ // 5: Status
+ // ...
+ //
+
+ //
+ // Get the index of the Data Length, it is the byte[2]
+ //
+ ui8Idx = g_sRxBuf.ui8Rd+2;
+
+ //
+ // Check for buffer wrap
+ //
+ if(ui8Idx > BUF_SIZE -1)
+ {
+ ui8Idx -= BUF_SIZE;
+ }
+
+ //
+ // The whole message length should 3+Datalength
+ //
+ if(g_sRxBuf.ui8Count < (g_sRxBuf.pui8RXBuf[ui8Idx] + 3))
+ {
+ return false;
+ }
+
+ //
+ // Got a complete message.
+ // Return the length of the message
+ //
+ *pui8Len = g_sRxBuf.pui8RXBuf[ui8Idx] + 3;
+
+ //
+ // Take the rx data out of the buffer and return to caller.
+ //
+ for(ui8Idx = 0; ui8Idx < *pui8Len; ui8Idx++)
+ {
+ pui8Buf[ui8Idx] = g_sRxBuf.pui8RXBuf[g_sRxBuf.ui8Rd++];
+ //
+ // Check for buffer wrap
+ //
+ if(g_sRxBuf.ui8Rd >= BUF_SIZE)
+ {
+ g_sRxBuf.ui8Rd = 0;
+ }
+ }
+ g_sRxBuf.ui8Count -= *pui8Len;
+
+ return true;
+}
+
+//*****************************************************************************
+//
+// This function validates and parses the received message and return true
+// if it is valid message, it also return the command status of the message.
+// If the message is not valid, the function returns false.
+//
+//*****************************************************************************
+bool
+ProcessRxData( uint8_t *pui8CmdStatus)
+{
+ uint8_t ui8Idx;
+ uint16_t ui16Val;
+
+ //
+ // Printout the complete message
+ //
+ DumpBuffer(g_pui8Msg, g_ui8MsgLen, false);
+
+ //
+ // Quick check on the first and third bytes.
+ // The first byte should be 0x4(EVENT)
+ // The third byte should be the data length.
+ //
+ if((g_pui8Msg[0] != HCI_EVENT_PACKET) ||
+ ((g_pui8Msg[2] + 3) != g_ui8MsgLen))
+ {
+ //
+ // Invalid message, toss it
+ //
+ return false;
+ }
+
+ //
+ // Parse the message:
+ // The second byte is event code, it is either vendor specific event code
+ // 0xFF(HCI_VE_EVENT_CODE) or any BLE event code.
+ // 3rd and 4th byte are the event
+ //
+ if(g_pui8Msg[1] == HCI_VE_EVENT_CODE)
+ {
+ //BLE Ext Event
+ g_ui16Event = (g_pui8Msg[3] | (g_pui8Msg[4]<<8));
+ }
+ else
+ {
+ //BLE Event
+ g_ui16Event = g_pui8Msg[1];
+ }
+
+ //
+ // Get the status in the response(5th byte)
+ //
+ if(g_pui8Msg[1] == HCI_VE_EVENT_CODE)
+ {
+ //BLE Ext Event
+ *pui8CmdStatus = g_pui8Msg[5];
+ }
+ else
+ {
+ //BLE Event
+ *pui8CmdStatus = g_pui8Msg[6];
+ }
+
+ switch(g_ui16Event)
+ {
+ case GAP_HCI_EVENT_EXT_CMD_STATUS:
+ //
+ // CommandStatus Event
+ // Get the command opcode
+ //
+ g_ui16CmdStatusOpcode = (g_pui8Msg[6] | (g_pui8Msg[7]<<8));
+ if(g_ui16CmdStatusOpcode == HCI_VE_GAP_GET_PARAM_OPCODE)
+ {
+ //
+ // Save the parameters.
+ //
+ g_ui16Param[g_ui8ParamWrIdx++] = (g_pui8Msg[9] | (g_pui8Msg[10]<<8));
+ }
+ break;
+
+ case GAP_HCI_EVENT_EXT_DEVICE_INIT_DONE:
+ //
+ // DeviceInitDone Event
+ //
+ break;
+
+ case GAP_HCI_EVENT_EXT_DEVICE_INFO:
+ //
+ // Device Information Event
+ // parse the scan response
+ //
+ if(g_pui8Msg[6] == GAP_ADTYPE_SCAN_RSP_IND)
+ {
+ if(g_ui8DevFound < MAX_SLAVE_NUM)
+ {
+ //
+ // Save the device address
+ //
+ g_psDev[g_ui8DevFound].ui8AddrType = g_pui8Msg[7];
+ memcpy(g_psDev[g_ui8DevFound].pui8Addr, g_pui8Msg + 8, HCI_BDADDR_LEN);
+
+ //
+ // Get the device name
+ // Skip the first ht(0x9) char.
+ //
+ memcpy(g_psDev[g_ui8DevFound].pcName, &g_pui8Msg[18], (g_pui8Msg[16]-1));
+
+ //
+ // Null terminate the name string
+ //
+ g_psDev[g_ui8DevFound].pcName[g_pui8Msg[16] -1] = 0;
+
+ //
+ // Increment the number of devices found.
+ //
+ g_ui8DevFound++;
+ }
+ else
+ {
+ UARTprintf("More than %d device found, ignor this device\n", MAX_SLAVE_NUM);
+ }
+
+ }
+ break;
+
+ case GAP_HCI_EVENT_EXT_DEVICE_DISC_DONE:
+ //
+ // Device Discover Done Event
+ // print out devices' info
+ //
+ UARTprintf("%d Devices found\n", g_pui8Msg[6]);
+ for(ui8Idx = 0; ui8Idx < g_ui8DevFound; ui8Idx++)
+ {
+ UARTprintf("Device Name: %s\n", g_psDev[ui8Idx].pcName);
+ UARTprintf(" -Addr Type: %02x\n", g_psDev[ui8Idx].ui8AddrType);
+ UARTprintf(" -Addr: %02x:%02x:%02x:%02x:%02x:%02x\n",
+ g_psDev[ui8Idx].pui8Addr[5],
+ g_psDev[ui8Idx].pui8Addr[4],
+ g_psDev[ui8Idx].pui8Addr[3],
+ g_psDev[ui8Idx].pui8Addr[2],
+ g_psDev[ui8Idx].pui8Addr[1],
+ g_psDev[ui8Idx].pui8Addr[0]);
+ }
+ break;
+
+ case GAP_HCI_EVENT_EXT_DEVICE_LINK_DONE:
+ //
+ // Device EstablishLink Event
+ //
+ g_ui16Handle = (g_pui8Msg[13] | (g_pui8Msg[14] << 8));
+ UARTprintf("Device connected: %s\n", g_psDev[g_ui8DevConnect].pcName);
+ UARTprintf(" -Handle: %04x\n", g_ui16Handle);
+ UARTprintf(" -Addr Type: %04x\n", g_psDev[g_ui8DevConnect].ui8AddrType);
+ UARTprintf(" -Addr: %02x:%02x:%02x:%02x:%02x:%02x\n",
+ g_psDev[g_ui8DevConnect].pui8Addr[5],
+ g_psDev[g_ui8DevConnect].pui8Addr[4],
+ g_psDev[g_ui8DevConnect].pui8Addr[3],
+ g_psDev[g_ui8DevConnect].pui8Addr[2],
+ g_psDev[g_ui8DevConnect].pui8Addr[1],
+ g_psDev[g_ui8DevConnect].pui8Addr[0]);
+
+ break;
+
+ case GAP_HCI_EVENT_EXT_DEVICE_TERM_LINK_DONE:
+ //
+ // Device TerminateLink Event
+ //
+ UARTprintf("Device Disconnected, reason: %02x\n", g_pui8Msg[8]);
+ break;
+ case GAP_HCI_EVENT_EXT_DEVICE_PASSKEY_NEEDED:
+ break;
+
+ case GAP_HCI_EVENT_EXT_DEVICE_AUTHENTICATE_DONE:
+ //
+ // Save the LongTermKey for bond request
+ //
+ g_psDev[g_ui8DevConnect].sSaveKey.bValid = true;
+ ui8Idx = 37; // The DSInf.Enable field is at index 37 in the byte string.
+ g_psDev[g_ui8DevConnect].sSaveKey.bAuth = g_pui8Msg[ui8Idx++];
+
+ //
+ // Next byte is LTK size, followed by the LTK
+ //
+ g_psDev[g_ui8DevConnect].sSaveKey.ui8LTKSize = g_pui8Msg[ui8Idx++];
+ memcpy(g_psDev[g_ui8DevConnect].sSaveKey.pui8LTK,
+ g_pui8Msg + ui8Idx,
+ g_psDev[g_ui8DevConnect].sSaveKey.ui8LTKSize);
+ ui8Idx += g_psDev[g_ui8DevConnect].sSaveKey.ui8LTKSize;
+
+ //
+ // 2 bytes of DIV, followed by 8 bytes of Random number
+ //
+ g_psDev[g_ui8DevConnect].sSaveKey.pui8DIV[0] = g_pui8Msg[ui8Idx++];
+ g_psDev[g_ui8DevConnect].sSaveKey.pui8DIV[1] = g_pui8Msg[ui8Idx++];
+ memcpy(g_psDev[g_ui8DevConnect].sSaveKey.pui8Rand, g_pui8Msg + ui8Idx, 8);
+
+ break;
+ case GAP_HCI_EVENT_EXT_DEVICE_BOND_DONE:
+ UARTprintf("Bonded\n");
+ break;
+
+ case GAP_HCI_EVENT_EXT_ATT_WRITE_RSP:
+ break;
+
+ case GAP_HCI_EVENT_EXT_ATT_READ_RSP:
+ //
+ // this is the IR temperature response
+ //
+ memcpy(g_pui8IRTemp, g_pui8Msg + 9, 4);
+ HandleTemp();
+ break;
+
+ case HCI_ATT_ERROR_RSP_EVENT:
+ UARTprintf("Error Response event: \n");
+ break;
+
+ case GAP_HCI_EVENT_CMD_COMPLETE:
+ //
+ // Get the command opcode
+ //
+ g_ui16CmdStatusOpcode = (g_pui8Msg[4] | (g_pui8Msg[5]<<8));
+ if(g_ui16CmdStatusOpcode == HCI_READ_RSSI_OPCODE)
+ {
+ //
+ // RSSI reading response
+ //
+ g_i8RSSI = (int8_t)g_pui8Msg[9];
+ UARTprintf("RSSI = %d 0x%x\n", g_i8RSSI, g_pui8Msg[9]);
+
+ //
+ // Display the data when it is only in LINKED state
+ //
+ if(g_iState == STATE_LINKED)
+ {
+ DisplayRSSI(g_ui32Width / 2 + 80, 80 + 40);
+ }
+ }
+ break;
+
+ case GAP_HCI_EVENT_HANDLE_VALUE_NOTIFY:
+ if(g_pui8Msg[8] > 2) //PduLen
+ {
+ ui16Val = g_pui8Msg[9] | (g_pui8Msg[10] <<8);
+ switch(ui16Val)
+ {
+ case GATT_IRTEMP_DATA_UUID_HANDLE:
+ //
+ // Temperatur Sensor data
+ //
+ memcpy(g_pui8IRTemp, g_pui8Msg + 11, 4);
+
+ //
+ // Display the data when it is LINKED state
+ //
+ if(g_iState == STATE_LINKED)
+ {
+ HandleTemp();
+ }
+ break;
+
+ case GATT_HUMIDITY_DATA_UUID_HANDLE:
+ //
+ // Humidity Sensor data
+ //
+ memcpy(g_pui8Humidity, g_pui8Msg + 11, 4);
+
+ //
+ // Display the data when it is LINKED state
+ //
+ if(g_iState == STATE_LINKED)
+ {
+ HandleHumidity();
+ }
+ break;
+
+ default:
+ UARTprintf("unexpected handle: %04x, fix me\n", ui16Val);
+ break;
+
+ }
+ }
+ break;
+
+ default:
+ UARTprintf("unexpected event: %04x, fix me\n", g_ui16Event);
+ break;
+
+ }
+
+ return true;
+}
+
+//*****************************************************************************
+//
+// This function verifies if the received response is expected, and return
+// true if it is, false otherwise.
+//
+//*****************************************************************************
+bool
+VerifyMsg(uint16_t ui16ExpectedEvent, uint16_t ui16ExpectedEventParam,
+ uint8_t *pui8Status)
+{
+ uint8_t ui8CmdStatus;
+
+ if(ProcessRxData(&ui8CmdStatus) == 0)
+ {
+ //
+ // Message is not valid
+ //
+ return false;
+ }
+
+ if(ui8CmdStatus != SUCCESS)
+ {
+ //
+ // Message return non-success status code
+ //
+ UARTprintf("Command Status return failure: %02x\n", ui8CmdStatus);
+ }
+
+ //
+ // Pass the status code to the caller if a location is provided.
+ if(pui8Status)
+ {
+ *pui8Status = ui8CmdStatus;
+ }
+
+ //
+ // check the received event
+ //
+ UARTprintf("RX: event 0x%04x\n", g_ui16Event);
+ if(ui16ExpectedEvent)
+ {
+ //
+ // We are expecting a specific event, check it.
+ //
+ if(g_ui16Event == ui16ExpectedEvent)
+ {
+ //
+ // Validate Event param if supplied.
+ //
+ if(ui16ExpectedEventParam)
+ {
+ if(ui16ExpectedEventParam == g_ui16CmdStatusOpcode)
+ {
+ return true;
+ }
+ }
+ else
+ {
+ //
+ // No need to verify EventParam
+ //
+ return true;
+ }
+ }
+ }
+ else
+ {
+ //
+ // We are NOT expecting any specific event, just return true.
+ //
+ return true;
+ }
+
+ return false;
+}
+
+//*****************************************************************************
+//
+// This function sets the timeout and waits for the given event, the function
+// will return true when the expected event has been received before the
+// timeout; or return false when the expected event has not been received
+// before the timeout.
+//
+//*****************************************************************************
+bool
+WaitForRsp(uint16_t ui16ExpectedEvent, uint16_t ui16ExpectedParam,
+ uint32_t ui32TimeoutMs, uint8_t *pui8Status)
+{
+ bool bRet = false;
+
+ //
+ // Set the timeout if non zero
+ // i32Timeout is in ms, convert it to number of systicks.
+ // Systick timer is every 10ms, so ui32TimeoutMs/10 + 1
+ //
+ g_ui32Delay = ui32TimeoutMs?(ui32TimeoutMs/10 + 1):0;
+
+ //
+ // Block until there is a response or timeout
+ //
+ while(g_ui32Delay > 1)
+ {
+ if(HWREGBITW(&g_ui32Flags, FLAG_HCI_MSG_COMPLETE) == 1)
+ {
+ //
+ // Got a response
+ //
+ bRet = VerifyMsg(ui16ExpectedEvent, ui16ExpectedParam, pui8Status);
+ if(bRet)
+ {
+ //
+ // Got what we expected, disable timeout, and exit the loop
+ //
+ g_ui32Delay = 0;
+ }
+
+ //
+ // Clear the flag to indicate we are ready to receive the next
+ // complete message
+ //
+ HWREGBITW(&g_ui32Flags, FLAG_HCI_MSG_COMPLETE) = 0;
+ }
+ }
+
+ //
+ // Check for timeout
+ //
+ if(g_ui32Delay == 1)
+ {
+ UARTprintf("\nTimeout waiting for response..%04x.\n",
+ ui16ExpectedEvent);
+ }
+
+ return bRet;
+}
+
+//*****************************************************************************
+//
+// This function checks if there are any events in the queue to be processed.
+// Such as notify event, it will be sent from slave periodically.
+//
+//*****************************************************************************
+bool
+CheckForMsg()
+{
+ bool bSuccess = false;
+
+ if(HWREGBITW(&g_ui32Flags, FLAG_HCI_MSG_COMPLETE) == 1)
+ {
+ //
+ // Got a response
+ //
+ bSuccess = VerifyMsg(0, 0, 0);
+ if(g_ui16Event == GAP_HCI_EVENT_EXT_DEVICE_TERM_LINK_DONE)
+ {
+ UARTprintf("Slave terminated the link\n");
+
+ //
+ // Sensor will be turned off by the slave
+ //
+ HWREGBITW(&g_ui32Flags, FLAG_SENSOR_CFGD) = 0;
+
+ //
+ // Go back to TERMED state
+ //
+ g_iState = STATE_TERMED;
+ }
+
+ //
+ // Clear the flag to indicate we are ready to receive the next
+ // complete message
+ //
+ HWREGBITW(&g_ui32Flags, FLAG_HCI_MSG_COMPLETE) = 0;
+ }
+
+ return bSuccess;
+
+}
+
+//*****************************************************************************
+//
+// This function configures the sensor profiles.
+//
+//*****************************************************************************
+void
+ConfigureSensors(void)
+{
+ uint8_t pui8Byte[2];
+ uint8_t ui8Status;
+ bool bSuccess;
+
+ //
+ // Enable IR Sensor and Measurements if it is not yet configured.
+ //
+ if(HWREGBITW(&g_ui32Flags, FLAG_SENSOR_CFGD) == 1)
+ {
+ return;
+ }
+
+ UARTprintf("Send Temp sensor wake cmd...\n");
+ pui8Byte[0] = 0x01;
+ GAPWriteCharValue(g_ui16Handle, GATT_IRTEMP_CFG_UUID_HANDLE, pui8Byte, 1);
+
+ //
+ // Wait for CommandStatus response, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_DEVICE_WRITE_CHAR_VAL_OPCODE, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("ConfigureSensors: Wait for CommandStatus error\n");
+ }
+
+ //
+ // Wait for ATT_WriteRsp event, timeout after 500ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_ATT_WRITE_RSP, 0, 500, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("ConfigureSensors: Wait for ATT_WriteRsp error\n");
+ }
+
+ //
+ // Humidity Sensor
+ //
+ UARTprintf("Send humidity sensor wake cmd...\n");
+ GAPWriteCharValue(g_ui16Handle, GATT_HUMIDITY_CFG_UUID_HANDLE, pui8Byte, 1);
+
+ //
+ // Wait for CommandStatus response, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_DEVICE_WRITE_CHAR_VAL_OPCODE, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("ConfigureSensors: Wait for CommandStatus error\n");
+ }
+
+ //
+ // Wait for ATT_WriteRsp event, timeout after 500ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_ATT_WRITE_RSP, 0, 500, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("ConfigureSensors: Wait for ATT_WriteRsp error\n");
+ }
+
+ UARTprintf("Send Temp sensor notify cmd...\n");
+ pui8Byte[0] = 0x01;
+ pui8Byte[1] = 0x00;
+ GAPWriteCharValue(g_ui16Handle, GATT_IRTEMP_NOTIFY_UUID_HANDLE, pui8Byte, 2);
+
+ //
+ // Wait for CommandStatus response, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_DEVICE_WRITE_CHAR_VAL_OPCODE, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("ConfigureSensors: Wait for CommandStatus error\n");
+ }
+
+ //
+ // Wait for ATT_WriteRsp event, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_ATT_WRITE_RSP, 0, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("ConfigureSensors: Wait for ATT_WriteRsp error\n");
+ }
+
+ //
+ // Humidity Sensor
+ //
+ UARTprintf("Send Humidity sensor notify cmd...\n");
+ GAPWriteCharValue(g_ui16Handle, GATT_HUMIDITY_NOTIDY_UUID_HANDLE, pui8Byte, 2);
+
+ //
+ // Wait for CommandStatus response, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_DEVICE_WRITE_CHAR_VAL_OPCODE, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("ConfigureSensors: Wait for CommandStatus error\n");
+ }
+
+ //
+ // Wait for ATT_WriteRsp event, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_ATT_WRITE_RSP, 0, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("ConfigureSensors: Wait for ATT_WriteRsp error\n");
+ }
+
+ //
+ // Set the flag that sensors are configured.
+ //
+ HWREGBITW(&g_ui32Flags, FLAG_SENSOR_CFGD) = 1;
+}
+
+//*****************************************************************************
+//
+// This function deconfigures the sensor profiles.
+//
+//*****************************************************************************
+void
+DeConfigureSensors(void)
+{
+ uint8_t pui8Byte[2];
+ uint8_t ui8Status;
+ bool bSuccess;
+
+ if(HWREGBITW(&g_ui32Flags, FLAG_SENSOR_CFGD) == 0)
+ {
+ // Do nothing if the sensors have not been configured.
+ return;
+ }
+
+ //
+ // TM006 IR and Ambient temperature sensor
+ //
+ UARTprintf("Send Temp sensor stop notify cmd...\n");
+ pui8Byte[0] = 0x00;
+ pui8Byte[1] = 0x00;
+ GAPWriteCharValue(g_ui16Handle, GATT_IRTEMP_NOTIFY_UUID_HANDLE, pui8Byte, 2);
+
+ //
+ // Wait for CommandStatus response, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_DEVICE_WRITE_CHAR_VAL_OPCODE, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("DeConfigureSensors: Wait for CommandStatus error\n");
+ }
+
+ //
+ // Humidity Sensor
+ //
+ UARTprintf("Send Humidity sensor stop notify cmd...\n");
+ GAPWriteCharValue(g_ui16Handle, GATT_HUMIDITY_NOTIDY_UUID_HANDLE, pui8Byte, 2);
+
+ //
+ // Wait for CommandStatus response, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_DEVICE_WRITE_CHAR_VAL_OPCODE, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("DeConfigureSensors: Wait for CommandStatus error\n");
+ }
+
+ //
+ // Wait for ATT_WriteRsp event, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_ATT_WRITE_RSP, 0, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("DeConfigureSensors: Wait for ATT_WriteRsp error\n");
+ }
+
+ //
+ // Put IR Sensor and Measurements to sleep
+ //
+ UARTprintf("Send IR Temp sensor sleep cmd...\n");
+ pui8Byte[0] = 0x00;
+ GAPWriteCharValue(g_ui16Handle, GATT_IRTEMP_CFG_UUID_HANDLE, pui8Byte, 1);
+
+ //
+ // Wait for CommandStatus response, timeout after 500ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_DEVICE_WRITE_CHAR_VAL_OPCODE, 500, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("DeConfigureSensors: Wait for CommandStatus error\n");
+ }
+
+ //
+ // Wait for ATT_WriteRsp event, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_ATT_WRITE_RSP, 0, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("DeConfigureSensors: Wait for ATT_WriteRsp error\n");
+ }
+
+ UARTprintf("Send Humidity sensor sleep cmd...\n");
+ GAPWriteCharValue(g_ui16Handle, GATT_HUMIDITY_CFG_UUID_HANDLE, pui8Byte, 1);
+
+ //
+ // Wait for CommandStatus response, timeout after 500ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_DEVICE_WRITE_CHAR_VAL_OPCODE, 500, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("DeConfigureSensors: Wait for CommandStatus error\n");
+ }
+
+ //
+ // Wait for ATT_WriteRsp event, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_ATT_WRITE_RSP, 0, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("DeConfigureSensors: Wait for ATT_WriteRsp error\n");
+ }
+ HWREGBITW(&g_ui32Flags, FLAG_SENSOR_CFGD) = 0;
+
+}
+
+//*****************************************************************************
+//
+// This function queries the parameters of the central device.
+//
+//*****************************************************************************
+bool
+GetParam(void)
+{
+ uint8_t ui8Status;
+ bool bSuccess;
+
+ UARTprintf("Get Param...\n");
+
+ //
+ // Start Parameter write index with 0
+ //
+ g_ui8ParamWrIdx = 0;
+
+ //
+ // Get the Minimum Link Layer connection interval
+ //
+ GAPGetParam(TGAP_CONN_EST_INT_MIN);
+
+ //
+ // Wait for CommandStatus response, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_GET_PARAM_OPCODE, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("Get Param %x failed\n", TGAP_CONN_EST_INT_MIN);
+ }
+
+ //
+ // Get the Maximum Link Layer connection interval
+ //
+ GAPGetParam(TGAP_CONN_EST_INT_MAX);
+
+ //
+ // Wait for CommandStatus response, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_GET_PARAM_OPCODE, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("Get Param %x failed\n", TGAP_CONN_EST_INT_MAX);
+ }
+
+ //
+ // Get the Link Layer connection slave latency
+ //
+ GAPGetParam(TGAP_CONN_EST_LATENCY);
+
+ //
+ // Wait for CommandStatus response, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_GET_PARAM_OPCODE, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("Get Param %x failed\n", TGAP_CONN_EST_LATENCY);
+ }
+
+ //
+ // Get the Link Layer connection supervision timeout
+ //
+ GAPGetParam(TGAP_CONN_EST_SUPERV_TIMEOUT);
+ //
+ // Wait for CommandStatus response, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_GET_PARAM_OPCODE, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+ UARTprintf("Get Param %x failed\n", TGAP_CONN_EST_SUPERV_TIMEOUT);
+ }
+
+ if(g_ui16Param[0] != 0 && g_ui16Param[1] != 0 && g_ui16Param[3] != 0)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+//*****************************************************************************
+//
+// This function set the parameters of the central device.
+//
+//*****************************************************************************
+bool
+SetParam(void)
+{
+ uint8_t ui8Status;
+ bool bSuccess;
+
+ UARTprintf("Set Param...\n");
+
+ //
+ // Set the Minimum Link Layer connection interval
+ //
+ GAPSetParam(TGAP_CONN_EST_INT_MIN, g_ui16Param[0]);
+
+ //
+ // Wait for CommandStatus response, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_SET_PARAM_OPCODE, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+
+ UARTprintf("Set Param %x failed\n", TGAP_CONN_EST_INT_MIN);
+ }
+
+ //
+ // Set the Maximum Link Layer connection interval
+ //
+ GAPSetParam(TGAP_CONN_EST_INT_MAX, g_ui16Param[1]);
+
+ //
+ // Wait for CommandStatus response, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_SET_PARAM_OPCODE, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+
+ UARTprintf("Set Param %x failed\n", TGAP_CONN_EST_INT_MAX);
+ }
+
+ //
+ // Set the Link Layer connection slave latency
+ //
+ GAPSetParam(TGAP_CONN_EST_LATENCY, g_ui16Param[2]);
+
+ //
+ // Wait for CommandStatus response, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_SET_PARAM_OPCODE, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+
+ UARTprintf("Set Param %x failed\n", TGAP_CONN_EST_LATENCY);
+ }
+
+ //
+ // Set the Link Layer connection supervision timeout
+ //
+ GAPSetParam(TGAP_CONN_EST_SUPERV_TIMEOUT, g_ui16Param[3]);
+
+ //
+ // Wait for CommandStatus response, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_SET_PARAM_OPCODE, 200, &ui8Status);
+ if(!bSuccess || ui8Status)
+ {
+
+ UARTprintf("Set Param %x failed\n", TGAP_CONN_EST_SUPERV_TIMEOUT);
+ }
+
+ return bSuccess;
+}
+
+//*****************************************************************************
+//
+// This function authenticates with the slave device.
+//
+//*****************************************************************************
+bool
+Authenticate(void)
+{
+ bool bSuccess = false;
+ uint8_t ui8Status;
+
+ if(g_psDev[g_ui8DevConnect].sSaveKey.bValid == false)
+ {
+ UARTprintf("Initiate Pairing Request...\n");
+ GAPAuthenticate(g_ui16Handle);
+
+ //
+ // Wait for CommandStatus response, timeout after 100ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_DEVICE_AUTHENTICATE_OPCODE, 100, &ui8Status);
+ if(bSuccess && ui8Status == SUCCESS)
+ {
+ //
+ // Wait for PasskeyNeeded event, timeout after 1s
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_DEVICE_PASSKEY_NEEDED, 0, 1000, &ui8Status);
+ if(bSuccess && ui8Status == SUCCESS)
+ {
+ //
+ // Got PasskeyNeeded event, send the key
+ //
+ GAPPassKeyUpdate(g_ui16Handle, "000000");
+
+ //
+ // Wait for CommandStatus response, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_DEVICE_PASSKEY_UPDATE_OPCODE, 200, &ui8Status);
+ if(bSuccess && ui8Status == SUCCESS)
+ {
+ //
+ // Wait for AuthenticationComplete event, timeout after 5s
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_DEVICE_AUTHENTICATE_DONE, 0, 5000, &ui8Status);
+ }
+ }
+ }
+ }
+ else
+ {
+ UARTprintf("Bond Request...\n");
+ GAPBond(g_ui16Handle, &g_psDev[g_ui8DevConnect].sSaveKey);
+
+ //
+ // Wait for CommandStatus response, timeout after 100ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_DEVICE_BOND_OPCODE, 100, &ui8Status);
+ if(bSuccess && ui8Status == SUCCESS)
+ {
+ //
+ // Wait for BondComplete event, timeout after 1s
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_DEVICE_BOND_DONE, 0, 1000, &ui8Status);
+ }
+ }
+
+ if(ui8Status != SUCCESS)
+ {
+ UARTprintf("Authenticate failure 0x%x\n", ui8Status);
+ return false;
+ }
+ return bSuccess;
+}
+
+//*****************************************************************************
+//
+// This function establishes link to the slave.
+//
+//*****************************************************************************
+bool
+EstablishLink(uint8_t ui8DevIdx)
+{
+ bool bSuccess = false;
+ uint8_t ui8Status;
+
+ UARTprintf("Link Request on device %d...\n", ui8DevIdx);
+
+ GAPEstLinkReq(false, false, g_psDev[ui8DevIdx].ui8AddrType, g_psDev[ui8DevIdx].pui8Addr);
+
+ //
+ // Wait for CommandStatus response, timeout after 100ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_DEVICE_EST_LINK_REQ_OPCODE, 100, &ui8Status);
+ if(bSuccess && (ui8Status == SUCCESS || ui8Status == bleAlreadyInRequestedMode))
+ {
+ //
+ // Wait for EstablishLink response, timeout after 15s
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_DEVICE_LINK_DONE, 0, 15000, &ui8Status);
+ if(bSuccess && ui8Status == SUCCESS)
+ {
+ //
+ // Got DeviceInitDone response, go to the next state
+ //
+ if(g_bInitPairReq == true)
+ {
+ bSuccess = Authenticate();
+ }
+ }
+ }
+
+ if(ui8Status != SUCCESS)
+ {
+ return false;
+ }
+ return bSuccess;
+}
+
+//*****************************************************************************
+//
+// This function terminates the link.
+//
+//*****************************************************************************
+bool
+TerminateLink(void)
+{
+ bool bSuccess = false;
+ uint8_t ui8Status;
+
+ UARTprintf("Terminate Link Request...\n");
+
+ DeConfigureSensors();
+
+ //
+ // Send TeminateLink request
+ //
+ GAPTerLinkReq(g_ui16Handle, HCI_DISCONNECT_REMOTE_USER_TERM);
+
+ //
+ // Wait for CommandStatus response, timeout after 200ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_DEVICE_TER_LINK_REQ_OPCODE, 200, &ui8Status);
+ if(bSuccess && ui8Status == SUCCESS)
+ {
+ //
+ // Wait for TerminateLink event, timeout after 1s
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_DEVICE_TERM_LINK_DONE, 0, 1000, &ui8Status);
+ }
+
+ if(ui8Status != SUCCESS)
+ {
+ return false;
+ }
+ return bSuccess;
+}
+
+//*****************************************************************************
+//
+// This function draws the animated circle during discovery state
+//
+//*****************************************************************************
+void
+DrawCircle(void)
+{
+ uint32_t ui32Idx;
+
+ //
+ // Loop through the circles in the animation.
+ //
+ for(ui32Idx = 0; ui32Idx < 8; ui32Idx++)
+ {
+ //
+ // Draw this circle.
+ //
+ GrContextForegroundSet(&g_sContext,
+ g_pui32CircleColor[(g_ui32ColorIdx +
+ ui32Idx) & 7]);
+ GrCircleFill(&g_sContext,
+ (g_ui32Width / 2) + g_ppi32CirclePos[ui32Idx][0],
+ (g_ui32Height / 2) + g_ppi32CirclePos[ui32Idx][1] + 24,
+ 2);
+ }
+
+ //
+ // Increment the color index.
+ //
+ g_ui32ColorIdx++;
+}
+
+//*****************************************************************************
+//
+// Clear the screen
+//
+//*****************************************************************************
+void ClearScreen(void)
+{
+ tRectangle sRect;
+
+ //
+ // Clear the display.
+ //
+ sRect.i16XMin = 0;
+ sRect.i16YMin = 0;
+ sRect.i16XMax = g_ui32Width - 1;
+ sRect.i16YMax = g_ui32Height - 1;
+ GrContextForegroundSet(&g_sContext, ClrBlack);
+ GrRectFill(&g_sContext, &sRect);
+ GrContextForegroundSet(&g_sContext, ClrWhite);
+}
+
+//*****************************************************************************
+//
+// Update the display.
+//
+//*****************************************************************************
+void
+UpdateDisplay(eDisplayUpdateIdx eUpdate)
+{
+ uint8_t ui8Loop;
+ char pcBuf[20];
+
+ //
+ // Clear the middle section of the display
+ //
+ ClearScreen();
+
+ //
+ // Update the middle of screen
+ //
+ if(eUpdate == iConnecting)
+ {
+ //
+ // show the to be connected device only
+ //
+ GrStringDrawCentered(&g_sContext, g_psDev[g_ui8DevConnect].pcName, -1,
+ g_ui32Width / 2, 60 + (40*g_ui8DevConnect), false);
+
+ //
+ // Convert the device address into a string.
+ //
+ usprintf(pcBuf, "(%02x:%02x:%02x:%02x:%02x:%02x)",
+ g_psDev[g_ui8DevConnect].pui8Addr[5],
+ g_psDev[g_ui8DevConnect].pui8Addr[4],
+ g_psDev[g_ui8DevConnect].pui8Addr[3],
+ g_psDev[g_ui8DevConnect].pui8Addr[2],
+ g_psDev[g_ui8DevConnect].pui8Addr[1],
+ g_psDev[g_ui8DevConnect].pui8Addr[0]);
+ GrContextFontSet(&g_sContext, g_psFontCm14);
+ GrStringDrawCentered(&g_sContext, pcBuf, -1,
+ g_ui32Width / 2, 60 + (40*g_ui8DevConnect + 16), false);
+ GrContextFontSet(&g_sContext, g_psFontCmss16b);
+
+ }
+ else if(eUpdate == iDisconnect)
+ {
+ GrStringDraw(&g_sContext, "IR Temperature:", -1,
+ (g_ui32Width / 2) - 110, 80, false);
+ GrStringDraw(&g_sContext, "Ambient Temperature:", -1,
+ (g_ui32Width / 2) - 110, 80 + 20, false);
+ GrStringDraw(&g_sContext, "RSSI:", -1,
+ (g_ui32Width / 2) - 110, 80 + 40, false);
+ GrStringDraw(&g_sContext, "Humidity:", -1,
+ (g_ui32Width / 2) - 110, 80 + 60, false);
+
+ //
+ // clear the sensor date
+ //
+ g_dIRTemp = 0;
+ g_dAmbTemp = 0;
+ g_dHumidity = 0;
+ g_i8RSSI = 0;
+
+ DisplayTemp(g_ui32Width / 2 + 80, 80);
+ DisplayRSSI(g_ui32Width / 2 + 80, 80 + 40);
+ DisplayHumidity(g_ui32Width / 2 + 80, 80 + 60);
+ }
+ else
+ {
+ if(ppcString[eUpdate][0])
+ {
+ GrStringDrawCentered(&g_sContext, ppcString[eUpdate][0], -1,
+ g_ui32Width / 2, (g_ui32Height / 2) - 18, false);
+ }
+ else
+ {
+
+ for(ui8Loop = 0; ui8Loop < g_ui8DevFound; ui8Loop++)
+ {
+ GrStringDrawCentered(&g_sContext, g_psDev[ui8Loop].pcName, -1,
+ g_ui32Width / 2, 60 + (40*ui8Loop), false);
+
+ //
+ // Convert the device address into a string.
+ //
+ usprintf(pcBuf, "(%02x:%02x:%02x:%02x:%02x:%02x)",
+ g_psDev[ui8Loop].pui8Addr[5],
+ g_psDev[ui8Loop].pui8Addr[4],
+ g_psDev[ui8Loop].pui8Addr[3],
+ g_psDev[ui8Loop].pui8Addr[2],
+ g_psDev[ui8Loop].pui8Addr[1],
+ g_psDev[ui8Loop].pui8Addr[0]);
+ GrContextFontSet(&g_sContext, g_psFontCm14);
+ GrStringDrawCentered(&g_sContext, pcBuf, -1,
+ g_ui32Width / 2, 60 + (40*ui8Loop + 16), false);
+ GrContextFontSet(&g_sContext, g_psFontCmss16b);
+ }
+ }
+ }
+
+ //
+ // Update the bottom text.
+ //
+ if(ppcString[eUpdate][1])
+ {
+ GrStringDrawCentered(&g_sContext, ppcString[eUpdate][1], -1,
+ g_ui32Width / 2, 200, false);
+ }
+}
+
+//*****************************************************************************
+//
+// Calculate the object temperature from TMP006 reading.
+// Refer to TMP006 data sheet.
+//
+//*****************************************************************************
+double
+calculateTemp(int16_t i16Tdie, int16_t i16Vobj)
+{
+ double Vobj2 = (double)i16Vobj*.00000015625;
+ double i16Tdie2 = (double)i16Tdie*.03125 + 273.15;
+ double S0 = 6.40*pow(10,-14);
+ double a1 = 1.75*pow(10,-3);
+ double a2 = -1.678*pow(10,-5);
+ double b0 = -2.94*pow(10,-5);
+ double b1 = -5.70*pow(10,-8);
+ double b2 = 4.63*pow(10,-10);
+ double c2 = 13.4;
+ double Tref = 298.15;
+ double S = S0*(1+a1*(i16Tdie2 - Tref)+a2*pow((i16Tdie2 - Tref),2));
+ double Vos = b0 + b1*(i16Tdie2 - Tref) + b2*pow((i16Tdie2 - Tref),2);
+ double fObj = (Vobj2 - Vos) + c2*pow((Vobj2 - Vos),2);
+ double Tobj = pow(pow(i16Tdie2,4) + (fObj/S),.25);
+ return (Tobj - 273.15);
+}
+
+//*****************************************************************************
+//
+// This function converts the raw temperature reading to actual temperature in
+// C and displays the temperatures on the display.
+//
+//*****************************************************************************
+void
+HandleTemp(void)
+{
+ int16_t i16VObj, i16TDie;
+
+ UARTprintf("IR %02x %02x %02x %02x\n", g_pui8IRTemp[0], g_pui8IRTemp[1],
+ g_pui8IRTemp[2], g_pui8IRTemp[3]);
+ //
+ // The first two bytes are Object Voltage,
+ // the last two bytes are Die temperature
+ //
+ i16VObj = (int16_t)(g_pui8IRTemp[0] | (g_pui8IRTemp[1]<<8));
+ i16TDie = (int16_t)(g_pui8IRTemp[2] | (g_pui8IRTemp[3]<<8));
+ if(i16VObj && i16TDie)
+ {
+ g_dIRTemp = calculateTemp(i16TDie>>2, i16VObj);
+ g_dAmbTemp = (double)i16TDie /128.0;
+ DisplayTemp(g_ui32Width / 2 + 80, 80);
+ }
+}
+
+//*****************************************************************************
+//
+// This function converts the raw humidity to humidity in rH and displays it
+// on the display.
+//
+//*****************************************************************************
+void
+HandleHumidity(void)
+{
+ uint16_t ui16RawH;
+
+ //
+ // The first two bytes are temperature(ignored)
+ // the last two bytes are humitity
+ //
+ ui16RawH = (g_pui8Humidity[2] | (g_pui8Humidity[3]<<8));
+ UARTprintf("Humidity %04x\n", ui16RawH);
+
+ //
+ // Conversion algorithm for Humidity
+ //
+ ui16RawH &= ~0x0003; // clear bits [1..0] (status bits)
+ g_dHumidity = -6.0 + (125.0 *(double)ui16RawH)/65536; // RH= -6 + 125 * SRH/2^16
+ DisplayHumidity(g_ui32Width / 2 + 80, 80 + 60);
+}
+
+//*****************************************************************************
+//
+// Display IR and Ambient temperatures on the display.
+//
+//*****************************************************************************
+void
+DisplayTemp(uint32_t ui32X, uint32_t ui32Y)
+{
+ char pcBuf[16];
+ int16_t i16IRInt, i16IRFrac;
+ tRectangle sRect;
+
+ i16IRInt = ((int16_t)(g_dIRTemp*100))/100;
+ i16IRFrac = (int16_t)(g_dIRTemp*100) - i16IRInt*100;
+ UARTprintf("IR temp = %d.%d\n", i16IRInt, i16IRFrac);
+
+ //
+ // Convert the temperature into a string.
+ //
+ usprintf(pcBuf, "%d.%dC", i16IRInt, i16IRFrac);
+
+ //
+ // Clear the previous reading.
+ //
+ sRect.i16XMin = ui32X;
+ sRect.i16YMin = ui32Y;
+ sRect.i16XMax = ui32X + 60;
+ sRect.i16YMax = ui32Y + 20;
+ GrContextForegroundSet(&g_sContext, ClrBlack);
+ GrRectFill(&g_sContext, &sRect);
+ GrContextForegroundSet(&g_sContext, ClrWhite);
+
+ //
+ // Display the IR temperature.
+ //
+ GrStringDraw(&g_sContext, pcBuf, -1, ui32X, ui32Y, false);
+
+ i16IRInt = ((int16_t)(g_dAmbTemp*100))/100;
+ i16IRFrac = (int16_t)(g_dAmbTemp*100) - i16IRInt*100;
+ UARTprintf("Ambient temp = %d.%d\n", i16IRInt, i16IRFrac);
+
+ //
+ // Convert the temperature into a string.
+ //
+ usprintf(pcBuf, "%d.%dC", i16IRInt, i16IRFrac);
+
+ //
+ // Clear the previous temperature.
+ //
+ sRect.i16XMin = ui32X;
+ sRect.i16YMin = ui32Y + 20;
+ sRect.i16XMax = ui32X + 60;
+ sRect.i16YMax = ui32Y + 40;
+ GrContextForegroundSet(&g_sContext, ClrBlack);
+ GrRectFill(&g_sContext, &sRect);
+ GrContextForegroundSet(&g_sContext, ClrWhite);
+
+ //
+ // Display the Ambient temperatur.
+ //
+ GrStringDraw(&g_sContext, pcBuf, -1, ui32X, ui32Y + 20, false);
+}
+
+//*****************************************************************************
+//
+// Display RSSI on the display.
+//
+//*****************************************************************************
+void
+DisplayRSSI(uint32_t ui32X, uint32_t ui32Y)
+{
+ char pcBuf[16];
+ tRectangle sRect;
+
+ //
+ // Convert the RSSI data into a string.
+ //
+ if(g_i8RSSI >= 0)
+ {
+ //
+ // RSSI has to be negative value, discard the nonvalid data.
+ //
+ return;
+ }
+ usprintf(pcBuf, "%ddBm", g_i8RSSI);
+
+ //
+ // Clear the previous reading.
+ //
+ sRect.i16XMin = ui32X;
+ sRect.i16YMin = ui32Y;
+ sRect.i16XMax = ui32X + 60;
+ sRect.i16YMax = ui32Y + 20;
+ GrContextForegroundSet(&g_sContext, ClrBlack);
+ GrRectFill(&g_sContext, &sRect);
+ GrContextForegroundSet(&g_sContext, ClrWhite);
+
+ //
+ // Display on the screen.
+ //
+ GrStringDraw(&g_sContext, pcBuf, -1, ui32X, ui32Y, false);
+}
+
+//*****************************************************************************
+//
+// Display Humidity on the display.
+//
+//*****************************************************************************
+void
+DisplayHumidity(uint32_t ui32X, uint32_t ui32Y)
+{
+ char pcBuf[16];
+ tRectangle sRect;
+ uint16_t ui8Int, ui8Frac;
+
+ ui8Int = (uint16_t)(g_dHumidity);
+ ui8Frac = (uint16_t)(g_dHumidity*10) - ui8Int*10;
+ UARTprintf("Humidity = %02d.%01d\n", ui8Int, ui8Frac);
+
+ //
+ // Convert the humidity into a string.
+ //
+ usprintf(pcBuf, "%d.%01d%%rH", ui8Int, ui8Frac);
+
+ //
+ // Clear the previous reading.
+ //
+ sRect.i16XMin = ui32X;
+ sRect.i16YMin = ui32Y;
+ sRect.i16XMax = ui32X + 70;
+ sRect.i16YMax = ui32Y + 20;
+ GrContextForegroundSet(&g_sContext, ClrBlack);
+ GrRectFill(&g_sContext, &sRect);
+ GrContextForegroundSet(&g_sContext, ClrWhite);
+
+ //
+ // Display on the screen.
+ //
+ GrStringDraw(&g_sContext, pcBuf, -1, ui32X, ui32Y, false);
+}
+
+//*****************************************************************************
+//
+// This example demonstrates how to communicate a BLE slave using TI's CC2540
+// EM on TM4C129X Development board.
+//
+//*****************************************************************************
+int
+main(void)
+{
+ uint32_t ui32SysClock;
+ bool bSuccess;
+ uint8_t ui8Status;
+ uint8_t pui8IRKOrCSRK[16];
+
+ //
+ // Run from the PLL at 120 MHz.
+ //
+ ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
+ SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |
+ SYSCTL_CFG_VCO_480), 120000000);
+
+ //
+ // Configure the device pins.
+ //
+ PinoutSet();
+
+ //
+ // Initialize the display driver.
+ //
+ Kentec320x240x16_SSD2119Init(ui32SysClock);
+
+ //
+ // Initialize the graphics context.
+ //
+ GrContextInit(&g_sContext, &g_sKentec320x240x16_SSD2119);
+
+ //
+ // Draw the application frame.
+ //
+ FrameDraw(&g_sContext, "ble-central");
+ GrContextFontSet(&g_sContext, g_psFontCmss16b);
+
+ //
+ // Initialize the touch screen driver
+ //
+ TouchScreenInit(ui32SysClock);
+ TouchScreenCallbackSet(TouchCallback);
+
+ //
+ // UART 0 is used for debugging message console.
+ //
+ UARTStdioConfig(0, 115200, ui32SysClock);
+
+ UARTprintf("\nBLE Central demo running...\n");
+
+ //
+ // Get the width and height of the display.
+ //
+ g_ui32Width = GrContextDpyWidthGet(&g_sContext);
+ g_ui32Height = GrContextDpyHeightGet(&g_sContext);
+
+ //
+ // UART3 is used to communicate with CC2540, configure the pins.
+ // PJ0, 1, 4, 5 are used for UART3.
+ //
+ ROM_GPIOPinConfigure(GPIO_PJ0_U3RX);
+ ROM_GPIOPinConfigure(GPIO_PJ1_U3TX);
+ ROM_GPIOPinConfigure(GPIO_PJ4_U3RTS);
+ ROM_GPIOPinConfigure(GPIO_PJ5_U3CTS);
+ ROM_GPIOPinTypeUART(GPIO_PORTJ_BASE, GPIO_PIN_0 | GPIO_PIN_1 |
+ GPIO_PIN_4 | GPIO_PIN_5);
+
+ //
+ // EnableUART3
+ //
+ ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART3);
+
+ //
+ // Configure the UART3 for 115,200, 8-N-1 operation.
+ //
+ ROM_UARTConfigSetExpClk(UART3_BASE, ui32SysClock, 115200,
+ (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
+ UART_CONFIG_PAR_NONE));
+
+ //
+ // Configure UART3 to use hardware flow control.
+ //
+ UARTFlowControlSet(UART3_BASE, UART_FLOWCONTROL_TX | UART_FLOWCONTROL_RX);
+
+ //
+ // Enable processor interrupts.
+ //
+ IntMasterEnable();
+
+ //
+ // Enable the UART interrupt.
+ //
+ ROM_IntEnable(INT_UART3);
+ ROM_UARTIntEnable(UART3_BASE, UART_INT_RX | UART_INT_RT);
+
+
+ //
+ // Clear timeout value
+ //
+ g_ui32Delay = 0;
+
+ //
+ // Configure SysTick for a periodic interrupt at 10ms.
+ //
+ ROM_SysTickPeriodSet(ui32SysClock / 100);
+ ROM_SysTickEnable();
+ ROM_SysTickIntEnable();
+
+ //
+ // clear the device info and RX buffer
+ //
+ memset(g_psDev, 0, sizeof(g_psDev));
+ memset(&g_sRxBuf, 0, sizeof(tCirBuf));
+
+ //
+ // Start the state machine with initial state
+ //
+ g_iState = STATE_DEV_INIT;
+
+ //
+ // Display "Initializing" on the bottom of screen
+ //
+ UpdateDisplay(iInitializing);
+
+ while(1)
+ {
+ switch(g_iState)
+ {
+ case STATE_DEV_INIT:
+
+ UARTprintf("Device Init...\n");
+
+ //
+ // Send GAP_DeviceInit command
+ //
+ memset(pui8IRKOrCSRK, 0, 16);
+ GAPDeviceInit(GAP_PROFILE_CENTRAL, 5, pui8IRKOrCSRK, pui8IRKOrCSRK, 1);
+
+ //
+ // Wait for CommandStatus response, timeout after 500ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_DEVICE_INIT_OPCODE, 500, &ui8Status);
+ if(bSuccess && ui8Status == SUCCESS)
+ {
+ //
+ // Wait for DeviceInitDone response, timeout after 500ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_DEVICE_INIT_DONE, 0, 500, &ui8Status);
+ if(bSuccess && ui8Status == SUCCESS)
+ {
+ //
+ // Got DeviceInitDone response, go to the next state
+ //
+ g_iState = STATE_GET_PARAM;
+ }
+ }
+ else
+ {
+ UARTprintf("CC2540 EM board is not connected to the DK\n");
+ UpdateDisplay(iNoBLE);
+
+ //
+ // Hang forever
+ //
+ while(1);
+ }
+ break;
+
+ case STATE_GET_PARAM:
+ if(GetParam())
+ {
+ //
+ // Query parameter successful, go to the discovery state
+ //
+ g_bDiscoveryReq = true;
+ g_iState = STATE_START_DISCOVERY;
+ UARTprintf("Ready to scan devices\n");
+
+ //
+ // Update display
+ //
+ UpdateDisplay(iScanning);
+ }
+ else
+ {
+ //
+ // cannot query parameters on CC2540, something wrong,
+ // go to the error state
+ //
+ g_iState = STATE_ERROR;
+ }
+ break;
+
+ case STATE_START_DISCOVERY:
+ if(g_bDiscoveryReq)
+ {
+ UARTprintf("Start Discovery...\n");
+
+ //
+ // Clear the number of devices discovered
+ //
+ g_ui8DevFound = 0;
+
+ //
+ // Start to draw circle periodically
+ //
+ HWREGBITW(&g_ui32Flags, FLAG_DRAW_CIRCLE) = 1;
+
+ //
+ // Send Discovery command
+ //
+ GAPDiscoveryReq(DEVDISC_MODE_ALL, true, false);
+
+ //
+ // Wait for CommandStatus response, timeout after 100ms
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_CMD_STATUS, HCI_VE_GAP_DEVICE_DISC_REQ_OPCODE, 100, &ui8Status);
+ if(bSuccess && ui8Status == SUCCESS)
+ {
+ //
+ // Wait for DiscoveryDone response, timeout after 20s
+ //
+ bSuccess = WaitForRsp(GAP_HCI_EVENT_EXT_DEVICE_DISC_DONE, 0, 20000, &ui8Status);
+ if(bSuccess && ui8Status == SUCCESS)
+ {
+ //
+ // Have we discovered any device?
+ //
+ if(g_ui8DevFound)
+ {
+ //
+ // Got DiscoveryDone response, go to the next state
+ //
+ g_iState = STATE_SET_PARAM;
+ }
+ else
+ {
+ //
+ // No device found:
+ // Stop drawing the circles.
+ //
+ HWREGBITW(&g_ui32Flags, FLAG_DRAW_CIRCLE) = 0;
+
+ //
+ // show the scan button on the bottom of the
+ // screen in order to repeat the scanning.
+ //
+ UpdateDisplay(iScan);
+ }
+ g_bDiscoveryReq = false;
+ }
+ }
+ }
+ break;
+
+ case STATE_SET_PARAM:
+ if(SetParam())
+ {
+ //
+ // Configure parameters are successful,
+ // go to the next state
+ //
+ g_iState = STATE_READY_FOR_LINK_REQ;
+ UARTprintf("Discovery done\n");
+
+ HWREGBITW(&g_ui32Flags, FLAG_DRAW_CIRCLE) = 0;
+ UpdateDisplay(iConnect);
+ }
+ else
+ {
+ //
+ // Failed to configure the parameters,
+ // go to the error state
+ //
+ g_iState = STATE_ERROR;
+ }
+ break;
+
+ case STATE_READY_FOR_LINK_REQ:
+ //
+ // Wait for user to connect any device
+ //
+ if(g_bEstLinkReq == true)
+ {
+ //
+ // Received connect command from user,
+ // go to the next state to connect the device
+ //
+ UpdateDisplay(iConnecting);
+ g_iState = STATE_LINK;
+ g_bEstLinkReq = false;
+ }
+
+ //
+ // Wait for user to do discovery/scan again
+ //
+ if(g_bDiscoveryReq == true)
+ {
+ //
+ // Discovery/scan is requested by user
+ //
+ g_iState = STATE_START_DISCOVERY;
+
+ //
+ // Update display
+ //
+ UpdateDisplay(iScanning);
+ }
+ break;
+
+ case STATE_LINK:
+ //
+ // Connect to the device
+ //
+ if( EstablishLink(g_ui8DevConnect))
+ {
+ //
+ // Connected the device without errors.
+ // go to the next state.
+ //
+ g_iState = STATE_LINKED;
+
+ //
+ // Display the sensor information.
+ //
+ UpdateDisplay(iDisconnect);
+ }
+ else
+ {
+ //
+ // Link failed, go back to STATE_READY_FOR_LINK_REQ.
+ //
+ UARTprintf("Link failed, go back to ready for link state\n");
+ g_iState = STATE_READY_FOR_LINK_REQ;
+ UpdateDisplay(iConnect);
+ }
+ break;
+
+ case STATE_LINKED:
+ //
+ // Handle Terminate request if any
+ //
+ if(g_bTermLinkReq == true)
+ {
+ g_iState = STATE_TERM;
+ UpdateDisplay(iDisconnecting);
+ break;
+ }
+
+ //
+ // Configure the sensor profiles.
+ //
+ ConfigureSensors();
+
+ //
+ // Check for any sensor notify event
+ //
+ CheckForMsg();
+
+ //
+ // We will read the device's RSSI every second.
+ //
+ if(HWREGBITW(&g_ui32Flags, FLAG_EVERY_SECOND) == 1)
+ {
+ HWREGBITW(&g_ui32Flags, FLAG_EVERY_SECOND) = 0;
+
+ //
+ // Read RSSI
+ //
+ HCIReadRSSI(g_ui16Handle);
+ }
+ break;
+
+ case STATE_TERM:
+ //
+ // We are told to termniate the link.
+ //
+ if(TerminateLink())
+ {
+ //
+ // Terminate success, go to the next state
+ //
+ g_iState = STATE_TERMED;
+ g_bTermLinkReq = false;
+ }
+ else
+ {
+ //TODO
+ g_iState = STATE_TERMED;
+ g_bTermLinkReq = false;
+
+ }
+ break;
+
+ case STATE_TERMED:
+ //
+ // Terminated, go to the next state
+ //
+ g_iState = STATE_READY_FOR_LINK_REQ;
+ UpdateDisplay(iConnect);
+ break;
+
+ case STATE_IDLE:
+ default:
+ //
+ // Check any messages.
+ //
+ CheckForMsg();
+ break;
+ }
+ }
+}
diff --git a/boards/dk-tm4c129x/ble_central/ble_central.ewd b/boards/dk-tm4c129x/ble_central/ble_central.ewd new file mode 100644 index 0000000..484e41a --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ble_central.ewd @@ -0,0 +1,614 @@ +<?xml version="1.0" encoding="iso-8859-1"?>
+
+<project>
+ <fileVersion>1</fileVersion>
+ <configuration>
+ <name>Debug</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>C-SPY</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>15</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CInput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCVariant</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>MemOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MemFile</name>
+ <state>$TOOLKIT_DIR$\CONFIG\debugger\TexasInstruments\tm4c129xnczad</state>
+ </option>
+ <option>
+ <name>RunToEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RunToName</name>
+ <state>main</state>
+ </option>
+ <option>
+ <name>CExtraOptionsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDDFArgumentProducer</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCDownloadSuppressDownload</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDownloadVerifyAll</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCProductVersion</name>
+ <state>5.11.0.50579</state>
+ </option>
+ <option>
+ <name>OCDynDriverList</name>
+ <state>LMIFTDI_ID</state>
+ </option>
+ <option>
+ <name>OCLastSavedByProductVersion</name>
+ <state>5.11.0.50579</state>
+ </option>
+ <option>
+ <name>OCDownloadAttachToProgram</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>FlashLoaders</name>
+ <state>,,,,(default),</state>
+ </option>
+ <option>
+ <name>UseFlashLoader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CLowLevel</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCBE8Slave</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ARMSIM_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCSimDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCSimEnablePSP</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCSimPspOverrideConfig</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCSimPspConfigFile</name>
+ <state></state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ANGEL_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCAngelHeartbeat</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CAngelCommunication</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CAngelCommBaud</name>
+ <version>0</version>
+ <state>3</state>
+ </option>
+ <option>
+ <name>CAngelCommPort</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ANGELTCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>DoAngelLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AngelLogFile</name>
+ <state>$TOOLKIT_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>GDBSERVER_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$TOOLKIT_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCJTagBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagUpdateBreakpoints</name>
+ <state>main</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IARROM_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CRomLogFileCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CRomLogFileEditB</name>
+ <state>$TOOLKIT_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CRomCommunication</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CRomCommPort</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CRomCommBaud</name>
+ <version>0</version>
+ <state>7</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>JLINK_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>9</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>JLinkSpeed</name>
+ <state>32</state>
+ </option>
+ <option>
+ <name>CCJLinkDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkLogFile</name>
+ <state>$TOOLKIT_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCJLinkHWResetDelay</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>JLinkInitialSpeed</name>
+ <state>32</state>
+ </option>
+ <option>
+ <name>CCDoJlinkMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCScanChainNonARMDevices</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkIRLength</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkCommRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkTCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>CCJLinkSpeedRadioV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCUSBDevice</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchUndef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchData</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchPrefetch</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkUpdateBreakpoints</name>
+ <state>main</state>
+ </option>
+ <option>
+ <name>CCJLinkInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkAttachSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCJLinkResetList</name>
+ <version>0</version>
+ <state>5</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>LMIFTDI_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>LmiftdiSpeed</name>
+ <state>500</state>
+ </option>
+ <option>
+ <name>CCLmiftdiDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCLmiftdiLogFile</name>
+ <state>$TOOLKIT_DIR$\cspycomm.log</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>MACRAIGOR_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>2</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>jtag</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>EmuSpeed</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$TOOLKIT_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>DoEmuMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>EmuMultiTarget</name>
+ <state>0@ARM7TDMI</state>
+ </option>
+ <option>
+ <name>EmuHWReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CEmuCommBaud</name>
+ <version>0</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>CEmuCommPort</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>jtago</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>UnusedAddr</name>
+ <state>0x00800000</state>
+ </option>
+ <option>
+ <name>CCMacraigorHWResetDelay</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCJTagBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagUpdateBreakpoints</name>
+ <state>main</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>RDI_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CRDIDriverDll</name>
+ <state>Browse to your RDI driver</state>
+ </option>
+ <option>
+ <name>CRDILogFileCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CRDILogFileEdit</name>
+ <state>$TOOLKIT_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCRDIHWReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchUndef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchData</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchPrefetch</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDIUseETM</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>THIRDPARTY_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CThirdPartyDriverDll</name>
+ <state>Browse to your third-party driver</state>
+ </option>
+ <option>
+ <name>CThirdPartyLogFileCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CThirdPartyLogFileEditB</name>
+ <state>$TOOLKIT_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <debuggerPlugins>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
+ <loadFlag>1</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin</file>
+ <loadFlag>1</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin</file>
+ <loadFlag>1</loadFlag>
+ </plugin>
+ </debuggerPlugins>
+ </configuration>
+</project>
diff --git a/boards/dk-tm4c129x/ble_central/ble_central.ewp b/boards/dk-tm4c129x/ble_central/ble_central.ewp new file mode 100644 index 0000000..5388441 --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ble_central.ewp @@ -0,0 +1,810 @@ +<?xml version="1.0" encoding="iso-8859-1"?>
+
+<project>
+ <fileVersion>1</fileVersion>
+ <configuration>
+ <name>Debug</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>General</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <version>14</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>ExePath</name>
+ <state>ewarm\Exe</state>
+ </option>
+ <option>
+ <name>ObjPath</name>
+ <state>ewarm\Obj</state>
+ </option>
+ <option>
+ <name>ListPath</name>
+ <state>ewarm\List</state>
+ </option>
+ <option>
+ <name>Variant</name>
+ <version>19</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>GEndianMode</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>Input variant</name>
+ <version>1</version>
+ <state>3</state>
+ </option>
+ <option>
+ <name>Input description</name>
+ <state>No specifier n, no float nor long long, no scan set, no assignment suppressing.</state>
+ </option>
+ <option>
+ <name>Output variant</name>
+ <version>0</version>
+ <state>3</state>
+ </option>
+ <option>
+ <name>Output description</name>
+ <state>No specifier a, A, no specifier n, no float nor long long, no flags.</state>
+ </option>
+ <option>
+ <name>GOutputBinary</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>FPU</name>
+ <version>2</version>
+ <state>5</state>
+ </option>
+ <option>
+ <name>OGCoreOrChip</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelect</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelectSlave</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RTDescription</name>
+ <state>Use the normal configuration of the C/C++ runtime library. No locale interface, C locale, no file descriptor support, no multibytes in printf and scanf, and no hex floats in strtod.</state>
+ </option>
+ <option>
+ <name>RTConfigPath</name>
+ <state>$TOOLKIT_DIR$\INC\DLib_Config_Normal.h</state>
+ </option>
+ <option>
+ <name>OGProductVersion</name>
+ <state>5.11.0.50579</state>
+ </option>
+ <option>
+ <name>OGLastSavedByProductVersion</name>
+ <state>5.11.0.50579</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>GeneralEnableMisra</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraVerbose</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGChipSelectEditMenu</name>
+ <state>TM4C129XNCZAD TexasInstruments TM4C129XNCZAD</state>
+ </option>
+ <option>
+ <name>GenLowLevelInterface</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GEndianModeBE</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGBufferedTerminalOutput</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ICCARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>19</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCDefines</name>
+ <state>ewarm</state>
+ <state>PART_TM4C129XNCZAD</state>
+ <state>TARGET_IS_TM4C129_RA0</state>
+ </option>
+ <option>
+ <name>CCPreprocFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocComments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMnemonics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMessages</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDiagSuppress</name>
+ <state>Pa050</state>
+ </option>
+ <option>
+ <name>CCDiagRemark</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagWarning</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagError</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCAllowList</name>
+ <version>1</version>
+ <state>1111111</state>
+ </option>
+ <option>
+ <name>CCDebugInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IEndianMode</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IExtraOptionsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCLangConformance</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSignedPlainChar</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCRequirePrototypes</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMultibyteSupport</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDiagWarnAreErr</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCompilerRuntimeInfo</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>CCLangSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCLibConfigHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>PreInclude</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CompilerMisraRules</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>CompilerMisraOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCIncludePath2</name>
+ <state>$PROJ_DIR$\..</state>
+ <state>$PROJ_DIR$\..\..\..\..</state>
+ </option>
+ <option>
+ <name>CCStdIncCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCStdIncludePath</name>
+ <state>$TOOLKIT_DIR$\INC\</state>
+ </option>
+ <option>
+ <name>CCCodeSection</name>
+ <state>.text</state>
+ </option>
+ <option>
+ <name>IInterwork2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IProcessorMode2</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptLevel</name>
+ <state>3</state>
+ </option>
+ <option>
+ <name>CCOptStrategy</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptLevelSlave</name>
+ <state>3</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>AARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>7</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>AObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>ACaseSensitivity</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacroChars</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnWhat</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnOne</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>ADebug</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AltRegisterNames</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ADefines</name>
+ <state>ewarm</state>
+ </option>
+ <option>
+ <name>AList</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AListHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AListing</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Includes</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacDefs</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacExps</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacExec</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OnlyAssed</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MultiLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLengthCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLength</name>
+ <state>80</state>
+ </option>
+ <option>
+ <name>TabSpacing</name>
+ <state>8</state>
+ </option>
+ <option>
+ <name>AXRef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDefines</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefInternal</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDual</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AOutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>AMultibyteSupport</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ALimitErrorsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ALimitErrorsEdit</name>
+ <state>100</state>
+ </option>
+ <option>
+ <name>AIgnoreStdInclude</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AStdIncludes</name>
+ <state>$TOOLKIT_DIR$\INC\</state>
+ </option>
+ <option>
+ <name>AUserIncludes</name>
+ <state>$PROJ_DIR$\..</state>
+ <state>$PROJ_DIR$\..\..\..\..</state>
+ </option>
+ <option>
+ <name>AExtraOptionsCheckV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AExtraOptionsV2</name>
+ <state></state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>OBJCOPY</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OOCOutputFormat</name>
+ <version>1</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>OCOutputOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OOCOutputFile</name>
+ <state>ble_central.bin</state>
+ </option>
+ <option>
+ <name>OOCCommandLineProducer</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OOCObjCopyEnable</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CUSTOM</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <extensions></extensions>
+ <cmdline></cmdline>
+ </data>
+ </settings>
+ <settings>
+ <name>BICOMP</name>
+ <archiveVersion>0</archiveVersion>
+ <data/>
+ </settings>
+ <settings>
+ <name>BUILDACTION</name>
+ <archiveVersion>1</archiveVersion>
+ <data>
+ <prebuild></prebuild>
+ <postbuild></postbuild>
+ </data>
+ </settings>
+ <settings>
+ <name>ILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>5</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IlinkLibIOConfig</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>XLinkMisraHandler</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkInputFileSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOutputFile</name>
+ <state>ble_central.out</state>
+ </option>
+ <option>
+ <name>IlinkDebugInfoEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkKeepSymbols</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySymbol</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySegment</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryAlign</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkConfigDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkMapFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLogFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogInitialization</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogModule</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogSection</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogVeneer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfOverride</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkIcfFile</name>
+ <state>$PROJ_DIR$\ble_central.icf</state>
+ </option>
+ <option>
+ <name>IlinkIcfFileSlave</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkSuppressDiags</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsRem</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsWarn</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsErr</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkWarningsAreErrors</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkUseExtraOptions</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkLowLevelInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAutoLibEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAdditionalLibs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkOverrideProgramEntryLabel</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabelSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabel</name>
+ <state>__iar_program_start</state>
+ </option>
+ <option>
+ <name>IlinkNXPLPCChecksum</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>DoFill</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>FillerByte</name>
+ <state>0xFF</state>
+ </option>
+ <option>
+ <name>FillerStart</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>FillerEnd</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>CrcSize</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcAlign</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcAlgo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcPoly</name>
+ <state>0x11021</state>
+ </option>
+ <option>
+ <name>CrcCompl</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcBitOrder</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcInitialValue</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>DoCrc</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkBE8Slave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkBufferedTerminalOutput</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IARCHIVE</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IarchiveInputs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IarchiveOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IarchiveOutput</name>
+ <state>###Unitialized###</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>BILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data/>
+ </settings>
+ </configuration>
+ <group>
+ <name>Libraries</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\driverlib\ewarm\Exe\driverlib.a</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\grlib\ewarm\Exe\grlib.a</name>
+ </file>
+ </group>
+ <group>
+ <name>Source</name>
+ <file>
+ <name>$PROJ_DIR$\ble_central.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\drivers\frame.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\gap.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\drivers\kentec320x240x16_ssd2119.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\drivers\pinout.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\startup_ewarm.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\drivers\touch.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\utils\uartstdio.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\utils\ustdlib.c</name>
+ </file>
+ </group>
+</project>
diff --git a/boards/dk-tm4c129x/ble_central/ble_central.icf b/boards/dk-tm4c129x/ble_central/ble_central.icf new file mode 100644 index 0000000..681cc5a --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ble_central.icf @@ -0,0 +1,78 @@ +//*****************************************************************************
+//
+// ble_central.icf - Linker configuration file for ble_central.
+//
+// Copyright (c) 2013-2014 Texas Instruments Incorporated. All rights reserved.
+// Software License Agreement
+//
+// Texas Instruments (TI) is supplying this software for use solely and
+// exclusively on TI's microcontroller products. The software is owned by
+// TI and/or its suppliers, and is protected under applicable copyright
+// laws. You may not combine this software with "viral" open-source
+// software in order to form a larger program.
+//
+// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
+// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
+// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
+// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+// DAMAGES, FOR ANY REASON WHATSOEVER.
+//
+// This is part of revision 2.1.0.12573 of the DK-TM4C129X Firmware Package.
+//
+//*****************************************************************************
+
+//
+// Define a memory region that covers the entire 4 GB addressible space of the
+// processor.
+//
+define memory mem with size = 4G;
+
+//
+// Define a region for the on-chip flash.
+//
+define region FLASH = mem:[from 0x00000000 to 0x000fffff];
+
+//
+// Define a region for the on-chip SRAM.
+//
+define region SRAM = mem:[from 0x20000000 to 0x2003ffff];
+
+//
+// Define a block for the heap. The size should be set to something other
+// than zero if things in the C library that require the heap are used.
+//
+define block HEAP with alignment = 8, size = 0x00000000 { };
+
+//
+// Indicate that the read/write values should be initialized by copying from
+// flash.
+//
+initialize by copy { readwrite };
+
+//
+// Indicate that the noinit values should be left alone. This includes the
+// stack, which if initialized will destroy the return address from the
+// initialization code, causing the processor to branch to zero and fault.
+//
+do not initialize { section .noinit };
+
+//
+// Place the interrupt vectors at the start of flash.
+//
+place at start of FLASH { readonly section .intvec };
+
+//
+// Place the remainder of the read-only items into flash.
+//
+place in FLASH { readonly };
+
+//
+// Place the RAM vector table at the start of SRAM.
+//
+place at start of SRAM { section VTABLE };
+
+//
+// Place all read/write items into SRAM.
+//
+place in SRAM { readwrite, block HEAP };
diff --git a/boards/dk-tm4c129x/ble_central/ble_central.ld b/boards/dk-tm4c129x/ble_central/ble_central.ld new file mode 100644 index 0000000..c528e4b --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ble_central.ld @@ -0,0 +1,57 @@ +/******************************************************************************
+ *
+ * ble_central.ld - Linker configuration file for ble_central.
+ *
+ * Copyright (c) 2013-2014 Texas Instruments Incorporated. All rights reserved.
+ * Software License Agreement
+ *
+ * Texas Instruments (TI) is supplying this software for use solely and
+ * exclusively on TI's microcontroller products. The software is owned by
+ * TI and/or its suppliers, and is protected under applicable copyright
+ * laws. You may not combine this software with "viral" open-source
+ * software in order to form a larger program.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
+ * NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
+ * NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
+ * CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+ * DAMAGES, FOR ANY REASON WHATSOEVER.
+ *
+ * This is part of revision 2.1.0.12573 of the DK-TM4C129X Firmware Package.
+ *
+ *****************************************************************************/
+
+MEMORY
+{
+ FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00100000
+ SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00040000
+}
+
+SECTIONS
+{
+ .text :
+ {
+ _text = .;
+ KEEP(*(.isr_vector))
+ *(.text*)
+ *(.rodata*)
+ _etext = .;
+ } > FLASH
+
+ .data : AT(ADDR(.text) + SIZEOF(.text))
+ {
+ _data = .;
+ *(vtable)
+ *(.data*)
+ _edata = .;
+ } > SRAM
+
+ .bss :
+ {
+ _bss = .;
+ *(.bss*)
+ *(COMMON)
+ _ebss = .;
+ } > SRAM
+}
diff --git a/boards/dk-tm4c129x/ble_central/ble_central.sct b/boards/dk-tm4c129x/ble_central/ble_central.sct new file mode 100644 index 0000000..b1e6c8a --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ble_central.sct @@ -0,0 +1,47 @@ +;******************************************************************************
+;
+; ble_central.sct - Linker configuration file for ble_central.
+;
+; Copyright (c) 2013-2014 Texas Instruments Incorporated. All rights reserved.
+; Software License Agreement
+;
+; Texas Instruments (TI) is supplying this software for use solely and
+; exclusively on TI's microcontroller products. The software is owned by
+; TI and/or its suppliers, and is protected under applicable copyright
+; laws. You may not combine this software with "viral" open-source
+; software in order to form a larger program.
+;
+; THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
+; NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
+; NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+; A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
+; CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+; DAMAGES, FOR ANY REASON WHATSOEVER.
+;
+; This is part of revision 2.1.0.12573 of the DK-TM4C129X Firmware Package.
+;
+;******************************************************************************
+
+LR_IROM 0x00000000 0x00100000
+{
+ ;
+ ; Specify the Execution Address of the code and the size.
+ ;
+ ER_IROM 0x00000000 0x00100000
+ {
+ *.o (RESET, +First)
+ * (InRoot$$Sections, +RO)
+ }
+
+ ;
+ ; Specify the Execution Address of the data area.
+ ;
+ RW_IRAM 0x20000000 0x00040000
+ {
+ ;
+ ; Uncomment the following line in order to use IntRegister().
+ ;
+ ;* (vtable, +First)
+ * (+RW, +ZI)
+ }
+}
diff --git a/boards/dk-tm4c129x/ble_central/ble_central.uvopt b/boards/dk-tm4c129x/ble_central/ble_central.uvopt new file mode 100644 index 0000000..90855bc --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ble_central.uvopt @@ -0,0 +1,401 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_opt.xsd">
+
+ <SchemaVersion>1.0</SchemaVersion>
+
+ <Header>### uVision Project, (C) Keil Software</Header>
+
+ <Extensions>
+ <cExt>*.c</cExt>
+ <aExt>*.s*; *.src; *.a*</aExt>
+ <oExt>*.obj</oExt>
+ <lExt>*.lib</lExt>
+ <tExt>*.txt; *.h; *.inc</tExt>
+ <pExt>*.plm</pExt>
+ <CppX>*.cpp</CppX>
+ </Extensions>
+
+ <DaveTm>
+ <dwLowDateTime>0</dwLowDateTime>
+ <dwHighDateTime>0</dwHighDateTime>
+ </DaveTm>
+
+ <Target>
+ <TargetName>ble_central</TargetName>
+ <ToolsetNumber>0x4</ToolsetNumber>
+ <ToolsetName>ARM-ADS</ToolsetName>
+ <TargetOption>
+ <CLKADS>25000000</CLKADS>
+ <OPTTT>
+ <gFlags>1</gFlags>
+ <BeepAtEnd>1</BeepAtEnd>
+ <RunSim>1</RunSim>
+ <RunTarget>0</RunTarget>
+ </OPTTT>
+ <OPTHX>
+ <HexSelection>1</HexSelection>
+ <FlashByte>65535</FlashByte>
+ <HexRangeLowAddress>0</HexRangeLowAddress>
+ <HexRangeHighAddress>0</HexRangeHighAddress>
+ <HexOffset>0</HexOffset>
+ </OPTHX>
+ <OPTLEX>
+ <PageWidth>79</PageWidth>
+ <PageLength>66</PageLength>
+ <TabStop>8</TabStop>
+ <ListingPath>.\rvmdk\</ListingPath>
+ </OPTLEX>
+ <ListingPage>
+ <CreateCListing>1</CreateCListing>
+ <CreateAListing>1</CreateAListing>
+ <CreateLListing>1</CreateLListing>
+ <CreateIListing>0</CreateIListing>
+ <AsmCond>1</AsmCond>
+ <AsmSymb>1</AsmSymb>
+ <AsmXref>0</AsmXref>
+ <CCond>1</CCond>
+ <CCode>0</CCode>
+ <CListInc>0</CListInc>
+ <CSymb>0</CSymb>
+ <LinkerCodeListing>0</LinkerCodeListing>
+ </ListingPage>
+ <OPTXL>
+ <LMap>1</LMap>
+ <LComments>1</LComments>
+ <LGenerateSymbols>1</LGenerateSymbols>
+ <LLibSym>1</LLibSym>
+ <LLines>1</LLines>
+ <LLocSym>1</LLocSym>
+ <LPubSym>1</LPubSym>
+ <LXref>0</LXref>
+ <LExpSel>0</LExpSel>
+ </OPTXL>
+ <OPTFL>
+ <tvExp>1</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <IsCurrentTarget>1</IsCurrentTarget>
+ </OPTFL>
+ <CpuCode>255</CpuCode>
+ <Books>
+ <Book>
+ <Number>0</Number>
+ <Title>Data Sheet</Title>
+ <Path>DATASHTS\Luminary\TM4C129XNCZAD.PDF</Path>
+ </Book>
+ </Books>
+ <DllOpt>
+ <SimDllName>SARMCM3.DLL</SimDllName>
+ <SimDllArguments>-MPU</SimDllArguments>
+ <SimDlgDllName>DCM.DLL</SimDlgDllName>
+ <SimDlgDllArguments>-pCM4</SimDlgDllArguments>
+ <TargetDllName>SARMCM3.DLL</TargetDllName>
+ <TargetDllArguments>-MPU</TargetDllArguments>
+ <TargetDlgDllName>TCM.DLL</TargetDlgDllName>
+ <TargetDlgDllArguments>-pCM4</TargetDlgDllArguments>
+ </DllOpt>
+ <DebugOpt>
+ <uSim>0</uSim>
+ <uTrg>1</uTrg>
+ <sLdApp>1</sLdApp>
+ <sGomain>1</sGomain>
+ <sRbreak>1</sRbreak>
+ <sRwatch>1</sRwatch>
+ <sRmem>1</sRmem>
+ <sRfunc>1</sRfunc>
+ <sRbox>1</sRbox>
+ <tLdApp>1</tLdApp>
+ <tGomain>0</tGomain>
+ <tRbreak>1</tRbreak>
+ <tRwatch>1</tRwatch>
+ <tRmem>1</tRmem>
+ <tRfunc>0</tRfunc>
+ <tRbox>1</tRbox>
+ <sRunDeb>0</sRunDeb>
+ <sLrtime>0</sLrtime>
+ <nTsel>4</nTsel>
+ <sDll></sDll>
+ <sDllPa></sDllPa>
+ <sDlgDll></sDlgDll>
+ <sDlgPa></sDlgPa>
+ <sIfile></sIfile>
+ <tDll></tDll>
+ <tDllPa></tDllPa>
+ <tDlgDll></tDlgDll>
+ <tDlgPa></tDlgPa>
+ <tIfile></tIfile>
+ <pMon>BIN\lmidk-agdi.dll</pMon>
+ </DebugOpt>
+ <TargetDriverDllRegistry>
+ <SetRegEntry>
+ <Number>0</Number>
+ <Key>lmidk-agdi</Key>
+ <Name>-O4614 -S1 -FO29</Name>
+ </SetRegEntry>
+ <SetRegEntry>
+ <Number>0</Number>
+ <Key>DLGTARM</Key>
+ <Name></Name>
+ </SetRegEntry>
+ <SetRegEntry>
+ <Number>0</Number>
+ <Key>ARMDBGFLAGS</Key>
+ <Name></Name>
+ </SetRegEntry>
+ </TargetDriverDllRegistry>
+ <DebugFlag>
+ <trace>0</trace>
+ <periodic>1</periodic>
+ <aLwin>0</aLwin>
+ <aCover>0</aCover>
+ <aSer1>0</aSer1>
+ <aSer2>0</aSer2>
+ <aPa>0</aPa>
+ <viewmode>1</viewmode>
+ <vrSel>0</vrSel>
+ <aSym>0</aSym>
+ <aTbox>0</aTbox>
+ <AscS1>0</AscS1>
+ <AscS2>0</AscS2>
+ <AscS3>0</AscS3>
+ <aSer3>0</aSer3>
+ <eProf>0</eProf>
+ <aLa>0</aLa>
+ <aPa1>0</aPa1>
+ <AscS4>0</AscS4>
+ <aSer4>0</aSer4>
+ <StkLoc>0</StkLoc>
+ <TrcWin>0</TrcWin>
+ <newCpu>0</newCpu>
+ <uProt>0</uProt>
+ </DebugFlag>
+ <LintExecutable></LintExecutable>
+ <LintConfigFile></LintConfigFile>
+ </TargetOption>
+ </Target>
+
+ <Group>
+ <GroupName>Source</GroupName>
+ <tvExp>1</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <File>
+ <GroupNumber>1</GroupNumber>
+ <FileNumber>1</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <Focus>0</Focus>
+ <ColumnNumber>0</ColumnNumber>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
+ <bDave2>0</bDave2>
+ <PathWithFileName>.\ble_central.c</PathWithFileName>
+ <FilenameWithoutPath>ble_central.c</FilenameWithoutPath>
+ </File>
+ <File>
+ <GroupNumber>1</GroupNumber>
+ <FileNumber>2</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <Focus>0</Focus>
+ <ColumnNumber>0</ColumnNumber>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
+ <bDave2>0</bDave2>
+ <PathWithFileName>..\drivers\frame.c</PathWithFileName>
+ <FilenameWithoutPath>frame.c</FilenameWithoutPath>
+ </File>
+ <File>
+ <GroupNumber>1</GroupNumber>
+ <FileNumber>3</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <Focus>0</Focus>
+ <ColumnNumber>0</ColumnNumber>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
+ <bDave2>0</bDave2>
+ <PathWithFileName>.\gap.c</PathWithFileName>
+ <FilenameWithoutPath>gap.c</FilenameWithoutPath>
+ </File>
+ <File>
+ <GroupNumber>1</GroupNumber>
+ <FileNumber>4</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <Focus>0</Focus>
+ <ColumnNumber>0</ColumnNumber>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
+ <bDave2>0</bDave2>
+ <PathWithFileName>..\drivers\kentec320x240x16_ssd2119.c</PathWithFileName>
+ <FilenameWithoutPath>kentec320x240x16_ssd2119.c</FilenameWithoutPath>
+ </File>
+ <File>
+ <GroupNumber>1</GroupNumber>
+ <FileNumber>5</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <Focus>0</Focus>
+ <ColumnNumber>0</ColumnNumber>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
+ <bDave2>0</bDave2>
+ <PathWithFileName>..\drivers\pinout.c</PathWithFileName>
+ <FilenameWithoutPath>pinout.c</FilenameWithoutPath>
+ </File>
+ <File>
+ <GroupNumber>1</GroupNumber>
+ <FileNumber>6</FileNumber>
+ <FileType>2</FileType>
+ <tvExp>0</tvExp>
+ <Focus>0</Focus>
+ <ColumnNumber>0</ColumnNumber>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
+ <bDave2>0</bDave2>
+ <PathWithFileName>.\startup_rvmdk.S</PathWithFileName>
+ <FilenameWithoutPath>startup_rvmdk.S</FilenameWithoutPath>
+ </File>
+ <File>
+ <GroupNumber>1</GroupNumber>
+ <FileNumber>7</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <Focus>0</Focus>
+ <ColumnNumber>0</ColumnNumber>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
+ <bDave2>0</bDave2>
+ <PathWithFileName>..\drivers\touch.c</PathWithFileName>
+ <FilenameWithoutPath>touch.c</FilenameWithoutPath>
+ </File>
+ <File>
+ <GroupNumber>1</GroupNumber>
+ <FileNumber>8</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <Focus>0</Focus>
+ <ColumnNumber>0</ColumnNumber>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
+ <bDave2>0</bDave2>
+ <PathWithFileName>..\..\..\..\utils\uartstdio.c</PathWithFileName>
+ <FilenameWithoutPath>uartstdio.c</FilenameWithoutPath>
+ </File>
+ <File>
+ <GroupNumber>1</GroupNumber>
+ <FileNumber>9</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <Focus>0</Focus>
+ <ColumnNumber>0</ColumnNumber>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
+ <bDave2>0</bDave2>
+ <PathWithFileName>..\..\..\..\utils\ustdlib.c</PathWithFileName>
+ <FilenameWithoutPath>ustdlib.c</FilenameWithoutPath>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Libraries</GroupName>
+ <tvExp>1</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <File>
+ <GroupNumber>2</GroupNumber>
+ <FileNumber>10</FileNumber>
+ <FileType>4</FileType>
+ <tvExp>0</tvExp>
+ <Focus>0</Focus>
+ <ColumnNumber>0</ColumnNumber>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
+ <bDave2>0</bDave2>
+ <PathWithFileName>..\..\..\..\driverlib\rvmdk\driverlib.lib</PathWithFileName>
+ <FilenameWithoutPath>driverlib.lib</FilenameWithoutPath>
+ </File>
+ <File>
+ <GroupNumber>2</GroupNumber>
+ <FileNumber>11</FileNumber>
+ <FileType>4</FileType>
+ <tvExp>0</tvExp>
+ <Focus>0</Focus>
+ <ColumnNumber>0</ColumnNumber>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
+ <bDave2>0</bDave2>
+ <PathWithFileName>..\..\..\..\grlib\rvmdk\grlib.lib</PathWithFileName>
+ <FilenameWithoutPath>grlib.lib</FilenameWithoutPath>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Documentation</GroupName>
+ <tvExp>1</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>12</FileNumber>
+ <FileType>5</FileType>
+ <tvExp>0</tvExp>
+ <Focus>1</Focus>
+ <ColumnNumber>0</ColumnNumber>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <TopLine>1</TopLine>
+ <CurrentLine>1</CurrentLine>
+ <bDave2>0</bDave2>
+ <PathWithFileName>.\readme.txt</PathWithFileName>
+ <FilenameWithoutPath>readme.txt</FilenameWithoutPath>
+ <WindowPosition>
+ <length>44</length>
+ <flags>0</flags>
+ <showCmd>1</showCmd>
+ <MinPosition>
+ <xPos>-1</xPos>
+ <yPos>-1</yPos>
+ </MinPosition>
+ <MaxPosition>
+ <xPos>-1</xPos>
+ <yPos>-1</yPos>
+ </MaxPosition>
+ <NormalPosition>
+ <Top>0</Top>
+ <Left>0</Left>
+ <Right>729</Right>
+ <Bottom>300</Bottom>
+ </NormalPosition>
+ </WindowPosition>
+ </File>
+ </Group>
+
+ <MDIGroups>
+ <Orientation>1</Orientation>
+ <ActiveMDIGroup>0</ActiveMDIGroup>
+ <MDIGroup>
+ <Size>100</Size>
+ <ActiveTab>0</ActiveTab>
+ <Documents>
+ <Doc>
+ <Name>.\readme.txt</Name>
+ <ColumnNumber>0</ColumnNumber>
+ <TopLine>1</TopLine>
+ <CurrentLine>1</CurrentLine>
+ </Doc>
+ </Documents>
+ </MDIGroup>
+ </MDIGroups>
+
+</ProjectOpt>
diff --git a/boards/dk-tm4c129x/ble_central/ble_central.uvproj b/boards/dk-tm4c129x/ble_central/ble_central.uvproj new file mode 100644 index 0000000..11a43fa --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ble_central.uvproj @@ -0,0 +1,464 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_proj.xsd">
+
+ <SchemaVersion>1.1</SchemaVersion>
+
+ <Header>### uVision Project, (C) Keil Software</Header>
+
+ <Targets>
+ <Target>
+ <TargetName>ble_central</TargetName>
+ <ToolsetNumber>0x4</ToolsetNumber>
+ <ToolsetName>ARM-ADS</ToolsetName>
+ <TargetOption>
+ <TargetCommonOption>
+ <Device>TM4C129XNCZAD</Device>
+ <Vendor>Texas Instruments</Vendor>
+ <Cpu>IRAM(0x20000000-0x2003FFFF) IROM(0-0xFFFFF) CLOCK(25000000) CPUTYPE("Cortex-M4") FPU2</Cpu>
+ <FlashUtilSpec></FlashUtilSpec>
+ <StartupFile>"STARTUP\Luminary\Startup.s" ("Luminary Startup Code")</StartupFile>
+ <FlashDriverDll>UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0LM4F_1024 -FS00 -FL0100000)</FlashDriverDll>
+ <DeviceId>5919</DeviceId>
+ <RegisterFile>LM4Fxxxx.H</RegisterFile>
+ <MemoryEnv></MemoryEnv>
+ <Cmp></Cmp>
+ <Asm></Asm>
+ <Linker></Linker>
+ <OHString></OHString>
+ <InfinionOptionDll></InfinionOptionDll>
+ <SLE66CMisc></SLE66CMisc>
+ <SLE66AMisc></SLE66AMisc>
+ <SLE66LinkerMisc></SLE66LinkerMisc>
+ <UseEnv>0</UseEnv>
+ <BinPath></BinPath>
+ <IncludePath></IncludePath>
+ <LibPath></LibPath>
+ <RegisterFilePath>Luminary\</RegisterFilePath>
+ <DBRegisterFilePath>Luminary\</DBRegisterFilePath>
+ <TargetStatus>
+ <Error>0</Error>
+ <ExitCodeStop>0</ExitCodeStop>
+ <ButtonStop>0</ButtonStop>
+ <NotGenerated>0</NotGenerated>
+ <InvalidFlash>1</InvalidFlash>
+ </TargetStatus>
+ <OutputDirectory>.\rvmdk\</OutputDirectory>
+ <OutputName>ble_central</OutputName>
+ <CreateExecutable>1</CreateExecutable>
+ <CreateLib>0</CreateLib>
+ <CreateHexFile>0</CreateHexFile>
+ <DebugInformation>1</DebugInformation>
+ <BrowseInformation>1</BrowseInformation>
+ <ListingPath>.\rvmdk\</ListingPath>
+ <HexFormatSelection>1</HexFormatSelection>
+ <Merge32K>0</Merge32K>
+ <CreateBatchFile>0</CreateBatchFile>
+ <BeforeCompile>
+ <RunUserProg1>0</RunUserProg1>
+ <RunUserProg2>0</RunUserProg2>
+ <UserProg1Name></UserProg1Name>
+ <UserProg2Name></UserProg2Name>
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+ </BeforeCompile>
+ <BeforeMake>
+ <RunUserProg1>0</RunUserProg1>
+ <RunUserProg2>0</RunUserProg2>
+ <UserProg1Name></UserProg1Name>
+ <UserProg2Name></UserProg2Name>
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+ </BeforeMake>
+ <AfterMake>
+ <RunUserProg1>1</RunUserProg1>
+ <RunUserProg2>0</RunUserProg2>
+ <UserProg1Name>fromelf --bin --output .\rvmdk\ble_central.bin .\rvmdk\ble_central.axf</UserProg1Name>
+ <UserProg2Name></UserProg2Name>
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+ </AfterMake>
+ <SelectedForBatchBuild>0</SelectedForBatchBuild>
+ <SVCSIdString></SVCSIdString>
+ </TargetCommonOption>
+ <CommonProperty>
+ <UseCPPCompiler>0</UseCPPCompiler>
+ <RVCTCodeConst>0</RVCTCodeConst>
+ <RVCTZI>0</RVCTZI>
+ <RVCTOtherData>0</RVCTOtherData>
+ <ModuleSelection>0</ModuleSelection>
+ <IncludeInBuild>1</IncludeInBuild>
+ <AlwaysBuild>0</AlwaysBuild>
+ <GenerateAssemblyFile>0</GenerateAssemblyFile>
+ <AssembleAssemblyFile>0</AssembleAssemblyFile>
+ <PublicsOnly>0</PublicsOnly>
+ <StopOnExitCode>3</StopOnExitCode>
+ <CustomArgument></CustomArgument>
+ <IncludeLibraryModules></IncludeLibraryModules>
+ </CommonProperty>
+ <DllOption>
+ <SimDllName>SARMCM3.DLL</SimDllName>
+ <SimDllArguments>-MPU</SimDllArguments>
+ <SimDlgDll>DCM.DLL</SimDlgDll>
+ <SimDlgDllArguments>-pCM4</SimDlgDllArguments>
+ <TargetDllName>SARMCM3.DLL</TargetDllName>
+ <TargetDllArguments>-MPU</TargetDllArguments>
+ <TargetDlgDll>TCM.DLL</TargetDlgDll>
+ <TargetDlgDllArguments>-pCM4</TargetDlgDllArguments>
+ </DllOption>
+ <DebugOption>
+ <OPTHX>
+ <HexSelection>1</HexSelection>
+ <HexRangeLowAddress>0</HexRangeLowAddress>
+ <HexRangeHighAddress>0</HexRangeHighAddress>
+ <HexOffset>0</HexOffset>
+ <Oh166RecLen>16</Oh166RecLen>
+ </OPTHX>
+ <Simulator>
+ <UseSimulator>0</UseSimulator>
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
+ <RunToMain>1</RunToMain>
+ <RestoreBreakpoints>1</RestoreBreakpoints>
+ <RestoreWatchpoints>1</RestoreWatchpoints>
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
+ <RestoreFunctions>1</RestoreFunctions>
+ <RestoreToolbox>1</RestoreToolbox>
+ <LimitSpeedToRealTime>0</LimitSpeedToRealTime>
+ </Simulator>
+ <Target>
+ <UseTarget>1</UseTarget>
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
+ <RunToMain>0</RunToMain>
+ <RestoreBreakpoints>1</RestoreBreakpoints>
+ <RestoreWatchpoints>1</RestoreWatchpoints>
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
+ <RestoreFunctions>0</RestoreFunctions>
+ <RestoreToolbox>1</RestoreToolbox>
+ </Target>
+ <RunDebugAfterBuild>0</RunDebugAfterBuild>
+ <TargetSelection>4</TargetSelection>
+ <SimDlls>
+ <CpuDll></CpuDll>
+ <CpuDllArguments></CpuDllArguments>
+ <PeripheralDll></PeripheralDll>
+ <PeripheralDllArguments></PeripheralDllArguments>
+ <InitializationFile></InitializationFile>
+ </SimDlls>
+ <TargetDlls>
+ <CpuDll></CpuDll>
+ <CpuDllArguments></CpuDllArguments>
+ <PeripheralDll></PeripheralDll>
+ <PeripheralDllArguments></PeripheralDllArguments>
+ <InitializationFile></InitializationFile>
+ <Driver>BIN\lmidk-agdi.dll</Driver>
+ </TargetDlls>
+ </DebugOption>
+ <Utilities>
+ <Flash1>
+ <UseTargetDll>1</UseTargetDll>
+ <UseExternalTool>0</UseExternalTool>
+ <RunIndependent>0</RunIndependent>
+ <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging>
+ <Capability>1</Capability>
+ <DriverSelection>4099</DriverSelection>
+ </Flash1>
+ <Flash2>BIN\lmidk-agdi.dll</Flash2>
+ <Flash3></Flash3>
+ <Flash4></Flash4>
+ </Utilities>
+ <TargetArmAds>
+ <ArmAdsMisc>
+ <GenerateListings>0</GenerateListings>
+ <asHll>1</asHll>
+ <asAsm>1</asAsm>
+ <asMacX>1</asMacX>
+ <asSyms>1</asSyms>
+ <asFals>1</asFals>
+ <asDbgD>1</asDbgD>
+ <asForm>1</asForm>
+ <ldLst>0</ldLst>
+ <ldmm>1</ldmm>
+ <ldXref>1</ldXref>
+ <BigEnd>0</BigEnd>
+ <AdsALst>0</AdsALst>
+ <AdsACrf>0</AdsACrf>
+ <AdsANop>0</AdsANop>
+ <AdsANot>0</AdsANot>
+ <AdsLLst>1</AdsLLst>
+ <AdsLmap>1</AdsLmap>
+ <AdsLcgr>1</AdsLcgr>
+ <AdsLsym>1</AdsLsym>
+ <AdsLszi>1</AdsLszi>
+ <AdsLtoi>1</AdsLtoi>
+ <AdsLsun>1</AdsLsun>
+ <AdsLven>1</AdsLven>
+ <AdsLsxf>1</AdsLsxf>
+ <RvctClst>0</RvctClst>
+ <GenPPlst>0</GenPPlst>
+ <AdsCpuType>"Cortex-M4"</AdsCpuType>
+ <RvctDeviceName></RvctDeviceName>
+ <mOS>0</mOS>
+ <uocRom>0</uocRom>
+ <uocRam>0</uocRam>
+ <hadIROM>1</hadIROM>
+ <hadIRAM>1</hadIRAM>
+ <hadXRAM>0</hadXRAM>
+ <uocXRam>0</uocXRam>
+ <RvdsVP>2</RvdsVP>
+ <hadIRAM2>0</hadIRAM2>
+ <hadIROM2>0</hadIROM2>
+ <StupSel>8</StupSel>
+ <useUlib>1</useUlib>
+ <EndSel>0</EndSel>
+ <uLtcg>0</uLtcg>
+ <RoSelD>3</RoSelD>
+ <RwSelD>3</RwSelD>
+ <CodeSel>0</CodeSel>
+ <OptFeed>0</OptFeed>
+ <NoZi1>0</NoZi1>
+ <NoZi2>0</NoZi2>
+ <NoZi3>0</NoZi3>
+ <NoZi4>0</NoZi4>
+ <NoZi5>0</NoZi5>
+ <Ro1Chk>0</Ro1Chk>
+ <Ro2Chk>0</Ro2Chk>
+ <Ro3Chk>0</Ro3Chk>
+ <Ir1Chk>1</Ir1Chk>
+ <Ir2Chk>0</Ir2Chk>
+ <Ra1Chk>0</Ra1Chk>
+ <Ra2Chk>0</Ra2Chk>
+ <Ra3Chk>0</Ra3Chk>
+ <Im1Chk>1</Im1Chk>
+ <Im2Chk>0</Im2Chk>
+ <OnChipMemories>
+ <Ocm1>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm1>
+ <Ocm2>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm2>
+ <Ocm3>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm3>
+ <Ocm4>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm4>
+ <Ocm5>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm5>
+ <Ocm6>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm6>
+ <IRAM>
+ <Type>0</Type>
+ <StartAddress>0x20000000</StartAddress>
+ <Size>0x40000</Size>
+ </IRAM>
+ <IROM>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x100000</Size>
+ </IROM>
+ <XRAM>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </XRAM>
+ <OCR_RVCT1>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT1>
+ <OCR_RVCT2>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT2>
+ <OCR_RVCT3>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT3>
+ <OCR_RVCT4>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x100000</Size>
+ </OCR_RVCT4>
+ <OCR_RVCT5>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT5>
+ <OCR_RVCT6>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT6>
+ <OCR_RVCT7>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT7>
+ <OCR_RVCT8>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT8>
+ <OCR_RVCT9>
+ <Type>0</Type>
+ <StartAddress>0x20000000</StartAddress>
+ <Size>0x40000</Size>
+ </OCR_RVCT9>
+ <OCR_RVCT10>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT10>
+ </OnChipMemories>
+ <RvctStartVector></RvctStartVector>
+ </ArmAdsMisc>
+ <Cads>
+ <interw>0</interw>
+ <Optim>3</Optim>
+ <oTime>0</oTime>
+ <SplitLS>0</SplitLS>
+ <OneElfS>1</OneElfS>
+ <Strict>0</Strict>
+ <EnumInt>0</EnumInt>
+ <PlainCh>0</PlainCh>
+ <Ropi>0</Ropi>
+ <Rwpi>0</Rwpi>
+ <wLevel>2</wLevel>
+ <uThumb>0</uThumb>
+ <VariousControls>
+ <MiscControls>--c99</MiscControls>
+ <Define>rvmdk PART_TM4C129XNCZAD TARGET_IS_TM4C129_RA0</Define>
+ <Undefine></Undefine>
+ <IncludePath>..;..\..\..\..;</IncludePath>
+ </VariousControls>
+ </Cads>
+ <Aads>
+ <interw>1</interw>
+ <Ropi>0</Ropi>
+ <Rwpi>0</Rwpi>
+ <thumb>0</thumb>
+ <SplitLS>0</SplitLS>
+ <SwStkChk>0</SwStkChk>
+ <NoWarn>0</NoWarn>
+ <VariousControls>
+ <MiscControls></MiscControls>
+ <Define></Define>
+ <Undefine></Undefine>
+ <IncludePath></IncludePath>
+ </VariousControls>
+ </Aads>
+ <LDads>
+ <umfTarg>0</umfTarg>
+ <Ropi>0</Ropi>
+ <Rwpi>0</Rwpi>
+ <noStLib>0</noStLib>
+ <RepFail>1</RepFail>
+ <useFile>0</useFile>
+ <TextAddressRange>0x00000000</TextAddressRange>
+ <DataAddressRange>0x20000000</DataAddressRange>
+ <ScatterFile>ble_central.sct</ScatterFile>
+ <IncludeLibs></IncludeLibs>
+ <IncludeLibsPath></IncludeLibsPath>
+ <Misc>--entry Reset_Handler</Misc>
+ <LinkerInputFile></LinkerInputFile>
+ <DisabledWarnings></DisabledWarnings>
+ </LDads>
+ </TargetArmAds>
+ </TargetOption>
+ <Groups>
+ <Group>
+ <GroupName>Source</GroupName>
+ <Files>
+ <File>
+ <FileName>ble_central.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>.\ble_central.c</FilePath>
+ </File>
+ <File>
+ <FileName>frame.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\drivers\frame.c</FilePath>
+ </File>
+ <File>
+ <FileName>gap.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>.\gap.c</FilePath>
+ </File>
+ <File>
+ <FileName>kentec320x240x16_ssd2119.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\drivers\kentec320x240x16_ssd2119.c</FilePath>
+ </File>
+ <File>
+ <FileName>pinout.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\drivers\pinout.c</FilePath>
+ </File>
+ <File>
+ <FileName>startup_rvmdk.S</FileName>
+ <FileType>2</FileType>
+ <FilePath>.\startup_rvmdk.S</FilePath>
+ </File>
+ <File>
+ <FileName>touch.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\drivers\touch.c</FilePath>
+ </File>
+ <File>
+ <FileName>uartstdio.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\..\..\..\utils\uartstdio.c</FilePath>
+ </File>
+ <File>
+ <FileName>ustdlib.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\..\..\..\utils\ustdlib.c</FilePath>
+ </File>
+ </Files>
+ </Group>
+ <Group>
+ <GroupName>Libraries</GroupName>
+ <Files>
+ <File>
+ <FileName>driverlib.lib</FileName>
+ <FileType>4</FileType>
+ <FilePath>..\..\..\..\driverlib\rvmdk\driverlib.lib</FilePath>
+ </File>
+ <File>
+ <FileName>grlib.lib</FileName>
+ <FileType>4</FileType>
+ <FilePath>..\..\..\..\grlib\rvmdk\grlib.lib</FilePath>
+ </File>
+ </Files>
+ </Group>
+ <Group>
+ <GroupName>Documentation</GroupName>
+ <Files>
+ <File>
+ <FileName>readme.txt</FileName>
+ <FileType>5</FileType>
+ <FilePath>.\readme.txt</FilePath>
+ </File>
+ </Files>
+ </Group>
+ </Groups>
+ </Target>
+ </Targets>
+
+</Project>
diff --git a/boards/dk-tm4c129x/ble_central/ble_central_ccs.cmd b/boards/dk-tm4c129x/ble_central/ble_central_ccs.cmd new file mode 100644 index 0000000..96f68e9 --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ble_central_ccs.cmd @@ -0,0 +1,70 @@ +/******************************************************************************
+ *
+ * ble_central_ccs.cmd - CCS linker configuration file for ble_central.
+ *
+ * Copyright (c) 2013-2014 Texas Instruments Incorporated. All rights reserved.
+ * Software License Agreement
+ *
+ * Texas Instruments (TI) is supplying this software for use solely and
+ * exclusively on TI's microcontroller products. The software is owned by
+ * TI and/or its suppliers, and is protected under applicable copyright
+ * laws. You may not combine this software with "viral" open-source
+ * software in order to form a larger program.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
+ * NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
+ * NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
+ * CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+ * DAMAGES, FOR ANY REASON WHATSOEVER.
+ *
+ * This is part of revision 2.1.0.12573 of the DK-TM4C129X Firmware Package.
+ *
+ *****************************************************************************/
+
+--retain=g_pfnVectors
+
+/* The following command line options are set as part of the CCS project. */
+/* If you are building using the command line, or for some reason want to */
+/* define them here, you can uncomment and modify these lines as needed. */
+/* If you are using CCS for building, it is probably better to make any such */
+/* modifications in your CCS project and leave this file alone. */
+/* */
+/* --heap_size=0 */
+/* --stack_size=256 */
+/* --library=rtsv7M3_T_le_eabi.lib */
+
+/* The starting address of the application. Normally the interrupt vectors */
+/* must be located at the beginning of the application. */
+#define APP_BASE 0x00000000
+#define RAM_BASE 0x20000000
+
+/* System memory map */
+
+MEMORY
+{
+ /* Application stored in and executes from internal flash */
+ FLASH (RX) : origin = APP_BASE, length = 0x00100000
+ /* Application uses internal RAM for data */
+ SRAM (RWX) : origin = 0x20000000, length = 0x00040000
+}
+
+/* Section allocation in memory */
+
+SECTIONS
+{
+ .intvecs: > APP_BASE
+ .text : > FLASH
+ .const : > FLASH
+ .cinit : > FLASH
+ .pinit : > FLASH
+ .init_array : > FLASH
+
+ .vtable : > RAM_BASE
+ .data : > SRAM
+ .bss : > SRAM
+ .sysmem : > SRAM
+ .stack : > SRAM
+}
+
+__STACK_TOP = __stack + 1024;
diff --git a/boards/dk-tm4c129x/ble_central/ccs/.ccsimportspec b/boards/dk-tm4c129x/ble_central/ccs/.ccsimportspec new file mode 100644 index 0000000..45bc2ed --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ccs/.ccsimportspec @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<importSpec>
+ <source root="..">
+ <file name="ble_central.c"/>
+ <file name="gap.c"/>
+ <file name="hci.h"/>
+ <file regex=".*_ccs\.cmd"/>
+ <file name="startup_ccs.c"/>
+ </source>
+</importSpec>
diff --git a/boards/dk-tm4c129x/ble_central/ccs/.ccsproject b/boards/dk-tm4c129x/ble_central/ccs/.ccsproject new file mode 100644 index 0000000..59a3400 --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ccs/.ccsproject @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8" ?>
+<?ccsproject version="1.0"?>
+<projectOptions>
+ <deviceVariant value="Cortex M.TM4C129XNCZAD"/>
+ <deviceFamily value="TMS470"/>
+ <deviceEndianness value="little"/>
+ <codegenToolVersion value="5.0.4"/>
+ <isElfFormat value="true"/>
+ <rts value="libc.a"/>
+</projectOptions>
diff --git a/boards/dk-tm4c129x/ble_central/ccs/.cproject b/boards/dk-tm4c129x/ble_central/ccs/.cproject new file mode 100644 index 0000000..4e1735b --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ccs/.cproject @@ -0,0 +1,191 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.427713807">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.427713807" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+ <macros>
+ <stringMacro name="SW_ROOT" type="VALUE_PATH_DIR" value="${PROJECT_ROOT}/../../../../.."/>
+ </macros>
+ <externalSettings/>
+ <extensions>
+ <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.427713807" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep=""${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/armofd" "${CG_TOOL_ROOT}/bin/armhex" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin"">
+ <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.427713807." name="/" resourcePath="">
+ <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.DebugToolchain.1938880615" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug.969834137">
+ <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.2042410903" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
+ <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C129XNCZAD"/>
+ <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
+ <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
+ <listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.1.0.01"/>
+ <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
+ <listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
+ </option>
+ <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.679313438" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.0.4" valueType="string"/>
+ <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.targetPlatformDebug.2031588630" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.targetPlatformDebug"/>
+ <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.builderDebug.1513230219" name="GNU Make.Debug" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.builderDebug"/>
+ <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.compilerDebug.1747263460" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.compilerDebug">
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION.637035974" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE.1712419554" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE.16" valueType="enumerated"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI.1731324335" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI.eabi" valueType="enumerated"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT.995442505" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL.1723182296" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WARNING.430853383" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WARNING" valueType="stringList">
+ <listOptionValue builtIn="false" value="225"/>
+ </option>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DISPLAY_ERROR_NUMBER.2000480257" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WRAP.1249291012" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.INCLUDE_PATH.1306661395" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.INCLUDE_PATH" valueType="includePath">
+ <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
+ <listOptionValue builtIn="false" value=""${SW_ROOT}/examples/boards/dk-tm4c129x""/>
+ <listOptionValue builtIn="false" value=""${SW_ROOT}""/>
+ </option>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.LITTLE_ENDIAN.504828138" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS.2104857197" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL.1039926129" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL.2" valueType="enumerated"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GCC.162588199" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GCC" value="true" valueType="boolean"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.UAL.34976295" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.UAL" value="true" valueType="boolean"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEFINE.748310583" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEFINE" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="ccs="ccs""/>
+ <listOptionValue builtIn="false" value="PART_TM4C129XNCZAD"/>
+ <listOptionValue builtIn="false" value="TARGET_IS_TM4C129_RA0"/>
+ </option>
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__C_SRCS.95466986" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__C_SRCS"/>
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__CPP_SRCS.1609298987" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__CPP_SRCS"/>
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM_SRCS.184889023" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM_SRCS"/>
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM2_SRCS.348481508" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM2_SRCS"/>
+ </tool>
+ <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug.969834137" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug">
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.MAP_FILE.342598324" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.MAP_FILE" value=""ble_central_ccs.map"" valueType="string"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.STACK_SIZE.1030391806" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.STACK_SIZE" value="1024" valueType="string"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.HEAP_SIZE.962444352" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.HEAP_SIZE" value="0" valueType="string"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.OUTPUT_FILE.515648561" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.XML_LINK_INFO.572393698" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.DISPLAY_ERROR_NUMBER.2119571876" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.DIAG_WRAP.205294274" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.SEARCH_PATH.615761381" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.SEARCH_PATH" valueType="libPaths">
+ <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/>
+ <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
+ </option>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.LIBRARY.77881367" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.LIBRARY" valueType="libs">
+ <listOptionValue builtIn="false" value=""libc.a""/>
+ <listOptionValue builtIn="false" value=""${SW_ROOT}/driverlib/ccs/Debug/driverlib.lib""/>
+ <listOptionValue builtIn="false" value=""${SW_ROOT}/grlib/ccs/Debug/grlib.lib""/>
+ </option>
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD_SRCS.1903037081" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD_SRCS"/>
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD2_SRCS.1089705277" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD2_SRCS"/>
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__GEN_CMDS.1186495176" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__GEN_CMDS"/>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Release.192932355">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.192932355" moduleId="org.eclipse.cdt.core.settings" name="Release">
+ <macros>
+ <stringMacro name="SW_ROOT" type="VALUE_PATH_DIR" value="${PROJECT_ROOT}/../../../../.."/>
+ </macros>
+ <externalSettings/>
+ <extensions>
+ <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.192932355" name="Release" parent="com.ti.ccstudio.buildDefinitions.TMS470.Release" postbuildStep=""${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/armofd" "${CG_TOOL_ROOT}/bin/armhex" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin"">
+ <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.192932355." name="/" resourcePath="">
+ <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.ReleaseToolchain.1614900783" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerRelease.141833600">
+ <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1435081199" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
+ <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C129XNCZAD"/>
+ <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
+ <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
+ <listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.1.0.01"/>
+ <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
+ <listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
+ </option>
+ <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1756885446" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.0.4" valueType="string"/>
+ <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.targetPlatformRelease.2022024778" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.targetPlatformRelease"/>
+ <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.builderRelease.476547513" name="GNU Make.Release" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.builderRelease"/>
+ <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.compilerRelease.626806923" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.compilerRelease">
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION.881950361" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE.629749068" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE.16" valueType="enumerated"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI.31430385" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI.eabi" valueType="enumerated"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT.1457299326" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WARNING.429852088" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WARNING" valueType="stringList">
+ <listOptionValue builtIn="false" value="225"/>
+ </option>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DISPLAY_ERROR_NUMBER.2074792496" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WRAP.288200951" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.INCLUDE_PATH.1394130919" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.INCLUDE_PATH" valueType="includePath">
+ <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
+ <listOptionValue builtIn="false" value=""${SW_ROOT}/examples/boards/dk-tm4c129x""/>
+ <listOptionValue builtIn="false" value=""${SW_ROOT}""/>
+ </option>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.LITTLE_ENDIAN.1726274582" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS.295771774" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GCC.2053894290" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GCC" value="true" valueType="boolean"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.UAL.1137725627" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.UAL" value="true" valueType="boolean"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEFINE.1357491806" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEFINE" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="ccs="ccs""/>
+ <listOptionValue builtIn="false" value="PART_TM4C129XNCZAD"/>
+ <listOptionValue builtIn="false" value="TARGET_IS_TM4C129_RA0"/>
+ </option>
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__C_SRCS.1872118018" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__C_SRCS"/>
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__CPP_SRCS.1404992367" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__CPP_SRCS"/>
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM_SRCS.1815370905" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM_SRCS"/>
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM2_SRCS.2001701446" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM2_SRCS"/>
+ </tool>
+ <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerRelease.141833600" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerRelease">
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.MAP_FILE.106173684" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.MAP_FILE" value=""ble_central_ccs.map"" valueType="string"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.STACK_SIZE.1310008718" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.STACK_SIZE" value="1024" valueType="string"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.HEAP_SIZE.265131132" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.HEAP_SIZE" value="0" valueType="string"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.OUTPUT_FILE.1331491376" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.XML_LINK_INFO.1370847950" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.DISPLAY_ERROR_NUMBER.366187030" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.DIAG_WRAP.366682081" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.SEARCH_PATH.1745333301" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.SEARCH_PATH" valueType="libPaths">
+ <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/>
+ <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
+ </option>
+ <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.LIBRARY.1814120141" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.LIBRARY" valueType="libs">
+ <listOptionValue builtIn="false" value=""libc.a""/>
+ <listOptionValue builtIn="false" value=""${SW_ROOT}/driverlib/ccs/Debug/driverlib.lib""/>
+ <listOptionValue builtIn="false" value=""${SW_ROOT}/grlib/ccs/Debug/grlib.lib""/>
+ </option>
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD_SRCS.246344107" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD_SRCS"/>
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD2_SRCS.1877937033" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD2_SRCS"/>
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__GEN_CMDS.70835665" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__GEN_CMDS"/>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="ble_central.com.ti.ccstudio.buildDefinitions.TMS470.ProjectType.1032750601" name="ARM" projectType="com.ti.ccstudio.buildDefinitions.TMS470.ProjectType"/>
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration"/>
+ <storageModule moduleId="org.eclipse.cdt.core.language.mapping">
+ <project-mappings>
+ <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.asmSource" language="com.ti.ccstudio.core.TIASMLanguage"/>
+ <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cHeader" language="com.ti.ccstudio.core.TIGCCLanguage"/>
+ <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cSource" language="com.ti.ccstudio.core.TIGCCLanguage"/>
+ <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxHeader" language="com.ti.ccstudio.core.TIGPPLanguage"/>
+ <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.ti.ccstudio.core.TIGPPLanguage"/>
+ </project-mappings>
+ </storageModule>
+</cproject>
diff --git a/boards/dk-tm4c129x/ble_central/ccs/.project b/boards/dk-tm4c129x/ble_central/ccs/.project new file mode 100644 index 0000000..0c9843d --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ccs/.project @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ble_central</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.ti.ccstudio.core.ccsNature</nature>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ </natures>
+ <linkedResources>
+ <link>
+ <name>ble_central.c</name>
+ <type>1</type>
+ <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/ble_central/ble_central.c</locationURI>
+ </link>
+ <link>
+ <name>ble_central_ccs.cmd</name>
+ <type>1</type>
+ <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/ble_central/ble_central_ccs.cmd</locationURI>
+ </link>
+ <link>
+ <name>gap.c</name>
+ <type>1</type>
+ <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/ble_central/gap.c</locationURI>
+ </link>
+ <link>
+ <name>startup_ccs.c</name>
+ <type>1</type>
+ <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/ble_central/startup_ccs.c</locationURI>
+ </link>
+ <link>
+ <name>drivers/frame.c</name>
+ <type>1</type>
+ <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/drivers/frame.c</locationURI>
+ </link>
+ <link>
+ <name>drivers/kentec320x240x16_ssd2119.c</name>
+ <type>1</type>
+ <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/drivers/kentec320x240x16_ssd2119.c</locationURI>
+ </link>
+ <link>
+ <name>drivers/pinout.c</name>
+ <type>1</type>
+ <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/drivers/pinout.c</locationURI>
+ </link>
+ <link>
+ <name>drivers/touch.c</name>
+ <type>1</type>
+ <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/drivers/touch.c</locationURI>
+ </link>
+ <link>
+ <name>utils/uartstdio.c</name>
+ <type>1</type>
+ <locationURI>SW_ROOT/utils/uartstdio.c</locationURI>
+ </link>
+ <link>
+ <name>utils/ustdlib.c</name>
+ <type>1</type>
+ <locationURI>SW_ROOT/utils/ustdlib.c</locationURI>
+ </link>
+ </linkedResources>
+ <variableList>
+ <variable>
+ <name>SW_ROOT</name>
+ <value>$%7BPARENT-5-PROJECT_LOC%7D</value>
+ </variable>
+ </variableList>
+</projectDescription>
diff --git a/boards/dk-tm4c129x/ble_central/ccs/.settings/org.eclipse.cdt.codan.core.prefs b/boards/dk-tm4c129x/ble_central/ccs/.settings/org.eclipse.cdt.codan.core.prefs new file mode 100644 index 0000000..98b6350 --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ccs/.settings/org.eclipse.cdt.codan.core.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1
+inEditor=false
+onBuild=false
diff --git a/boards/dk-tm4c129x/ble_central/ccs/Debug/ble_central.bin b/boards/dk-tm4c129x/ble_central/ccs/Debug/ble_central.bin Binary files differnew file mode 100644 index 0000000..e0dd72c --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ccs/Debug/ble_central.bin diff --git a/boards/dk-tm4c129x/ble_central/ccs/Debug/ble_central.out b/boards/dk-tm4c129x/ble_central/ccs/Debug/ble_central.out Binary files differnew file mode 100644 index 0000000..77f2e2e --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ccs/Debug/ble_central.out diff --git a/boards/dk-tm4c129x/ble_central/ccs/macros.ini_initial b/boards/dk-tm4c129x/ble_central/ccs/macros.ini_initial new file mode 100644 index 0000000..31214b5 --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ccs/macros.ini_initial @@ -0,0 +1 @@ +SW_ROOT = ../../../../..
diff --git a/boards/dk-tm4c129x/ble_central/ccs/target_config.ccxml b/boards/dk-tm4c129x/ble_central/ccs/target_config.ccxml new file mode 100644 index 0000000..6e5ef45 --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ccs/target_config.ccxml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<configurations XML_version="1.2" id="configurations_0">
+ <configuration XML_version="1.2" id="Stellaris In-Circuit Debug Interface_0">
+ <instance XML_version="1.2" desc="Stellaris In-Circuit Debug Interface_0" href="connections/Stellaris_ICDI_Connection.xml" id="Stellaris In-Circuit Debug Interface_0" xml="Stellaris_ICDI_Connection.xml" xmlpath="connections"/>
+ <connection XML_version="1.2" id="Stellaris In-Circuit Debug Interface_0">
+ <instance XML_version="1.2" href="drivers/stellaris_cs_dap.xml" id="drivers" xml="stellaris_cs_dap.xml" xmlpath="drivers"/>
+ <instance XML_version="1.2" href="drivers/stellaris_cortex_m4.xml" id="drivers" xml="stellaris_cortex_m4.xml" xmlpath="drivers"/>
+ <platform XML_version="1.2" id="platform_0">
+ <instance XML_version="1.2" desc="Stellaris TM4C129XNCZAD_0" href="devices/tm4c129xnczad.xml" id="Stellaris TM4C129XNCZAD_0" xml="tm4c129xnczad.xml" xmlpath="devices"/>
+ </platform>
+ </connection>
+ </configuration>
+</configurations>
diff --git a/boards/dk-tm4c129x/ble_central/ewarm/Exe/ble_central.bin b/boards/dk-tm4c129x/ble_central/ewarm/Exe/ble_central.bin Binary files differnew file mode 100644 index 0000000..4759a71 --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ewarm/Exe/ble_central.bin diff --git a/boards/dk-tm4c129x/ble_central/ewarm/Exe/ble_central.out b/boards/dk-tm4c129x/ble_central/ewarm/Exe/ble_central.out Binary files differnew file mode 100644 index 0000000..6c8f670 --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/ewarm/Exe/ble_central.out diff --git a/boards/dk-tm4c129x/ble_central/gap.c b/boards/dk-tm4c129x/ble_central/gap.c new file mode 100644 index 0000000..086b21c --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/gap.c @@ -0,0 +1,371 @@ +//*****************************************************************************
+//
+// gap.c - GAP configuration and control APIs
+//
+// Copyright (c) 2013-2014 Texas Instruments Incorporated. All rights reserved.
+// Software License Agreement
+//
+// Texas Instruments (TI) is supplying this software for use solely and
+// exclusively on TI's microcontroller products. The software is owned by
+// TI and/or its suppliers, and is protected under applicable copyright
+// laws. You may not combine this software with "viral" open-source
+// software in order to form a larger program.
+//
+// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
+// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
+// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
+// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+// DAMAGES, FOR ANY REASON WHATSOEVER.
+//
+// This is part of revision 2.1.0.12573 of the DK-TM4C129X Firmware Package.
+//
+//*****************************************************************************
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include "hci.h"
+#include "utils/uartstdio.h"
+
+//*****************************************************************************
+//
+// TX buffer used by all APIs.
+//
+//*****************************************************************************
+uint8_t g_pui8TXBuf[64];
+uint8_t g_ui8TXLen;
+
+//*****************************************************************************
+//
+// Forward reference of functions used in this file.
+//
+//*****************************************************************************
+extern void UARTSend(const uint8_t *pui8Buffer, uint32_t ui32Count);
+extern void DumpBuffer(uint8_t *pui8Buf, uint32_t ui32Len, bool bTX);
+
+//*****************************************************************************
+//
+// GAP Device Initialization Request
+//
+//*****************************************************************************
+void
+GAPDeviceInit(uint8_t ui8ProfileRole,
+ uint8_t ui8MaxScanRsps,
+ uint8_t *pui8IRK,
+ uint8_t *pui8SRK,
+ uint32_t ui32SignCounter)
+{
+ g_ui8TXLen = 0;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_CMD_PACKET;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_VE_GAP_DEVICE_INIT_OPCODE & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = (HCI_VE_GAP_DEVICE_INIT_OPCODE >> 8) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = 38;
+ g_pui8TXBuf[g_ui8TXLen++] = ui8ProfileRole;
+ g_pui8TXBuf[g_ui8TXLen++] = ui8MaxScanRsps;
+ memcpy(g_pui8TXBuf + g_ui8TXLen, pui8IRK, 16);
+ g_ui8TXLen +=16;
+ memcpy(g_pui8TXBuf + g_ui8TXLen, pui8SRK, 16);
+ g_ui8TXLen +=16;
+ g_pui8TXBuf[g_ui8TXLen++] = ui32SignCounter & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = (ui32SignCounter >> 8) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = (ui32SignCounter >> 16) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = (ui32SignCounter >> 24) & 0xFF;
+
+ DumpBuffer((uint8_t*)g_pui8TXBuf, g_ui8TXLen, true);
+ UARTSend((const uint8_t*)g_pui8TXBuf, g_ui8TXLen);
+ return;
+}
+
+//*****************************************************************************
+//
+// GAP Get Parameter Request.
+//
+//*****************************************************************************
+void
+GAPGetParam(uint8_t ui8ParamID)
+{
+ g_ui8TXLen = 0;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_CMD_PACKET;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_VE_GAP_GET_PARAM_OPCODE & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = (HCI_VE_GAP_GET_PARAM_OPCODE >> 8) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = 1;
+ g_pui8TXBuf[g_ui8TXLen++] = ui8ParamID;
+
+ DumpBuffer((uint8_t*)g_pui8TXBuf, g_ui8TXLen, true);
+ UARTSend((const uint8_t*)g_pui8TXBuf, g_ui8TXLen);
+ return;
+}
+
+//*****************************************************************************
+//
+// GAP Set Parameter request.
+//
+//*****************************************************************************
+void
+GAPSetParam(uint8_t ui8ParamID, uint16_t ui16Value)
+{
+ g_ui8TXLen = 0;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_CMD_PACKET;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_VE_GAP_SET_PARAM_OPCODE & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = (HCI_VE_GAP_SET_PARAM_OPCODE >> 8) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = 3;
+ g_pui8TXBuf[g_ui8TXLen++] = ui8ParamID;
+ g_pui8TXBuf[g_ui8TXLen++] = ui16Value & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = (ui16Value >> 8) & 0xFF;
+
+ DumpBuffer((uint8_t*)g_pui8TXBuf, g_ui8TXLen, true);
+ UARTSend((const uint8_t*)g_pui8TXBuf, g_ui8TXLen);
+ return;
+}
+
+//*****************************************************************************
+//
+// Start Discovery Request.
+//
+//*****************************************************************************
+void
+GAPDiscoveryReq(uint8_t ui8Mode, bool bActiveScan, bool bWhiteList)
+{
+ g_ui8TXLen = 0;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_CMD_PACKET;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_VE_GAP_DEVICE_DISC_REQ_OPCODE & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = (HCI_VE_GAP_DEVICE_DISC_REQ_OPCODE >> 8) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = 3;
+ g_pui8TXBuf[g_ui8TXLen++] = ui8Mode;
+ g_pui8TXBuf[g_ui8TXLen++] = bActiveScan;
+ g_pui8TXBuf[g_ui8TXLen++] = bWhiteList;
+
+ DumpBuffer((uint8_t*)g_pui8TXBuf, g_ui8TXLen, true);
+ UARTSend((const uint8_t*)g_pui8TXBuf, g_ui8TXLen);
+ return;
+}
+
+//*****************************************************************************
+//
+// Establish Link Request.
+//
+//*****************************************************************************
+void
+GAPEstLinkReq(bool bHighDutyCycle, bool bWhiteList,
+ uint8_t ui8AddrType, uint8_t *pui8DevAddr)
+{
+ uint8_t ui8Idx;
+
+ g_ui8TXLen = 0;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_CMD_PACKET;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_VE_GAP_DEVICE_EST_LINK_REQ_OPCODE & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] =
+ (HCI_VE_GAP_DEVICE_EST_LINK_REQ_OPCODE >> 8) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = 9;
+ g_pui8TXBuf[g_ui8TXLen++] = bHighDutyCycle;
+ g_pui8TXBuf[g_ui8TXLen++] = bWhiteList;
+ g_pui8TXBuf[g_ui8TXLen++] = ui8AddrType;
+ for(ui8Idx = 0; ui8Idx < HCI_BDADDR_LEN; ui8Idx++)
+ {
+ g_pui8TXBuf[g_ui8TXLen++] = pui8DevAddr[ui8Idx];
+ }
+
+ DumpBuffer((uint8_t*)g_pui8TXBuf, g_ui8TXLen, true);
+ UARTSend((const uint8_t*)g_pui8TXBuf, g_ui8TXLen);
+ return;
+}
+
+//*****************************************************************************
+//
+// Terminate Link Request.
+//
+//*****************************************************************************
+void
+GAPTerLinkReq(uint16_t ui16ConnHandle, uint8_t ui8Reason)
+{
+ g_ui8TXLen = 0;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_CMD_PACKET;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_VE_GAP_DEVICE_TER_LINK_REQ_OPCODE & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] =
+ (HCI_VE_GAP_DEVICE_TER_LINK_REQ_OPCODE >> 8) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = 3;
+ g_pui8TXBuf[g_ui8TXLen++] = ui16ConnHandle & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = (ui16ConnHandle >> 8) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = ui8Reason;
+
+ DumpBuffer((uint8_t*)g_pui8TXBuf, g_ui8TXLen, true);
+ UARTSend((const uint8_t*)g_pui8TXBuf, g_ui8TXLen);
+ return;
+}
+
+//*****************************************************************************
+//
+// Start Pairing Request.
+//
+//*****************************************************************************
+void
+GAPAuthenticate(uint16_t ui16ConnHandle)
+{
+ g_ui8TXLen = 0;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_CMD_PACKET;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_VE_GAP_DEVICE_AUTHENTICATE_OPCODE & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] =
+ (HCI_VE_GAP_DEVICE_AUTHENTICATE_OPCODE >> 8) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = 29;
+ g_pui8TXBuf[g_ui8TXLen++] = ui16ConnHandle & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = (ui16ConnHandle >> 8) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = 0x04; //KeyboardDisplay
+ g_pui8TXBuf[g_ui8TXLen++] = 0x00; //oob false
+ memset(&g_pui8TXBuf[g_ui8TXLen], 0, 16);
+ g_ui8TXLen +=16;
+ g_pui8TXBuf[g_ui8TXLen++] = 0x05; //AuthReq
+ g_pui8TXBuf[g_ui8TXLen++] = 0x10; // MaxEKeySize
+ g_pui8TXBuf[g_ui8TXLen++] = 0x3F; // KeyDist
+ g_pui8TXBuf[g_ui8TXLen++] = 0x00; // Pair.enable
+ g_pui8TXBuf[g_ui8TXLen++] = 0x03; // Pair.ioCaps
+ g_pui8TXBuf[g_ui8TXLen++] = 0x00; // Pair.oobDFlag
+
+ g_pui8TXBuf[g_ui8TXLen++] = 0x01; // Pair.authReq
+ g_pui8TXBuf[g_ui8TXLen++] = 0x10; // MaxEKeySize
+ g_pui8TXBuf[g_ui8TXLen++] = 0x3F; // KeyDist
+
+ DumpBuffer((uint8_t*)g_pui8TXBuf, g_ui8TXLen, true);
+ UARTSend((const uint8_t*)g_pui8TXBuf, g_ui8TXLen);
+ return;
+}
+
+//*****************************************************************************
+//
+// PASS key during Authentication.
+//
+//*****************************************************************************
+void
+GAPPassKeyUpdate(uint16_t ui16ConnHandle, char *pcPassCode)
+{
+ g_ui8TXLen = 0;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_CMD_PACKET;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_VE_GAP_DEVICE_PASSKEY_UPDATE_OPCODE & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] =
+ (HCI_VE_GAP_DEVICE_PASSKEY_UPDATE_OPCODE >> 8) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = 8;
+ g_pui8TXBuf[g_ui8TXLen++] = ui16ConnHandle & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = (ui16ConnHandle >> 8) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = pcPassCode[0];
+ g_pui8TXBuf[g_ui8TXLen++] = pcPassCode[1];
+ g_pui8TXBuf[g_ui8TXLen++] = pcPassCode[2];
+ g_pui8TXBuf[g_ui8TXLen++] = pcPassCode[3];
+ g_pui8TXBuf[g_ui8TXLen++] = pcPassCode[4];
+ g_pui8TXBuf[g_ui8TXLen++] = pcPassCode[5];
+
+ DumpBuffer((uint8_t*)g_pui8TXBuf, g_ui8TXLen, true);
+ UARTSend((const uint8_t*)g_pui8TXBuf, g_ui8TXLen);
+ return;
+}
+
+//*****************************************************************************
+//
+// GAP Bonding Request.
+//
+//*****************************************************************************
+void
+GAPBond(uint16_t ui16ConnHandle, tLTKData *psSavedKey)
+{
+ uint8_t ui8Loop;
+
+ g_ui8TXLen = 0;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_CMD_PACKET;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_VE_GAP_DEVICE_BOND_OPCODE & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = (HCI_VE_GAP_DEVICE_BOND_OPCODE >> 8) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = 30;
+ g_pui8TXBuf[g_ui8TXLen++] = ui16ConnHandle & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = (ui16ConnHandle >> 8) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = psSavedKey->bAuth;
+ for(ui8Loop = 0; ui8Loop < psSavedKey->ui8LTKSize; ui8Loop++)
+ {
+ g_pui8TXBuf[g_ui8TXLen++] = psSavedKey->pui8LTK[ui8Loop];
+ }
+ g_pui8TXBuf[g_ui8TXLen++] = psSavedKey->pui8DIV[0];
+ g_pui8TXBuf[g_ui8TXLen++] = psSavedKey->pui8DIV[1];
+ for(ui8Loop = 0; ui8Loop < 8; ui8Loop++)
+ {
+ g_pui8TXBuf[g_ui8TXLen++] = psSavedKey->pui8Rand[ui8Loop];
+ }
+ g_pui8TXBuf[g_ui8TXLen++] = psSavedKey->ui8LTKSize;
+
+ DumpBuffer((uint8_t*)g_pui8TXBuf, g_ui8TXLen, true);
+ UARTSend((const uint8_t*)g_pui8TXBuf, g_ui8TXLen);
+ return;
+}
+
+//*****************************************************************************
+//
+// Read Characteristic Value.
+//
+//*****************************************************************************
+void
+GAPReadCharValue(uint16_t ui16ConnHandle, uint16_t ui16Handle)
+{
+ g_ui8TXLen = 0;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_CMD_PACKET;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_VE_GAP_DEVICE_READ_CHAR_VAL_OPCODE & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] =
+ (HCI_VE_GAP_DEVICE_READ_CHAR_VAL_OPCODE >> 8) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = 4;
+ g_pui8TXBuf[g_ui8TXLen++] = ui16ConnHandle & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = ui16ConnHandle & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = ui16Handle & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = (ui16Handle >> 8) & 0xFF;
+
+ DumpBuffer((uint8_t*)g_pui8TXBuf, g_ui8TXLen, true);
+ UARTSend((const uint8_t*)g_pui8TXBuf, g_ui8TXLen);
+ return;
+
+}
+
+//*****************************************************************************
+//
+// Write Characteristic Value request.
+//
+//*****************************************************************************
+void
+GAPWriteCharValue(uint16_t ui16ConnHandle, uint16_t ui16Handle,
+ uint8_t *pui8Buf, uint8_t ui8Len)
+{
+ uint8_t ui8Loop;
+
+ g_ui8TXLen = 0;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_CMD_PACKET;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_VE_GAP_DEVICE_WRITE_CHAR_VAL_OPCODE & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] =
+ (HCI_VE_GAP_DEVICE_WRITE_CHAR_VAL_OPCODE >> 8) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = 4 + ui8Len;
+ g_pui8TXBuf[g_ui8TXLen++] = ui16ConnHandle & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = ui16ConnHandle & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = ui16Handle & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = (ui16Handle >> 8) & 0xFF;
+ for(ui8Loop = 0; ui8Loop < ui8Len; ui8Loop++)
+ {
+ g_pui8TXBuf[g_ui8TXLen++] = pui8Buf[ui8Loop];
+ }
+
+ DumpBuffer((uint8_t*)g_pui8TXBuf, g_ui8TXLen, true);
+ UARTSend((const uint8_t*)g_pui8TXBuf, g_ui8TXLen);
+ return;
+}
+
+//*****************************************************************************
+//
+// Read RSSI Value Request.
+//
+//*****************************************************************************
+void
+HCIReadRSSI(uint16_t ui16ConnHandle)
+{
+ g_ui8TXLen = 0;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_CMD_PACKET;
+ g_pui8TXBuf[g_ui8TXLen++] = HCI_READ_RSSI_OPCODE & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = (HCI_READ_RSSI_OPCODE >> 8) & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = 2;
+ g_pui8TXBuf[g_ui8TXLen++] = ui16ConnHandle & 0xFF;
+ g_pui8TXBuf[g_ui8TXLen++] = (ui16ConnHandle >>8) & 0xFF;
+
+ DumpBuffer((uint8_t*)g_pui8TXBuf, g_ui8TXLen, true);
+ UARTSend((const uint8_t*)g_pui8TXBuf, g_ui8TXLen);
+ return;
+}
diff --git a/boards/dk-tm4c129x/ble_central/gcc/ble_central.axf b/boards/dk-tm4c129x/ble_central/gcc/ble_central.axf Binary files differnew file mode 100644 index 0000000..ea891ff --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/gcc/ble_central.axf diff --git a/boards/dk-tm4c129x/ble_central/gcc/ble_central.bin b/boards/dk-tm4c129x/ble_central/gcc/ble_central.bin Binary files differnew file mode 100644 index 0000000..a1b24e6 --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/gcc/ble_central.bin diff --git a/boards/dk-tm4c129x/ble_central/hci.h b/boards/dk-tm4c129x/ble_central/hci.h new file mode 100644 index 0000000..c5680cf --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/hci.h @@ -0,0 +1,329 @@ +//*****************************************************************************
+//
+// hci.h - This file contains the types, contants, external functions
+// etc. for the BLE HCI Transport Layer.
+// This file copied most of #defines from BLE-Stack 1.3.2 release
+//
+// Copyright (c) 2013-2014 Texas Instruments Incorporated. All rights reserved.
+// Software License Agreement
+//
+// Texas Instruments (TI) is supplying this software for use solely and
+// exclusively on TI's microcontroller products. The software is owned by
+// TI and/or its suppliers, and is protected under applicable copyright
+// laws. You may not combine this software with "viral" open-source
+// software in order to form a larger program.
+//
+// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
+// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
+// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
+// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+// DAMAGES, FOR ANY REASON WHATSOEVER.
+//
+// This is part of revision 2.1.0.12573 of the DK-TM4C129X Firmware Package.
+//
+//*****************************************************************************
+
+#ifndef HCI_H
+#define HCI_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+//
+// Long Term Key info
+//
+typedef struct
+{
+ bool bValid;
+ bool bAuth;
+ uint8_t ui8LTKSize;
+ uint8_t pui8LTK[16];
+ uint8_t pui8DIV[2];
+ uint8_t pui8Rand[8];
+} tLTKData;
+
+#define HCI_BDADDR_LEN 6
+
+//
+// HCI Packet Types
+//
+#define HCI_CMD_PACKET 0x01
+#define HCI_ACL_DATA_PACKET 0x02
+#define HCI_SCO_DATA_PACKET 0x03
+#define HCI_EVENT_PACKET 0x04
+
+//
+// Vendor Specific Command Opcode
+//
+#define HCI_VE_GAP_DEVICE_INIT_OPCODE 0xFE00
+#define HCI_VE_GAP_DEVICE_DISC_REQ_OPCODE 0xFE04
+#define HCI_VE_GAP_DEVICE_EST_LINK_REQ_OPCODE 0xFE09
+#define HCI_VE_GAP_DEVICE_TER_LINK_REQ_OPCODE 0xFE0A
+#define HCI_VE_GAP_DEVICE_AUTHENTICATE_OPCODE 0xFE0B
+#define HCI_VE_GAP_DEVICE_PASSKEY_UPDATE_OPCODE 0xFE0C
+#define HCI_VE_GAP_DEVICE_BOND_OPCODE 0xFE0F
+#define HCI_VE_GAP_SET_PARAM_OPCODE 0xFE30
+#define HCI_VE_GAP_GET_PARAM_OPCODE 0xFE31
+#define HCI_VE_GAP_DEVICE_READ_CHAR_VAL_OPCODE 0xFD8A
+#define HCI_VE_GAP_DEVICE_WRITE_CHAR_VAL_OPCODE 0xFD92
+
+//
+// BLE Command Opcode
+//
+#define HCI_READ_RSSI_OPCODE 0x1405
+
+//
+// Characteristic Value Handle
+//
+#define GATT_IRTEMP_DATA_UUID_HANDLE 0x25
+#define GATT_IRTEMP_NOTIFY_UUID_HANDLE 0x26
+#define GATT_IRTEMP_CFG_UUID_HANDLE 0x29
+#define GATT_HUMIDITY_DATA_UUID_HANDLE 0x38
+#define GATT_HUMIDITY_NOTIDY_UUID_HANDLE 0x39
+#define GATT_HUMIDITY_CFG_UUID_HANDLE 0x3C
+
+//
+// GAP Profile Roles Bit mask values
+//
+#define GAP_PROFILE_BROADCASTER 0x01 //A device that sends advertising events only.
+#define GAP_PROFILE_OBSERVER 0x02 //A device that receives advertising events only.
+#define GAP_PROFILE_PERIPHERAL 0x04 //A device that accepts the establishment of an LE physical link using the connection establishment procedure
+#define GAP_PROFILE_CENTRAL 0x08 //A device that supports the Central role initiates the establishment of a physical connection
+
+
+//
+// GAP_PARAMETER_ID_DEFINES GAP Parameter IDs
+//
+#define TGAP_GEN_DISC_ADV_MIN 0 //!< Minimum time to remain advertising, when in Discoverable mode (mSec). Setting this parameter to 0 turns off the timeout (default).
+#define TGAP_LIM_ADV_TIMEOUT 1 //!< Maximum time to remain advertising, when in Limited Discoverable mode. In seconds (default 180 seconds)
+#define TGAP_GEN_DISC_SCAN 2 //!< Minimum time to perform scanning, when performing General Discovery proc (mSec)
+#define TGAP_LIM_DISC_SCAN 3 //!< Minimum time to perform scanning, when performing Limited Discovery proc (mSec)
+#define TGAP_CONN_EST_ADV_TIMEOUT 4 //!< Advertising timeout, when performing Connection Establishment proc (mSec)
+#define TGAP_CONN_PARAM_TIMEOUT 5 //!< Link Layer connection parameter update notification timer, connection parameter update proc (mSec)
+
+// Constants
+#define TGAP_LIM_DISC_ADV_INT_MIN 6 //!< Minimum advertising interval, when in limited discoverable mode (n * 0.625 mSec)
+#define TGAP_LIM_DISC_ADV_INT_MAX 7 //!< Maximum advertising interval, when in limited discoverable mode (n * 0.625 mSec)
+#define TGAP_GEN_DISC_ADV_INT_MIN 8 //!< Minimum advertising interval, when in General discoverable mode (n * 0.625 mSec)
+#define TGAP_GEN_DISC_ADV_INT_MAX 9 //!< Maximum advertising interval, when in General discoverable mode (n * 0.625 mSec)
+#define TGAP_CONN_ADV_INT_MIN 10 //!< Minimum advertising interval, when in Connectable mode (n * 0.625 mSec)
+#define TGAP_CONN_ADV_INT_MAX 11 //!< Maximum advertising interval, when in Connectable mode (n * 0.625 mSec)
+#define TGAP_CONN_SCAN_INT 12 //!< Scan interval used during Link Layer Initiating state, when in Connectable mode (n * 0.625 mSec)
+#define TGAP_CONN_SCAN_WIND 13 //!< Scan window used during Link Layer Initiating state, when in Connectable mode (n * 0.625 mSec)
+#define TGAP_CONN_HIGH_SCAN_INT 14 //!< Scan interval used during Link Layer Initiating state, when in Connectable mode, high duty scan cycle scan paramaters (n * 0.625 mSec)
+#define TGAP_CONN_HIGH_SCAN_WIND 15 //!< Scan window used during Link Layer Initiating state, when in Connectable mode, high duty scan cycle scan paramaters (n * 0.625 mSec)
+#define TGAP_GEN_DISC_SCAN_INT 16 //!< Scan interval used during Link Layer Scanning state, when in General Discovery proc (n * 0.625 mSec)
+#define TGAP_GEN_DISC_SCAN_WIND 17 //!< Scan window used during Link Layer Scanning state, when in General Discovery proc (n * 0.625 mSec)
+#define TGAP_LIM_DISC_SCAN_INT 18 //!< Scan interval used during Link Layer Scanning state, when in Limited Discovery proc (n * 0.625 mSec)
+#define TGAP_LIM_DISC_SCAN_WIND 19 //!< Scan window used during Link Layer Scanning state, when in Limited Discovery proc (n * 0.625 mSec)
+#define TGAP_CONN_EST_ADV 20 //!< Advertising interval, when using Connection Establishment proc (n * 0.625 mSec). Obsolete - Do not use.
+#define TGAP_CONN_EST_INT_MIN 21 //!< Minimum Link Layer connection interval, when using Connection Establishment proc (n * 1.25 mSec)
+#define TGAP_CONN_EST_INT_MAX 22 //!< Maximum Link Layer connection interval, when using Connection Establishment proc (n * 1.25 mSec)
+#define TGAP_CONN_EST_SCAN_INT 23 //!< Scan interval used during Link Layer Initiating state, when using Connection Establishment proc (n * 0.625 mSec)
+#define TGAP_CONN_EST_SCAN_WIND 24 //!< Scan window used during Link Layer Initiating state, when using Connection Establishment proc (n * 0.625 mSec)
+#define TGAP_CONN_EST_SUPERV_TIMEOUT 25 //!< Link Layer connection supervision timeout, when using Connection Establishment proc (n * 10 mSec)
+#define TGAP_CONN_EST_LATENCY 26 //!< Link Layer connection slave latency, when using Connection Establishment proc (in number of connection events)
+#define TGAP_CONN_EST_MIN_CE_LEN 27 //!< Local informational parameter about min len of connection needed, when using Connection Establishment proc (n * 0.625 mSec)
+#define TGAP_CONN_EST_MAX_CE_LEN 28 //!< Local informational parameter about max len of connection needed, when using Connection Establishment proc (n * 0.625 mSec)
+#define TGAP_PRIVATE_ADDR_INT 29 //!< Minimum Time Interval between private (resolvable) address changes. In minutes (default 15 minutes)
+#define TGAP_CONN_PAUSE_CENTRAL 30 //!< Central idle timer. In seconds (default 1 second)
+#define TGAP_CONN_PAUSE_PERIPHERAL 31 //!< Minimum time upon connection establishment before the peripheral starts a connection update procedure. In seconds (default 5 seconds)
+
+// Proprietary
+#define TGAP_SM_TIMEOUT 32 //!< SM Message Timeout (milliseconds). Default 30 seconds.
+#define TGAP_SM_MIN_KEY_LEN 33 //!< SM Minimum Key Length supported. Default 7.
+#define TGAP_SM_MAX_KEY_LEN 34 //!< SM Maximum Key Length supported. Default 16.
+#define TGAP_FILTER_ADV_REPORTS 35 //!< Filter duplicate advertising reports. Default TRUE.
+#define TGAP_SCAN_RSP_RSSI_MIN 36 //!< Minimum RSSI required for scan responses to be reported to the app. Default -127.
+
+//
+// GAP Device Discovery Modes
+//
+#define DEVDISC_MODE_NONDISCOVERABLE 0x00 //!< No discoverable setting
+#define DEVDISC_MODE_GENERAL 0x01 //!< General Discoverable devices
+#define DEVDISC_MODE_LIMITED 0x02 //!< Limited Discoverable devices
+#define DEVDISC_MODE_ALL 0x03 //!< Not filtered
+
+//
+// GAP Address Types
+//
+#define ADDRTYPE_PUBLIC 0x00 //!< Use the BD_ADDR
+#define ADDRTYPE_STATIC 0x01 //!< Static address
+#define ADDRTYPE_PRIVATE_NONRESOLVE 0x02 //!< Generate Non-Resolvable Private Address
+#define ADDRTYPE_PRIVATE_RESOLVE 0x03 //!< Generate Resolvable Private Address
+
+//
+// GAP Advertiser Event Types
+//
+#define GAP_ADTYPE_ADV_IND 0x00 //!< Connectable undirected advertisement
+#define GAP_ADTYPE_ADV_DIRECT_IND 0x01 //!< Connectable directed advertisement
+#define GAP_ADTYPE_ADV_DISCOVER_IND 0x02 //!< Discoverable undirected advertisement
+#define GAP_ADTYPE_ADV_NONCONN_IND 0x03 //!< Non-Connectable undirected advertisement
+#define GAP_ADTYPE_SCAN_RSP_IND 0x04 //!< Only used in gapDeviceInfoEvent_t
+
+//
+// Vendor Specific Event Code
+//
+#define HCI_VE_EVENT_CODE 0xFF
+
+// Vendor Specific Event
+#define GAP_HCI_EVENT_EXT_CMD_STATUS 0x067F
+#define GAP_HCI_EVENT_EXT_DEVICE_INIT_DONE 0x0600
+#define GAP_HCI_EVENT_EXT_DEVICE_INFO 0x060D
+#define GAP_HCI_EVENT_EXT_DEVICE_DISC_DONE 0x0601
+#define GAP_HCI_EVENT_EXT_DEVICE_LINK_DONE 0x0605
+#define GAP_HCI_EVENT_EXT_DEVICE_TERM_LINK_DONE 0x0606
+#define GAP_HCI_EVENT_EXT_DEVICE_PASSKEY_NEEDED 0x060B
+#define GAP_HCI_EVENT_EXT_DEVICE_AUTHENTICATE_DONE 0x060A
+#define GAP_HCI_EVENT_EXT_DEVICE_BOND_DONE 0x060E
+#define GAP_HCI_EVENT_EXT_ATT_READ_RSP 0x050B
+#define GAP_HCI_EVENT_EXT_ATT_WRITE_RSP 0x0513
+#define GAP_HCI_EVENT_CMD_COMPLETE 0x0E
+#define HCI_ATT_ERROR_RSP_EVENT 0x0501
+#define GAP_HCI_EVENT_HANDLE_VALUE_NOTIFY 0x051B
+
+/*
+** HCI Status
+**
+** Per the Bluetooth Core Specification, V4.0.0, Vol. 2, Part D.
+*/
+#define HCI_SUCCESS 0x00
+#define HCI_ERROR_CODE_UNKNOWN_HCI_CMD 0x01
+#define HCI_ERROR_CODE_UNKNOWN_CONN_ID 0x02
+#define HCI_ERROR_CODE_HW_FAILURE 0x03
+#define HCI_ERROR_CODE_PAGE_TIMEOUT 0x04
+#define HCI_ERROR_CODE_AUTH_FAILURE 0x05
+#define HCI_ERROR_CODE_PIN_KEY_MISSING 0x06
+#define HCI_ERROR_CODE_MEM_CAP_EXCEEDED 0x07
+#define HCI_ERROR_CODE_CONN_TIMEOUT 0x08
+#define HCI_ERROR_CODE_CONN_LIMIT_EXCEEDED 0x09
+#define HCI_ERROR_CODE_SYNCH_CONN_LIMIT_EXCEEDED 0x0A
+#define HCI_ERROR_CODE_ACL_CONN_ALREADY_EXISTS 0x0B
+#define HCI_ERROR_CODE_CMD_DISALLOWED 0x0C
+#define HCI_ERROR_CODE_CONN_REJ_LIMITED_RESOURCES 0x0D
+#define HCI_ERROR_CODE_CONN_REJECTED_SECURITY_REASONS 0x0E
+#define HCI_ERROR_CODE_CONN_REJECTED_UNACCEPTABLE_BDADDR 0x0F
+#define HCI_ERROR_CODE_CONN_ACCEPT_TIMEOUT_EXCEEDED 0x10
+#define HCI_ERROR_CODE_UNSUPPORTED_FEATURE_PARAM_VALUE 0x11
+#define HCI_ERROR_CODE_INVALID_HCI_CMD_PARAMS 0x12
+#define HCI_ERROR_CODE_REMOTE_USER_TERM_CONN 0x13
+#define HCI_ERROR_CODE_REMOTE_DEVICE_TERM_CONN_LOW_RESOURCES 0x14
+#define HCI_ERROR_CODE_REMOTE_DEVICE_TERM_CONN_POWER_OFF 0x15
+#define HCI_ERROR_CODE_CONN_TERM_BY_LOCAL_HOST 0x16
+#define HCI_ERROR_CODE_REPEATED_ATTEMPTS 0x17
+#define HCI_ERROR_CODE_PAIRING_NOT_ALLOWED 0x18
+#define HCI_ERROR_CODE_UNKNOWN_LMP_PDU 0x19
+#define HCI_ERROR_CODE_UNSUPPORTED_REMOTE_FEATURE 0x1A
+#define HCI_ERROR_CODE_SCO_OFFSET_REJ 0x1B
+#define HCI_ERROR_CODE_SCO_INTERVAL_REJ 0x1C
+#define HCI_ERROR_CODE_SCO_AIR_MODE_REJ 0x1D
+#define HCI_ERROR_CODE_INVALID_LMP_PARAMS 0x1E
+#define HCI_ERROR_CODE_UNSPECIFIED_ERROR 0x1F
+#define HCI_ERROR_CODE_UNSUPPORTED_LMP_PARAM_VAL 0x20
+#define HCI_ERROR_CODE_ROLE_CHANGE_NOT_ALLOWED 0x21
+#define HCI_ERROR_CODE_LMP_LL_RESP_TIMEOUT 0x22
+#define HCI_ERROR_CODE_LMP_ERR_TRANSACTION_COLLISION 0x23
+#define HCI_ERROR_CODE_LMP_PDU_NOT_ALLOWED 0x24
+#define HCI_ERROR_CODE_ENCRYPT_MODE_NOT_ACCEPTABLE 0x25
+#define HCI_ERROR_CODE_LINK_KEY_CAN_NOT_BE_CHANGED 0x26
+#define HCI_ERROR_CODE_REQ_QOS_NOT_SUPPORTED 0x27
+#define HCI_ERROR_CODE_INSTANT_PASSED 0x28
+#define HCI_ERROR_CODE_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED 0x29
+#define HCI_ERROR_CODE_DIFFERENT_TRANSACTION_COLLISION 0x2A
+#define HCI_ERROR_CODE_RESERVED1 0x2B
+#define HCI_ERROR_CODE_QOS_UNACCEPTABLE_PARAM 0x2C
+#define HCI_ERROR_CODE_QOS_REJ 0x2D
+#define HCI_ERROR_CODE_CHAN_ASSESSMENT_NOT_SUPPORTED 0x2E
+#define HCI_ERROR_CODE_INSUFFICIENT_SECURITY 0x2F
+#define HCI_ERROR_CODE_PARAM_OUT_OF_MANDATORY_RANGE 0x30
+#define HCI_ERROR_CODE_RESERVED2 0x31
+#define HCI_ERROR_CODE_ROLE_SWITCH_PENDING 0x32
+#define HCI_ERROR_CODE_RESERVED3 0x33
+#define HCI_ERROR_CODE_RESERVED_SLOT_VIOLATION 0x34
+#define HCI_ERROR_CODE_ROLE_SWITCH_FAILED 0x35
+#define HCI_ERROR_CODE_EXTENDED_INQUIRY_RESP_TOO_LARGE 0x36
+#define HCI_ERROR_CODE_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST 0x37
+#define HCI_ERROR_CODE_HOST_BUSY_PAIRING 0x38
+#define HCI_ERROR_CODE_CONN_REJ_NO_SUITABLE_CHAN_FOUND 0x39
+#define HCI_ERROR_CODE_CONTROLLER_BUSY 0x3A
+#define HCI_ERROR_CODE_UNACCEPTABLE_CONN_INTERVAL 0x3B
+#define HCI_ERROR_CODE_DIRECTED_ADV_TIMEOUT 0x3C
+#define HCI_ERROR_CODE_CONN_TERM_MIC_FAILURE 0x3D
+#define HCI_ERROR_CODE_CONN_FAILED_TO_ESTABLISH 0x3E
+#define HCI_ERROR_CODE_MAC_CONN_FAILED 0x3F
+
+//
+// Generic Status Return Values
+//
+#define SUCCESS 0x00
+#define FAILURE 0x01
+#define INVALIDPARAMETER 0x02
+#define INVALID_TASK 0x03
+#define MSG_BUFFER_NOT_AVAIL 0x04
+#define INVALID_MSG_POINTER 0x05
+#define INVALID_EVENT_ID 0x06
+#define INVALID_INTERRUPT_ID 0x07
+#define NO_TIMER_AVAIL 0x08
+#define NV_ITEM_UNINIT 0x09
+#define NV_OPER_FAILED 0x0A
+#define INVALID_MEM_SIZE 0x0B
+#define NV_BAD_ITEM_LEN 0x0C
+
+#define bleNotReady 0x10 //!< Not ready to perform task
+#define bleAlreadyInRequestedMode 0x11 //!< Already performing that task
+#define bleIncorrectMode 0x12 //!< Not setup properly to perform that task
+#define bleMemAllocError 0x13 //!< Memory allocation error occurred
+#define bleNotConnected 0x14 //!< Can't perform function when not in a connection
+#define bleNoResources 0x15 //!< There are no resource available
+#define blePending 0x16 //!< Waiting
+#define bleTimeout 0x17 //!< Timed out performing function
+#define bleInvalidRange 0x18 //!< A parameter is out of range
+#define bleLinkEncrypted 0x19 //!< The link is already encrypted
+#define bleProcedureComplete 0x1A //!< The Procedure is completed
+
+// GAP Status Return Values - returned as bStatus_t
+#define bleGAPUserCanceled 0x30 //!< The user canceled the task
+#define bleGAPConnNotAcceptable 0x31 //!< The connection was not accepted
+#define bleGAPBondRejected 0x32 //!< The bound information was rejected.
+
+// ATT Status Return Values - returned as bStatus_t
+#define bleInvalidPDU 0x40 //!< The attribute PDU is invalid
+#define bleInsufficientAuthen 0x41 //!< The attribute has insufficient authentication
+#define bleInsufficientEncrypt 0x42 //!< The attribute has insufficient encryption
+#define bleInsufficientKeySize 0x43 //!< The attribute has insufficient encryption key size
+
+// Disconnect Reasons
+#define HCI_DISCONNECT_AUTH_FAILURE HCI_ERROR_CODE_AUTH_FAILURE
+#define HCI_DISCONNECT_REMOTE_USER_TERM HCI_ERROR_CODE_REMOTE_USER_TERM_CONN
+#define HCI_DISCONNECT_REMOTE_DEV_LOW_RESOURCES HCI_ERROR_CODE_REMOTE_DEVICE_TERM_CONN_LOW_RESOURCES
+#define HCI_DISCONNECT_REMOTE_DEV_POWER_OFF HCI_ERROR_CODE_REMOTE_DEVICE_TERM_CONN_POWER_OFF
+#define HCI_DISCONNECT_UNSUPPORTED_REMOTE_FEATURE HCI_ERROR_CODE_UNSUPPORTED_REMOTE_FEATURE
+#define HCI_DISCONNECT_KEY_PAIRING_NOT_SUPPORTED HCI_ERROR_CODE_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED
+#define HCI_DISCONNECT_UNACCEPTABLE_CONN_INTERVAL HCI_ERROR_CODE_UNACCEPTABLE_CONN_INTERVAL
+
+extern void GAPDeviceInit(uint8_t ui8ProfileRole,
+ uint8_t ui8MaxScanRsps,
+ uint8_t *pui8IRK,
+ uint8_t *pui8SRK,
+ uint32_t ui32SignCounter);
+extern void GAPGetParam(uint8_t ui8ParamID);
+extern void GAPSetParam(uint8_t ui8ParamID, uint16_t ui16Value);
+extern void GAPDiscoveryReq(uint8_t ui8Mode, bool bActiveScan, bool bWhiteList);
+extern void GAPEstLinkReq(bool bHighDutyCycle, bool bWhiteList,
+ uint8_t ui8AddrType, uint8_t *pui8DevAddr);
+extern void GAPTerLinkReq(uint16_t ui16ConnHandle, uint8_t ui8Reason);
+extern void GAPAuthenticate(uint16_t ui16ConnHandle);
+extern void GAPPassKeyUpdate(uint16_t ui16ConnHandle, char *pcPassCode);
+extern void GAPBond(uint16_t ui16ConnHandle, tLTKData *psSavedKey);
+extern void GAPReadCharValue(uint16_t ui16ConnHandle, uint16_t ui16Handle);
+extern void GAPWriteCharValue(uint16_t ui16ConnHandle, uint16_t ui16Handle,
+ uint8_t *pui8Buf, uint8_t ui8Len);
+extern void HCIReadRSSI(uint16_t ui16ConnHandle);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* HCI_H */
diff --git a/boards/dk-tm4c129x/ble_central/readme.txt b/boards/dk-tm4c129x/ble_central/readme.txt new file mode 100644 index 0000000..b703699 --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/readme.txt @@ -0,0 +1,94 @@ +BLE Central Device Demonstration
+
+This application provides a demonstration use of Bluetooth Low Energy
+central device by utilizing TI’s BLE CC2540 Evaluation Module and
+SesorTags.
+
+By connecting a CC2540 EM board to the EM header on the TM4C129X development
+board, the TM4C129X can communicate with the CC2540 by means of
+vendor-specific HCI commands using the UART interface. This application can
+discover up to three SensorTag devices, it can connect to any one of them,
+perform pairing and bonding, read some sensor data and RSSI data from the
+slave, and display the information on the LCD display.
+
+This application can discover any BLE device although it may not be
+able to make a connection to a device other than a SensorTag/CC2540 as the
+bonding process will likely fail due to the use of a default passcode.
+We have tested this application with SensorTag and CC2540 Development
+boards (SmartRF05EB + CC2540 EM) with the SimpleBLEPeripheral
+sample application programmed. It can successfully bond with both boards
+since the same default passcode is expected. Both SensorTag and CC2540
+devices have BLE Stack 1.4.0 release code programmed.
+
+CC2540 device should be programmed with the HostTestRelease
+(Network Processor) application. A hex file containing the this application
+can be found in the BLE stack 1.4.0 release under
+C:\\...\\BLE-CC254x-1.4.0\\Accessories\\HexFiles\\
+CC2540_SmartRF_HostTestRelease_All.hex. Please refer to the Bluetooth Low
+Energy CC2540 Development Kit User's Guide for information on how to load
+the hex file to the CC2540. This User's Guide can be found in
+http://www.ti.com/lit/ug/swru301a/swru301a.pdf
+
+On the TM4C129X development board, make sure that jumpers PJ0 and PJ1
+are connected to the "EM_UART" side which allows UART3 TX and RX signals to
+be routed to the EM header. UART3 is used as the communication channel
+between the CC2540 device and the TM4C129X device.
+
+Once the application starts, it will verify the serial connection by
+sending the CC2540 device a vendor-specific HCI command, and waiting for the
+expected responses within a short time period. Once the physical connection
+between TM4C129X and CC2540 is verified, the device will automatically
+start to discover BLE peripheral device. If no devices are found within 20
+seconds, the application will timeout and display "No Device Found",
+otherwise the discovered device names will be shown on the display.
+Touching any of the device names will start the process of establishing a
+connection with that device. This sample application always tries to make
+a secure connection by pairing the device with default passcode "00000".
+Upon successfully linking and pairing, application will start querying
+sensor data, including IR temperature, ambient temperature, humidity and
+RSSI.
+
+Whe run inside, IR and ambient temperature should typically be in the low
+20s (Celsius). You can place the SensorTag near a hot object (such as a
+cup of coffee) to verify that the IR temperature increases. You can move
+the SensorTag further from the TM4C129X development board to verify that
+its RSSI reading will decrease.
+
+At any time after the connection is established, you can touch the
+"disconnect" button on the bottom of the screen to terminate the
+connection with the peripheral device.
+
+In order to make the SensorTag discoverable by a central device, the
+SensorTag needs to be in the discovery mode. The LED in the middle of the
+board will blink periodically if the SensorTag is in discovery mode. If the
+LED is not blinking, pressing the side button on the SensorTag should
+place it in discovery mode. Once it is connected to a central device,
+the LED should be off, pressing the side button while it is connected will
+terminate the connection and put the SensorTag in discovery mode again.
+For more information on SensorTag, please visit
+http://processors.wiki.ti.com/index.php/Bluetooth_SensorTag
+
+Every HCI command and event are output to the UART console for
+debugging purpose. The UART terminal should be configured in 115,200 baud,
+8-n-1 mode.
+
+
+-------------------------------------------------------------------------------
+
+Copyright (c) 2013-2014 Texas Instruments Incorporated. All rights reserved.
+Software License Agreement
+
+Texas Instruments (TI) is supplying this software for use solely and
+exclusively on TI's microcontroller products. The software is owned by
+TI and/or its suppliers, and is protected under applicable copyright
+laws. You may not combine this software with "viral" open-source
+software in order to form a larger program.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
+NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
+NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
+CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, FOR ANY REASON WHATSOEVER.
+
+This is part of revision 2.1.0.12573 of the DK-TM4C129X Firmware Package.
diff --git a/boards/dk-tm4c129x/ble_central/rvmdk/ble_central.axf b/boards/dk-tm4c129x/ble_central/rvmdk/ble_central.axf Binary files differnew file mode 100644 index 0000000..03e170b --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/rvmdk/ble_central.axf diff --git a/boards/dk-tm4c129x/ble_central/rvmdk/ble_central.bin b/boards/dk-tm4c129x/ble_central/rvmdk/ble_central.bin Binary files differnew file mode 100644 index 0000000..2a4a4ba --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/rvmdk/ble_central.bin diff --git a/boards/dk-tm4c129x/ble_central/startup_ccs.c b/boards/dk-tm4c129x/ble_central/startup_ccs.c new file mode 100644 index 0000000..156d185 --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/startup_ccs.c @@ -0,0 +1,277 @@ +//*****************************************************************************
+//
+// startup_ccs.c - Startup code for use with TI's Code Composer Studio.
+//
+// Copyright (c) 2013-2014 Texas Instruments Incorporated. All rights reserved.
+// Software License Agreement
+//
+// Texas Instruments (TI) is supplying this software for use solely and
+// exclusively on TI's microcontroller products. The software is owned by
+// TI and/or its suppliers, and is protected under applicable copyright
+// laws. You may not combine this software with "viral" open-source
+// software in order to form a larger program.
+//
+// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
+// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
+// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
+// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+// DAMAGES, FOR ANY REASON WHATSOEVER.
+//
+// This is part of revision 2.1.0.12573 of the DK-TM4C129X Firmware Package.
+//
+//*****************************************************************************
+
+#include <stdint.h>
+#include "inc/hw_nvic.h"
+#include "inc/hw_types.h"
+
+//*****************************************************************************
+//
+// Forward declaration of the default fault handlers.
+//
+//*****************************************************************************
+void ResetISR(void);
+static void NmiSR(void);
+static void FaultISR(void);
+static void IntDefaultHandler(void);
+
+//*****************************************************************************
+//
+// External declaration for the reset handler that is to be called when the
+// processor is started
+//
+//*****************************************************************************
+extern void _c_int00(void);
+
+//*****************************************************************************
+//
+// Linker variable that marks the top of the stack.
+//
+//*****************************************************************************
+extern uint32_t __STACK_TOP;
+
+//*****************************************************************************
+//
+// External declarations for the interrupt handlers used by the application.
+//
+//*****************************************************************************
+extern void TouchScreenIntHandler(void);
+extern void SysTickIntHandler(void);
+extern void UART3IntHandler(void);
+
+//*****************************************************************************
+//
+// The vector table. Note that the proper constructs must be placed on this to
+// ensure that it ends up at physical address 0x0000.0000 or at the start of
+// the program if located at a start address other than 0.
+//
+//*****************************************************************************
+#pragma DATA_SECTION(g_pfnVectors, ".intvecs")
+void (* const g_pfnVectors[])(void) =
+{
+ (void (*)(void))((uint32_t)&__STACK_TOP),
+ // The initial stack pointer
+ ResetISR, // The reset handler
+ NmiSR, // The NMI handler
+ FaultISR, // The hard fault handler
+ IntDefaultHandler, // The MPU fault handler
+ IntDefaultHandler, // The bus fault handler
+ IntDefaultHandler, // The usage fault handler
+ 0, // Reserved
+ 0, // Reserved
+ 0, // Reserved
+ 0, // Reserved
+ IntDefaultHandler, // SVCall handler
+ IntDefaultHandler, // Debug monitor handler
+ 0, // Reserved
+ IntDefaultHandler, // The PendSV handler
+ SysTickIntHandler, // The SysTick handler
+ IntDefaultHandler, // GPIO Port A
+ IntDefaultHandler, // GPIO Port B
+ IntDefaultHandler, // GPIO Port C
+ IntDefaultHandler, // GPIO Port D
+ IntDefaultHandler, // GPIO Port E
+ IntDefaultHandler, // UART0 Rx and Tx
+ IntDefaultHandler, // UART1 Rx and Tx
+ IntDefaultHandler, // SSI0 Rx and Tx
+ IntDefaultHandler, // I2C0 Master and Slave
+ IntDefaultHandler, // PWM Fault
+ IntDefaultHandler, // PWM Generator 0
+ IntDefaultHandler, // PWM Generator 1
+ IntDefaultHandler, // PWM Generator 2
+ IntDefaultHandler, // Quadrature Encoder 0
+ IntDefaultHandler, // ADC Sequence 0
+ IntDefaultHandler, // ADC Sequence 1
+ IntDefaultHandler, // ADC Sequence 2
+ TouchScreenIntHandler, // ADC Sequence 3
+ IntDefaultHandler, // Watchdog timer
+ IntDefaultHandler, // Timer 0 subtimer A
+ IntDefaultHandler, // Timer 0 subtimer B
+ IntDefaultHandler, // Timer 1 subtimer A
+ IntDefaultHandler, // Timer 1 subtimer B
+ IntDefaultHandler, // Timer 2 subtimer A
+ IntDefaultHandler, // Timer 2 subtimer B
+ IntDefaultHandler, // Analog Comparator 0
+ IntDefaultHandler, // Analog Comparator 1
+ IntDefaultHandler, // Analog Comparator 2
+ IntDefaultHandler, // System Control (PLL, OSC, BO)
+ IntDefaultHandler, // FLASH Control
+ IntDefaultHandler, // GPIO Port F
+ IntDefaultHandler, // GPIO Port G
+ IntDefaultHandler, // GPIO Port H
+ IntDefaultHandler, // UART2 Rx and Tx
+ IntDefaultHandler, // SSI1 Rx and Tx
+ IntDefaultHandler, // Timer 3 subtimer A
+ IntDefaultHandler, // Timer 3 subtimer B
+ IntDefaultHandler, // I2C1 Master and Slave
+ IntDefaultHandler, // CAN0
+ IntDefaultHandler, // CAN1
+ IntDefaultHandler, // Ethernet
+ IntDefaultHandler, // Hibernate
+ IntDefaultHandler, // USB0
+ IntDefaultHandler, // PWM Generator 3
+ IntDefaultHandler, // uDMA Software Transfer
+ IntDefaultHandler, // uDMA Error
+ IntDefaultHandler, // ADC1 Sequence 0
+ IntDefaultHandler, // ADC1 Sequence 1
+ IntDefaultHandler, // ADC1 Sequence 2
+ IntDefaultHandler, // ADC1 Sequence 3
+ IntDefaultHandler, // External Bus Interface 0
+ IntDefaultHandler, // GPIO Port J
+ IntDefaultHandler, // GPIO Port K
+ IntDefaultHandler, // GPIO Port L
+ IntDefaultHandler, // SSI2 Rx and Tx
+ IntDefaultHandler, // SSI3 Rx and Tx
+ UART3IntHandler, // UART3 Rx and Tx
+ IntDefaultHandler, // UART4 Rx and Tx
+ IntDefaultHandler, // UART5 Rx and Tx
+ IntDefaultHandler, // UART6 Rx and Tx
+ IntDefaultHandler, // UART7 Rx and Tx
+ IntDefaultHandler, // I2C2 Master and Slave
+ IntDefaultHandler, // I2C3 Master and Slave
+ IntDefaultHandler, // Timer 4 subtimer A
+ IntDefaultHandler, // Timer 4 subtimer B
+ IntDefaultHandler, // Timer 5 subtimer A
+ IntDefaultHandler, // Timer 5 subtimer B
+ IntDefaultHandler, // FPU
+ 0, // Reserved
+ 0, // Reserved
+ IntDefaultHandler, // I2C4 Master and Slave
+ IntDefaultHandler, // I2C5 Master and Slave
+ IntDefaultHandler, // GPIO Port M
+ IntDefaultHandler, // GPIO Port N
+ 0, // Reserved
+ IntDefaultHandler, // Tamper
+ IntDefaultHandler, // GPIO Port P (Summary or P0)
+ IntDefaultHandler, // GPIO Port P1
+ IntDefaultHandler, // GPIO Port P2
+ IntDefaultHandler, // GPIO Port P3
+ IntDefaultHandler, // GPIO Port P4
+ IntDefaultHandler, // GPIO Port P5
+ IntDefaultHandler, // GPIO Port P6
+ IntDefaultHandler, // GPIO Port P7
+ IntDefaultHandler, // GPIO Port Q (Summary or Q0)
+ IntDefaultHandler, // GPIO Port Q1
+ IntDefaultHandler, // GPIO Port Q2
+ IntDefaultHandler, // GPIO Port Q3
+ IntDefaultHandler, // GPIO Port Q4
+ IntDefaultHandler, // GPIO Port Q5
+ IntDefaultHandler, // GPIO Port Q6
+ IntDefaultHandler, // GPIO Port Q7
+ IntDefaultHandler, // GPIO Port R
+ IntDefaultHandler, // GPIO Port S
+ IntDefaultHandler, // SHA/MD5 0
+ IntDefaultHandler, // AES 0
+ IntDefaultHandler, // DES3DES 0
+ IntDefaultHandler, // LCD Controller 0
+ IntDefaultHandler, // Timer 6 subtimer A
+ IntDefaultHandler, // Timer 6 subtimer B
+ IntDefaultHandler, // Timer 7 subtimer A
+ IntDefaultHandler, // Timer 7 subtimer B
+ IntDefaultHandler, // I2C6 Master and Slave
+ IntDefaultHandler, // I2C7 Master and Slave
+ IntDefaultHandler, // HIM Scan Matrix Keyboard 0
+ IntDefaultHandler, // One Wire 0
+ IntDefaultHandler, // HIM PS/2 0
+ IntDefaultHandler, // HIM LED Sequencer 0
+ IntDefaultHandler, // HIM Consumer IR 0
+ IntDefaultHandler, // I2C8 Master and Slave
+ IntDefaultHandler, // I2C9 Master and Slave
+ IntDefaultHandler // GPIO Port T
+};
+
+//*****************************************************************************
+//
+// This is the code that gets called when the processor first starts execution
+// following a reset event. Only the absolutely necessary set is performed,
+// after which the application supplied entry() routine is called. Any fancy
+// actions (such as making decisions based on the reset cause register, and
+// resetting the bits in that register) are left solely in the hands of the
+// application.
+//
+//*****************************************************************************
+void
+ResetISR(void)
+{
+ //
+ // Jump to the CCS C initialization routine. This will enable the
+ // floating-point unit as well, so that does not need to be done here.
+ //
+ __asm(" .global _c_int00\n"
+ " b.w _c_int00");
+}
+
+//*****************************************************************************
+//
+// This is the code that gets called when the processor receives a NMI. This
+// simply enters an infinite loop, preserving the system state for examination
+// by a debugger.
+//
+//*****************************************************************************
+static void
+NmiSR(void)
+{
+ //
+ // Enter an infinite loop.
+ //
+ while(1)
+ {
+ }
+}
+
+//*****************************************************************************
+//
+// This is the code that gets called when the processor receives a fault
+// interrupt. This simply enters an infinite loop, preserving the system state
+// for examination by a debugger.
+//
+//*****************************************************************************
+static void
+FaultISR(void)
+{
+ //
+ // Enter an infinite loop.
+ //
+ while(1)
+ {
+ }
+}
+
+//*****************************************************************************
+//
+// This is the code that gets called when the processor receives an unexpected
+// interrupt. This simply enters an infinite loop, preserving the system state
+// for examination by a debugger.
+//
+//*****************************************************************************
+static void
+IntDefaultHandler(void)
+{
+ //
+ // Go into an infinite loop.
+ //
+ while(1)
+ {
+ }
+}
diff --git a/boards/dk-tm4c129x/ble_central/startup_ewarm.c b/boards/dk-tm4c129x/ble_central/startup_ewarm.c new file mode 100644 index 0000000..9852a56 --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/startup_ewarm.c @@ -0,0 +1,308 @@ +//*****************************************************************************
+//
+// startup_ewarm.c - Startup code for use with IAR's Embedded Workbench,
+// version 5.
+//
+// Copyright (c) 2013-2014 Texas Instruments Incorporated. All rights reserved.
+// Software License Agreement
+//
+// Texas Instruments (TI) is supplying this software for use solely and
+// exclusively on TI's microcontroller products. The software is owned by
+// TI and/or its suppliers, and is protected under applicable copyright
+// laws. You may not combine this software with "viral" open-source
+// software in order to form a larger program.
+//
+// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
+// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
+// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
+// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+// DAMAGES, FOR ANY REASON WHATSOEVER.
+//
+// This is part of revision 2.1.0.12573 of the DK-TM4C129X Firmware Package.
+//
+//*****************************************************************************
+
+#include <stdint.h>
+#include "inc/hw_nvic.h"
+#include "inc/hw_types.h"
+
+//*****************************************************************************
+//
+// Enable the IAR extensions for this source file.
+//
+//*****************************************************************************
+#pragma language=extended
+
+//*****************************************************************************
+//
+// Forward declaration of the default fault handlers.
+//
+//*****************************************************************************
+void ResetISR(void);
+static void NmiSR(void);
+static void FaultISR(void);
+static void IntDefaultHandler(void);
+
+//*****************************************************************************
+//
+// External declarations for the interrupt handlers used by the application.
+//
+//*****************************************************************************
+extern void TouchScreenIntHandler(void);
+extern void SysTickIntHandler(void);
+extern void UART3IntHandler(void);
+
+//*****************************************************************************
+//
+// The entry point for the application startup code.
+//
+//*****************************************************************************
+extern void __iar_program_start(void);
+
+//*****************************************************************************
+//
+// Reserve space for the system stack.
+//
+//*****************************************************************************
+static uint32_t pui32Stack[256] @ ".noinit";
+
+//*****************************************************************************
+//
+// A union that describes the entries of the vector table. The union is needed
+// since the first entry is the stack pointer and the remainder are function
+// pointers.
+//
+//*****************************************************************************
+typedef union
+{
+ void (*pfnHandler)(void);
+ uint32_t ui32Ptr;
+}
+uVectorEntry;
+
+//*****************************************************************************
+//
+// The vector table. Note that the proper constructs must be placed on this to
+// ensure that it ends up at physical address 0x0000.0000.
+//
+//*****************************************************************************
+__root const uVectorEntry __vector_table[] @ ".intvec" =
+{
+ { .ui32Ptr = (uint32_t)pui32Stack + sizeof(pui32Stack) },
+ // The initial stack pointer
+ ResetISR, // The reset handler
+ NmiSR, // The NMI handler
+ FaultISR, // The hard fault handler
+ IntDefaultHandler, // The MPU fault handler
+ IntDefaultHandler, // The bus fault handler
+ IntDefaultHandler, // The usage fault handler
+ 0, // Reserved
+ 0, // Reserved
+ 0, // Reserved
+ 0, // Reserved
+ IntDefaultHandler, // SVCall handler
+ IntDefaultHandler, // Debug monitor handler
+ 0, // Reserved
+ IntDefaultHandler, // The PendSV handler
+ SysTickIntHandler, // The SysTick handler
+ IntDefaultHandler, // GPIO Port A
+ IntDefaultHandler, // GPIO Port B
+ IntDefaultHandler, // GPIO Port C
+ IntDefaultHandler, // GPIO Port D
+ IntDefaultHandler, // GPIO Port E
+ IntDefaultHandler, // UART0 Rx and Tx
+ IntDefaultHandler, // UART1 Rx and Tx
+ IntDefaultHandler, // SSI0 Rx and Tx
+ IntDefaultHandler, // I2C0 Master and Slave
+ IntDefaultHandler, // PWM Fault
+ IntDefaultHandler, // PWM Generator 0
+ IntDefaultHandler, // PWM Generator 1
+ IntDefaultHandler, // PWM Generator 2
+ IntDefaultHandler, // Quadrature Encoder 0
+ IntDefaultHandler, // ADC Sequence 0
+ IntDefaultHandler, // ADC Sequence 1
+ IntDefaultHandler, // ADC Sequence 2
+ TouchScreenIntHandler, // ADC Sequence 3
+ IntDefaultHandler, // Watchdog timer
+ IntDefaultHandler, // Timer 0 subtimer A
+ IntDefaultHandler, // Timer 0 subtimer B
+ IntDefaultHandler, // Timer 1 subtimer A
+ IntDefaultHandler, // Timer 1 subtimer B
+ IntDefaultHandler, // Timer 2 subtimer A
+ IntDefaultHandler, // Timer 2 subtimer B
+ IntDefaultHandler, // Analog Comparator 0
+ IntDefaultHandler, // Analog Comparator 1
+ IntDefaultHandler, // Analog Comparator 2
+ IntDefaultHandler, // System Control (PLL, OSC, BO)
+ IntDefaultHandler, // FLASH Control
+ IntDefaultHandler, // GPIO Port F
+ IntDefaultHandler, // GPIO Port G
+ IntDefaultHandler, // GPIO Port H
+ IntDefaultHandler, // UART2 Rx and Tx
+ IntDefaultHandler, // SSI1 Rx and Tx
+ IntDefaultHandler, // Timer 3 subtimer A
+ IntDefaultHandler, // Timer 3 subtimer B
+ IntDefaultHandler, // I2C1 Master and Slave
+ IntDefaultHandler, // CAN0
+ IntDefaultHandler, // CAN1
+ IntDefaultHandler, // Ethernet
+ IntDefaultHandler, // Hibernate
+ IntDefaultHandler, // USB0
+ IntDefaultHandler, // PWM Generator 3
+ IntDefaultHandler, // uDMA Software Transfer
+ IntDefaultHandler, // uDMA Error
+ IntDefaultHandler, // ADC1 Sequence 0
+ IntDefaultHandler, // ADC1 Sequence 1
+ IntDefaultHandler, // ADC1 Sequence 2
+ IntDefaultHandler, // ADC1 Sequence 3
+ IntDefaultHandler, // External Bus Interface 0
+ IntDefaultHandler, // GPIO Port J
+ IntDefaultHandler, // GPIO Port K
+ IntDefaultHandler, // GPIO Port L
+ IntDefaultHandler, // SSI2 Rx and Tx
+ IntDefaultHandler, // SSI3 Rx and Tx
+ UART3IntHandler, // UART3 Rx and Tx
+ IntDefaultHandler, // UART4 Rx and Tx
+ IntDefaultHandler, // UART5 Rx and Tx
+ IntDefaultHandler, // UART6 Rx and Tx
+ IntDefaultHandler, // UART7 Rx and Tx
+ IntDefaultHandler, // I2C2 Master and Slave
+ IntDefaultHandler, // I2C3 Master and Slave
+ IntDefaultHandler, // Timer 4 subtimer A
+ IntDefaultHandler, // Timer 4 subtimer B
+ IntDefaultHandler, // Timer 5 subtimer A
+ IntDefaultHandler, // Timer 5 subtimer B
+ IntDefaultHandler, // FPU
+ 0, // Reserved
+ 0, // Reserved
+ IntDefaultHandler, // I2C4 Master and Slave
+ IntDefaultHandler, // I2C5 Master and Slave
+ IntDefaultHandler, // GPIO Port M
+ IntDefaultHandler, // GPIO Port N
+ 0, // Reserved
+ IntDefaultHandler, // Tamper
+ IntDefaultHandler, // GPIO Port P (Summary or P0)
+ IntDefaultHandler, // GPIO Port P1
+ IntDefaultHandler, // GPIO Port P2
+ IntDefaultHandler, // GPIO Port P3
+ IntDefaultHandler, // GPIO Port P4
+ IntDefaultHandler, // GPIO Port P5
+ IntDefaultHandler, // GPIO Port P6
+ IntDefaultHandler, // GPIO Port P7
+ IntDefaultHandler, // GPIO Port Q (Summary or Q0)
+ IntDefaultHandler, // GPIO Port Q1
+ IntDefaultHandler, // GPIO Port Q2
+ IntDefaultHandler, // GPIO Port Q3
+ IntDefaultHandler, // GPIO Port Q4
+ IntDefaultHandler, // GPIO Port Q5
+ IntDefaultHandler, // GPIO Port Q6
+ IntDefaultHandler, // GPIO Port Q7
+ IntDefaultHandler, // GPIO Port R
+ IntDefaultHandler, // GPIO Port S
+ IntDefaultHandler, // SHA/MD5 0
+ IntDefaultHandler, // AES 0
+ IntDefaultHandler, // DES3DES 0
+ IntDefaultHandler, // LCD Controller 0
+ IntDefaultHandler, // Timer 6 subtimer A
+ IntDefaultHandler, // Timer 6 subtimer B
+ IntDefaultHandler, // Timer 7 subtimer A
+ IntDefaultHandler, // Timer 7 subtimer B
+ IntDefaultHandler, // I2C6 Master and Slave
+ IntDefaultHandler, // I2C7 Master and Slave
+ IntDefaultHandler, // HIM Scan Matrix Keyboard 0
+ IntDefaultHandler, // One Wire 0
+ IntDefaultHandler, // HIM PS/2 0
+ IntDefaultHandler, // HIM LED Sequencer 0
+ IntDefaultHandler, // HIM Consumer IR 0
+ IntDefaultHandler, // I2C8 Master and Slave
+ IntDefaultHandler, // I2C9 Master and Slave
+ IntDefaultHandler // GPIO Port T
+};
+
+//*****************************************************************************
+//
+// This is the code that gets called when the processor first starts execution
+// following a reset event. Only the absolutely necessary set is performed,
+// after which the application supplied entry() routine is called. Any fancy
+// actions (such as making decisions based on the reset cause register, and
+// resetting the bits in that register) are left solely in the hands of the
+// application.
+//
+//*****************************************************************************
+void
+ResetISR(void)
+{
+ //
+ // Enable the floating-point unit. This must be done here to handle the
+ // case where main() uses floating-point and the function prologue saves
+ // floating-point registers (which will fault if floating-point is not
+ // enabled). Any configuration of the floating-point unit using DriverLib
+ // APIs must be done here prior to the floating-point unit being enabled.
+ //
+ // Note that this does not use DriverLib since it might not be included in
+ // this project.
+ //
+ HWREG(NVIC_CPAC) = ((HWREG(NVIC_CPAC) &
+ ~(NVIC_CPAC_CP10_M | NVIC_CPAC_CP11_M)) |
+ NVIC_CPAC_CP10_FULL | NVIC_CPAC_CP11_FULL);
+
+ //
+ // Call the application's entry point.
+ //
+ __iar_program_start();
+}
+
+//*****************************************************************************
+//
+// This is the code that gets called when the processor receives a NMI. This
+// simply enters an infinite loop, preserving the system state for examination
+// by a debugger.
+//
+//*****************************************************************************
+static void
+NmiSR(void)
+{
+ //
+ // Enter an infinite loop.
+ //
+ while(1)
+ {
+ }
+}
+
+//*****************************************************************************
+//
+// This is the code that gets called when the processor receives a fault
+// interrupt. This simply enters an infinite loop, preserving the system state
+// for examination by a debugger.
+//
+//*****************************************************************************
+static void
+FaultISR(void)
+{
+ //
+ // Enter an infinite loop.
+ //
+ while(1)
+ {
+ }
+}
+
+//*****************************************************************************
+//
+// This is the code that gets called when the processor receives an unexpected
+// interrupt. This simply enters an infinite loop, preserving the system state
+// for examination by a debugger.
+//
+//*****************************************************************************
+static void
+IntDefaultHandler(void)
+{
+ //
+ // Go into an infinite loop.
+ //
+ while(1)
+ {
+ }
+}
diff --git a/boards/dk-tm4c129x/ble_central/startup_gcc.c b/boards/dk-tm4c129x/ble_central/startup_gcc.c new file mode 100644 index 0000000..851b511 --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/startup_gcc.c @@ -0,0 +1,324 @@ +//*****************************************************************************
+//
+// startup_gcc.c - Startup code for use with GNU tools.
+//
+// Copyright (c) 2013-2014 Texas Instruments Incorporated. All rights reserved.
+// Software License Agreement
+//
+// Texas Instruments (TI) is supplying this software for use solely and
+// exclusively on TI's microcontroller products. The software is owned by
+// TI and/or its suppliers, and is protected under applicable copyright
+// laws. You may not combine this software with "viral" open-source
+// software in order to form a larger program.
+//
+// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
+// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
+// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
+// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+// DAMAGES, FOR ANY REASON WHATSOEVER.
+//
+// This is part of revision 2.1.0.12573 of the DK-TM4C129X Firmware Package.
+//
+//*****************************************************************************
+
+#include <stdint.h>
+#include "inc/hw_nvic.h"
+#include "inc/hw_types.h"
+
+//*****************************************************************************
+//
+// Forward declaration of the default fault handlers.
+//
+//*****************************************************************************
+void ResetISR(void);
+static void NmiSR(void);
+static void FaultISR(void);
+static void IntDefaultHandler(void);
+
+//*****************************************************************************
+//
+// External declarations for the interrupt handlers used by the application.
+//
+//*****************************************************************************
+extern void TouchScreenIntHandler(void);
+extern void SysTickIntHandler(void);
+extern void UART3IntHandler(void);
+
+//*****************************************************************************
+//
+// The entry point for the application.
+//
+//*****************************************************************************
+extern int main(void);
+
+//*****************************************************************************
+//
+// Reserve space for the system stack.
+//
+//*****************************************************************************
+static uint32_t pui32Stack[256];
+
+//*****************************************************************************
+//
+// The vector table. Note that the proper constructs must be placed on this to
+// ensure that it ends up at physical address 0x0000.0000.
+//
+//*****************************************************************************
+__attribute__ ((section(".isr_vector")))
+void (* const g_pfnVectors[])(void) =
+{
+ (void (*)(void))((uint32_t)pui32Stack + sizeof(pui32Stack)),
+ // The initial stack pointer
+ ResetISR, // The reset handler
+ NmiSR, // The NMI handler
+ FaultISR, // The hard fault handler
+ IntDefaultHandler, // The MPU fault handler
+ IntDefaultHandler, // The bus fault handler
+ IntDefaultHandler, // The usage fault handler
+ 0, // Reserved
+ 0, // Reserved
+ 0, // Reserved
+ 0, // Reserved
+ IntDefaultHandler, // SVCall handler
+ IntDefaultHandler, // Debug monitor handler
+ 0, // Reserved
+ IntDefaultHandler, // The PendSV handler
+ SysTickIntHandler, // The SysTick handler
+ IntDefaultHandler, // GPIO Port A
+ IntDefaultHandler, // GPIO Port B
+ IntDefaultHandler, // GPIO Port C
+ IntDefaultHandler, // GPIO Port D
+ IntDefaultHandler, // GPIO Port E
+ IntDefaultHandler, // UART0 Rx and Tx
+ IntDefaultHandler, // UART1 Rx and Tx
+ IntDefaultHandler, // SSI0 Rx and Tx
+ IntDefaultHandler, // I2C0 Master and Slave
+ IntDefaultHandler, // PWM Fault
+ IntDefaultHandler, // PWM Generator 0
+ IntDefaultHandler, // PWM Generator 1
+ IntDefaultHandler, // PWM Generator 2
+ IntDefaultHandler, // Quadrature Encoder 0
+ IntDefaultHandler, // ADC Sequence 0
+ IntDefaultHandler, // ADC Sequence 1
+ IntDefaultHandler, // ADC Sequence 2
+ TouchScreenIntHandler, // ADC Sequence 3
+ IntDefaultHandler, // Watchdog timer
+ IntDefaultHandler, // Timer 0 subtimer A
+ IntDefaultHandler, // Timer 0 subtimer B
+ IntDefaultHandler, // Timer 1 subtimer A
+ IntDefaultHandler, // Timer 1 subtimer B
+ IntDefaultHandler, // Timer 2 subtimer A
+ IntDefaultHandler, // Timer 2 subtimer B
+ IntDefaultHandler, // Analog Comparator 0
+ IntDefaultHandler, // Analog Comparator 1
+ IntDefaultHandler, // Analog Comparator 2
+ IntDefaultHandler, // System Control (PLL, OSC, BO)
+ IntDefaultHandler, // FLASH Control
+ IntDefaultHandler, // GPIO Port F
+ IntDefaultHandler, // GPIO Port G
+ IntDefaultHandler, // GPIO Port H
+ IntDefaultHandler, // UART2 Rx and Tx
+ IntDefaultHandler, // SSI1 Rx and Tx
+ IntDefaultHandler, // Timer 3 subtimer A
+ IntDefaultHandler, // Timer 3 subtimer B
+ IntDefaultHandler, // I2C1 Master and Slave
+ IntDefaultHandler, // CAN0
+ IntDefaultHandler, // CAN1
+ IntDefaultHandler, // Ethernet
+ IntDefaultHandler, // Hibernate
+ IntDefaultHandler, // USB0
+ IntDefaultHandler, // PWM Generator 3
+ IntDefaultHandler, // uDMA Software Transfer
+ IntDefaultHandler, // uDMA Error
+ IntDefaultHandler, // ADC1 Sequence 0
+ IntDefaultHandler, // ADC1 Sequence 1
+ IntDefaultHandler, // ADC1 Sequence 2
+ IntDefaultHandler, // ADC1 Sequence 3
+ IntDefaultHandler, // External Bus Interface 0
+ IntDefaultHandler, // GPIO Port J
+ IntDefaultHandler, // GPIO Port K
+ IntDefaultHandler, // GPIO Port L
+ IntDefaultHandler, // SSI2 Rx and Tx
+ IntDefaultHandler, // SSI3 Rx and Tx
+ UART3IntHandler, // UART3 Rx and Tx
+ IntDefaultHandler, // UART4 Rx and Tx
+ IntDefaultHandler, // UART5 Rx and Tx
+ IntDefaultHandler, // UART6 Rx and Tx
+ IntDefaultHandler, // UART7 Rx and Tx
+ IntDefaultHandler, // I2C2 Master and Slave
+ IntDefaultHandler, // I2C3 Master and Slave
+ IntDefaultHandler, // Timer 4 subtimer A
+ IntDefaultHandler, // Timer 4 subtimer B
+ IntDefaultHandler, // Timer 5 subtimer A
+ IntDefaultHandler, // Timer 5 subtimer B
+ IntDefaultHandler, // FPU
+ 0, // Reserved
+ 0, // Reserved
+ IntDefaultHandler, // I2C4 Master and Slave
+ IntDefaultHandler, // I2C5 Master and Slave
+ IntDefaultHandler, // GPIO Port M
+ IntDefaultHandler, // GPIO Port N
+ 0, // Reserved
+ IntDefaultHandler, // Tamper
+ IntDefaultHandler, // GPIO Port P (Summary or P0)
+ IntDefaultHandler, // GPIO Port P1
+ IntDefaultHandler, // GPIO Port P2
+ IntDefaultHandler, // GPIO Port P3
+ IntDefaultHandler, // GPIO Port P4
+ IntDefaultHandler, // GPIO Port P5
+ IntDefaultHandler, // GPIO Port P6
+ IntDefaultHandler, // GPIO Port P7
+ IntDefaultHandler, // GPIO Port Q (Summary or Q0)
+ IntDefaultHandler, // GPIO Port Q1
+ IntDefaultHandler, // GPIO Port Q2
+ IntDefaultHandler, // GPIO Port Q3
+ IntDefaultHandler, // GPIO Port Q4
+ IntDefaultHandler, // GPIO Port Q5
+ IntDefaultHandler, // GPIO Port Q6
+ IntDefaultHandler, // GPIO Port Q7
+ IntDefaultHandler, // GPIO Port R
+ IntDefaultHandler, // GPIO Port S
+ IntDefaultHandler, // SHA/MD5 0
+ IntDefaultHandler, // AES 0
+ IntDefaultHandler, // DES3DES 0
+ IntDefaultHandler, // LCD Controller 0
+ IntDefaultHandler, // Timer 6 subtimer A
+ IntDefaultHandler, // Timer 6 subtimer B
+ IntDefaultHandler, // Timer 7 subtimer A
+ IntDefaultHandler, // Timer 7 subtimer B
+ IntDefaultHandler, // I2C6 Master and Slave
+ IntDefaultHandler, // I2C7 Master and Slave
+ IntDefaultHandler, // HIM Scan Matrix Keyboard 0
+ IntDefaultHandler, // One Wire 0
+ IntDefaultHandler, // HIM PS/2 0
+ IntDefaultHandler, // HIM LED Sequencer 0
+ IntDefaultHandler, // HIM Consumer IR 0
+ IntDefaultHandler, // I2C8 Master and Slave
+ IntDefaultHandler, // I2C9 Master and Slave
+ IntDefaultHandler // GPIO Port T
+};
+
+//*****************************************************************************
+//
+// The following are constructs created by the linker, indicating where the
+// the "data" and "bss" segments reside in memory. The initializers for the
+// for the "data" segment resides immediately following the "text" segment.
+//
+//*****************************************************************************
+extern uint32_t _etext;
+extern uint32_t _data;
+extern uint32_t _edata;
+extern uint32_t _bss;
+extern uint32_t _ebss;
+
+//*****************************************************************************
+//
+// This is the code that gets called when the processor first starts execution
+// following a reset event. Only the absolutely necessary set is performed,
+// after which the application supplied entry() routine is called. Any fancy
+// actions (such as making decisions based on the reset cause register, and
+// resetting the bits in that register) are left solely in the hands of the
+// application.
+//
+//*****************************************************************************
+void
+ResetISR(void)
+{
+ uint32_t *pui32Src, *pui32Dest;
+
+ //
+ // Copy the data segment initializers from flash to SRAM.
+ //
+ pui32Src = &_etext;
+ for(pui32Dest = &_data; pui32Dest < &_edata; )
+ {
+ *pui32Dest++ = *pui32Src++;
+ }
+
+ //
+ // Zero fill the bss segment.
+ //
+ __asm(" ldr r0, =_bss\n"
+ " ldr r1, =_ebss\n"
+ " mov r2, #0\n"
+ " .thumb_func\n"
+ "zero_loop:\n"
+ " cmp r0, r1\n"
+ " it lt\n"
+ " strlt r2, [r0], #4\n"
+ " blt zero_loop");
+
+ //
+ // Enable the floating-point unit. This must be done here to handle the
+ // case where main() uses floating-point and the function prologue saves
+ // floating-point registers (which will fault if floating-point is not
+ // enabled). Any configuration of the floating-point unit using DriverLib
+ // APIs must be done here prior to the floating-point unit being enabled.
+ //
+ // Note that this does not use DriverLib since it might not be included in
+ // this project.
+ //
+ HWREG(NVIC_CPAC) = ((HWREG(NVIC_CPAC) &
+ ~(NVIC_CPAC_CP10_M | NVIC_CPAC_CP11_M)) |
+ NVIC_CPAC_CP10_FULL | NVIC_CPAC_CP11_FULL);
+
+ //
+ // Call the application's entry point.
+ //
+ main();
+}
+
+//*****************************************************************************
+//
+// This is the code that gets called when the processor receives a NMI. This
+// simply enters an infinite loop, preserving the system state for examination
+// by a debugger.
+//
+//*****************************************************************************
+static void
+NmiSR(void)
+{
+ //
+ // Enter an infinite loop.
+ //
+ while(1)
+ {
+ }
+}
+
+//*****************************************************************************
+//
+// This is the code that gets called when the processor receives a fault
+// interrupt. This simply enters an infinite loop, preserving the system state
+// for examination by a debugger.
+//
+//*****************************************************************************
+static void
+FaultISR(void)
+{
+ //
+ // Enter an infinite loop.
+ //
+ while(1)
+ {
+ }
+}
+
+//*****************************************************************************
+//
+// This is the code that gets called when the processor receives an unexpected
+// interrupt. This simply enters an infinite loop, preserving the system state
+// for examination by a debugger.
+//
+//*****************************************************************************
+static void
+IntDefaultHandler(void)
+{
+ //
+ // Go into an infinite loop.
+ //
+ while(1)
+ {
+ }
+}
diff --git a/boards/dk-tm4c129x/ble_central/startup_rvmdk.S b/boards/dk-tm4c129x/ble_central/startup_rvmdk.S new file mode 100644 index 0000000..af8433a --- /dev/null +++ b/boards/dk-tm4c129x/ble_central/startup_rvmdk.S @@ -0,0 +1,333 @@ +; <<< Use Configuration Wizard in Context Menu >>>
+;******************************************************************************
+;
+; startup_rvmdk.S - Startup code for use with Keil's uVision.
+;
+; Copyright (c) 2013-2014 Texas Instruments Incorporated. All rights reserved.
+; Software License Agreement
+;
+; Texas Instruments (TI) is supplying this software for use solely and
+; exclusively on TI's microcontroller products. The software is owned by
+; TI and/or its suppliers, and is protected under applicable copyright
+; laws. You may not combine this software with "viral" open-source
+; software in order to form a larger program.
+;
+; THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
+; NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
+; NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+; A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
+; CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+; DAMAGES, FOR ANY REASON WHATSOEVER.
+;
+; This is part of revision 2.1.0.12573 of the DK-TM4C129X Firmware Package.
+;
+;******************************************************************************
+
+;******************************************************************************
+;
+; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;
+;******************************************************************************
+Stack EQU 0x00000400
+
+;******************************************************************************
+;
+; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;
+;******************************************************************************
+Heap EQU 0x00000000
+
+;******************************************************************************
+;
+; Allocate space for the stack.
+;
+;******************************************************************************
+ AREA STACK, NOINIT, READWRITE, ALIGN=3
+StackMem
+ SPACE Stack
+__initial_sp
+
+;******************************************************************************
+;
+; Allocate space for the heap.
+;
+;******************************************************************************
+ AREA HEAP, NOINIT, READWRITE, ALIGN=3
+__heap_base
+HeapMem
+ SPACE Heap
+__heap_limit
+
+;******************************************************************************
+;
+; Indicate that the code in this file preserves 8-byte alignment of the stack.
+;
+;******************************************************************************
+ PRESERVE8
+
+;******************************************************************************
+;
+; Place code into the reset code section.
+;
+;******************************************************************************
+ AREA RESET, CODE, READONLY
+ THUMB
+
+;******************************************************************************
+;
+; External declarations for the interrupt handlers used by the application.
+;
+;******************************************************************************
+ EXTERN TouchScreenIntHandler
+ EXTERN SysTickIntHandler
+ EXTERN UART3IntHandler
+
+;******************************************************************************
+;
+; The vector table.
+;
+;******************************************************************************
+ EXPORT __Vectors
+__Vectors
+ DCD StackMem + Stack ; Top of Stack
+ DCD Reset_Handler ; Reset Handler
+ DCD NmiSR ; NMI Handler
+ DCD FaultISR ; Hard Fault Handler
+ DCD IntDefaultHandler ; The MPU fault handler
+ DCD IntDefaultHandler ; The bus fault handler
+ DCD IntDefaultHandler ; The usage fault handler
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD IntDefaultHandler ; SVCall handler
+ DCD IntDefaultHandler ; Debug monitor handler
+ DCD 0 ; Reserved
+ DCD IntDefaultHandler ; The PendSV handler
+ DCD SysTickIntHandler ; The SysTick handler
+ DCD IntDefaultHandler ; GPIO Port A
+ DCD IntDefaultHandler ; GPIO Port B
+ DCD IntDefaultHandler ; GPIO Port C
+ DCD IntDefaultHandler ; GPIO Port D
+ DCD IntDefaultHandler ; GPIO Port E
+ DCD IntDefaultHandler ; UART0 Rx and Tx
+ DCD IntDefaultHandler ; UART1 Rx and Tx
+ DCD IntDefaultHandler ; SSI0 Rx and Tx
+ DCD IntDefaultHandler ; I2C0 Master and Slave
+ DCD IntDefaultHandler ; PWM Fault
+ DCD IntDefaultHandler ; PWM Generator 0
+ DCD IntDefaultHandler ; PWM Generator 1
+ DCD IntDefaultHandler ; PWM Generator 2
+ DCD IntDefaultHandler ; Quadrature Encoder 0
+ DCD IntDefaultHandler ; ADC Sequence 0
+ DCD IntDefaultHandler ; ADC Sequence 1
+ DCD IntDefaultHandler ; ADC Sequence 2
+ DCD TouchScreenIntHandler ; ADC Sequence 3
+ DCD IntDefaultHandler ; Watchdog timer
+ DCD IntDefaultHandler ; Timer 0 subtimer A
+ DCD IntDefaultHandler ; Timer 0 subtimer B
+ DCD IntDefaultHandler ; Timer 1 subtimer A
+ DCD IntDefaultHandler ; Timer 1 subtimer B
+ DCD IntDefaultHandler ; Timer 2 subtimer A
+ DCD IntDefaultHandler ; Timer 2 subtimer B
+ DCD IntDefaultHandler ; Analog Comparator 0
+ DCD IntDefaultHandler ; Analog Comparator 1
+ DCD IntDefaultHandler ; Analog Comparator 2
+ DCD IntDefaultHandler ; System Control (PLL, OSC, BO)
+ DCD IntDefaultHandler ; FLASH Control
+ DCD IntDefaultHandler ; GPIO Port F
+ DCD IntDefaultHandler ; GPIO Port G
+ DCD IntDefaultHandler ; GPIO Port H
+ DCD IntDefaultHandler ; UART2 Rx and Tx
+ DCD IntDefaultHandler ; SSI1 Rx and Tx
+ DCD IntDefaultHandler ; Timer 3 subtimer A
+ DCD IntDefaultHandler ; Timer 3 subtimer B
+ DCD IntDefaultHandler ; I2C1 Master and Slave
+ DCD IntDefaultHandler ; CAN0
+ DCD IntDefaultHandler ; CAN1
+ DCD IntDefaultHandler ; Ethernet
+ DCD IntDefaultHandler ; Hibernate
+ DCD IntDefaultHandler ; USB0
+ DCD IntDefaultHandler ; PWM Generator 3
+ DCD IntDefaultHandler ; uDMA Software Transfer
+ DCD IntDefaultHandler ; uDMA Error
+ DCD IntDefaultHandler ; ADC1 Sequence 0
+ DCD IntDefaultHandler ; ADC1 Sequence 1
+ DCD IntDefaultHandler ; ADC1 Sequence 2
+ DCD IntDefaultHandler ; ADC1 Sequence 3
+ DCD IntDefaultHandler ; External Bus Interface 0
+ DCD IntDefaultHandler ; GPIO Port J
+ DCD IntDefaultHandler ; GPIO Port K
+ DCD IntDefaultHandler ; GPIO Port L
+ DCD IntDefaultHandler ; SSI2 Rx and Tx
+ DCD IntDefaultHandler ; SSI3 Rx and Tx
+ DCD UART3IntHandler ; UART3 Rx and Tx
+ DCD IntDefaultHandler ; UART4 Rx and Tx
+ DCD IntDefaultHandler ; UART5 Rx and Tx
+ DCD IntDefaultHandler ; UART6 Rx and Tx
+ DCD IntDefaultHandler ; UART7 Rx and Tx
+ DCD IntDefaultHandler ; I2C2 Master and Slave
+ DCD IntDefaultHandler ; I2C3 Master and Slave
+ DCD IntDefaultHandler ; Timer 4 subtimer A
+ DCD IntDefaultHandler ; Timer 4 subtimer B
+ DCD IntDefaultHandler ; Timer 5 subtimer A
+ DCD IntDefaultHandler ; Timer 5 subtimer B
+ DCD IntDefaultHandler ; FPU
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD IntDefaultHandler ; I2C4 Master and Slave
+ DCD IntDefaultHandler ; I2C5 Master and Slave
+ DCD IntDefaultHandler ; GPIO Port M
+ DCD IntDefaultHandler ; GPIO Port N
+ DCD 0 ; Reserved
+ DCD IntDefaultHandler ; Tamper
+ DCD IntDefaultHandler ; GPIO Port P (Summary or P0)
+ DCD IntDefaultHandler ; GPIO Port P1
+ DCD IntDefaultHandler ; GPIO Port P2
+ DCD IntDefaultHandler ; GPIO Port P3
+ DCD IntDefaultHandler ; GPIO Port P4
+ DCD IntDefaultHandler ; GPIO Port P5
+ DCD IntDefaultHandler ; GPIO Port P6
+ DCD IntDefaultHandler ; GPIO Port P7
+ DCD IntDefaultHandler ; GPIO Port Q (Summary or Q0)
+ DCD IntDefaultHandler ; GPIO Port Q1
+ DCD IntDefaultHandler ; GPIO Port Q2
+ DCD IntDefaultHandler ; GPIO Port Q3
+ DCD IntDefaultHandler ; GPIO Port Q4
+ DCD IntDefaultHandler ; GPIO Port Q5
+ DCD IntDefaultHandler ; GPIO Port Q6
+ DCD IntDefaultHandler ; GPIO Port Q7
+ DCD IntDefaultHandler ; GPIO Port R
+ DCD IntDefaultHandler ; GPIO Port S
+ DCD IntDefaultHandler ; SHA/MD5 0
+ DCD IntDefaultHandler ; AES 0
+ DCD IntDefaultHandler ; DES3DES 0
+ DCD IntDefaultHandler ; LCD Controller 0
+ DCD IntDefaultHandler ; Timer 6 subtimer A
+ DCD IntDefaultHandler ; Timer 6 subtimer B
+ DCD IntDefaultHandler ; Timer 7 subtimer A
+ DCD IntDefaultHandler ; Timer 7 subtimer B
+ DCD IntDefaultHandler ; I2C6 Master and Slave
+ DCD IntDefaultHandler ; I2C7 Master and Slave
+ DCD IntDefaultHandler ; HIM Scan Matrix Keyboard 0
+ DCD IntDefaultHandler ; One Wire 0
+ DCD IntDefaultHandler ; HIM PS/2 0
+ DCD IntDefaultHandler ; HIM LED Sequencer 0
+ DCD IntDefaultHandler ; HIM Consumer IR 0
+ DCD IntDefaultHandler ; I2C8 Master and Slave
+ DCD IntDefaultHandler ; I2C9 Master and Slave
+ DCD IntDefaultHandler ; GPIO Port T
+
+;******************************************************************************
+;
+; This is the code that gets called when the processor first starts execution
+; following a reset event.
+;
+;******************************************************************************
+ EXPORT Reset_Handler
+Reset_Handler
+ ;
+ ; Enable the floating-point unit. This must be done here to handle the
+ ; case where main() uses floating-point and the function prologue saves
+ ; floating-point registers (which will fault if floating-point is not
+ ; enabled). Any configuration of the floating-point unit using
+ ; DriverLib APIs must be done here prior to the floating-point unit
+ ; being enabled.
+ ;
+ ; Note that this does not use DriverLib since it might not be included
+ ; in this project.
+ ;
+ MOVW R0, #0xED88
+ MOVT R0, #0xE000
+ LDR R1, [R0]
+ ORR R1, #0x00F00000
+ STR R1, [R0]
+
+ ;
+ ; Call the C library enty point that handles startup. This will copy
+ ; the .data section initializers from flash to SRAM and zero fill the
+ ; .bss section.
+ ;
+ IMPORT __main
+ B __main
+
+;******************************************************************************
+;
+; This is the code that gets called when the processor receives a NMI. This
+; simply enters an infinite loop, preserving the system state for examination
+; by a debugger.
+;
+;******************************************************************************
+NmiSR
+ B NmiSR
+
+;******************************************************************************
+;
+; This is the code that gets called when the processor receives a fault
+; interrupt. This simply enters an infinite loop, preserving the system state
+; for examination by a debugger.
+;
+;******************************************************************************
+FaultISR
+ B FaultISR
+
+;******************************************************************************
+;
+; This is the code that gets called when the processor receives an unexpected
+; interrupt. This simply enters an infinite loop, preserving the system state
+; for examination by a debugger.
+;
+;******************************************************************************
+IntDefaultHandler
+ B IntDefaultHandler
+
+;******************************************************************************
+;
+; Make sure the end of this section is aligned.
+;
+;******************************************************************************
+ ALIGN
+
+;******************************************************************************
+;
+; Some code in the normal code section for initializing the heap and stack.
+;
+;******************************************************************************
+ AREA |.text|, CODE, READONLY
+
+;******************************************************************************
+;
+; The function expected of the C library startup code for defining the stack
+; and heap memory locations. For the C library version of the startup code,
+; provide this function so that the C library initialization code can find out
+; the location of the stack and heap.
+;
+;******************************************************************************
+ IF :DEF: __MICROLIB
+ EXPORT __initial_sp
+ EXPORT __heap_base
+ EXPORT __heap_limit
+ ELSE
+ IMPORT __use_two_region_memory
+ EXPORT __user_initial_stackheap
+__user_initial_stackheap
+ LDR R0, =HeapMem
+ LDR R1, =(StackMem + Stack)
+ LDR R2, =(HeapMem + Heap)
+ LDR R3, =StackMem
+ BX LR
+ ENDIF
+
+;******************************************************************************
+;
+; Make sure the end of this section is aligned.
+;
+;******************************************************************************
+ ALIGN
+
+;******************************************************************************
+;
+; Tell the assembler that we're done.
+;
+;******************************************************************************
+ END
|
