embedded system library for e-puck  1.0.1
A redesigned API library for the e-puck robot platform
 All Data Structures Files Functions Variables Enumerations Enumerator Modules Pages
el_ir_proximity.h
Go to the documentation of this file.
1 /*
2 
3 embedded system library for e-puck
4 
5 --------------------------------------------------------------------------------
6 
7 code distribution:
8 https://github.com/jianingchen/epucklib
9 
10 online documentation:
11 http://jianingchen.github.io/epucklib/html/
12 
13 --------------------------------------------------------------------------------
14 
15 This file is released under the terms of the MIT license (see "el.h").
16 
17 */
18 
28 #ifndef EL_IR_PROXIMITY_H
29 #define EL_IR_PROXIMITY_H
30 
31 #include "el_common.h"
32 #include "el_clock.h"
33 #include "el_trigger.h"
34 
35 #define EL_IR_PROXIMITY_VALUE_MAX 4095U
36 
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
46 
54 typedef enum {
60 
61 
67 typedef struct {
70  el_bool SubtractEA;
72 
73 
80 typedef enum {
86 
91 typedef struct {
92  el_int16 Ambient;
93  el_int16 Reflection;
94  el_int16 Message;
96 
97 /*
98 --------------------------------------------------------------------------------
99 */
100 
101 
106 void el_enable_ir_proximity(void);
107 
108 
113 void el_disable_ir_proximity(void);
114 
115 
122 
129 
130 
138 
139 
155 
156 
194 int el_ir_proximity_get(el_index i,el_ir_proximity_output u,el_int16*out);
195 
196 
204 el_uint32 el_ir_proximity_get_counter();
205 
206 
207 /*
208 --------------------------------------------------------------------------------
209 */
210 
211 
212 #ifdef EL_INCLUDE_LIB_INTERNAL_CONTEXT
213 
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);
218 
219 extern el_bool el_irps_is_calibrated;
220 
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];// need calibration
226 extern el_uint16 el_irps_samples_NeutralNoise[8];
227 
228 void el_init_ir_proximity(void);
229 void el_routine_ir_proximity_2400hz(void);
230 
231 #endif
232 
233 #endif
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