Merge pull request #10558 from iNavFlight/MrD_Correct-comments-on-OSD-symbols
[inav.git] / src / main / drivers / io_types.h
blobba80cd3bc77660946127d38c07e9726b3b8eaa80
1 #pragma once
3 #include <stdint.h>
5 // IO pin identification
6 // make sure that ioTag_t can't be assigned into IO_t without warning
7 typedef uint8_t ioTag_t; // packet tag to specify IO pin
8 typedef void* IO_t; // type specifying IO pin. Currently ioRec_t pointer, but this may change
10 // NONE initializer for ioTag_t variables
11 #define IOTAG_NONE ((ioTag_t)0)
13 // NONE initializer for IO_t variable
14 #define IO_NONE ((IO_t)0)
16 // both ioTag_t and IO_t are guarantied to be zero if pinid is NONE (no pin)
17 // this simplifies initialization (globals are zeroed on start) and allows
18 // omitting unused fields in structure initializers.
19 // it is also possible to use IO_t and ioTag_t as boolean value
20 // TODO - this may conflict with requirement to generate warning/error on IO_t - ioTag_t assignment
21 // IO_t being pointer is only possibility I know of ..
23 // pin config handling
24 // pin config is packed into ioConfig_t to decrease memory requirements
25 // IOCFG_x macros are defined for common combinations for all CPUs; this
26 // helps masking CPU differences
28 typedef uint8_t ioConfig_t; // packed IO configuration