Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
Loading...
Searching...
No Matches
cascoda_evbme.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019, Cascoda Ltd.
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 are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * 3. Neither the name of the copyright holder nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE.
27 */
39
41#include "ca821x_api.h"
42
43#include "M2351.h"
44#include "sys.h"
45
46#ifndef CASCODA_EVBME_H
47#define CASCODA_EVBME_H
48
49#ifdef __cplusplus
50extern "C" {
51#endif
52
53#ifndef CA_TARGET_NAME
54// Should be defined by the build system
55#define CA_TARGET_NAME "UNKNOWN-TARGET"
56#endif
57
69
76
77/* CAX wakeup check time in [ms] */
78#define CAX_WAKEUP_TIME 100
79
80/******************************************************************************/
81/****** Global Parameters that can by set via EVBME_SET_request ******/
82/******************************************************************************/
83extern u8_t EVBME_HasReset;
84extern u8_t EVBME_UseMAC;
85
86extern void (*EVBME_Message)(char *message, size_t len);
87extern void (*MAC_Message)(u8_t CommandId, u8_t Count, const u8_t *pBuffer);
88
89/******************************************************************************/
90/****** EVBME API Functions ******/
91/******************************************************************************/
92
93/******************************************************************************/
94/***************************************************************************/
105ca_error EVBMEInitialise(const char *aAppName, struct ca821x_dev *dev);
106
107/******************************************************************************/
108/***************************************************************************/
114const char *EVBME_GetAppName(void);
115
116/******************************************************************************/
117/***************************************************************************/
124ca_error EVBME_NotHandled(const struct MAC_Message *msg, struct ca821x_dev *pDeviceRef);
125
126/******************************************************************************/
127/***************************************************************************/
134void cascoda_io_handler(struct ca821x_dev *pDeviceRef);
135
136/******************************************************************************/
137/***************************************************************************/
148extern int (*cascoda_reinitialise)(struct ca821x_dev *pDeviceRef);
149
150/******************************************************************************/
151/***************************************************************************/
172ca_error EVBME_PowerDown(enum powerdown_mode mode, enum wakeup_mode keep_radio_off_on_wakeup, u32_t sleeptime_ms, struct ca821x_dev *pDeviceRef);
173
174/******************************************************************************/
175/***************************************************************************/
180ca_error EVBME_PowerUpRadio(struct ca821x_dev *pDeviceRef);
181
182/******************************************************************************/
183/***************************************************************************/
190void EVBME_SwitchClock(struct ca821x_dev *pDeviceRef, u8_t useExternalClock);
191
192/******************************************************************************/
193/***************************************************************************/
199ca_error EVBME_CAX_Restart(struct ca821x_dev *pDeviceRef);
200
201/******************************************************************************/
202/***************************************************************************/
216ca_error EVBME_GET_OT_Attrib(enum evbme_attribute aAttrib, uint8_t *aOutBufLen, uint8_t *aOutBuf);
217
218#ifdef __cplusplus
219}
220#endif
221
225
226#endif // CASCODA_EVBME_H
The main ca821x-api include file.
unsigned long u32_t
Definition cascoda_types.h:50
unsigned char u8_t
Definition cascoda_types.h:46
struct ca821x_dev dev
Definition flash_test_main.c:114
ca_error EVBME_GET_OT_Attrib(enum evbme_attribute aAttrib, uint8_t *aOutBufLen, uint8_t *aOutBuf)
Get an openthread-specific EVBME attribute.
Definition cascoda_evbme.c:1251
ca_error EVBME_PowerUpRadio(struct ca821x_dev *pDeviceRef)
Powers Up CA821x if it is sleeping to be used for PDM_POWERDOWN or PDM_STANDBY only.
Definition cascoda_evbme.c:1132
void cascoda_io_handler(struct ca821x_dev *pDeviceRef)
Processes messages received over available interfaces.
Definition cascoda_evbme.c:893
ca_error EVBME_NotHandled(const struct MAC_Message *msg, struct ca821x_dev *pDeviceRef)
Sends DownStream Command from API UpStream to Serial.
Definition cascoda_evbme.c:946
void EVBME_SwitchClock(struct ca821x_dev *pDeviceRef, u8_t useExternalClock)
System Clock Switch.
Definition cascoda_evbme.c:957
ca_error EVBME_CAX_Restart(struct ca821x_dev *pDeviceRef)
Restarts Air Interface.
Definition cascoda_evbme.c:1166
u8_t EVBME_UseMAC
Use MAC functionality during phy tests.
Definition cascoda_evbme.c:64
int(* cascoda_reinitialise)(struct ca821x_dev *pDeviceRef)
re-initialises CA821x / MAC PIB after powerdown.
Definition cascoda_evbme.c:81
powerdown_mode
Definitions for Powerdown Modes.
Definition cascoda_evbme.h:60
const char * EVBME_GetAppName(void)
Returns the app name string.
Definition cascoda_evbme.c:1246
ca_error EVBME_PowerDown(enum powerdown_mode mode, enum wakeup_mode keep_radio_off_on_wakeup, u32_t sleeptime_ms, struct ca821x_dev *pDeviceRef)
Put the system into a state of power-down for a given time.
Definition cascoda_evbme.c:992
u8_t EVBME_HasReset
Used to notify apps that radio has been reset.
Definition cascoda_evbme.c:63
ca_error EVBMEInitialise(const char *aAppName, struct ca821x_dev *dev)
Initialises EVBME after Reset.
Definition cascoda_evbme.c:1191
wakeup_mode
Definitions for Wakeup after Powerdown.
Definition cascoda_evbme.h:72
@ PDM_POWERDOWN
No CAX Retention, PIB has to be re-initialised.
Definition cascoda_evbme.h:64
@ PDM_POWEROFF
No CAX Retention, PIB has to be re-initialised.
Definition cascoda_evbme.h:65
@ PDM_STANDBY
CAX Full Data Retention.
Definition cascoda_evbme.h:63
@ PDM_ACTIVE
CAX Full Data Retention, MAC Running.
Definition cascoda_evbme.h:62
@ PDM_ALLON
Mainly for Testing.
Definition cascoda_evbme.h:61
@ PDM_DPD
No CAX Retention or MCU Retention (Data saved in NVM).
Definition cascoda_evbme.h:66
@ PDM_DPD_MCU_ONLY
No CAX Retention or MCU Retention (Data saved in NVM).
Definition cascoda_evbme.h:67
@ WUP_KEEP_RADIO_OFF
keep CAX off when waking up
Definition cascoda_evbme.h:74
@ WUP_WAKEUP_ALL
restart micro and CAX
Definition cascoda_evbme.h:73
ca_error
Cascoda error type.
Definition ca821x_error.h:51
evbme_attribute
EVBME attribute ids for use with EVBME_SET_REQUEST and EVBME_GET_REQUEST.
Definition evbme_messages.h:73
EVBME Message command in Cascoda TLV format.
Definition evbme_messages.h:258
SPI Message Format Typedef.
Definition mac_messages.h:1017
CA-821x Device reference struct.
Definition ca821x_api.h:164