81 uint8_t switch_val = 0;
84 switch_val |= (1 << i);
110 #define NUM_BOUNDS (8) 124 if (
bounds_[i].get_Num_Switches()) {
131 uint8_t bounds_val = 0;
134 bounds_val |= (1 << i);
141 uint8_t bound_val = 0;
156 #endif // !_BOUND_BOX_H_ Bound_Box & operator=(Bound_Box &&)=default
static Bound_Box & get_Instance()
Definition: bound_box.cpp:25
void update()
Definition: bound_box.h:122
void add_LimitSwitch(GPIO_TypeDef *gpio, uint16_t pin)
Add limit switch gpio to the bound.
Definition: bound_box.h:62
Definition: bound_box.h:41
uint8_t get_Bounds()
Definition: bound_box.h:130
Bound()
Definition: bound_box.h:44
uint8_t get_Bound(uint8_t fence_no)
Definition: bound_box.h:140
uint8_t num_switches_
Definition: bound_box.h:100
uint8_t get_Num_Switches()
Definition: bound_box.h:90
Face
Definition: bound_box.h:28
Bound< 2 > bounds_[NUM_BOUNDS]
Definition: bound_box.h:153
Bound_Box()
Definition: bound_box.h:149
void update()
Definition: bound_box.h:80
Bound & operator=(Bound &&)=default
uint8_t read()
Read which limit switches are pressed.
Definition: bound_box.h:78
#define NUM_BOUNDS
Definition: bound_box.h:110
uint8_t switch_state_
Definition: bound_box.h:101
~Bound_Box()
Definition: bound_box.h:116
uint16_t gpio_pins_[N]
Definition: bound_box.h:99
void clear()
Definition: bound_box.h:92
int init()
Definition: bound_box.cpp:32
Definition: bound_box.h:106
GPIO_TypeDef * gpios_[N]
Definition: bound_box.h:98
~Bound()
Definition: bound_box.h:49