libnile
Loading...
Searching...
No Matches
rtc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023, 2024, 2025 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
23#ifndef NILE_MCU_RTC_H_
24#define NILE_MCU_RTC_H_
25
26#include "../mcu.h"
27
29 uint8_t cmd,
30 const void __far* inbuf, size_t inbuflen,
31 void __far* outbuf, size_t outbuflen
32) {
33 int16_t result;
34 if ((result = nile_mcu_native_send_cmd(NILE_MCU_NATIVE_CMD(0x14, cmd), inbuf, inbuflen)) < 0) return result;
35 return nile_mcu_native_recv_cmd(outbuf, outbuflen);
36}
37
38#endif /* NILE_MCU_RTC_H_ */
int16_t nile_mcu_native_recv_cmd(void __far *buffer, uint16_t buflen)
Receive the response of a "native protocol" MCU command synchronously.
#define NILE_MCU_NATIVE_CMD(cmd, arg)
Definition mcu.h:55
static int16_t nile_mcu_native_send_cmd(uint16_t cmd, const void __far *buffer, int buflen)
Send a "native protocol" MCU command asynchronously.
Definition mcu.h:163
static int16_t nile_mcu_native_rtc_transaction_sync(uint8_t cmd, const void __far *inbuf, size_t inbuflen, void __far *outbuf, size_t outbuflen)
Definition rtc.h:28