English
Language : 

AN91162 Datasheet, PDF (25/43 Pages) Ramtron International Corporation – Creating a BLE Custom Profile
Creating a BLE Custom Profile
main.h
#define TRUE
#define FALSE
BLEProcess.h
/* RGB LED Characteristic data length*/
#define RGB_CHAR_DATA_LEN
led.h
/* LED Color and status related Macros */
#define RGB_LED_MAX_VAL
#define RGB_LED_OFF
#define RGB_LED_ON
0x01
0x00
4
0xFF
0xFF
0x00
/* Index values in array where respective color coordinates
* are saved */
#define RED_INDEX
0x00
#define GREEN_INDEX
0x01
#define BLUE_INDEX
0x02
#define INTENSITY_INDEX
0x03
System Initialization
The first step in firmware configuration is to initialize the Components in the system. The following function is called first after
entering main.c. Open main.c by double-clicking on it in the Workspace Explorer window on the left-hand side of the PSoC
Creator window. Add the following function definition in main.c:
void InitializeSystem(void)
{
/* Enable Global Interrupt Mask */
CyGlobalIntEnable;
/* Start BLE stack and register the event callback function.*/
CyBle_Start(GeneralEventHandler);
/* Start PrISM modules for LED control */
PrISM_1_Start();
PrISM_2_Start();
/* Switch off the RGB LEDs through PrISM modules */
PrISM_1_WritePulse0(RGB_LED_OFF);
PrISM_1_WritePulse1(RGB_LED_OFF);
PrISM_2_WritePulse0(RGB_LED_OFF);
/* Set Drive modes of the output pins to Strong drive */
RED_SetDriveMode(RED_DM_STRONG);
GREEN_SetDriveMode(GREEN_DM_STRONG);
BLUE_SetDriveMode(BLUE_DM_STRONG);
}
www.cypress.com
Document No. 001-91162 Rev. *A
25