Nordic Thingy:52
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ble_uis.h File Reference

Go to the source code of this file.

Data Structures

struct  ble_uis_init_t
 LED Button Service init structure. This structure contains all options and data needed for initialization of the service. More...
 
struct  ble_uis_s
 LED Button Service structure. This structure contains various status information for the service. More...
 

Macros

#define BLE_UIS_LED_COLOR_MIX_MAX   7
 
#define BLE_UIS_LED_COLOR_MIX_MIN   1
 
#define BLE_UIS_LED_DELAY_MAX   10000
 
#define BLE_UIS_LED_DELAY_MIN   1
 
#define BLE_UIS_LED_INTENSITY_MAX   100
 
#define BLE_UIS_LED_INTENSITY_MIN   1
 
#define BLE_UIS_LED_MODE_BREATHE_LENGTH   5
 
#define BLE_UIS_LED_MODE_BREATHE_ONE_SHOT_LENGTH   3
 
#define BLE_UIS_LED_MODE_CONST_LENGTH   4
 
#define BLE_UIS_LED_MODE_MAX   BLE_UIS_LED_MODE_BREATHE_ONE_SHOT
 
#define BLE_UIS_LED_MODE_MIN   BLE_UIS_LED_MODE_OFF
 
#define BLE_UIS_LED_MODE_OFF_LENGTH   1
 
#define BLE_UIS_UUID_BUTTON_CHAR   0x0302
 
#define BLE_UIS_UUID_LED_CHAR   0x0301
 
#define BLE_UIS_UUID_PIN_CHAR   0x0303
 
#define BLE_UIS_UUID_SERVICE   0x0300
 

Typedefs

typedef void(* ble_uis_led_write_handler_t )(ble_uis_t *p_uis, ble_uis_led_t *rgb)
 Declaring the LED write handler.
 
typedef void(* ble_uis_pin_write_handler_t )(ble_uis_t *p_uis, ble_uis_pin_t *pin)
 Declaring the pin write handler.
 
typedef struct ble_uis_s ble_uis_t
 Forward declaration of the ble_uis_t type.
 

Enumerations

enum  ble_uis_led_mode_t { BLE_UIS_LED_MODE_OFF, BLE_UIS_LED_MODE_CONST, BLE_UIS_LED_MODE_BREATHE, BLE_UIS_LED_MODE_BREATHE_ONE_SHOT }
 The available LED operation modes. More...
 

Functions

uint32_t ble_uis_init (ble_uis_t *p_uis, const ble_uis_init_t *p_uis_init)
 Function for initializing the LED Button Service. More...
 
void ble_uis_on_ble_evt (ble_uis_t *p_uis, ble_evt_t *p_ble_evt)
 Function for handling the application's BLE stack events. More...
 
uint32_t ble_uis_on_button_change (ble_uis_t *p_uis, uint8_t buttons_state)
 Function for sending a button state notification. More...
 
typedef PACKED (union{PACKED(struct{uint8_t r;uint8_t g;uint8_t b;}) mode_const;PACKED(struct{uint8_tcolor_mix;uint8_tintensity;uint16_t delay;}) mode_breathe;PACKED(struct{uint8_t color_mix;uint8_t intensity;}) mode_breathe_one_shot;}) ble_uis_led_data_t
 union representing LED BLE characteristics.
 
typedef PACKED (struct{ble_uis_led_mode_t mode;ble_uis_led_data_t data;}) ble_uis_led_t
 The LED mode and data, editable over BLE.
 
typedef PACKED (struct{uint8_t mos_1;uint8_t mos_2;uint8_t mos_3;uint8_t mos_4;}) ble_uis_pin_t
 Data structure for the PIN characteristic. Controls the Metal Oxide Semiconductors (transistors).