VivicoreSerial library
|
Communication protocol definitions for VIVIWARE Cell Branch and Custom. More...
#include <inttypes.h>
Go to the source code of this file.
Macros | |
#define | BLE_PROTOCOL_MAJOR_VERSION (uint8_t)(0x07) |
BLE communication protocol major version. More... | |
#define | BLE_PROTOCOL_MINOR_VERSION (uint8_t)(0x00) |
BLE communication protocol minor version. More... | |
#define | NUM_MAX_BLE_PKT (20) |
Maximum packet size for BLE communication protocol. More... | |
#define | NUM_MAX_BLE_PKT_BODY (NUM_MAX_BLE_PKT - 2) |
Maximum body size on a packet for BLE communication protocol. More... | |
#define | UART_PROTOCOL_MAJOR_VERSION (uint8_t)(0x07) |
UART communication protocol major version. More... | |
#define | UART_PROTOCOL_MINOR_VERSION (uint8_t)(0x00) |
UART communication protocol minor version. More... | |
#define | UART_PROTOCOL_BAUDRATE (50000) |
Baudrate for UART communication protocol. More... | |
#define | NUM_MAX_UART_PKT_BODY_DATA (NUM_MAX_BLE_PKT_BODY) |
Maximum data size on a packet for UART communication protocol. More... | |
#define | NUM_MAX_UART_PKT_BODY (NUM_MAX_UART_PKT_BODY_DATA + 2) |
Maximum body size on a packet for UART communication protocol. More... | |
#define | NUM_MAX_UART_PKT (NUM_MAX_UART_PKT_BODY + 3) |
Maximum packet size for UART communication protocol. More... | |
#define | NUM_MAX_DC (16) |
Maximum number of DC info in a Branch. | |
Enumerations | |
enum | BranchId_t { BRANCH_ID_BROADCAST = 0x00 , BRANCH_ID_ALL = BRANCH_ID_BROADCAST , BRANCH_ID_ROOT = 0x01 , BRANCH_ID_2 = 0x02 , BRANCH_ID_3 = 0x03 , BRANCH_ID_4 = 0x04 , BRANCH_ID_5 = 0x05 , BRANCH_ID_MAX = BRANCH_ID_5 , BRANCH_ID_IGNORED = 0xFF } |
Branch ID. More... | |
enum | ChipType_t { CHIP_TYPE_ATMEGA_328P = 0x00 , CHIP_TYPE_ATMEGA_328PB = 0x01 } |
Microcontroller chip types on Branch. More... | |
Communication protocol definitions for VIVIWARE Cell Branch and Custom.
#define BLE_PROTOCOL_MAJOR_VERSION (uint8_t)(0x07) |
BLE communication protocol major version.
The major version should be incremented if any of the following changes is applied.
#define BLE_PROTOCOL_MINOR_VERSION (uint8_t)(0x00) |
BLE communication protocol minor version.
The minor version should be incremented if any of the following changes is applied.
#define NUM_MAX_BLE_PKT (20) |
Maximum packet size for BLE communication protocol.
The packet for BLE communication protocol is constructed with HEADER and BODY. This size includes all of them.
#define NUM_MAX_BLE_PKT_BODY (NUM_MAX_BLE_PKT - 2) |
Maximum body size on a packet for BLE communication protocol.
This size is equivalent to the size excluding HEADER of ACMD size (1) and Branch ID size (1) from NUM_MAX_BLE_PKT.
#define NUM_MAX_UART_PKT (NUM_MAX_UART_PKT_BODY + 3) |
Maximum packet size for UART communication protocol.
The packet for UART communication protocol is constructed with HEADER, BODY, and FOOTER. This size includes all of HEADER, BODY, and FOOTER. This is equivalent to the size appending HEADER of STX size (1) and data length size (1), and FOOTER of CRC (1) to NUM_MAX_UART_PKT_BODY.
#define NUM_MAX_UART_PKT_BODY (NUM_MAX_UART_PKT_BODY_DATA + 2) |
Maximum body size on a packet for UART communication protocol.
The packet for UART communication protocol is constructed with HEADER, BODY, and FOOTER. This size includes only BODY. This is equivalent to the size appending BCMD size (1) and Branch ID size (1) to NUM_MAX_UART_PKT_BODY_DATA.
#define NUM_MAX_UART_PKT_BODY_DATA (NUM_MAX_BLE_PKT_BODY) |
Maximum data size on a packet for UART communication protocol.
The packet for UART communication protocol is constructed with HEADER (STX + data length), BODY (BCMD + Branch ID + data), and FOOTER (CRC). This size includes BODY which excludes BCMD and Branch ID. This is equivalent to NUM_MAX_BLE_PKT_BODY.
#define UART_PROTOCOL_BAUDRATE (50000) |
Baudrate for UART communication protocol.
This is baudrate of UART to communicate between Core and Branch.
#define UART_PROTOCOL_MAJOR_VERSION (uint8_t)(0x07) |
UART communication protocol major version.
The major version should be incremented if any of the following changes is applied.
#define UART_PROTOCOL_MINOR_VERSION (uint8_t)(0x00) |
UART communication protocol minor version.
The minor version should be incremented if any of the following changes is applied.
enum BranchId_t |
Branch ID.
This ID is assigned to the connected branches. ID 1 is for the nearest one to Core. ID 5 is maximum number and farthest from Core.
Enumerator | |
---|---|
BRANCH_ID_BROADCAST | ID for broadcasting (e.g. used for discovery command) |
BRANCH_ID_ALL | Equivalent to BRANCH_ID_BROADCAST |
BRANCH_ID_ROOT | ID for the nearest one to Core |
BRANCH_ID_2 | ID for second one |
BRANCH_ID_3 | ID for third one |
BRANCH_ID_4 | ID for fourth one |
BRANCH_ID_5 | ID for farthest one |
enum ChipType_t |