Contiki-NG
Loading...
Searching...
No Matches
sched.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its
14 * contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28 * OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30/**
31 * \addtogroup cc13xx-cc26xx-rf
32 * @{
33 *
34 * \defgroup cc13xx-cc26xx-rf-sched RF Scheduler for CC13xx/CC26xx
35 *
36 * @{
37 *
38 * \file
39 * Header file of the CC13xx/CC26xx RF scheduler.
40 * \author
41 * Edvard Pettersen <e.pettersen@ti.com>
42 */
43/*---------------------------------------------------------------------------*/
44#ifndef RF_SCHED_H_
45#define RF_SCHED_H_
46/*---------------------------------------------------------------------------*/
47#include "contiki.h"
48#include "sys/process.h"
49/*---------------------------------------------------------------------------*/
50#include <ti/drivers/rf/RF.h>
51/*---------------------------------------------------------------------------*/
52#include <stdbool.h>
53/*---------------------------------------------------------------------------*/
54PROCESS_NAME(rf_sched_process);
55/*---------------------------------------------------------------------------*/
56typedef enum {
57 RF_RESULT_OK = 0,
58 RF_RESULT_ERROR,
59} rf_result_t;
60/*---------------------------------------------------------------------------*/
61typedef enum {
62 BLE_ADV_CHANNEL_37 = (1 << 0),
63 BLE_ADV_CHANNEL_38 = (1 << 1),
64 BLE_ADV_CHANNEL_39 = (1 << 2),
65
66 BLE_ADV_CHANNEL_ALL = (BLE_ADV_CHANNEL_37 |
67 BLE_ADV_CHANNEL_38 |
68 BLE_ADV_CHANNEL_39),
69} ble_adv_channel_t;
70/*---------------------------------------------------------------------------*/
71/**
72 * \name Common RF scheduler functionality.
73 *
74 * @{
75 */
76rf_result_t rf_yield(void);
77rf_result_t rf_restart_rat(void);
78rf_result_t rf_set_tx_power(RF_Handle handle, RF_TxPowerTable_Entry *table, int8_t dbm);
79rf_result_t rf_get_tx_power(RF_Handle handle, RF_TxPowerTable_Entry *table, int8_t *dbm);
80/** @} */
81/*---------------------------------------------------------------------------*/
82/**
83 * \name Nestack Radio scheduler functionality.
84 *
85 * Either for Prop-mode or IEEE-mode Radio driver.
86 *
87 * @{
88 */
89RF_Handle netstack_open(RF_Params *params);
90rf_result_t netstack_sched_fs(void);
91rf_result_t netstack_sched_ieee_tx(uint16_t payload_length, bool ack_request);
92rf_result_t netstack_sched_prop_tx(uint16_t payload_length);
93rf_result_t netstack_sched_rx(bool start);
94rf_result_t netstack_stop_rx(void);
95/** @} */
96/*---------------------------------------------------------------------------*/
97/**
98 * \name BLE Radio scheduler functionality.
99 *
100 * Only for the BLE Beacon Daemon.
101 *
102 * @{
103 */
104RF_Handle ble_open(RF_Params *params);
105rf_result_t ble_sched_beacons(uint8_t bm_adv_channel);
106/** @} */
107/*---------------------------------------------------------------------------*/
108#endif /* RF_SCHED_H_ */
109/*---------------------------------------------------------------------------*/
110/**
111 * @}
112 * @}
113 */
#define PROCESS_NAME(name)
Declare the name of a process.
Definition process.h:286
static void start(void)
Start measurement.
Header file for the Contiki process interface.