1 /*
2 * Copyright (c) 2018, NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include <zephyr/kernel.h>
8 #include <zephyr/sys/printk.h>
9 #include <zephyr/device.h>
10 #include <zephyr/drivers/ipm.h>
11
ping_ipm_callback(const struct device * dev,void * context,uint32_t id,volatile void * data)12 void ping_ipm_callback(const struct device *dev, void *context,
13 uint32_t id, volatile void *data)
14 {
15 ipm_send(dev, 1, 0, (const void *)data, 4);
16 }
17
18
19
main(void)20 int main(void)
21 {
22 const struct device *ipm;
23
24 ipm = DEVICE_DT_GET_ANY(nxp_lpc_mailbox);
25 if (!(ipm && device_is_ready(ipm))) {
26 while (1) {
27 }
28 }
29 ipm_register_callback(ipm, ping_ipm_callback, NULL);
30 ipm_set_enabled(ipm, 1);
31 while (1) {
32 }
33 return 0;
34 }
35