Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
cascoda_interface_core.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  */
40 #ifndef CASCODA_INTERFACE_CORE_H
41 #define CASCODA_INTERFACE_CORE_H
42 
43 #include "cascoda_types.h"
44 #include "mac_messages.h"
45 
52 void BSP_WaitUs(u32_t us);
53 
60 void BSP_Waiting(void);
61 
69 
76 void BSP_WaitTicks(u32_t ticks);
77 
84 void BSP_ResetRF(u8_t ms);
85 
92 u8_t BSP_SenseRFIRQ(void);
93 
98 void BSP_DisableRFIRQ(void);
99 
104 void BSP_EnableRFIRQ(void);
105 
110 void BSP_SetRFSSBHigh(void);
111 
116 void BSP_SetRFSSBLow(void);
117 
122 void BSP_SPIInit(void);
123 
139 void BSP_SPIExchange(u8_t *RxBuf, const u8_t *TxBuf, u8_t RxLen, u8_t TxLen);
140 
145 bool BSP_IsInsideInterrupt(void);
146 
151 void BSP_SetSPIMOSIOutput(void);
152 
157 void BSP_SetSPIMOSITristate(void);
158 
163 void BSP_MicroTimerStart(void);
164 
170 
176 
181 bool BSP_IsCommsInterfaceEnabled(void);
182 
183 #endif // CASCODA_INTERFACE_CORE_H
184 
Type definitions used by Cascoda baremetal drivers.
unsigned long u32_t
Definition: cascoda_types.h:50
unsigned char u8_t
Definition: cascoda_types.h:46
void BSP_SPIExchange(u8_t *RxBuf, const u8_t *TxBuf, u8_t RxLen, u8_t TxLen)
Exchange bytes over SPI, receiving into RxBuf and transferring from TxBuf.
void BSP_SetSPIMOSITristate(void)
Disconnect MOSI port from SPI MOSI and put to tristate with pull-up.
Definition: cascoda_bsp_chili.c:583
void BSP_SetSPIMOSIOutput(void)
Connect MOSI port to SPI MOSI and disable pull-up.
Definition: cascoda_bsp_chili.c:573
u32_t BSP_MicroTimerGet(void)
get microseconds timer while running
Definition: cascoda_time.c:64
u32_t BSP_MicroTimerStop(void)
stop microseconds timer
Definition: cascoda_time.c:56
bool BSP_IsCommsInterfaceEnabled(void)
check if comms interface is connected
Definition: cascoda_bsp_chili.c:557
void BSP_SPIInit(void)
Initialise GPIO and SPI Pins for Comms with CA-821X.
Definition: cascoda_bsp_chili.c:358
void BSP_Waiting(void)
This function will be called repeatedly when the Baremetal drivers are blocking & waiting (eg.
Definition: cascoda_bsp_chili.c:644
u8_t BSP_SenseRFIRQ(void)
Sense whether SPI IRQ is high or low.
Definition: cascoda_bsp_chili.c:118
bool BSP_IsInsideInterrupt(void)
Is the code running in an interrupt context?
Definition: cascoda_bsp_chili.c:802
void BSP_WaitTicks(u32_t ticks)
Wait for specified Time in Milliseconds.
Definition: cascoda_time.c:38
void BSP_SetRFSSBLow(void)
Put SPI Select (SSB) Pin low.
Definition: cascoda_bsp_chili.c:154
u32_t BSP_ReadAbsoluteTime(void)
Get the number of milliseconds since program start.
Definition: cascoda_time.c:17
void BSP_WaitUs(u32_t us)
Wait for specified Time in Microseconds (max.
Definition: cascoda_bsp_chili.c:78
void BSP_EnableRFIRQ(void)
Allow SPI IRQ, re-enabling interrupt after BSP_DisableRFIRQ()
Definition: cascoda_bsp_chili.c:136
void BSP_DisableRFIRQ(void)
Inhibit SPI IRQ, suppresses interrupt but still latches it.
Definition: cascoda_bsp_chili.c:126
void BSP_ResetRF(u8_t ms)
Reset CAX RF Chip.
Definition: cascoda_bsp_chili.c:99
void BSP_MicroTimerStart(void)
start microseconds timer
Definition: cascoda_time.c:49
void BSP_SetRFSSBHigh(void)
Put SPI Select (SSB) Pin high.
Definition: cascoda_bsp_chili.c:146
Definitions relating to MLME and MCPS API messages.