paul@15 | 1 | /* |
paul@15 | 2 | * Some simple debugging functions. |
paul@15 | 3 | * |
paul@15 | 4 | * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> |
paul@15 | 5 | * |
paul@15 | 6 | * This program is free software: you can redistribute it and/or modify |
paul@15 | 7 | * it under the terms of the GNU General Public License as published by |
paul@15 | 8 | * the Free Software Foundation, either version 3 of the License, or |
paul@15 | 9 | * (at your option) any later version. |
paul@15 | 10 | * |
paul@15 | 11 | * This program is distributed in the hope that it will be useful, |
paul@15 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@15 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@15 | 14 | * GNU General Public License for more details. |
paul@15 | 15 | * |
paul@15 | 16 | * You should have received a copy of the GNU General Public License |
paul@15 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
paul@15 | 18 | */ |
paul@15 | 19 | |
paul@11 | 20 | #ifndef __DEBUG_H__ |
paul@11 | 21 | #define __DEBUG_H__ |
paul@11 | 22 | |
paul@24 | 23 | /* Register output functions using UART1. */ |
paul@24 | 24 | |
paul@24 | 25 | void rbits(uint32_t reg); |
paul@24 | 26 | void rhex(uint32_t reg); |
paul@24 | 27 | |
paul@19 | 28 | /* Value output functions using UART1. */ |
paul@19 | 29 | |
paul@24 | 30 | void bits(uint32_t val, int bytes); |
paul@24 | 31 | void hex(uint32_t val, int bytes); |
paul@19 | 32 | |
paul@19 | 33 | /* General input/output functions. */ |
paul@19 | 34 | |
paul@19 | 35 | int uart_can_read(int uart); |
paul@19 | 36 | char uart_read_char(int uart); |
paul@19 | 37 | int uart_can_write(int uart); |
paul@19 | 38 | void uart_write_char(int uart, char c); |
paul@19 | 39 | |
paul@19 | 40 | /* Functions using UART1. */ |
paul@19 | 41 | |
paul@11 | 42 | void uart_write(char c); |
paul@24 | 43 | void uart_write_nl(void); |
paul@12 | 44 | void uart_write_string(const char *s); |
paul@11 | 45 | |
paul@11 | 46 | #endif /* __DEBUG_H__ */ |