1 /* 2 * Copyright (c) 2018 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 /** 8 * @file 9 * @brief 10 * This file includes the Zephyr platform-specific initializers. 11 */ 12 13 #ifndef PLATFORM_ZEPHYR_H_ 14 #define PLATFORM_ZEPHYR_H_ 15 16 #include <stdint.h> 17 18 #include <openthread/instance.h> 19 #include <zephyr/net/net_pkt.h> 20 21 /** 22 * This function initializes the alarm service used by OpenThread. 23 * 24 */ 25 void platformAlarmInit(void); 26 27 /** 28 * This function performs alarm driver processing. 29 * 30 * @param[in] aInstance The OpenThread instance structure. 31 * 32 */ 33 void platformAlarmProcess(otInstance *aInstance); 34 35 /** 36 * This function initializes the radio service used by OpenThread. 37 * 38 */ 39 void platformRadioInit(void); 40 41 /** 42 * This function performs radio driver processing. 43 * 44 * @param[in] aInstance The OpenThread instance structure. 45 * 46 */ 47 void platformRadioProcess(otInstance *aInstance); 48 49 /** 50 * This function performs UART driver processing. 51 * 52 * @param[in] aInstance The OpenThread instance structure. 53 * 54 */ 55 void platformUartProcess(otInstance *aInstance); 56 57 /** 58 * Outer component calls this method to notify UART driver that it should 59 * switch to panic mode and work in synchronous way. 60 */ 61 void platformUartPanic(void); 62 63 /** 64 * Get current channel from radio driver. 65 * 66 * @param[in] aInstance The OpenThread instance structure. 67 * 68 * @return Current channel radio driver operates on. 69 * 70 */ 71 uint16_t platformRadioChannelGet(otInstance *aInstance); 72 73 /** 74 * Start/stop continuous carrier wave transmission. 75 */ 76 otError platformRadioTransmitCarrier(otInstance *aInstance, bool aEnable); 77 78 /** 79 * This function initializes the random number service used by OpenThread. 80 * 81 */ 82 void platformRandomInit(void); 83 84 85 /** 86 * Initialize platform Shell driver. 87 */ 88 void platformShellInit(otInstance *aInstance); 89 90 91 /** 92 * Notify OpenThread task about new rx message. 93 */ 94 int notify_new_rx_frame(struct net_pkt *pkt); 95 96 /** 97 * Notify OpenThread task about new tx message. 98 */ 99 int notify_new_tx_frame(struct net_pkt *pkt); 100 101 #endif /* PLATFORM_POSIX_H_ */ 102