Beispiel #1
0
/**
 * @brief Function for turning off LEDs.
 *
 * Sets the pin low state according to active_high parameter.
 *
 * @param[in] p_pwm_instance        Pointer to instance of low-power PWM.
 */
__STATIC_INLINE void led_off(low_power_pwm_t * p_pwm_instance)
{
    if (p_pwm_instance->active_high)
    {
        nrf_gpio_pins_clear(p_pwm_instance->bit_mask_toggle);
    }
    else
    {
        nrf_gpio_pins_set(p_pwm_instance->bit_mask_toggle);
    }
    p_pwm_instance->led_is_on = false;
}
Beispiel #2
0
/**
 * @brief Callback function for handling NFC events.
 */
static void nfc_callback(void * p_context, nfc_t2t_event_t event, const uint8_t * p_data, size_t data_length)
{
    (void)p_context;

    switch (event)
    {
        case NFC_T2T_EVENT_FIELD_ON:
            (void)led_softblink_stop();
            nrf_gpio_pins_clear(LEDS_MASK);
            break;
        case NFC_T2T_EVENT_FIELD_OFF:
            nrf_gpio_pins_set(LEDS_MASK);
            (void)led_softblink_start(m_active_led_mask);
            break;
        case NFC_T2T_EVENT_DATA_READ:
            break;
        default:
            break;
    }
}
Beispiel #3
0
/**@brief Function for initialization of LEDs.
 */
static void leds_init(void)
{
    nrf_gpio_range_cfg_output(LED_START, LED_STOP);
    nrf_gpio_pins_set(LEDS_MASK);
}