Data_Type - HomeMadeRobots/Embedded_Software_Cpp_Framework GitHub Wiki
- Basic_Integer_Types
- Basic_Boolean_Type
- Basic_Floating_Point_Type
- Enumerated_Data_Type
- Physical_Data_Type
- Array_Data_Type
- Structured_Data_Type
The Basic_Integer_Types are implemented using the types defined in <stdint.h>.
Basic_Type | C++ type |
---|---|
uint8 | uint8_t |
sint8 | int8_t |
uint16 | uint16_t |
sint16 | int16_t |
uint32 | uint32_t |
sint32 | int32_t |
uint64 | unt64_t |
sint64 | int64_t |
The Basic_Boolean_Type boolean is implemented using the C++ type bool
The Basic_Floating_Point_Types are implemented using the native C++ floating point data types.
Basic_Type | C++ type |
---|---|
fp32 | float |
fp64 | double |
An Enumerated_Data_Type is implemented using the typedef
specifier with the enum
keyword.
The following Enumerated_Data_Type :
is implemented as follow :
#ifndef E_IO_LEVEL_H
#define E_IO_LEVEL_H
/* Enumerated_Data_Type */
/* Allows to model a data representing the hardware level of a pin. */
typedef enum E_IO_LEVEL {
IO_LEVEL_HIGH,
IO_LEVEL_LOW
} E_IO_LEVEL;
#endif
A Physical_Data_Type is implemented using the typedef
specifier. It defines the Physical_Data_Type name as its Based_Data_Type_Ref (a Basic_Integer_Type).
The following Physical_Data_Type:
is implemented as follow :
#ifndef T_VOLTAGE_H
#define T_VOLTAGE_H
#include "stdint.h"
/* Physical_Data_Type */
/*
Allows to model a data representing a voltage with a resolution of 0.004887 V.
(Typically used to represent a data from 0 to 5 V.)
*/
/*
Unit : V
Resolution : 0.004887
Offset : 0
*/
typedef uint16_t T_VOLTAGE;
#endif