Skip to content

XTypes

Path: src/modbus/types.h

Revision History:

  • Initial documentation

A core utility header that defines fundamental type aliases used throughout the codebase. This file provides standardized type definitions to ensure consistent data type usage across the application.

No specific hardware requirements. This is a pure software utility.

  • cchar: A type alias for constant character data
  • uchar: A type alias for unsigned character data
  • millis_t: A type alias for millisecond time representations
  • ushort: A type alias for unsigned short integers
  • ulong: A type alias for unsigned long integers
  • lint: A type alias for long integers
  • llint: A type alias for long long integers
  • Simple, standardized type definitions
  • Cross-platform compatibility
  • Consistent naming convention for derived types
  • Avoids usage of standard library types
  • <stdint.h> - Standard C library for integer types

Types

stdint

This component is a passive header-only utility that doesn’t have runtime behavior.

  • No specific performance considerations as these are basic type aliases
  • Consider defining overflow-safe numeric types for sensitive operations
  • Verify that these type definitions are consistent with the target hardware architecture
  • Ensure compliance with C17 standard
  • Use these type aliases consistently throughout the codebase
  • Consider adding more explicit sizing (e.g., uint32_t) for architecture-dependent types where exact bit sizes are critical
  • When adding new types, maintain the established naming convention
  • Document the expected size (in bits) for each type to avoid platform-specific issues