INF2004-Project v0.1
 
Loading...
Searching...
No Matches
ir_sensor.h
Go to the documentation of this file.
1
12#ifndef IR_SENSOR_H // Include guard.
13#define IR_SENSOR_H
14#include "pico/types.h"
15#include "irline/barcode.h"
16
21typedef struct ir_flags
22{
23 bool top_wall;
24 bool left_wall;
26
27// Function prototypes.
28//
29void ir_setup_adc_pin(uint adc_pin);
30void ir_setup_gpio_pin(uint gpio_pin);
32uint16_t ir_read_line(uint gpio_pin_in);
35uint16_t ir_find_wall_directions(uint gpio_pin_left, uint gpio_pin_right);
36
37#endif // IR_SENSOR_H
38
39// End of file driver/ir_sensor/ir_sensor.h.
Header file for the barcode driver.
barcode_line_type_t
Enum for the barcode line types (black or white, thin or thick). None for error handling.
Definition: barcode.h:125
void ir_update_left_flag(ir_flags_t *flag)
Indicates whether there is a left wall.
Definition: ir_sensor.c:73
void ir_update_top_flag(ir_flags_t *flag)
Indicates whether there is a top wall.
Definition: ir_sensor.c:62
void ir_setup_adc_pin(uint adc_pin)
Initalises the analog pins for the IR sensor to ADC.
Definition: ir_sensor.c:24
uint16_t ir_find_wall_directions(uint gpio_pin_left, uint gpio_pin_right)
This returns the information of the walls in the node.
Definition: ir_sensor.c:87
barcode_line_type_t ir_read_barcode(void)
This function reads the barcode and determines the colour and the thickness.
Definition: ir_sensor.c:109
uint16_t ir_read_line(uint gpio_pin_in)
Detects line.
Definition: ir_sensor.c:50
struct ir_flags ir_flags_t
Indicates whether the IR line sensor detects walls on the top and left sides.
void ir_setup_gpio_pin(uint gpio_pin)
Initialises the digital pin for the IR sensor.
Definition: ir_sensor.c:37
Indicates whether the IR line sensor detects walls on the top and left sides.
Definition: ir_sensor.h:22
bool top_wall
Indicates whether there is a top wall.
Definition: ir_sensor.h:23
bool left_wall
Indicates whether there is a left wall.
Definition: ir_sensor.h:24