28 #ifndef EL_IR_PROXIMITY_H
29 #define EL_IR_PROXIMITY_H
35 #define EL_IR_PROXIMITY_VALUE_MAX 4095U
37 #define EL_IR_PROXIMITY_SENSOR_ALL -1
38 #define EL_IR_PROXIMITY_SENSOR_0 0
39 #define EL_IR_PROXIMITY_SENSOR_1 1
40 #define EL_IR_PROXIMITY_SENSOR_2 2
41 #define EL_IR_PROXIMITY_SENSOR_3 3
42 #define EL_IR_PROXIMITY_SENSOR_4 4
43 #define EL_IR_PROXIMITY_SENSOR_5 5
44 #define EL_IR_PROXIMITY_SENSOR_6 6
45 #define EL_IR_PROXIMITY_SENSOR_7 7
212 #ifdef EL_INCLUDE_LIB_INTERNAL_CONTEXT
214 extern bool el_irps_enabled;
215 extern uint8_t el_irps_working_mode;
216 extern uint8_t el_irps_working_phase;
217 extern void (*el_adc_callback_ir_proximity)(
const unsigned int*result_8v);
219 extern el_bool el_irps_is_calibrated;
221 extern el_uint16 el_irps_samples_Ambient[8];
222 extern el_uint16 el_irps_samples_Mixed[8];
223 extern el_uint16 el_irps_samples_Temp[8];
224 extern el_uint16 el_irps_samples_Noise[8];
225 extern el_uint16 el_irps_samples_NeutralReflection[8];
226 extern el_uint16 el_irps_samples_NeutralNoise[8];
228 void el_init_ir_proximity(
void);
229 void el_routine_ir_proximity_2400hz(
void);
int el_ir_proximity_get(el_index i, el_ir_proximity_output u, el_int16 *out)
get output value(s) from a accelerometer
use the Passive Mode
Definition: el_ir_proximity.h:55
use the Communication Mode (not implemented yet)
Definition: el_ir_proximity.h:58
get the data encoded (not implemented yet)
Definition: el_ir_proximity.h:83
el_uint16 EnvironmentalAmbient
the ambient infrared intensity in the environment, used to correct the the ambient output ...
Definition: el_ir_proximity.h:69
void el_disable_ir_proximity(void)
disable the proximity sensors module
get all of the three outputs
Definition: el_ir_proximity.h:84
el_ir_proximity_mode WorkingMode
the working mode of the proximity sensors
Definition: el_ir_proximity.h:68
el_ir_proximity_mode
Definition: el_ir_proximity.h:54
el_int16 Ambient
This value can be used to detect nearby e-pucks in the Emit Mode.
Definition: el_ir_proximity.h:92
void el_enable_ir_proximity(void)
enable the proximity sensors module
get the ambient output
Definition: el_ir_proximity.h:81
Definition: el_ir_proximity.h:67
el_ir_proximity_output
Definition: el_ir_proximity.h:80
void el_ir_proximity_options_apply()
apply the settings stored in el_ir_proximity_options directly
void el_config_ir_proximity(const el_ir_proximity_param *p)
apply the settings in the given structure
el_ir_proximity_param * el_ir_proximity_options()
get the pointer to a static instance of el_ir_proximity_param
el_int16 Message
(not implemented yet)
Definition: el_ir_proximity.h:94
void el_ir_proximity_options_reset()
reset the settings stored in el_ir_proximity_options to default
el_int16 Reflection
In all modes, this value can be used to detect passive things in the evnironment (e.g. obstacles and walls).
Definition: el_ir_proximity.h:93
el_uint32 el_ir_proximity_get_counter()
get total number of samples obtained since initialization
use the Emit Mode
Definition: el_ir_proximity.h:57
use the Pulse Mode (default mode)
Definition: el_ir_proximity.h:56
get the reflection output
Definition: el_ir_proximity.h:82
el_bool SubtractEA
whether to use EnvironmentalAmbient in the ambient output
Definition: el_ir_proximity.h:70
Definition: el_ir_proximity.h:91