User Tools

Site Tools


robots:hako:firmware:welcome

This is an old revision of the document!


Hako Firmware

ESX 3XL

Download Hello World Example (29 KB)

<sxh c> int main(void) { T_x_sys_system_information tSys; sint32 s32_Error; s32_Error = x_sys_init(&tSys); init ESX-3XL hardware, this function call is mandatory if (s32_Error == C_NO_ERR) { system init OK? init serial interface X_SER_01 (19200, 8N1) s32_Error = x_ser_init(X_SER_01, 19200, X_SER_MODE_8DB_NO_PARITY, 1u, 0u, NULL); init X_SER_01 TX buffer s32_Error |= x_ser_init_tx_buf(X_SER_01, 100u, 0u, NULL); } if (s32_Error == C_NO_ERR) { x_ser_write_string(X_SER_01, “Hello world!”);

</sxh>

Mainboard - Software - Notation - Types and prefixes

Header file: “xll_stwtypes.h”

In the past used type names like 'word', 'long' or 'dword' are mistakeable. They can have a different meaning dependent to the platform where they are used. E.g. 'word' means 16 bits at a 16-bit controller like the Infineon C167 or a 16/32-bit controller as the Freescale 68k. At a 32-bit controller like the used TriCore TC1796 it would mean 32 bits. There 16 bits are called a 'halfword' instead. That is why STW introduced unambiguous types like 'uint16' to avoid confusions in future.

Recommended unambiguous type definitions and prefixes

STW typePrefix SizeRange (hexadecimal - HEX)Range (decimal - DEC)C equivalent
uint8 u8_ 8 bit 0x00 .. 0xFF0 .. 255unsigned char
sint8 s8_ 8 bit 0x80 .. 0x7F-128 .. +127signed char
uint16u16_16 bit0x0000 .. 0xFFFF0 .. 65535unsigned short int
sint16s16_16 bit0x8000 .. 0x7FFF-32768 .. +32767signed short int
uint32u32_32 bit0x00000000 .. 0xFFFFFFFF0 .. 4294967295unsigned long int
sint32s32_32 bit0x80000000 .. 0x7FFFFFFF-2147483648 .. +2147483647signed long int
uint64u64_64 bit0x0000000000000000 .. 0xFFFFFFFFFFFFFFFF0 .. 18446744073709551615unsigned long long int
sint64s64_64 bit0x8000000000000000 .. 0x7FFFFFFFFFFFFFFF-9223372036854775808 .. +9223372036854775807signed long long int
float32f32_32 bit[ ≈ ±2-126 .. ±2127 ]0, ≈ ±1.18E-38 .. ±3.4E38 (decimal places 6..7)float (FPU: IEEE-754) single precision
float64f64_64 bit[ ≈ ±2-1022 .. ±21023 ]0, ≈ ±2.225E-308 .. ±1.798E+308 (decimal places 15..16)double (SW: IEEE- 754)
float80f80_80 bit[ ≈ ±2-16382 .. ±216383 ]0, ≈ ±3.362E-4932 .. ±1.190E+4932 (decimal places 18..19)long double (SW: IEEE-754) double extended precision

Not recommended mistakable NATIVE type definitions (PLATFORM DEPENDENT!)

robots/hako/firmware/welcome.1348671053.txt.gz · Last modified: 2021/08/14 04:20 (external edit)