KETCube
|
This file contains the KETCube starNet node and concentrator modules. More...
#include <string.h>
#include "hw.h"
#include "radio.h"
#include "low_power.h"
#include "ketCube_starNet.h"
#include "ketCube_common.h"
#include "ketCube_terminal.h"
#include "ketCube_modules.h"
#include "ketCube_i2c.h"
#include "ketCube_adc.h"
#include "ketCube_hdcX080.h"
#include "ketCube_rxDisplay.h"
Macros | |
#define | FSK_FDEV 25000 |
#define | FSK_DATARATE 50000 |
#define | FSK_BANDWIDTH 50000 |
#define | FSK_AFC_BANDWIDTH 83333 |
#define | FSK_PREAMBLE_LENGTH 5 |
#define | FSK_FIX_LENGTH_PAYLOAD_ON FALSE |
#define | RX_TIMEOUT_VALUE 1000 |
#define | TX_TIMEOUT_VALUE 500 |
Functions | |
static void | ketCube_starNet_OnRxError (void) |
This function is executed on radio Rx Error event. More... | |
static void | ketCube_starNet_OnRxTimeout (void) |
This function is executed on radio Rx Timeout event. More... | |
static void | ketCube_starNet_OnTxTimeout (void) |
This function is executed on radio Tx Timeout event. More... | |
static void | ketCube_starNet_OnTxDone (void) |
This function is executed on Tx Done event. More... | |
static void | ketCube_starNet_OnRxDone (uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr) |
This function is executed on Rx Done event. More... | |
ketCube_cfg_ModError_t | ketCube_starNet_Init (ketCube_starNet_NodeType_t nodeType) |
Initialize starNet module. More... | |
ketCube_cfg_ModError_t | ketCube_starNet_SleepEnter (void) |
Prepare sleep mode. More... | |
ketCube_cfg_ModError_t | ketCube_starNet_ConcentratorInit (ketCube_InterModMsg_t ***msg) |
Initialize starNet Concentrator. More... | |
ketCube_cfg_ModError_t | ketCube_starNet_NodeInit (ketCube_InterModMsg_t ***msg) |
Initialize starNet Node. More... | |
ketCube_cfg_ModError_t | ketCube_starNet_sendData (uint8_t *buffer, uint8_t *len) |
Send sensor data. More... | |
Variables | |
ketCube_starNet_moduleCfg_t | ketCube_starNetConcentrator_moduleCfg |
ketCube_starNet_moduleCfg_t | ketCube_starNetNode_moduleCfg |
static RadioEvents_t | RadioEvents |
uint8_t | txBuffer_len = 0 |
static ketCube_starNet_State_t | moduleState |
static uint8_t | ketCube_starNet_dataBuff [KETCUBE_STARNET_DATA_BUFFER_LEN] |
ketCube_starNet_NodeType_t | ketCube_starNet_nodeType |
ketCube_starNet_NodeType_t | nodeType |
This file contains the KETCube starNet node and concentrator modules.
Developed by: The SmartCampus Team Department of Technologies and Measurement www.smartcampus.cz | www.zcu.cz
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal with the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
#define FSK_AFC_BANDWIDTH 83333 |
Hz
#define FSK_BANDWIDTH 50000 |
Hz
#define FSK_DATARATE 50000 |
bps
#define FSK_FDEV 25000 |
Hz
#define FSK_FIX_LENGTH_PAYLOAD_ON FALSE |
#define FSK_PREAMBLE_LENGTH 5 |
Same for Tx and Rx
#define RX_TIMEOUT_VALUE 1000 |
#define TX_TIMEOUT_VALUE 500 |
Timeout should be small, it should not occur in general, but it occurs (with some parts), see the in-code note above the woraround
ketCube_cfg_ModError_t ketCube_starNet_Init | ( | ketCube_starNet_NodeType_t | nodeType | ) |
Initialize starNet module.
KETCUBE_CFG_MODULE_OK | in case of success |
KETCUBE_CFG_MODULE_ERROR | in case of failure |
|
static |
This function is executed on Rx Done event.
|
static |
This function is executed on radio Rx Error event.
|
static |
This function is executed on radio Rx Timeout event.
|
static |
This function is executed on Tx Done event.
|
static |
This function is executed on radio Tx Timeout event.
|
static |
|
static |
ketCube_starNet_NodeType_t nodeType |
This device type: Node/Concentrator
|
static |
uint8_t txBuffer_len = 0 |