Standard Types and Constants

Normative

The root types, constants, and identifiers every Chiisai HAL driver uses. Standard types available via Std_Types.h MUST always be used instead of native C types, and read-only variables and never-modified pointer parameters MUST be const-qualified. Keywords per Requirement Keywords.

Standard types

Symbol

Value / type

Meaning

Std_ReturnType

uint8

Standard API return type. 0x00 = E_OK (success), 0x01 = E_NOT_OK (error); 0x020xFF are reserved for implementation-specific return values.

E_OK / E_NOT_OK

0x00 / 0x01

The two standard Std_ReturnType results.

STD_ON / STD_OFF

0x01 / 0x00

Standard on/off state definition.

Available via Std_Types.h.

Platform types

Available via Platform_Types.h.

Type

Range / definition

boolean

TRUE / FALSE (C99 _Bool may back it).

uint8 / uint16 / uint32 / uint64

Unsigned integers [0, 2^8-1][0, 2^64-1].

sint8 / sint16 / sint32 / sint64

Signed integers [-2^7, 2^7-1][-2^63, 2^63-1].

uint8_leastuint32_least, sint8_leastsint32_least

Fastest type at least as wide as the named width.

float32 / float64

IEEE 754-2008 binary32 / binary64.

Architecture description macros — each defined as one of its listed range symbols, all available via Platform_Types.h:

Macro

Range symbols

Meaning

CPU_TYPE

CPU_TYPE_8 / _16 / _32 / _64

CPU architecture width.

CPU_BIT_ORDER

MSB_FIRST / LSB_FIRST

Bit order.

CPU_BYTE_ORDER

HIGH_BYTE_FIRST / LOW_BYTE_FIRST

Byte order (endianness).

TRUE / FALSE

1 / 0

Logical values for boolean (C99 true / false may back them).

Communication-stack types

Available via ComStack_Types.h. Used by the communication drivers (CAN, LIN, …) to exchange protocol data units with the upper layer.

Type

Kind

Meaning

PduIdType

uint8

Zero-based PDU identifier (00xFF).

PduLengthType

uint8

PDU data length in bytes (00xFF).

PduInfoType

struct

Fundamental information about a PDU: uint8* sduDataPtr (payload), uint8* metaDataPtr (associated metadata), uint8 sduLength (payload length in bytes).

Note

A module may specialise these (for example the CAN driver’s Can_PduInfoType); such module-specific types are documented in the module’s own reference.

Module identifiers

Each module has a 16-bit id 0x<8-bit component id><8-bit module id> used mainly for error reporting via LogM_Report. The component id for Chiisai HAL is 0x01.

Module

ID (uint16)

CanDrv

0x0101

LinDrv

0x0102

SpiDrv

0x0103

I2cDrv

0x0104

UartDrv

0x0105

WdgDrv

0x0106

MemDrv

0x0107

McuDrv

0x0108

PortDrv

0x0109

Other driver not specified here

0x01800x01FF