Basic definitions
CANopen_301 » Driver

Target specific basic definitions and data types according to Misra C specification. More...

## Macros

#define | CO_LITTLE_ENDIAN
| CO_LITTLE_ENDIAN or CO_BIG_ENDIAN must be defined.
#define | CO_SWAP_16(x) x
| Macro must swap bytes, if CO_BIG_ENDIAN is defined.
#define | CO_SWAP_32(x) x
| Macro must swap bytes, if CO_BIG_ENDIAN is defined.
#define | CO_SWAP_64(x) x
| Macro must swap bytes, if CO_BIG_ENDIAN is defined.
#define | NULL (0)
| NULL, for general usage.
#define | true 1
| Logical true, for general use.
#define | false 0
| Logical false, for general use.

## Typedefs

typedef unsigned char | bool_t
| Boolean data type for general use.
typedef signed char | int8_t
| INTEGER8 in CANopen (0002h), 8-bit signed integer.
typedef signed int | int16_t
| INTEGER16 in CANopen (0003h), 16-bit signed integer.
typedef signed long int | int32_t
| INTEGER32 in CANopen (0004h), 32-bit signed integer.
typedef signed long long int | int64_t
| INTEGER64 in CANopen (0015h), 64-bit signed integer.
typedef unsigned char | uint8_t
| UNSIGNED8 in CANopen (0005h), 8-bit unsigned integer.
typedef unsigned int | uint16_t
| UNSIGNED16 in CANopen (0006h), 16-bit unsigned integer.
typedef unsigned long int | uint32_t
| UNSIGNED32 in CANopen (0007h), 32-bit unsigned integer.
typedef unsigned long long int | uint64_t
| UNSIGNED64 in CANopen (001Bh), 64-bit unsigned integer.
typedef float | float32_t
| REAL32 in CANopen (0008h), single precision floating point value, 32-bit.
typedef double | float64_t
| REAL64 in CANopen (0011h), double precision floating point value, 64-bit.
typedef char | char_t
| VISIBLE_STRING in CANopen (0009h), string of signed 8-bit values.
typedef unsigned char | oChar_t
| OCTET_STRING in CANopen (000Ah), string of unsigned 8-bit values.
typedef unsigned char | domain_t
| DOMAIN in CANopen (000Fh), used to transfer a large block of data.

## Detailed Description

Target specific basic definitions and data types according to Misra C specification.

Must be defined in the CO_driver_target.h file.

Depending on processor or compiler architecture, one of the two macros must be defined: CO_LITTLE_ENDIAN or CO_BIG_ENDIAN. CANopen itself is little endian.

Basic data types may be specified differently on different architectures. Usually `true` and `false` are defined in `<stdbool.h>`, `NULL` is defined in `<stddef.h>`, `int8_t` to `uint64_t` are defined in `<stdint.h>`.