2022-09-19 02:51:11 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2022 - Tillitis AB
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LIB_H
|
|
|
|
#define LIB_H
|
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2023-02-27 11:50:14 -05:00
|
|
|
#ifdef NOCONSOLE
|
|
|
|
#define htif_putc(ch)
|
|
|
|
#define htif_lf()
|
|
|
|
#define htif_puthex(c)
|
|
|
|
#define htif_putinthex(n)
|
|
|
|
#define htif_puts(s) ((int)0)
|
|
|
|
#define htif_hexdump(buf, len)
|
|
|
|
#else
|
2022-12-02 09:09:10 -05:00
|
|
|
void htif_putc(int ch);
|
|
|
|
void htif_lf();
|
|
|
|
void htif_puthex(uint8_t c);
|
|
|
|
void htif_putinthex(const uint32_t n);
|
|
|
|
int htif_puts(const char *s);
|
|
|
|
void htif_hexdump(uint8_t *buf, int len);
|
2023-02-27 11:50:14 -05:00
|
|
|
#endif
|
|
|
|
|
2022-09-19 02:51:11 -04:00
|
|
|
void *memset(void *dest, int c, unsigned n);
|
2023-02-27 11:00:23 -05:00
|
|
|
void memcpy_s(void *dest, size_t destsize, const void *src, size_t n);
|
|
|
|
void wordcpy_s(void *dest, size_t destsize, const void *src, size_t n);
|
2022-09-19 02:51:11 -04:00
|
|
|
int memeq(void *dest, const void *src, unsigned n);
|
|
|
|
|
|
|
|
#endif
|