SWRU271I
October 2010 – January 2020
CC2540
,
CC2540T
,
CC2541
,
CC2541-Q1
,
CC2640R2F
Preface
Trademarks
Related Documentation
1
Overview
1.1
Support Note
1.2
Introduction
1.3
Bluetooth Low Energy Protocol Stack Basics
2
The TI Bluetooth Low Energy Software Development Platform
2.1
Overview
2.2
Configurations
2.3
Projects
2.4
Software Overview
3
The Operating System Abstraction Layer (OSAL)
3.1
Overview
3.2
Task Initialization
3.3
Task Events and Event Processing
3.4
Heap Manager
3.5
OSAL Messages
4
The Application and Profiles
4.1
Overview
4.2
Project Overview
4.3
Start-up in main()
4.4
Application Initialization
4.5
Event Processing
4.5.1
Periodic Event
4.5.2
OSAL Messages
4.6
Callbacks
4.7
Complete Attribute Table
4.8
Additional Sample Projects
5
The Bluetooth Low Energy Protocol Stack
5.1
Overview
5.2
Generic Access Profile (GAP)
5.2.1
Overview
5.2.1.1
Connection Parameters
5.2.1.2
Effective Connection Interval
5.2.1.3
Connection Parameter Considerations
5.2.1.4
Connection Parameter Update
5.2.1.5
Connection Termination
5.2.2
GAP Abstraction
5.2.3
Configuring the GAP Layer
5.3
GAPRole Task
5.3.1
Peripheral Role
5.3.2
Central Role
5.4
Gap Bond Manager (GAPBondMgr)
5.4.1
Overview of Bluetooth Low Energy Security
5.4.2
Using the GapBondMgr Profile
5.4.3
GAPBondMgr Examples for Various Security Modes
5.4.3.1
Pairing Disabled
5.4.3.2
Just Works Pairing Without Bonding
5.4.3.3
Just Works Pairing With Bonding Enabled
5.4.3.4
Authenticated Pairing
5.4.3.5
Authenticated Pairing With Bonding Enabled
5.5
Generic Attribute Profile (GATT)
5.5.1
GATT Characteristics and Attributes
5.5.2
GATT Services and Profile
5.5.3
GATT Client Abstraction
5.5.3.1
Using the GATT Layer Directly
5.5.4
GATT Server Abstraction
5.5.4.1
GATTServApp Module
5.5.4.1.1
Building Up the Attribute Table
5.5.4.2
Profile Architecture
5.5.4.2.1
Attribute Table Definition
5.5.4.2.1.1
Service Declaration
5.5.4.2.1.2
Characteristic Declaration
5.5.4.2.1.3
Characteristic Value
5.5.4.2.1.4
Client Characteristic Configuration
5.5.4.2.2
Add Service Function
5.5.4.2.3
Register Application Callback Function
5.5.4.2.4
Read and Write Callback Functions
5.5.4.2.4.1
Read Request from A GATT Client
5.5.4.2.4.2
Write Request From Client
5.5.4.2.5
Get and Set Functions
5.6
L2CAP
5.7
HCI
5.7.1
HCI Extension Vendor-Specific Commands
5.7.2
Receiving HCI Extension Events in the Application
5.8
Library Files
6
Drivers
6.1
Overview
6.2
ADC
6.3
AES
6.4
LCD
6.5
LED
6.6
KEY
6.7
DMA
6.8
UART and SPI
6.9
Other Peripherals
6.10
Simple NV (SNV)
7
Creating a Custom Bluetooth Low Energy Application
7.1
Overview
7.2
Configuring the Bluetooth Low Energy Stack
7.3
Define Bluetooth Low Energy Behavior
7.4
Define Application Tasks
7.5
Configure Hardware Peripherals
7.6
Configuring Parameters for Custom Hardware
7.6.1
Board File
7.6.2
Adjusting for 32-MHz Crystal Stabilization Time
7.6.3
Setting the Sleep Clock Accuracy
7.7
Software Considerations
7.7.1
Memory Management for GATT Notifications and Indications
7.7.2
Limit Application Processing During Bluetooth Low Energy Activity
7.7.3
Global Interrupts
8
Development and Debugging
8.1
Overview
8.2
IAR Overview
8.3
Using IAR Embedded Workbench
8.3.1
Open an Existing Project
8.3.2
Project Options, Configurations, and Defined Symbols
8.3.3
Building and Debugging a Project
8.3.4
Linker Map File
9
General Information
9.1
Overview
9.2
Porting From BLE-Stack 1.5.0 to 1.5.1
9.3
Porting From BLE-Stack 1.4.2 to 1.5.0
9.4
Porting From Earlier BLE-Stack Versions
9.4.1
Porting BLEv1.4.1 Projects to BLEv1.4.2
9.4.2
Porting BLEv1.4.0 Projects to BLEv1.4.1
9.4.2.1
Project Porting Directions
9.4.2.2
API Changes
9.4.2.3
Typedef Changes
9.4.2.4
Structure Changes
9.4.2.4.1
Array Elements Changed to Pointers
9.4.2.4.2
Additional Fields in Key Distribution Strucutre
9.4.2.5
Default Value of HAL Components
9.4.2.6
Allocating Memory for Over-the-Air Messages
9.4.2.7
Allocation of Client Characteristic Configuration Table
9.4.3
Porting BLEv1.3.2 Projects to BLEv1.4.0
9.4.4
Porting BLEv1.2 Projects to BLEv1.3
9.4.5
Porting From CC2540 to CC2541 Project
9.5
Release Notes History
9.6
Document History
A GAP API
A.1 Commands
A.2 Configurable Parameters
A.3 Events
B GAPRole Peripheral Role API
B.1 Commands
B.2 Configurable Parameters
B.3 Callbacks
B.3.1 State Change Callback (pfnStateChange)
B.3.2 RSSI Callback (pfnRssiRead)
C GAPRole Central Role API
C.1 Commands
C.2 Configurable Parameters
C.3 Callbacks
C.3.1 RSSI Callback (rssiCB)
C.3.2 Central Event Callback (eventCB)
D GATT/ATT API
D.1 Overview
D.2 Server Commands
D.3 Client Commands
D.4 Return Values
D.5 Events
D.6 GATT Commands and Corresponding ATT Events
D.7 ATT_ERROR_RSP Error Codes
E GATTServApp API
E.1 Overview
E.2 Commands
F GAPBondMgr API
F.1 Overview
F.2 Commands
F.3 Configurable Parameters
F.4 Callbacks
F.4.1 Passcode Callback (passcodeCB)
F.4.2 Pairing State Callback (pairStateCB)
G HCI Extension API
G.1 Overview
G.2 Commands
G.3 Host Error Codes
Revision History
A
GAP API