| Nordic Thingy:52 v2.0.0

Modules | Data Structures | Macros | Enumerations | Functions
User interface
Thingy modules

User interface module API. More...

## Modules

| User interface flash configuration
| User interface module flash configuration.

## Data Structures

struct | m_ui_init_t
| TWI configuraion. More...

## Macros

#define | DEFAULT_LED_FADE_IN_TIME 2000
| LED fade in time [ms].
#define | DEFAULT_LED_FADE_OUT_TIME 500
| LED fade out time [ms].
#define | DEFAULT_LED_INTENSITY_PERCENT 20
| Default LED intensity [percent].
#define | DEFAULT_LED_OFF_TIME_MS 3500
| Time LED is off between cycles [ms].
#define | DEFAULT_LED_ON_TIME_MS 35
| LED on duration [ms].
#define | SEQUENCE_DEFAULT_VALUES
| Default LED sequence values.
#define | UI_CONFIG_DEFAULT_CONNECTED
| Default LED configuration upon BLE connection.
#define | UI_CONFIG_DEFAULT_DISCONNECTED
| Default LED configuration upon BLE disconnect.
#define | UI_CONFIG_DEFAULT_ERROR
| Default LED configuration when an error occurs.

## Enumerations

enum | { M_IU_STATUS_CODE_SUCCESS = NRF_SUCCESS, M_IU_STATUS_CODE_INVALID_PARAM }
| User interface module status return codes. More...
enum | ui_led_events
| Predefined events linked to corresponding LED configurations.

## Functions

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). More...
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. More...
ret_code_t | m_ui_led_set_event (ui_led_events event_code)
| Function for setting LED color according to predefined events. More...

## Detailed Description

User interface module API.

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

User interface module status return codes.

Enumerator
M_IU_STATUS_CODE_SUCCESS | Successful.
M_IU_STATUS_CODE_INVALID_PARAM | Invalid parameters supplied.

## Function Documentation

## ◆ m_ui_init()

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).

Parameters

  [in] | p_handle | Pointer to BLE service handle structure.
  [in] | p_params | Initialization parameters.

Return values

  NRF_SUCCESS | Operation was successful.
  NRF_ERROR_NULL | NULL pointer supplied.
  Other | codes from the underlying drivers.

## ◆ m_ui_led_set()

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.

Parameters

  [in] | r | Red intensity (0 to 255).
  [in] | g | Green intensity (0 to 255).
  [in] | b | Blue intensity (0 to 255).

Note
  In Breathe or One-shot mode, the intensity will be set via a separate intensity variable. The values entered in these two modes will be treated as binary (Boolean) for each color.

Return values

  NRF_SUCCESS | Operation was successful.
  Other | codes from the underlying drivers.

## ◆ m_ui_led_set_event()

ret_code_t m_ui_led_set_event | ( | ui_led_events | event_code | ) |

Function for setting LED color according to predefined events.

Parameters

  [in] | event_code | Predefined event code.

Return values

  NRF_SUCCESS | If initialization was successful.
  Other | codes from the underlying drivers.