38 #ifndef SIMPLE_HAL_H__ 39 #define SIMPLE_HAL_H__ 57 #define HAL_BUTTON_PRESS_DEBOUNCE_INTERVAL MS_TO_US(400) 60 #define HAL_LED_BLINK_PERIOD_MIN_MS (20) 63 #define LED_MASK_STATE_OFF (false) 65 #define LED_MASK_STATE_ON (true) 68 #define HAL_LED_MASK ((1 << LEDS_NUMBER) - 1) 70 #if (LEDS_NUMBER == 1) 71 #define HAL_LED_MASK_HALF (HAL_LED_MASK) 72 #define HAL_LED_MASK_LOWER_HALF (HAL_LED_MASK) 73 #define HAL_LED_MASK_UPPER_HALF (HAL_LED_MASK) 75 #define HAL_LED_MASK_HALF ((1 << (LEDS_NUMBER/2)) - 1) 76 #define HAL_LED_MASK_LOWER_HALF (HAL_LED_MASK_HALF) 77 #define HAL_LED_MASK_UPPER_HALF (HAL_LED_MASK ^ HAL_LED_MASK_HALF) 81 #define BUTTON_BOARD (defined(BOARD_PCA10040) || defined(BOARD_PCA10028) || defined(BOARD_PCA10056) \ 82 || defined(BOARD_PCA10100) || defined(BOARD_PCA10059)) //lint -e491 // Suppress "non-standard use of 'defined' preprocessor operator" 144 void hal_led_blink_ms(uint32_t pin_mask, uint32_t delay_ms, uint32_t blink_count);
void hal_led_pin_set(uint32_t pin, bool value)
Sets the LED for the given PIN.
void hal_led_blink_stop(void)
Stops blinking the LEDs (previously started by hal_led_blink_ms).
uint32_t hal_buttons_init(hal_button_handler_cb_t cb)
Initializes the buttons on a DK.
void(* hal_button_handler_cb_t)(uint32_t button_number)
Button event handler callback type.
void hal_led_blink_ms(uint32_t pin_mask, uint32_t delay_ms, uint32_t blink_count)
Blinks (one toggle cycle) pin_mask a specified number of times.
bool hal_led_pin_get(uint32_t pin)
Gets the current state of a (LED) pin.
void hal_led_mask_set(uint32_t led_mask, bool value)
Sets the LEDs for the given mask.
void hal_leds_init(void)
Initializes the LEDs.