Zephyr API Documentation
4.2.0-rc3
A Scalable Open Source RTOS
4.2.0-rc3
Toggle main menu visibility
Main Page
Related Pages
Topics
Data Structures
Data Structures
Data Structure Index
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
Files
File List
Globals
All
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
f
g
h
i
k
l
m
n
o
p
r
s
t
u
x
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Macros
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Zephyr API Documentation
Introduction
Deprecated List
Topics
Data Structures
Files
File List
doc
kernel
lib
modules
subsys
zephyr
acpi
app_memory
arch
audio
bluetooth
canbus
console
crypto
data
debug
devicetree
dfu
display
drivers
dsp
basicmath.h
basicmath_f16.h
dsp.h
print_format.h
types.h
utils.h
dt-bindings
fs
input
internal
ipc
kernel
linker
llext
logging
lorawan
math
mem_mgmt
mgmt
misc
modbus
modem
multi_heap
net
platform
pm
pmci
portability
posix
psa
random
retention
rtio
sd
sensing
settings
shell
sip_svc
stats
storage
sys
task_wdt
timing
toolchain
tracing
usb
usb_c
xen
zbus
zvfs
bindesc.h
cache.h
device.h
devicetree.h
fatal.h
fatal_types.h
init.h
irq.h
irq_multilevel.h
irq_nextlevel.h
irq_offload.h
kernel.h
kernel_includes.h
kernel_structs.h
kernel_version.h
net_buf.h
shared_irq.h
smf.h
spinlock.h
sw_isr_table.h
sys_clock.h
syscall.h
toolchain.h
types.h
Globals
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
Loading...
Searching...
No Matches
print_format.h
Go to the documentation of this file.
1
/* Copyright (c) 2023 Google LLC
2
* SPDX-License-Identifier: Apache-2.0
3
*/
4
5
#ifndef ZEPHYR_INCLUDE_DSP_PRINT_FORMAT_H_
6
#define ZEPHYR_INCLUDE_DSP_PRINT_FORMAT_H_
7
8
#include <
inttypes.h
>
9
#include <
stdlib.h
>
10
#include <
zephyr/dsp/types.h
>
11
26
30
#define PRIq(precision) "s%" PRIu32 ".%0" STRINGIFY(precision) PRIu32
31
32
static
inline
int64_t
___PRIq_arg_shift(
int64_t
q,
int
shift)
33
{
34
if
(shift < 0) {
35
return
llabs
(q) >> -shift;
36
}
else
{
37
return
llabs
(q) << shift;
38
}
39
}
40
41
#define __EXP2(a, b) a ## b
42
#define __EXP(a, b) __EXP2(a ## e, b)
43
#define __CONSTPOW(C, x) __EXP(C, x)
44
45
#define __PRIq_arg_shift(q, shift) ___PRIq_arg_shift(q, ((shift) + (8 * (4 - (int)sizeof(q)))))
46
#define __PRIq_arg_get(q, shift, h, l) FIELD_GET(GENMASK64(h, l), __PRIq_arg_shift(q, shift))
47
#define __PRIq_arg_get_int(q, shift) __PRIq_arg_get(q, shift, 63, 31)
48
#define __PRIq_arg_get_frac(q, precision, shift) \
49
((__PRIq_arg_get(q, shift, 30, 0) * __CONSTPOW(1, precision)) / INT32_MAX)
50
58
#define PRIq_arg(q, precision, shift) \
59
((q) < 0 ? "-" : ""), (uint32_t)__PRIq_arg_get_int(q, shift), \
60
(uint32_t)__PRIq_arg_get_frac(q, precision, shift)
58
#define PRIq_arg(q, precision, shift) \
…
61
65
66
#endif
/* ZEPHYR_INCLUDE_DSP_PRINT_FORMAT_H_ */
types.h
inttypes.h
int64_t
__INT64_TYPE__ int64_t
Definition
stdint.h:75
stdlib.h
llabs
static long long llabs(long long __n)
Definition
stdlib.h:70
zephyr
dsp
print_format.h
Generated on
for Zephyr API Documentation by
1.14.0