kopia lustrzana https://github.com/pimoroni/pimoroni-pico
Renamed IOE's set_addr method to set_address
rodzic
3b9927fbef
commit
31edcf8f93
|
@ -372,7 +372,7 @@ namespace pimoroni {
|
|||
return ((uint16_t)i2c_reg_read_uint8(reg::CHIP_ID_H) << 8) | (uint16_t)i2c_reg_read_uint8(reg::CHIP_ID_L);
|
||||
}
|
||||
|
||||
void IOExpander::set_addr(uint8_t address) {
|
||||
void IOExpander::set_address(uint8_t address) {
|
||||
set_bit(reg::CTRL, 4);
|
||||
i2c_reg_write_uint8(reg::ADDR, address);
|
||||
this->address = address;
|
||||
|
|
|
@ -180,7 +180,7 @@ namespace pimoroni {
|
|||
|
||||
uint16_t get_chip_id();
|
||||
|
||||
void set_addr(uint8_t address);
|
||||
void set_address(uint8_t address);
|
||||
|
||||
float get_adc_vref();
|
||||
void set_adc_vref(float vref);
|
||||
|
|
|
@ -44,8 +44,8 @@ namespace pimoroni {
|
|||
return ioe.get_int();
|
||||
}
|
||||
|
||||
void BreakoutEncoder::set_addr(uint8_t i2c_addr) {
|
||||
ioe.set_addr(i2c_addr);
|
||||
void BreakoutEncoder::set_address(uint8_t address) {
|
||||
ioe.set_address(address);
|
||||
}
|
||||
|
||||
bool BreakoutEncoder::get_direction(void) {
|
||||
|
|
|
@ -77,7 +77,7 @@ namespace pimoroni {
|
|||
int get_int() const;
|
||||
|
||||
// Calls through to IOExpander class
|
||||
void set_addr(uint8_t i2c_addr);
|
||||
void set_address(uint8_t address);
|
||||
|
||||
// Encoder breakout specific
|
||||
bool get_direction();
|
||||
|
|
|
@ -47,8 +47,8 @@ namespace pimoroni {
|
|||
return ioe.get_int();
|
||||
}
|
||||
|
||||
void BreakoutMICS6814::set_addr(uint8_t i2c_addr) {
|
||||
ioe.set_addr(i2c_addr);
|
||||
void BreakoutMICS6814::set_address(uint8_t address) {
|
||||
ioe.set_address(address);
|
||||
}
|
||||
|
||||
float BreakoutMICS6814::get_adc_vref(void) {
|
||||
|
|
|
@ -76,7 +76,7 @@ namespace pimoroni {
|
|||
int get_int() const;
|
||||
|
||||
// Calls through to IOExpander class
|
||||
void set_addr(uint8_t i2c_addr);
|
||||
void set_address(uint8_t address);
|
||||
|
||||
float get_adc_vref();
|
||||
void set_adc_vref(float vref);
|
||||
|
|
|
@ -54,8 +54,8 @@ namespace pimoroni {
|
|||
return ioe.get_int();
|
||||
}
|
||||
|
||||
void BreakoutPotentiometer::set_addr(uint8_t i2c_addr) {
|
||||
ioe.set_addr(i2c_addr);
|
||||
void BreakoutPotentiometer::set_address(uint8_t address) {
|
||||
ioe.set_address(address);
|
||||
}
|
||||
|
||||
float BreakoutPotentiometer::get_adc_vref(void) {
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace pimoroni {
|
|||
int get_int() const;
|
||||
|
||||
// Calls through to IOExpander class
|
||||
void set_addr(uint8_t i2c_addr);
|
||||
void set_address(uint8_t address);
|
||||
|
||||
float get_adc_vref();
|
||||
void set_adc_vref(float vref);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***** Methods *****/
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutEncoder_set_addr_obj, 2, BreakoutEncoder_set_addr);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutEncoder_set_address_obj, 2, BreakoutEncoder_set_address);
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(BreakoutEncoder_get_direction_obj, BreakoutEncoder_get_direction);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutEncoder_set_direction_obj, 2, BreakoutEncoder_set_direction);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutEncoder_set_brightness_obj, 2, BreakoutEncoder_set_brightness);
|
||||
|
@ -15,7 +15,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(BreakoutEncoder_read_obj, BreakoutEncoder_read);
|
|||
|
||||
/***** Binding of Methods *****/
|
||||
STATIC const mp_rom_map_elem_t BreakoutEncoder_locals_dict_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_addr), MP_ROM_PTR(&BreakoutEncoder_set_addr_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_address), MP_ROM_PTR(&BreakoutEncoder_set_address_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_get_direction), MP_ROM_PTR(&BreakoutEncoder_get_direction_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_direction), MP_ROM_PTR(&BreakoutEncoder_set_direction_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_brightness), MP_ROM_PTR(&BreakoutEncoder_set_brightness_obj) },
|
||||
|
|
|
@ -110,7 +110,7 @@ mp_obj_t BreakoutEncoder_make_new(const mp_obj_type_t *type, size_t n_args, size
|
|||
}
|
||||
|
||||
/***** Methods *****/
|
||||
mp_obj_t BreakoutEncoder_set_addr(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
mp_obj_t BreakoutEncoder_set_address(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_self, ARG_address };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
||||
|
@ -122,7 +122,7 @@ mp_obj_t BreakoutEncoder_set_addr(size_t n_args, const mp_obj_t *pos_args, mp_ma
|
|||
|
||||
breakout_encoder_BreakoutEncoder_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_encoder_BreakoutEncoder_obj_t);
|
||||
|
||||
self->breakout->set_addr(args[ARG_address].u_int);
|
||||
self->breakout->set_address(args[ARG_address].u_int);
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ extern const mp_obj_type_t breakout_encoder_BreakoutEncoder_type;
|
|||
/***** Extern of Class Methods *****/
|
||||
extern void BreakoutEncoder_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind);
|
||||
extern mp_obj_t BreakoutEncoder_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args);
|
||||
extern mp_obj_t BreakoutEncoder_set_addr(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutEncoder_set_address(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutEncoder_get_direction(mp_obj_t self_in);
|
||||
extern mp_obj_t BreakoutEncoder_set_direction(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutEncoder_set_brightness(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***** Methods *****/
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutMICS6814_set_addr_obj, 2, BreakoutMICS6814_set_addr);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutMICS6814_set_address_obj, 2, BreakoutMICS6814_set_address);
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(BreakoutMICS6814_get_adc_vref_obj, BreakoutMICS6814_get_adc_vref);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutMICS6814_set_adc_vref_obj, 2, BreakoutMICS6814_set_adc_vref);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutMICS6814_set_brightness_obj, 2, BreakoutMICS6814_set_brightness);
|
||||
|
@ -24,7 +24,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(BreakoutMICS6814_read_oxidising_obj, BreakoutMICS6814_
|
|||
|
||||
/***** Binding of Methods *****/
|
||||
STATIC const mp_rom_map_elem_t BreakoutMICS6814_locals_dict_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_addr), MP_ROM_PTR(&BreakoutMICS6814_set_addr_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_address), MP_ROM_PTR(&BreakoutMICS6814_set_address_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_get_adc_vref), MP_ROM_PTR(&BreakoutMICS6814_get_adc_vref_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_adc_vref), MP_ROM_PTR(&BreakoutMICS6814_set_adc_vref_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_brightness), MP_ROM_PTR(&BreakoutMICS6814_set_brightness_obj) },
|
||||
|
|
|
@ -110,7 +110,7 @@ mp_obj_t BreakoutMICS6814_make_new(const mp_obj_type_t *type, size_t n_args, siz
|
|||
}
|
||||
|
||||
/***** Methods *****/
|
||||
mp_obj_t BreakoutMICS6814_set_addr(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
mp_obj_t BreakoutMICS6814_set_address(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_self, ARG_address };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
||||
|
@ -122,7 +122,7 @@ mp_obj_t BreakoutMICS6814_set_addr(size_t n_args, const mp_obj_t *pos_args, mp_m
|
|||
|
||||
breakout_mics6814_BreakoutMICS6814_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_mics6814_BreakoutMICS6814_obj_t);
|
||||
|
||||
self->breakout->set_addr(args[ARG_address].u_int);
|
||||
self->breakout->set_address(args[ARG_address].u_int);
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ extern const mp_obj_type_t breakout_mics6814_BreakoutMICS6814_type;
|
|||
/***** Extern of Class Methods *****/
|
||||
extern void BreakoutMICS6814_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind);
|
||||
extern mp_obj_t BreakoutMICS6814_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args);
|
||||
extern mp_obj_t BreakoutMICS6814_set_addr(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutMICS6814_set_address(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutMICS6814_get_adc_vref(mp_obj_t self_in);
|
||||
extern mp_obj_t BreakoutMICS6814_set_adc_vref(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutMICS6814_set_brightness(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***** Methods *****/
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutPotentiometer_set_addr_obj, 2, BreakoutPotentiometer_set_addr);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutPotentiometer_set_address_obj, 2, BreakoutPotentiometer_set_address);
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(BreakoutPotentiometer_get_adc_vref_obj, BreakoutPotentiometer_get_adc_vref);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutPotentiometer_set_adc_vref_obj, 2, BreakoutPotentiometer_set_adc_vref);
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(BreakoutPotentiometer_get_direction_obj, BreakoutPotentiometer_get_direction);
|
||||
|
@ -17,7 +17,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(BreakoutPotentiometer_read_as_percent_obj, BreakoutPot
|
|||
|
||||
/***** Binding of Methods *****/
|
||||
STATIC const mp_rom_map_elem_t BreakoutPotentiometer_locals_dict_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_addr), MP_ROM_PTR(&BreakoutPotentiometer_set_addr_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_address), MP_ROM_PTR(&BreakoutPotentiometer_set_address_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_get_adc_vref), MP_ROM_PTR(&BreakoutPotentiometer_get_adc_vref_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_adc_vref), MP_ROM_PTR(&BreakoutPotentiometer_set_adc_vref_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_get_direction), MP_ROM_PTR(&BreakoutPotentiometer_get_direction_obj) },
|
||||
|
|
|
@ -110,7 +110,7 @@ mp_obj_t BreakoutPotentiometer_make_new(const mp_obj_type_t *type, size_t n_args
|
|||
}
|
||||
|
||||
/***** Methods *****/
|
||||
mp_obj_t BreakoutPotentiometer_set_addr(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
mp_obj_t BreakoutPotentiometer_set_address(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_self, ARG_address };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
||||
|
@ -122,7 +122,7 @@ mp_obj_t BreakoutPotentiometer_set_addr(size_t n_args, const mp_obj_t *pos_args,
|
|||
|
||||
breakout_potentiometer_BreakoutPotentiometer_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_potentiometer_BreakoutPotentiometer_obj_t);
|
||||
|
||||
self->breakout->set_addr(args[ARG_address].u_int);
|
||||
self->breakout->set_address(args[ARG_address].u_int);
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ extern const mp_obj_type_t breakout_potentiometer_BreakoutPotentiometer_type;
|
|||
/***** Extern of Class Methods *****/
|
||||
extern void BreakoutPotentiometer_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind);
|
||||
extern mp_obj_t BreakoutPotentiometer_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args);
|
||||
extern mp_obj_t BreakoutPotentiometer_set_addr(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutPotentiometer_set_address(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutPotentiometer_get_adc_vref(mp_obj_t self_in);
|
||||
extern mp_obj_t BreakoutPotentiometer_set_adc_vref(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutPotentiometer_get_direction(mp_obj_t self_in);
|
||||
|
|
Ładowanie…
Reference in New Issue