basic example main execution.
- Returns
- ret - Result of the example execution. If working correctly, will execute print the sample data.
basic example main execution.
- Returns
- ret - Result of the example execution. If working correctly, will execute continuously function basic_app_run and will not return.
basic example main execution.
- Returns
- ret - Result of the example execution. If working correctly, will execute continuously the while(1) loop and will not return.
-
ret - Result of the example execution. If working correctly, will execute print the sample data.
basic example main execution.
- Returns
- ret - Result of the example execution. If working correctly, will execute continuously function basic_app_run and will not return.
basic example main execution.
- Returns
- ret - Result of the example execution. If working correctly, will execute continuously the while(1) loop and will not return.
basic example main execution.
Demonstrates a full IO-Link communication cycle without an IO-Link stack:
- STARTUP - establish communication, read device identity from DPP
- PREOPERATE - read ISDU parameters (vendor name, serial number, etc.)
- OPERATE - exchange cyclic process data
- Returns
- 0 on success, negative error code otherwise.
basic example main execution.
- Returns
- ret - Result of the example execution.
basic example main execution.
Initialises the UART peripheral, prints a banner, then loops forever printing a counter message once per second.
- Returns
- 0 on success, negative error code on failure.
basic example main execution.
SAFETY FEATURES DEMONSTRATED:
- Current Limit Verification
- Validates V_ILIM register matches configuration
- Checks maximum current is within hardware limits
- Prevents operation with dangerous current limits
- Limited Fault Retry
- Uses 1 retry for transient faults (not unlimited)
- Prevents thermal cycling on persistent faults
- Software tracking limits retries to 3 attempts
- Selective Fault Clearing
- Hardware faults (FET_BAD, FET_SHORT) -> latch off permanently
- Transient faults (OC, UV, OV) -> limited retry only
- Never auto-retry hardware damage conditions
- FET Status Validation
- Checks SYSTEM_STATUS before reading VOUT
- Prevents floating ADC pin readings (82V bug)
- Reports FET state clearly to user
- Power Cross-Validation
- Compares chip power register to V×I calculation
- Detects configuration errors (dividers, RSENSE)
- Warns on >10% discrepancy
- Timeout Protection
- 1-hour monitoring limit (not infinite loop)
- Exits cleanly on I2C errors
- Suitable for production deployment
- Clear Safety Messaging
- Explains why faults are critical
- Guides user on required actions
- Prevents dangerous auto-recovery
IMPORTANT FOR PRODUCTION ADAPTATION:
- DO NOT increase retry limits without understanding risks
- DO NOT clear FET_BAD or FET_SHORT faults automatically
- DO verify current limit before enabling FETs
- DO implement watchdog timer for production systems
- DO add energy overflow detection for billing systems
- Returns
- 0 on success, negative error code on failure