51 #include "app_error.h" 53 #include "nrf_drv_twi.h" 55 #define DEFAULT_LED_INTENSITY_PERCENT 20 56 #define DEFAULT_LED_ON_TIME_MS 35 57 #define DEFAULT_LED_OFF_TIME_MS 3500 58 #define DEFAULT_LED_FADE_IN_TIME 2000 59 #define DEFAULT_LED_FADE_OUT_TIME 500 71 #define UI_CONFIG_DEFAULT_CONNECTED \ 73 .mode = BLE_UIS_LED_MODE_BREATHE, \ 78 .color_mix = (uint8_t)DRV_EXT_LIGHT_COLOR_GREEN, \ 79 .intensity = DEFAULT_LED_INTENSITY_PERCENT, \ 80 .delay = DEFAULT_LED_OFF_TIME_MS \ 87 #define UI_CONFIG_DEFAULT_DISCONNECTED \ 89 .mode = BLE_UIS_LED_MODE_BREATHE, \ 94 .color_mix = (uint8_t)DRV_EXT_LIGHT_COLOR_BLUE, \ 95 .intensity = DEFAULT_LED_INTENSITY_PERCENT, \ 96 .delay = DEFAULT_LED_OFF_TIME_MS \ 103 #define UI_CONFIG_DEFAULT_ERROR \ 105 .mode = BLE_UIS_LED_MODE_BREATHE, \ 110 .color_mix = (uint8_t)DRV_EXT_LIGHT_COLOR_RED, \ 111 .intensity = DEFAULT_LED_INTENSITY_PERCENT, \ 112 .delay = DEFAULT_LED_OFF_TIME_MS / 4 \ 119 #define SEQUENCE_DEFAULT_VALUES \ 121 .sequence_vals.on_time_ms = DEFAULT_LED_ON_TIME_MS, \ 122 .sequence_vals.on_intensity = 0xFF, \ 123 .sequence_vals.off_intensity = 0, \ 124 .sequence_vals.fade_in_time_ms = DEFAULT_LED_FADE_IN_TIME, \ 125 .sequence_vals.fade_out_time_ms = DEFAULT_LED_FADE_OUT_TIME, \ 133 M_UI_BLE_DISCONNECTED,
141 nrf_drv_twi_t
const * p_twi_instance;
167 ret_code_t
m_ui_led_set(uint8_t r, uint8_t g, uint8_t b);
Successful.
Definition: m_ui.h:65
BLE service handle structure.
Definition: m_ble.h:83
ret_code_t m_ui_led_set(uint8_t r, uint8_t g, uint8_t b)
Function for setting the RGB value of an LED.
TWI configuraion.
Definition: m_ui.h:139
Invalid parameters supplied.
Definition: m_ui.h:66
ui_led_events
Predefined events linked to corresponding LED configurations.
Definition: m_ui.h:130
ret_code_t m_ui_led_set_event(ui_led_events event_code)
Function for setting LED color according to predefined events.
ret_code_t m_ui_init(m_ble_service_handle_t *p_handle, m_ui_init_t *p_params)
Function for initializing all UI components (Buttons and LEDs).