SPIKE-RT C API Reference [Japanese]
An RTOS-based software platform for LEGO® Education SPIKE™.
pup_device.h
1// SPDX-License-Identifier: MIT
2/*
3 * Common codes for controlling PUP devices.
4 * Based on https://github.com/pybricks/pybricks-micropython/blob/master/pybricks/util_pb/pb_device.h
5 *
6 * Original codes Copyright (c) 2018-2021 The Pybricks Authors
7 * Modifications for TOPPERS/APS3 Kernel Copyright (c) 2022 Embedded and Real-Time Systems Laboratory,
8 * Graduate School of Information Science, Nagoya Univ., JAPAN
9 */
10
11
12#ifndef __PUP_DEVICE_H__
13#define __PUP_DEVICE_H__
14
15#include <stdint.h>
16
17#include <pbio/color.h>
18#include <pbio/error.h>
19#include <pbio/iodev.h>
20
21typedef struct _pup_device_t pup_device_t;
22
23pup_device_t *pup_device_get_device(pbio_port_id_t port, pbio_iodev_type_id_t valid_id);
24pbio_error_t pup_device_get_values(pup_device_t *pdev, uint8_t mode, int32_t *values);
25pbio_error_t pup_device_set_values(pup_device_t *pdev, uint8_t mode, int32_t *values, uint8_t num_values);
26
27pbio_error_t pup_device_setup_motor(pbio_port_id_t port, bool is_servo);
28
29#endif // _PBDEVICE_H_
Definition: pup_device.c:21