FRDM-IMX93 for NXP CUP
FRDM-IMX93 support for NXP CUP
 
Loading...
Searching...
No Matches
pixy2_command.h
Go to the documentation of this file.
1/*
2 * Copyright 2025 NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
17#ifndef _PIXY2_COMMAND_H_
18#define _PIXY2_COMMAND_H_
19
20#include "pixy2_protocol.h"
21
35#define PIXY2_REQUEST(t, l, p, c) \
36{ \
37 .hdr.sync0 = PIXY2_REQUEST_SYNC0(c), \
38 .hdr.sync1 = PIXY2_REQUEST_SYNC1(c), \
39 .hdr.type = t, \
40 .hdr.len = l, \
41 .checksum = c, \
42 .payload = (uint8_t *)p, \
43}
44
57#define PIXY2_REPLY(l, p, c) \
58{ \
59 .hdr.sync0 = PIXY2_REPLY_SYNC0, \
60 .hdr.sync1 = PIXY2_REPLY_SYNC1, \
61 .hdr.len = l, \
62 .hdr.checksum = c, \
63 .payload = (uint8_t *)p, \
64}
65
70struct pixy2_led {
72 uint8_t red;
74 uint8_t blue;
76 uint8_t green;
77} __packed;
78
83struct pixy2_lamp {
85 uint8_t upper;
87 uint8_t lower;
88} __packed;
89
101
113int pixy2_set_led(struct pixy2_transport *t, struct pixy2_led *led);
114
126int pixy2_set_lamp(struct pixy2_transport *t, struct pixy2_lamp *lamp);
127
128#endif /* _PIXY2_COMMAND_H_ */
int pixy2_set_led(struct pixy2_transport *t, struct pixy2_led *led)
Send the setLED command.
Definition pixy2_command.c:51
int pixy2_set_lamp(struct pixy2_transport *t, struct pixy2_lamp *lamp)
Send the setLamp command.
Definition pixy2_command.c:68
int pixy2_print_version(struct pixy2_transport *t)
Print firmware and hardware information.
Definition pixy2_command.c:33
Pixy2 protocol layer API.
Pixy2 setLamp() command arguments.
Definition pixy2_command.h:83
uint8_t upper
Definition pixy2_command.h:85
uint8_t lower
Definition pixy2_command.h:87
Pixy2 setLED() command arguments.
Definition pixy2_command.h:70
uint8_t blue
Definition pixy2_command.h:74
uint8_t red
Definition pixy2_command.h:72
uint8_t green
Definition pixy2_command.h:76
Pixy2 transport layer structure.
Definition pixy2_transport.h:83