Zephyr API Documentation 3.7.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
ipm_console.h
Go to the documentation of this file.
1/* ipm_console.c - Console messages to/from another processor */
2
3/*
4 * Copyright (c) 2015 Intel Corporation
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8
9#ifndef ZEPHYR_INCLUDE_DRIVERS_CONSOLE_IPM_CONSOLE_H_
10#define ZEPHYR_INCLUDE_DRIVERS_CONSOLE_IPM_CONSOLE_H_
11
12#include <zephyr/kernel.h>
13#include <zephyr/device.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#define IPM_CONSOLE_STDOUT (BIT(0))
21#define IPM_CONSOLE_PRINTK (BIT(1))
22
23/*
24 * Good way to determine these numbers other than trial-and-error?
25 * using printf() in the thread seems to require a lot more stack space
26 */
27#define IPM_CONSOLE_STACK_SIZE CONFIG_IPM_CONSOLE_STACK_SIZE
28#define IPM_CONSOLE_PRI 2
29
32 char *bind_to;
33
39
45
47 unsigned int rb_size32;
48
54 char *line_buf;
55
57 unsigned int lb_size;
58
63 unsigned int flags;
64};
65
68 struct ring_buf rb;
69
71 struct k_sem sem;
72
74 const struct device *ipm_device;
75
80
83};
84
95
96#if CONFIG_IPM_CONSOLE_RECEIVER
97int ipm_console_receiver_init(const struct device *d);
98#endif
99
100#if CONFIG_IPM_CONSOLE_SENDER
101int ipm_console_sender_init(const struct device *d);
102#endif
103
104#ifdef __cplusplus
105}
106#endif
107
108#endif /* ZEPHYR_INCLUDE_DRIVERS_CONSOLE_IPM_CONSOLE_H_ */
struct z_thread_stack_element k_thread_stack_t
Typedef of struct z_thread_stack_element.
Definition arch_interface.h:46
irp nz macro MOVR cc d
Definition asm-macro-32-bit-gnu.h:11
Public kernel APIs.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Runtime device structure (in ROM) per driver instance.
Definition device.h:412
Definition ipm_console.h:30
unsigned int rb_size32
Size of ring_buf_data in 32-bit chunks.
Definition ipm_console.h:47
char * line_buf
Line buffer for incoming messages, characters accumulate here and then are sent to printk() once full...
Definition ipm_console.h:54
k_thread_stack_t * thread_stack
Stack for the receiver's thread, which prints out messages as they come in.
Definition ipm_console.h:38
uint32_t * ring_buf_data
Ring buffer data area for stashing characters from the interrupt callback.
Definition ipm_console.h:44
unsigned int flags
Destination for received console messages, one of IPM_CONSOLE_STDOUT or IPM_CONSOLE_PRINTK.
Definition ipm_console.h:63
char * bind_to
Name of the low-level IPM driver to bind to.
Definition ipm_console.h:32
unsigned int lb_size
Size in bytes of the line buffer.
Definition ipm_console.h:57
Definition ipm_console.h:66
const struct device * ipm_device
pointer to the bound low-level IPM device
Definition ipm_console.h:74
int channel_disabled
Indicator that the channel is temporarily disabled due to full buffer.
Definition ipm_console.h:79
struct k_sem sem
Semaphore to wake up the thread to print out messages.
Definition ipm_console.h:71
struct k_thread rx_thread
Receiver worker thread.
Definition ipm_console.h:82
struct ring_buf rb
Buffer for received bytes from the low-level IPM device.
Definition ipm_console.h:68
Definition ipm_console.h:85
int flags
Source of messages to forward, hooks will be installed.
Definition ipm_console.h:93
char * bind_to
Name of the low-level driver to bind to.
Definition ipm_console.h:87
Thread Structure.
Definition thread.h:259
A structure to represent a ring buffer.
Definition ring_buffer.h:41