OpenOCD
jep106.c
Go to the documentation of this file.
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
3
/***************************************************************************
4
* Copyright (C) 2015 Andreas Fritiofson *
5
* andreas.fritiofson@gmail.com *
6
***************************************************************************/
7
8
#ifdef HAVE_CONFIG_H
9
#include "
config.h
"
10
#endif
11
12
#include "
jep106.h
"
13
#include "
log.h
"
14
15
static
const
char
*
const
jep106
[][126] = {
16
#include "jep106.inc"
17
};
18
19
const
char
*
jep106_table_manufacturer
(
unsigned
int
bank
,
unsigned
int
id
)
20
{
21
if
(id < 1 || id > 126) {
22
LOG_DEBUG
(
"BUG: Caller passed out-of-range JEP106 ID!"
);
23
return
"<invalid>"
;
24
}
25
26
/* index is zero based */
27
id
--;
28
29
if
(
bank
>=
ARRAY_SIZE
(
jep106
) || !
jep106
[
bank
][
id
])
30
return
"<unknown>"
;
31
32
return
jep106
[
bank
][
id
];
33
}
config.h
bank
uint8_t bank
Definition:
esirisc.c:135
jep106
static const char *const jep106[][126]
Definition:
jep106.c:15
jep106_table_manufacturer
const char * jep106_table_manufacturer(unsigned int bank, unsigned int id)
Get the manufacturer name associated with a JEP106 ID.
Definition:
jep106.c:19
jep106.h
log.h
LOG_DEBUG
#define LOG_DEBUG(expr ...)
Definition:
log.h:124
id
uint32_t id
Definition:
nrf54.c:43
ARRAY_SIZE
#define ARRAY_SIZE(x)
Compute the number of elements of a variable length array.
Definition:
types.h:57
src
helper
jep106.c
Generated by
1.9.1