Simple demo application for wireless chat.
Copyright (c) 2019 - 2022 Microchip Technology Inc. and its subsidiaries.
#include "system.h"
#include "miwi_config.h"
#include "miwi_config_p2p.h"
#include "sysTimer.h"
#include "miwi_api.h"
#include "mimem.h"
#include "sio2host.h"
#include "asf.h"
#include "phy.h"
#include "edbg-eui.h"
Data Structures | |
struct | TxMessage_t |
Macros | |
#define | APP_DEBOUNCE_TIME_MS 50 |
#define | KEY_BACKSPACE 0x08 |
#define | KEY_ENTER 0x0D |
#define | MAX_MESSAGE_LEN 35 |
#define | NVM_UID_ADDRESS ((volatile uint16_t *)(0x00804008U)) |
#define | NVM_UID_ADDRESS ((volatile uint16_t *)(0x0080400AU)) |
Functions | |
static void | Connection_Confirm (miwi_status_t status) |
static void | dataConfcb (uint8_t handle, miwi_status_t status, uint8_t *msgPointer) |
void | DumpConnection (INPUT uint8_t index) |
void | FormatTxMessage (void) |
static void | longAddressValidationAndUpdation (void) |
int | main (void) |
void | ProcessRxMessage (void) |
void | ReadMacAddress (void) |
void | ReceivedDataIndication (RECEIVED_MESSAGE *ind) |
void | TransmitMessage (void) |
Variables | |
uint8_t | AdditionalNodeID [ADDITIONAL_NODE_ID_SIZE] = {0x00} |
CONNECTION_ENTRY | connectionTable [CONNECTION_SIZE] |
defaultParametersRamOnly_t | defaultParamsRamOnly |
defaultParametersRomOrRam_t | defaultParamsRomOrRam |
bool | messagePending = false |
uint8_t | msghandledemo = 0 |
uint8_t | myChannel = 3 |
API_UINT16_UNION | myPANID |
MIWI_TICK | tickCurrent |
MIWI_TICK | tickPrevious |
bool | transmitPending = false |
TxMessage_t | TxMessage |
#define APP_DEBOUNCE_TIME_MS 50 |
Referenced by main().
#define KEY_BACKSPACE 0x08 |
Referenced by FormatTxMessage().
#define KEY_ENTER 0x0D |
Referenced by FormatTxMessage().
#define MAX_MESSAGE_LEN 35 |
Referenced by FormatTxMessage(), and main().
#define NVM_UID_ADDRESS ((volatile uint16_t *)(0x00804008U)) |
Referenced by ReadMacAddress().
#define NVM_UID_ADDRESS ((volatile uint16_t *)(0x0080400AU)) |
|
static |
Referenced by main().
|
static |
References MiMem_Free().
Referenced by TransmitMessage().
void DumpConnection | ( | INPUT uint8_t | index | ) |
References ADDITIONAL_NODE_ID_SIZE, CONNECTION_SIZE, currentChannel, MY_ADDRESS_LENGTH, myLongAddress, and API_UINT16_UNION::v.
Referenced by main().
void FormatTxMessage | ( | void | ) |
References KEY_BACKSPACE, KEY_ENTER, MAX_MESSAGE_LEN, TxMessage_t::Message, messagePending, TxMessage_t::MessageSize, MiWi_TickGet(), sio2host_rx(), sio2host_tx(), transmitPending, and _MIWI_TICK::Val.
Referenced by main().
|
static |
References LONG_ADDR_LEN, MY_ADDRESS_LENGTH, myLongAddress, PHY_RandomReq(), and PHY_SetIEEEAddr().
Referenced by main().
int main | ( | void | ) |
References APP_DEBOUNCE_TIME_MS, board_init(), BUTTON_0_ACTIVE, BUTTON_0_PIN, CHANNEL, Connection_Confirm(), cpu_irq_enable, delay_init(), delay_ms, DumpConnection(), ENABLE_ALL_CONN, FormatTxMessage(), irq_initialize_vectors, LED_0_ACTIVE, LED_0_PIN, longAddressValidationAndUpdation(), MAX_MESSAGE_LEN, messagePending, TxMessage_t::MessageSize, MiApp_ConnectionMode(), MiApp_EstablishConnection(), MiApp_ProtocolInit(), MiApp_Set(), MiApp_StartConnection(), MiApp_SubscribeDataIndicationCallback(), MiWi_TickGet(), MiWi_TickGetDiff(), myChannel, ONE_SECOND, P2PTasks(), port_pin_get_input_level(), port_pin_set_output_level(), ReadMacAddress(), ReceivedDataIndication(), sio2host_init(), START_CONN_DIRECT, SYS_TimerInit(), system_init(), TransmitMessage(), transmitPending, and _MIWI_TICK::Val.
void ProcessRxMessage | ( | void | ) |
void ReadMacAddress | ( | void | ) |
References edbg_eui_read_eui64(), MY_ADDRESS_LENGTH, myLongAddress, and NVM_UID_ADDRESS.
Referenced by main().
void ReceivedDataIndication | ( | RECEIVED_MESSAGE * | ind | ) |
References RECEIVED_MESSAGE::bits, RECEIVED_MESSAGE::flags, MY_ADDRESS_LENGTH, RECEIVED_MESSAGE::Payload, RECEIVED_MESSAGE::PayloadSize, rxMessage, sio2host_tx(), and RECEIVED_MESSAGE::SourceAddress.
Referenced by main().
void TransmitMessage | ( | void | ) |
References dataConfcb(), messagePending, TxMessage_t::MessageSize, MiApp_SendData(), msghandledemo, and transmitPending.
Referenced by main().
uint8_t AdditionalNodeID[ADDITIONAL_NODE_ID_SIZE] = {0x00} |
CONNECTION_ENTRY connectionTable[CONNECTION_SIZE] |
defaultParametersRamOnly_t defaultParamsRamOnly |
defaultParametersRomOrRam_t defaultParamsRomOrRam |
Referenced by MiMAC_ReceivedPacket().
Referenced by FormatTxMessage(), main(), and TransmitMessage().
uint8_t msghandledemo = 0 |
Referenced by TransmitMessage().
uint8_t myChannel = 3 |
Referenced by main().
API_UINT16_UNION myPANID |
MIWI_TICK tickCurrent |
MIWI_TICK tickPrevious |
Referenced by FormatTxMessage(), main(), and TransmitMessage().
TxMessage_t TxMessage |