SPIKE-RT C API Reference [English]
An RTOS-based software platform for LEGO® Education SPIKE™.
Loading...
Searching...
No Matches
button.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2/*
3 * API for the hub built-in button.
4 *
5 * Copyright (c) 2022 Embedded and Real-Time Systems Laboratory,
6 * Graduate School of Information Science, Nagoya Univ., JAPAN
7 */
8
32#ifndef _HUB_BUTTON_H_
33#define _HUB_BUTTON_H_
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39#include <stdint.h>
40#include <pbio/button.h>
41#include <pbio/error.h>
42
50typedef enum _hub_button_t {
51 HUB_BUTTON_LEFT = PBIO_BUTTON_LEFT,
52 HUB_BUTTON_CENTER = PBIO_BUTTON_CENTER,
53 HUB_BUTTON_RIGHT = PBIO_BUTTON_RIGHT,
54 HUB_BUTTON_BT = PBIO_BUTTON_RIGHT_UP,
56
68pbio_error_t hub_button_is_pressed(hub_button_t *pressed);
69
70#ifdef __cplusplus
71}
72#endif
73
74#endif // _HUB_BUTTON_H_
75
enum _hub_button_t hub_button_t
Bitmask definitions for each built-in button on the hub.
pbio_error_t hub_button_is_pressed(hub_button_t *pressed)
Checks which buttons are currently pressed.
Definition button.c:19
_hub_button_t
Bitmask definitions for each built-in button on the hub.
Definition button.h:50