# C Common types The fttypes.h header defines a range of useful types and values the C interface relies on. It includes the connector types, sensor types, measurement modes and many more. | Content | | ---------------------------------------------- | | [ftobjects_connections]() | | [ftinput_modes]() | | [ftinputs_components]() | | [ft_txt_mode]() | | [ft_event]() | | [ft_bevent]() | | [ft_faults_flag]()| ### ftobjects_connection This enum defines values for all connectors of the TXT 4.0. These values are used in the [allocation of devices](c_allocators.md#allocators). | Name | Value | Connector | | ------------- | ------------- | ---------------- | | ftdev_unknown | 0 | unknown connector | | ftdev_txt | 1 | TXT itself | | ftdev_i1 | 2 | I1 | | ftdev_i2 | 3 | I2 | | ftdev_i3 | 4 | I3 | | ftdev_i4 | 5 | I4 | | ftdev_i5 | 6 | I5 | | ftdev_i6 | 7 | I6 | | ftdev_i7 | 8 | I7 | | ftdev_i8 | 9 | I8 | | ftdev_o1 | 10 | O1 | | ftdev_m1 | 10 | M1 | | ftdev_o2 | 11 | O2 | | ftdev_o3 | 12 | O3 | | ftdev_m2 | 12 | M2 | | ftdev_o4 | 13 | O4 | | ftdev_o5 | 14 | O5 | | ftdev_m3 | 14 | M3 | | ftdev_o6 | 15 | O6 | | ftdev_o7 | 16 | O7 | | ftdev_m4 | 16 | M4 | | ftdev_o8 | 17 | O8 | | ftdev_c1 | 18 | C1 | | ftdev_c2 | 19 | C2 | | ftdev_c3 | 20 | C3 | | ftdev_c4 | 21 | C4 | | ftdev_s1 | 22 | S1 | | ftdev_s2 | 23 | S2 | | ftdev_s3 | 24 | S3 | | ftdev_max | 25 | max connectors | ### ftinput_modes This enum defines the measurement modes and resolutions for input devices. These are used when manually allocating a sensor and are returned by the function [ftop_alloc_mode](c_allocators.md#span-classtype-idallocmodeintspan-ftopallocmodespan-classtypefttxt2-spantxt-span-classtypeintspan-num). | Name | Value | Description | | ------------- | ------------- | ---------------- | | ftinp_unknown | 0 | unconfigured input | | ftinp_active | 0 | active input | | ftinp_passive | 1 | passive input | | ftinp_digital | 2 | digital input | | ftinp_analog | 4 | analog input | | ftinp_ultrasonic | 8 | ultrasonic input | | ftinp_r1 | 0 | normal range (0 - 5 V) | | ftinp_r2 | 16 | extended range (0 - 9 V) | ### ftinputs_components The ftinputs_components enum defines the different input devices that are supported by the C-API. These are used when manually allocating an input device. Also, the function [ft_alloc_code](c_allocators.md#span-classtype-idalloccodeintspan-ftopalloccodespan-classtypefttxt2-spantxt-span-classtypeintspan-num) returns these values to characterize the given sensor. | Name | Value | Description | | ---------------------- | ------------- | -------------------- | | ftinput_unknown | 0 | unconfigured input | | ftinput_switch | 1 | switch input | | ftinput_voltage | 2 | voltage input | | ftinput_resistor | 3 | resistor input | | ftinput_termistor | 4 | thermistor input | | ftinput_color_sensor | 5 | color sensor input | | ftinput_trail_follower | 6 | trail follower input | | ftinput_ultrasonic | 7 | ultrasonic input | | ftinput_digital | 8 | digital input | | ftinput_encoder | 9 | encoder | | ftinput_max | 10 | max input components | ### ft_txt_mode The ft_txt_mode enum defines the different communication modes the TXT 4.0 can be set to. They are used by the function [ftop_txt_mode](c_slave.md#span-classtype-idtxtmodevoidspan-ftoptxtmodespan-classtypefttxt2-spandevice-span-classtypeintspan-mode). | Name | Value | Description | | ------------- | ------------- | ---------------- | | ft_txt_single | 0 | single mode | | ft_txt_master | 1 | master mode | | ft_txt_slave | 2 | slave mode | ### ft_event This enum defines events for different TXT updates. | Name | Value | Description | | ---------------------- | ------------- | ------------------ | | ft_event_info_update | 0 | common info update | | ft_event_values_update | 1 | value update | | ft_event_slaves_update | 2 | slaves set update | | ft_event_faults_update | 3 | faults update | | ft_event_max | 4 | max event | ### ft_bevents The enum ft_bevents defines event bits based on [ft_event](#ftevent). These are used to build event bit masks for event listening via [ftop_wait_event()](c_operations.md#span-classtype-idwaiteventintspan-ftopwaiteventspan-classtypevoid-spandevice-span-classtypeuint32tspan-emask). | Name | Value | Description | | ----------------------- | ------------- | ------------------ | | ft_bevent_info_update | 1 | common info update | | ft_bevent_values_update | 2 | value update | | ft_bevent_slaves_update | 4 | slaves set update | | ft_bevent_faults_update | 8 | faults update | ### ft_faults_flags The enum ft_faults_flags defines various TXT board related faults. | Name | Value | Description | | -------- | ------------- | ------------------------ | | FTF_OVP | 2 | overvoltage | | FTF_UVLO | 4 | undervoltage lock-out | | FTF_OCP | 8 | overcurrent | | FTF_OLD | 16 | open load | | FTF_OTW | 32 | overtemperature warning | | FTF_OTSD | 64 | overtemperature shutdown |