libwwcl libwwcl
WWitch compatibility layer for the Wonderful toolchain
Loading...
Searching...
No Matches
comm.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Adrian "asie" Siekierka
3 *
4 * This software is provided 'as-is', without any express or implied
5 * warranty. In no event will the authors be held liable for any damages
6 * arising from the use of this software.
7 *
8 * Permission is granted to anyone to use this software for any purpose,
9 * including commercial applications, and to alter it and redistribute it
10 * freely, subject to the following restrictions:
11 *
12 * 1. The origin of this software must not be misrepresented; you must not
13 * claim that you wrote the original software. If you use this software
14 * in a product, an acknowledgment in the product documentation would be
15 * appreciated but is not required.
16 *
17 * 2. Altered source versions must be plainly marked as such, and must not be
18 * misrepresented as being the original software.
19 *
20 * 3. This notice may not be removed or altered from any source distribution.
21 */
22
27#ifndef __WF_LIBWW_COMM_H__
28#define __WF_LIBWW_COMM_H__
29
30#include <ws.h>
31#include "types.h"
32
38#define ERR_SIO_BUSY 0x8100
39#define ERR_SIO_TIMEOUT 0x8101
40#define ERR_SIO_OVERRUN 0x8102
41#define ERR_SIO_CANCEL 0x8103
42
43void comm_open(void);
44void comm_close(void);
45uint16_t comm_send_char(int c);
47int comm_receive_with_timeout(uint16_t timeout);
48uint16_t comm_send_string(const char __far* str);
49uint16_t comm_send_block(const void __far* buf, uint16_t length);
50void comm_receive_block(const void __far* buf, uint16_t length, uint16_t *out_length);
51void comm_set_timeout(uint16_t recv_timeout, uint16_t send_timeout);
52
53#define COMM_SPEED_9600 0
54#define COMM_SPEED_38400 1
55
63void comm_set_baudrate(uint16_t rate);
64uint16_t comm_get_baudrate(void);
65
66void comm_set_cancel_key(uint16_t value);
67uint16_t comm_get_cancel_key(void);
68
69// Missing: comm_xmodem
70
73#endif /* __WF_LIBWW_COMM_H__ */
uint16_t comm_send_block(const void __far *buf, uint16_t length)
void comm_open(void)
void comm_set_baudrate(uint16_t rate)
Set the new baud rate.
void comm_set_timeout(uint16_t recv_timeout, uint16_t send_timeout)
uint16_t comm_get_baudrate(void)
void comm_receive_block(const void __far *buf, uint16_t length, uint16_t *out_length)
uint16_t comm_send_char(int c)
void comm_close(void)
int comm_receive_char(void)
int comm_receive_with_timeout(uint16_t timeout)
void comm_set_cancel_key(uint16_t value)
uint16_t comm_send_string(const char __far *str)
uint16_t comm_get_cancel_key(void)