contrib/firmware: add new adapter ANGIE's firmware/bitstream code
[openocd.git] / contrib / firmware / angie / c / include / serial.h
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2
3 /**
4 * This code was taken from the fx2lib project from this link:
5 * https://github.com/djmuhlestein/fx2lib
6 *
7 * Copyright (C) 2009 Ubixum, Inc.
8 **/
9
10 /** \file serial.h
11 * defines functions to print to a serial console with SIO0
12 **/
13
14 #include "fx2macros.h"
15 #include <stdint.h>
16 /**
17 * This function inits sio0 to use T2CON (timer 2)
18 * See TRM 14.3.4.1 (Table 14-16)
19 * Certain baud rates have too high an error rate to work. All baud rates are .16%
20 * except:
21 *
22 * 12MHZ 24MHZ
23 * \li 57600 -6.99%
24 * \li 38400 -2.34% -2.34%
25 * \li 19200 -2.34%
26 *
27 * Possible Baud rates:
28 * \li 2400
29 * \li 4800
30 * \li 9600
31 * \li 19200
32 * \li 28800
33 * \li 38400
34 * \li 57600
35 *
36 * Any of these rates should work except 57600 at 12mhz. -2.34% is pushing
37 * most hardware specs for working. All rates at 48mhz work at .16%
38 **/
39
40 void sio0_init(uint32_t baud_rate) __critical; /* baud_rate max should be 57600 since int=2 bytes */
41
42 /**
43 * putchar('\\n') or putchar('\\r') both transmit \\r\\n
44 * Just use one or the other. (This makes terminal echo easy)
45 **/
46 int putchar(char c);
47 int getchar(void);

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)