Firmware data types. STMicroelectronics STEVAL-IHP007V1
Werbung
Werbung
UM1818 Firmware description
The DL_FSM() is the PLM stack main loop, this manage the PLM low level communication.
The application engine “APP_StackUpdate()” is the state machine which runs inside the
PLM application state machine; this uses the data link service provided from DL_Service layer.
The user program implemented in this user manual realizes a bridge between the power line communication and the COM port: all data arriving from the COM port addressed to another
PLM module is sent via PLM, and in turn all data received from PLM is sent back to the
COM port. It is necessary that the user program does not stop the core operations (looping instructions) without calling the application engine.
All the hardware configurations are contained in the board support package file, and the file
DL_SimpleNodeConf contains the data link configuration parameters and the PLM modem configuration value (frequency, modulation zero crossing delay, etc.).
The next paragraph lists all the data types and the APIs used in the application engine that can be modified by the user if different needs arise.
4.5 Firmware data types
The data type found in the wrapper.h module, are listed hereafter:
/* USER FRAME STRUCTURE */ typedef struct
{
APP_ftype_t type;
bool broadcast;
u8 address[6];
u8 len;
u8 data[USER_PAYLOAD_SIZE]; /* MAX PAYLOAD SIZE: 100 bytes */
bool EnableTX
}APP_frame_t;
/* APPLICATION FRAME TYPE */ typedef enum
{
APP_DATA_FRAME = 0x00,
APP_SERVICE_FRAME = 0x01,
APP_PING_FRAME = 0x02,
APP_ERROR_FRAME = 0x03,
APP_PROGRAMMING_FRAME = 0x04,
APP_ACK_FRAME = 0x05,
APP_MIB_FRAME = 0x06
}APP_ftype_t;
DocID026935 Rev 3 13/47
47
Firmware description UM1818
/* APPLICATION ERRORS */ typedef enum
{
APP_ERROR_NONE = 0x00, // No error
APP_ERROR_GENERIC = 0x01, // Generic communication error
APP_ERROR_COMM_TIMEOUT = 0x02, // Communication timeout error
APP_ERROR_SERVICE_GRP_UNKNOWN = 0x03, // Service group unknown error
APP_ERROR_SERVICE_CMD_ERROR = 0x04, // Service command error
APP_ERROR_COMMUNICATION = 0x05, // Communication error
APP_ERROR_ISOLATED_NODE = 0x06, // Node unreachable error
APP_ERROR_HARDWARE = 0x07, // Hardware error
APP_ERROR_WRONG_PROG_COMMAND = 0x08, // Wrong programming command error
APP_ERROR_WRONG_PROG_GROUP = 0x09, // Wrong programming group error
APP_ERROR_DEVICE_BLANK = 0x0a, // Device blank
APP_ERROR_RTC_ERROR = 0x0b, // Error setting the system time
APP_ERROR_WATCHDOG_DISABLED = 0x0c, // Hardware reset impossible
APP_ERROR_NODE_INIT_FAILED = 0x0d, // Node initialization failure
APP_ERROR_RTC_DISABLED = 0x0e // Internal RTC disabled
}APP_ERROR_t;
14/47
/* PROGRAMMING GROUPS */ typedef enum
{
PROG_GRP_DEVICE_DATA = 0x00, // Device Data
PROG_GRP_LL_STACK_PARAM = 0x01, // Link layer stack parameters
PROG_GRP_USER_DATA = 0x02 // User program
}APP_PROG_GROUP_t;
/* SERVICE COMMANDS */ typedef enum
{
/* NATIVE SERVICE COMMANDS */
SERVICE_SOFTWARE_RESET = 0x00,// Reset internal state machines
SERVICE_HARDWARE_RESET = 0x01,// Module hardware reset
SERVICE_PARAM_SET = 0x02,// Set service parameters
SERVICE_PARAM_GET = 0x03,// Get service parameters
SERVICE_INPUTS_GET = 0x04,// Get general purpose inputs pin status
SERVICE_OUTPUTS_SET = 0x05,// Set general purpose outputs pins value
SERVICE_FW_REL_GET = 0x06,// Get the stack and the module firmware release
SERVICE_PLM_CLOCK_SET = 0x07,// Set the internal time clock value
DocID026935 Rev 3
Herunterladen
Werbung