zephyr/subsys/net/lib/openthread/platform/spi.c
Robert Lubos 39aee39cf9 net: openthread: Align with the new NCP API
OpenThread modified its NCP API, so we need to align with these changes
in Zephyr.

One of the major changes was removal of UART from the platform APIs.
`openthread/platform/uart.h` header file was moved to
`examples/platforms/util/uart.h` so we need to use the new location in
Zephyr. This means that OpenThread no longer impose the UART API but for
the simplicity of the upmerge I've kept the UART APIs as they are for
now.

The NCP initialization function have now to register a send handler,
and the appropriate transport driver have to call NCP callbacks when
transmission/reception is done. For now, re-use the existing code of
the UART driver, just as the upstream NCP application does.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-04-30 12:55:02 -05:00

49 lines
968 B
C

/*
* Copyright (c) 2018 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <kernel.h>
#include <stdio.h>
#include <stdlib.h>
#include <openthread/platform/spi-slave.h>
#include "platform-zephyr.h"
/* Spi-slave stubs */
otError otPlatSpiSlaveEnable(
otPlatSpiSlaveTransactionCompleteCallback aCompleteCallback,
otPlatSpiSlaveTransactionProcessCallback aProcessCallback,
void *aContext)
{
ARG_UNUSED(aCompleteCallback);
ARG_UNUSED(aProcessCallback);
ARG_UNUSED(aContext);
return OT_ERROR_NOT_IMPLEMENTED;
}
void otPlatSpiSlaveDisable(void)
{
/* Intentionally empty */
}
otError otPlatSpiSlavePrepareTransaction(
uint8_t *anOutputBuf,
uint16_t anOutputBufLen,
uint8_t *anInputBuf,
uint16_t anInputBufLen,
bool aRequestTransactionFlag
)
{
ARG_UNUSED(anOutputBuf);
ARG_UNUSED(anOutputBufLen);
ARG_UNUSED(anInputBuf);
ARG_UNUSED(anInputBufLen);
ARG_UNUSED(aRequestTransactionFlag);
return OT_ERROR_NOT_IMPLEMENTED;
}