#include "t89c51cc02.h"
#include "datatypes.h"
Go to the source code of this file.
Defines | |
#define | NR_SENSORS 18 |
#define | COMMAND_READ 0x00 |
#define | COMMAND_MONITOR 0x10 |
#define | COMMAND_STOPMONITOR 0x11 |
#define | COMMAND_MONITORSTATUS 0x12 |
#define | COMMAND_RECALLMONITOR 0x13 |
#define | COMMAND_STOPALLMONITORS 0x14 |
#define | COMMAND_REPORT 0x20 |
#define | COMMAND_STOPREPORT 0x21 |
#define | COMMAND_TIMECHECK_ENABLE 0xA0 |
#define | COMMAND_TIMECHECK_DISABLE 0xA1 |
#define | COMMAND_TIMECHECKSTATUS 0xA2 |
#define | COMMAND_EEPROM_SAVEMONITOR 0xE0 |
#define | COMMAND_EEPROM_CLEAR 0xE1 |
#define | COMMAND_RESET 0xff |
#define | Command_ClearRead() readenable=0 |
#define | Command_DisableReport() reporting=0 |
#define | Command_ClearMonitor() monitor=0 |
#define | Command_CheckMonitor() (monitor!=0) |
#define | Command_TimecheckEnable() timecheck=1 |
#define | Command_TimecheckDisable() timecheck=0 |
#define | Command_CheckTime() (timecheck==1) |
#define | CHECKSUM_FILLER 0x3c2a |
Functions | |
void | Command_SetRead (BYTE) |
marks a sensor for reading after next measurement | |
BYTE | Command_ReportDue (void) |
signal if a report of the sensor values is due | |
void | Command_EnableMonitor (BYTE, WORD, bit) |
marks one sensor for monitoring so it will report a value above or beyond a specified boundary value | |
void | Command_DisableMonitor (BYTE) |
disable monitoring for a given sensor | |
BYTE | CheckMonitor (BYTE, WORD) |
checks whether the monitoring condition for a given sensor is true | |
void | Command_EnableReport (BYTE) |
enables reporting of all sensors | |
WORD | Command_GetBoundary (BYTE) |
reports the current boundary value for a given sensor | |
void | Command_SetBoundary (BYTE, WORD) |
set the boundary value for a given sensor | |
void | Command_ReadDefaultConfiguration (void) |
load monitoring data from EEPROM and activate it again | |
void | Command_WriteDefaultConfiguration (void) |
writes the current monitoring conditions into the EEPROM | |
Variables | |
LONG | readenable |
stores a bit vector to mark which sensor values have to be sent after the current sampling cycle. | |
LONG | monitor |
LONG | monitor_direction |
volatile bit | reporting |
volatile bit | timecheck |
volatile bit | read_eeprom_config |
volatile bit | write_eeprom_config |
Definition in file command.h.
|
start value for checksum calculation Definition at line 59 of file command.h. Referenced by Command_ReadDefaultConfiguration(), and Command_WriteDefaultConfiguration(). |
|
checkes whether sensors are monitored |
|
checks whether monitoring of the timing constraints is active Definition at line 56 of file command.h. Referenced by CAN_interrupt(). |
|
macro to disable all monitoring conditions Definition at line 48 of file command.h. Referenced by CAN_interrupt(). |
|
macro to clear reading markers Definition at line 44 of file command.h. Referenced by CAN_interrupt(). |
|
macro to disable whole sample reporting Definition at line 46 of file command.h. Referenced by CAN_interrupt(). |
|
symbolic command name to clear the monitoring configuration inside of the EEPROM Definition at line 39 of file command.h. Referenced by CAN_interrupt(). |
|
symbolic command name to save the active monitoring conditions to the EEPROM Definition at line 37 of file command.h. Referenced by CAN_interrupt(). |
|
symbolic command name to set a monitoring condition for a given sensor Definition at line 17 of file command.h. Referenced by CAN_interrupt(). |
|
symbolic command name to read the status of active monitoring conditions Definition at line 21 of file command.h. Referenced by CAN_interrupt(). |
|
symbolic command name to schedule reading of a given sensor Definition at line 15 of file command.h. Referenced by CAN_interrupt(). |
|
symbolic command name to schedule a reinitialization of the monitoring conditions from EEPROM contents Definition at line 23 of file command.h. Referenced by CAN_interrupt(). |
|
symbolic command name to schedule complete sample reports Definition at line 27 of file command.h. Referenced by CAN_interrupt(). |
|
symbolic command name to reset all monitoring and reporting conditions Definition at line 41 of file command.h. Referenced by CAN_interrupt(). |
|
symbolic command name to remove all active monitoring conditions Definition at line 25 of file command.h. Referenced by CAN_interrupt(). |
|
symbolic command name to disable a monitoring condition for a given sensor Definition at line 19 of file command.h. Referenced by CAN_interrupt(). |
|
symbolic command name to stop complete reporting Definition at line 29 of file command.h. Referenced by CAN_interrupt(). |
|
symbolic command name to disable time constraint monitoring Definition at line 33 of file command.h. Referenced by CAN_interrupt(). |
|
symbolic command name to enable monitoring of the time constraints Definition at line 31 of file command.h. Referenced by CAN_interrupt(). |
|
macro to disable monitoring of the timing constraints Definition at line 54 of file command.h. Referenced by CAN_interrupt(). |
|
macro to enable monitoring of the timing constraints Definition at line 52 of file command.h. Referenced by CAN_interrupt(), and main(). |
|
symbolic command name to read the status of time constraint monitoring Definition at line 35 of file command.h. Referenced by CAN_interrupt(). |
|
number of sensors available in the system Definition at line 12 of file command.h. Referenced by CheckMonitor(), Command_DisableMonitor(), Command_EnableMonitor(), and Command_SetRead(). |
|
checks whether the monitoring condition for a given sensor is true
The sample value is compared to the boundary for the given sensor.
Definition at line 153 of file command.c. References masks, monitor, monitor_boundary, monitor_direction, and NR_SENSORS. Referenced by main(). |
|
disable monitoring for a given sensor
Definition at line 137 of file command.c. References masks, monitor, and NR_SENSORS. Referenced by CAN_interrupt(). |
|
marks one sensor for monitoring so it will report a value above or beyond a specified boundary value
Monitoring of a given sensor is enabled.
Definition at line 119 of file command.c. References masks, monitor, monitor_boundary, monitor_direction, and NR_SENSORS. Referenced by CAN_interrupt(). |
|
enables reporting of all sensors
The firmware will skip the given amount of timeframes between complete reports.
Definition at line 70 of file command.c. References report, report_reload, and reporting. Referenced by CAN_interrupt(). |
|
reports the current boundary value for a given sensor The boundary value is persistent, even if the monitoring condition has been disabled with a Command_EnableMonitor command for the given sensor.
Definition at line 184 of file command.c. References monitor_boundary. |
|
load monitoring data from EEPROM and activate it again This function reads the EEPROM contents and checks its checksum. If the checksum is correct the values are used to set the monitoring conditions for up to all sensors. Definition at line 206 of file command.c. References CHECKSUM_FILLER, EEPROM_BOUNDARY, EEPROM_CHECKSUM, EEPROM_DIRECTION, EEPROM_MONITOR, EEPROM_read(), monitor, monitor_boundary, and monitor_direction. Referenced by main(). |
|
signal if a report of the sensor values is due The routine counts the elapsed timeframes for reports and signals when the report is due at the current time slot.
Definition at line 84 of file command.c. References report, report_reload, and reporting. Referenced by main(). |
|
set the boundary value for a given sensor
Definition at line 195 of file command.c. References monitor_boundary. |
|
marks a sensor for reading after next measurement The marker corresponds to a bit number in the readenable status word
Definition at line 56 of file command.c. References masks, NR_SENSORS, and readenable. Referenced by CAN_interrupt(). |
|
writes the current monitoring conditions into the EEPROM
The needed checksum is calculated before writing the configuration. Definition at line 251 of file command.c. References CHECKSUM_FILLER, monitor, monitor_boundary, and monitor_direction. |
|
stores a bit vector to mark which sensors are monitored Definition at line 20 of file command.c. Referenced by CAN_interrupt(), CheckMonitor(), Command_DisableMonitor(), Command_EnableMonitor(), Command_ReadDefaultConfiguration(), and Command_WriteDefaultConfiguration(). |
|
bit vector which indicates the direction of boundary monitoring Definition at line 23 of file command.c. Referenced by CheckMonitor(), Command_EnableMonitor(), Command_ReadDefaultConfiguration(), and Command_WriteDefaultConfiguration(). |
|
semaphore to schedule a reread of the EEPROM contents Definition at line 31 of file command.c. Referenced by CAN_interrupt(), and main(). |
|
stores a bit vector to mark which sensor values have to be sent after the current sampling cycle. The bit vector is automatically cleared when all scheduled readings have taken place. Definition at line 17 of file command.c. Referenced by Command_SetRead(), and main(). |
|
a flag that indicates if all sensor values should be reported Definition at line 26 of file command.c. Referenced by Command_EnableReport(), Command_ReportDue(), and main(). |
|
a flag that indicates whether the main loop shall report violations of the timing restrictions |
|
semaphore to schedule writing of new EEPROM contents Definition at line 33 of file command.c. Referenced by CAN_interrupt(). |