kopia lustrzana https://github.com/pimoroni/pimoroni-pico
Micropython bindings and example for MSA301
rodzic
c4b166d4d9
commit
ea460f9519
|
@ -30,6 +30,22 @@ namespace pimoroni {
|
|||
sleep_ms(1);
|
||||
}
|
||||
|
||||
i2c_inst_t* MSA301::get_i2c() const {
|
||||
return i2c;
|
||||
}
|
||||
|
||||
int MSA301::get_sda() const {
|
||||
return sda;
|
||||
}
|
||||
|
||||
int MSA301::get_scl() const {
|
||||
return scl;
|
||||
}
|
||||
|
||||
int MSA301::get_int() const {
|
||||
return interrupt;
|
||||
}
|
||||
|
||||
uint8_t MSA301::part_id() {
|
||||
return i2c_reg_read_uint8(PART_ID);
|
||||
}
|
||||
|
@ -71,7 +87,7 @@ namespace pimoroni {
|
|||
i2c_reg_write_uint8(RESOLUTION_RANGE, range | resolution);
|
||||
}
|
||||
|
||||
void MSA301::set_axis_polarity(int polarity) {
|
||||
void MSA301::set_axis_polarity(uint8_t polarity) {
|
||||
i2c_reg_write_uint8(SET_AXIS_POLARITY, polarity);
|
||||
}
|
||||
|
||||
|
@ -79,7 +95,7 @@ namespace pimoroni {
|
|||
enable_interrupts(MSA301::Interrupt::NONE);
|
||||
}
|
||||
|
||||
void MSA301::enable_interrupts(int interrupts) {
|
||||
void MSA301::enable_interrupts(uint16_t interrupts) {
|
||||
i2c_reg_write_uint8(INTERRUPT_ENABLE_0, interrupts & 0xff);
|
||||
i2c_reg_write_uint8(INTERRUPT_ENABLE_1, (interrupts & 0xff00) >> 8);
|
||||
}
|
||||
|
|
|
@ -132,6 +132,11 @@ namespace pimoroni {
|
|||
void init();
|
||||
void reset();
|
||||
|
||||
i2c_inst_t* get_i2c() const;
|
||||
int get_sda() const;
|
||||
int get_scl() const;
|
||||
int get_int() const;
|
||||
|
||||
uint8_t part_id();
|
||||
float get_axis(Axis axis, uint8_t sample_count = 1);
|
||||
float get_x_axis(uint8_t sample_count = 1);
|
||||
|
@ -141,10 +146,10 @@ namespace pimoroni {
|
|||
|
||||
void set_power_mode(MSA301::PowerMode power_mode);
|
||||
void set_range_and_resolution(Range range, MSA301::Resolution resolution);
|
||||
void set_axis_polarity(int polarity);
|
||||
void set_axis_polarity(uint8_t polarity);
|
||||
|
||||
void disable_all_interrupts();
|
||||
void enable_interrupts(int interrupts);
|
||||
void enable_interrupts(uint16_t interrupts);
|
||||
void set_interrupt_latch(InterruptLatchPeriod latch_period, bool reset_latched);
|
||||
bool read_interrupt(Interrupt interrupt);
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
import time
|
||||
from breakout_msa301 import BreakoutMSA301
|
||||
|
||||
msa = BreakoutMSA301()
|
||||
|
||||
part_id = msa.part_id()
|
||||
print("Found MSA301. Part ID: 0x", '{:02x}'.format(part_id), sep="")
|
||||
|
||||
msa.enable_interrupts(BreakoutMSA301.FREEFALL | BreakoutMSA301.ORIENTATION)
|
||||
|
||||
while True:
|
||||
print("X:", msa.get_x_axis(), end=",\t")
|
||||
print("Y:", msa.get_y_axis(), end=",\t")
|
||||
print("Z:", msa.get_z_axis(), end=",\t")
|
||||
print("Freefall?", msa.read_interrupt(BreakoutMSA301.FREEFALL), end=",\t")
|
||||
print("Orientation:", msa.get_orientation())
|
||||
time.sleep(0.1)
|
|
@ -0,0 +1,113 @@
|
|||
#include "breakout_msa301.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// BreakoutMSA301 Class
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***** Methods *****/
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(BreakoutMSA301_part_id_obj, BreakoutMSA301_part_id);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutMSA301_get_axis_obj, 2, BreakoutMSA301_get_axis);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutMSA301_get_x_axis_obj, 1, BreakoutMSA301_get_x_axis);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutMSA301_get_y_axis_obj, 1, BreakoutMSA301_get_y_axis);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutMSA301_get_z_axis_obj, 1, BreakoutMSA301_get_z_axis);
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(BreakoutMSA301_get_orientation_obj, BreakoutMSA301_get_orientation);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutMSA301_set_power_mode_obj, 2, BreakoutMSA301_set_power_mode);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutMSA301_set_range_and_resolution_obj, 2, BreakoutMSA301_set_range_and_resolution);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutMSA301_set_axis_polarity_obj, 2, BreakoutMSA301_set_axis_polarity);
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(BreakoutMSA301_disable_all_interrupts_obj, BreakoutMSA301_disable_all_interrupts);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutMSA301_enable_interrupts_obj, 2, BreakoutMSA301_enable_interrupts);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutMSA301_set_interrupt_latch_obj, 3, BreakoutMSA301_set_interrupt_latch);
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutMSA301_read_interrupt_obj, 2, BreakoutMSA301_read_interrupt);
|
||||
|
||||
/***** Binding of Methods *****/
|
||||
STATIC const mp_rom_map_elem_t BreakoutMSA301_locals_dict_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR_part_id), MP_ROM_PTR(&BreakoutMSA301_part_id_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_get_axis), MP_ROM_PTR(&BreakoutMSA301_get_axis_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_get_x_axis), MP_ROM_PTR(&BreakoutMSA301_get_x_axis_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_get_y_axis), MP_ROM_PTR(&BreakoutMSA301_get_y_axis_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_get_z_axis), MP_ROM_PTR(&BreakoutMSA301_get_z_axis_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_get_orientation), MP_ROM_PTR(&BreakoutMSA301_get_orientation_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_power_mode), MP_ROM_PTR(&BreakoutMSA301_set_power_mode_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_range_and_resolution), MP_ROM_PTR(&BreakoutMSA301_set_range_and_resolution_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_axis_polarity), MP_ROM_PTR(&BreakoutMSA301_set_axis_polarity_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_disable_all_interrupts), MP_ROM_PTR(&BreakoutMSA301_disable_all_interrupts_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_enable_interrupts), MP_ROM_PTR(&BreakoutMSA301_enable_interrupts_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_interrupt_latch), MP_ROM_PTR(&BreakoutMSA301_set_interrupt_latch_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_read_interrupt), MP_ROM_PTR(&BreakoutMSA301_read_interrupt_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_X), MP_ROM_INT(MSA_AXIS_X) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_Y), MP_ROM_INT(MSA_AXIS_Y) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_Z), MP_ROM_INT(MSA_AXIS_Z) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PORTRAIT), MP_ROM_INT(MSA_PORTRAIT) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PORTRAIT_INVERTED), MP_ROM_INT(MSA_PORTRAIT_INVERTED) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LANDSCAPE), MP_ROM_INT(MSA_LANDSCAPE) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LANDSCAPE_INVERTED), MP_ROM_INT(MSA_LANDSCAPE_INVERTED) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_NORMAL), MP_ROM_INT(MSA_NORMAL) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LOW), MP_ROM_INT(MSA_LOW) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_SUSPEND), MP_ROM_INT(MSA_SUSPEND) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_G_2), MP_ROM_INT(MSA_G_2) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_G_4), MP_ROM_INT(MSA_G_4) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_G_8), MP_ROM_INT(MSA_G_8) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_G_16), MP_ROM_INT(MSA_G_16) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_BITS_14), MP_ROM_INT(MSA_BITS_14) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_BITS_12), MP_ROM_INT(MSA_BITS_12) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_BITS_10), MP_ROM_INT(MSA_BITS_10) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_BITS_8), MP_ROM_INT(MSA_BITS_8) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_INVERT_X), MP_ROM_INT(MSA_INVERT_X) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_INVERT_Y), MP_ROM_INT(MSA_INVERT_Y) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_INVERT_Z), MP_ROM_INT(MSA_INVERT_Z) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_XY_SWAP), MP_ROM_INT(MSA_XY_SWAP) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_NONE), MP_ROM_INT(MSA_NONE) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_ACTIVE), MP_ROM_INT(MSA_ACTIVE) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_NEW_DATA), MP_ROM_INT(MSA_NEW_DATA) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_FREEFALL), MP_ROM_INT(MSA_FREEFALL) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_ORIENTATION), MP_ROM_INT(MSA_ORIENTATION) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_SINGLE_TAP), MP_ROM_INT(MSA_SINGLE_TAP) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_DOUBLE_TAP), MP_ROM_INT(MSA_DOUBLE_TAP) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_Z_ACTIVE), MP_ROM_INT(MSA_Z_ACTIVE) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_Y_ACTIVE), MP_ROM_INT(MSA_Y_ACTIVE) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_X_ACTIVE), MP_ROM_INT(MSA_X_ACTIVE) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LATCH_1MS), MP_ROM_INT(MSA_LATCH_1MS) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LATCH_2MS), MP_ROM_INT(MSA_LATCH_2MS) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LATCH_25MS), MP_ROM_INT(MSA_LATCH_25MS) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LATCH_50MS), MP_ROM_INT(MSA_LATCH_50MS) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LATCH_100MS), MP_ROM_INT(MSA_LATCH_100MS) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LATCH_250MS), MP_ROM_INT(MSA_LATCH_250MS) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LATCH_500MS), MP_ROM_INT(MSA_LATCH_500MS) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LATCH_1S), MP_ROM_INT(MSA_LATCH_1S) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LATCH_2S), MP_ROM_INT(MSA_LATCH_2S) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LATCH_4S), MP_ROM_INT(MSA_LATCH_4S) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LATCH_8S), MP_ROM_INT(MSA_LATCH_8S) },
|
||||
};
|
||||
STATIC MP_DEFINE_CONST_DICT(BreakoutMSA301_locals_dict, BreakoutMSA301_locals_dict_table);
|
||||
|
||||
/***** Class Definition *****/
|
||||
const mp_obj_type_t breakout_msa301_BreakoutMSA301_type = {
|
||||
{ &mp_type_type },
|
||||
.name = MP_QSTR_breakout_msa301,
|
||||
.print = BreakoutMSA301_print,
|
||||
.make_new = BreakoutMSA301_make_new,
|
||||
.locals_dict = (mp_obj_dict_t*)&BreakoutMSA301_locals_dict,
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// breakout_msa301 Module
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***** Globals Table *****/
|
||||
STATIC const mp_map_elem_t breakout_msa301_globals_table[] = {
|
||||
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_breakout_msa301) },
|
||||
{ MP_OBJ_NEW_QSTR(MP_QSTR_BreakoutMSA301), (mp_obj_t)&breakout_msa301_BreakoutMSA301_type },
|
||||
};
|
||||
STATIC MP_DEFINE_CONST_DICT(mp_module_breakout_msa301_globals, breakout_msa301_globals_table);
|
||||
|
||||
/***** Module Definition *****/
|
||||
const mp_obj_module_t breakout_msa301_user_cmodule = {
|
||||
.base = { &mp_type_module },
|
||||
.globals = (mp_obj_dict_t*)&mp_module_breakout_msa301_globals,
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
MP_REGISTER_MODULE(MP_QSTR_breakout_msa301, breakout_msa301_user_cmodule, MODULE_BREAKOUT_MSA301_ENABLED);
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
@ -0,0 +1,374 @@
|
|||
#include "../../../libraries/breakout_msa301/breakout_msa301.hpp"
|
||||
|
||||
#define MP_OBJ_TO_PTR2(o, t) ((t *)(uintptr_t)(o))
|
||||
|
||||
// SDA/SCL on even/odd pins, I2C0/I2C1 on even/odd pairs of pins.
|
||||
#define IS_VALID_SCL(i2c, pin) (((pin) & 1) == 1 && (((pin) & 2) >> 1) == (i2c))
|
||||
#define IS_VALID_SDA(i2c, pin) (((pin) & 1) == 0 && (((pin) & 2) >> 1) == (i2c))
|
||||
|
||||
|
||||
using namespace pimoroni;
|
||||
|
||||
extern "C" {
|
||||
#include "breakout_msa301.h"
|
||||
|
||||
/***** Variables Struct *****/
|
||||
typedef struct _breakout_msa301_BreakoutMSA301_obj_t {
|
||||
mp_obj_base_t base;
|
||||
BreakoutMSA301 *breakout;
|
||||
} breakout_msa301_BreakoutMSA301_obj_t;
|
||||
|
||||
/***** Print *****/
|
||||
void BreakoutMSA301_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
|
||||
(void)kind; //Unused input parameter
|
||||
breakout_msa301_BreakoutMSA301_obj_t *self = MP_OBJ_TO_PTR2(self_in, breakout_msa301_BreakoutMSA301_obj_t);
|
||||
BreakoutMSA301* breakout = self->breakout;
|
||||
mp_print_str(print, "BreakoutMSA301(");
|
||||
|
||||
mp_print_str(print, "i2c = ");
|
||||
mp_obj_print_helper(print, mp_obj_new_int((breakout->get_i2c() == i2c0) ? 0 : 1), PRINT_REPR);
|
||||
|
||||
mp_print_str(print, ", sda = ");
|
||||
mp_obj_print_helper(print, mp_obj_new_int(breakout->get_sda()), PRINT_REPR);
|
||||
|
||||
mp_print_str(print, ", scl = ");
|
||||
mp_obj_print_helper(print, mp_obj_new_int(breakout->get_scl()), PRINT_REPR);
|
||||
|
||||
mp_print_str(print, ", int = ");
|
||||
mp_obj_print_helper(print, mp_obj_new_int(breakout->get_int()), PRINT_REPR);
|
||||
|
||||
mp_print_str(print, ")");
|
||||
}
|
||||
|
||||
/***** Constructor *****/
|
||||
mp_obj_t BreakoutMSA301_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
|
||||
breakout_msa301_BreakoutMSA301_obj_t *self = nullptr;
|
||||
|
||||
if(n_args == 0) {
|
||||
mp_arg_check_num(n_args, n_kw, 0, 0, true);
|
||||
self = m_new_obj(breakout_msa301_BreakoutMSA301_obj_t);
|
||||
self->base.type = &breakout_msa301_BreakoutMSA301_type;
|
||||
self->breakout = new BreakoutMSA301();
|
||||
}
|
||||
else {
|
||||
enum { ARG_i2c, ARG_sda, ARG_scl, ARG_interrupt };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_i2c, MP_ARG_REQUIRED | MP_ARG_INT },
|
||||
{ MP_QSTR_sda, MP_ARG_REQUIRED | MP_ARG_INT },
|
||||
{ MP_QSTR_scl, MP_ARG_REQUIRED | MP_ARG_INT },
|
||||
{ MP_QSTR_interrupt, MP_ARG_INT, {.u_int = BreakoutMSA301::PIN_UNUSED} },
|
||||
};
|
||||
|
||||
// Parse args.
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
// Get I2C bus.
|
||||
int i2c_id = args[ARG_i2c].u_int;
|
||||
if(i2c_id < 0 || i2c_id > 1) {
|
||||
mp_raise_msg_varg(&mp_type_ValueError, MP_ERROR_TEXT("I2C(%d) doesn't exist"), i2c_id);
|
||||
}
|
||||
|
||||
int sda = args[ARG_sda].u_int;
|
||||
if (!IS_VALID_SDA(i2c_id, sda)) {
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("bad SDA pin"));
|
||||
}
|
||||
|
||||
int scl = args[ARG_scl].u_int;
|
||||
if (!IS_VALID_SCL(i2c_id, scl)) {
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("bad SCL pin"));
|
||||
}
|
||||
|
||||
self = m_new_obj(breakout_msa301_BreakoutMSA301_obj_t);
|
||||
self->base.type = &breakout_msa301_BreakoutMSA301_type;
|
||||
|
||||
i2c_inst_t *i2c = (i2c_id == 0) ? i2c0 : i2c1;
|
||||
self->breakout = new BreakoutMSA301(i2c, sda, scl, args[ARG_interrupt].u_int);
|
||||
}
|
||||
|
||||
self->breakout->init();
|
||||
|
||||
return MP_OBJ_FROM_PTR(self);
|
||||
}
|
||||
|
||||
/***** Methods *****/
|
||||
mp_obj_t BreakoutMSA301_part_id(mp_obj_t self_in) {
|
||||
breakout_msa301_BreakoutMSA301_obj_t *self = MP_OBJ_TO_PTR2(self_in, breakout_msa301_BreakoutMSA301_obj_t);
|
||||
return mp_obj_new_int(self->breakout->part_id());
|
||||
}
|
||||
|
||||
mp_obj_t BreakoutMSA301_get_axis(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_self, ARG_axis, ARG_sample_count };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
||||
{ MP_QSTR_axis, MP_ARG_REQUIRED | MP_ARG_INT },
|
||||
{ MP_QSTR_sample_count, MP_ARG_INT, {.u_int = 1} },
|
||||
};
|
||||
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
breakout_msa301_BreakoutMSA301_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_msa301_BreakoutMSA301_obj_t);
|
||||
|
||||
int sample_count = args[ARG_sample_count].u_int;
|
||||
if(sample_count < 0 || sample_count > 255)
|
||||
mp_raise_ValueError("sample_count out of range. Expected 0 to 255");
|
||||
else {
|
||||
float value = 0.0f;
|
||||
switch(args[ARG_axis].u_int) {
|
||||
case MSA_AXIS_X:
|
||||
value = self->breakout->get_axis(BreakoutMSA301::X, sample_count);
|
||||
break;
|
||||
case MSA_AXIS_Y:
|
||||
value = self->breakout->get_axis(BreakoutMSA301::Y, sample_count);
|
||||
break;
|
||||
case MSA_AXIS_Z:
|
||||
value = self->breakout->get_axis(BreakoutMSA301::Z, sample_count);
|
||||
break;
|
||||
default:
|
||||
mp_raise_ValueError("axis out of range. Expected 0 to 2 (X, Y, Z)");
|
||||
break;
|
||||
}
|
||||
|
||||
return mp_obj_new_float(value);
|
||||
}
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
|
||||
mp_obj_t BreakoutMSA301_get_x_axis(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_self, ARG_sample_count };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
||||
{ MP_QSTR_sample_count, MP_ARG_INT, {.u_int = 1} },
|
||||
};
|
||||
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
breakout_msa301_BreakoutMSA301_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_msa301_BreakoutMSA301_obj_t);
|
||||
|
||||
int sample_count = args[ARG_sample_count].u_int;
|
||||
if(sample_count < 0 || sample_count > 255)
|
||||
mp_raise_ValueError("sample_count out of range. Expected 0 to 255");
|
||||
else
|
||||
return mp_obj_new_float(self->breakout->get_x_axis(sample_count));
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
|
||||
mp_obj_t BreakoutMSA301_get_y_axis(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_self, ARG_sample_count };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
||||
{ MP_QSTR_sample_count, MP_ARG_INT, {.u_int = 1} },
|
||||
};
|
||||
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
breakout_msa301_BreakoutMSA301_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_msa301_BreakoutMSA301_obj_t);
|
||||
|
||||
int sample_count = args[ARG_sample_count].u_int;
|
||||
if(sample_count < 0 || sample_count > 255)
|
||||
mp_raise_ValueError("sample_count out of range. Expected 0 to 255");
|
||||
else
|
||||
return mp_obj_new_float(self->breakout->get_y_axis(sample_count));
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
|
||||
mp_obj_t BreakoutMSA301_get_z_axis(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_self, ARG_sample_count };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
||||
{ MP_QSTR_sample_count, MP_ARG_INT, {.u_int = 1} },
|
||||
};
|
||||
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
breakout_msa301_BreakoutMSA301_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_msa301_BreakoutMSA301_obj_t);
|
||||
|
||||
int sample_count = args[ARG_sample_count].u_int;
|
||||
if(sample_count < 0 || sample_count > 255)
|
||||
mp_raise_ValueError("sample_count out of range. Expected 0 to 255");
|
||||
else
|
||||
return mp_obj_new_float(self->breakout->get_z_axis(sample_count));
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
|
||||
mp_obj_t BreakoutMSA301_get_orientation(mp_obj_t self_in) {
|
||||
breakout_msa301_BreakoutMSA301_obj_t *self = MP_OBJ_TO_PTR2(self_in, breakout_msa301_BreakoutMSA301_obj_t);
|
||||
return mp_obj_new_int(self->breakout->get_orientation());
|
||||
}
|
||||
|
||||
mp_obj_t BreakoutMSA301_set_power_mode(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_self, ARG_power_mode };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
||||
{ MP_QSTR_power_mode, MP_ARG_REQUIRED | MP_ARG_INT },
|
||||
};
|
||||
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
breakout_msa301_BreakoutMSA301_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_msa301_BreakoutMSA301_obj_t);
|
||||
|
||||
int power_mode = args[ARG_power_mode].u_int;
|
||||
if(power_mode < 0 || power_mode > 255)
|
||||
mp_raise_ValueError("power_mode out of range. Expected 0 to 2 (NORMAL, LOW, SUSPEND)");
|
||||
else
|
||||
self->breakout->set_power_mode((BreakoutMSA301::PowerMode)power_mode);
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
|
||||
mp_obj_t BreakoutMSA301_set_range_and_resolution(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_self, ARG_range, ARG_resolution };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
||||
{ MP_QSTR_range, MP_ARG_REQUIRED | MP_ARG_INT },
|
||||
{ MP_QSTR_resolution, MP_ARG_REQUIRED | MP_ARG_INT },
|
||||
};
|
||||
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
breakout_msa301_BreakoutMSA301_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_msa301_BreakoutMSA301_obj_t);
|
||||
|
||||
int range = args[ARG_range].u_int;
|
||||
int resolution = args[ARG_resolution].u_int;
|
||||
if(range < 0 || range > 3)
|
||||
mp_raise_ValueError("range out of range. Expected 0 to 3 (G_2, G_4, G_8, G_16)");
|
||||
if(resolution < 0 || resolution > 3)
|
||||
mp_raise_ValueError("resolution out of range. Expected 0 to 3 (BITS_14, BITS_12, BITS_10, BITS_8)");
|
||||
else
|
||||
self->breakout->set_range_and_resolution((BreakoutMSA301::Range)range, (BreakoutMSA301::Resolution)(resolution << 2));
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
|
||||
mp_obj_t BreakoutMSA301_set_axis_polarity(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_self, ARG_polarity };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
||||
{ MP_QSTR_polarity, MP_ARG_REQUIRED | MP_ARG_INT },
|
||||
};
|
||||
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
breakout_msa301_BreakoutMSA301_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_msa301_BreakoutMSA301_obj_t);
|
||||
|
||||
int polarity = args[ARG_polarity].u_int;
|
||||
if(polarity < 0 || polarity > 15)
|
||||
mp_raise_ValueError("polarity out of range. Expected 0 or the bitwise combination of 1 (INVERT_X), 2 (INVERT_Y), 4 (INVERT_Z), or 8 (XY_SWAP)");
|
||||
else
|
||||
self->breakout->set_axis_polarity(polarity);
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
|
||||
mp_obj_t BreakoutMSA301_disable_all_interrupts(mp_obj_t self_in) {
|
||||
breakout_msa301_BreakoutMSA301_obj_t *self = MP_OBJ_TO_PTR2(self_in, breakout_msa301_BreakoutMSA301_obj_t);
|
||||
self->breakout->disable_all_interrupts();
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
|
||||
mp_obj_t BreakoutMSA301_enable_interrupts(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_self, ARG_interrupts };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
||||
{ MP_QSTR_interrupts, MP_ARG_REQUIRED | MP_ARG_INT },
|
||||
};
|
||||
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
breakout_msa301_BreakoutMSA301_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_msa301_BreakoutMSA301_obj_t);
|
||||
|
||||
int interrupts = args[ARG_interrupts].u_int;
|
||||
|
||||
uint32_t mask = BreakoutMSA301::ACTIVE |
|
||||
BreakoutMSA301::NEW_DATA |
|
||||
BreakoutMSA301::FREEFALL |
|
||||
BreakoutMSA301::ORIENTATION |
|
||||
BreakoutMSA301::SINGLE_TAP |
|
||||
BreakoutMSA301::DOUBLE_TAP;
|
||||
if(interrupts < 0 || (interrupts & mask) == 0)
|
||||
mp_raise_ValueError("interrupts out of range. Expected 0 or the bitwise combination of 1 (X_ACTIVE), 2 (Y_ACTIVE), 4 (Z_ACTIVE), 16 (DOUBLE_TAP), 32 (SINGLE_TAP), 64 (ORIENTATION), 2048 (FREEFALL), 4096 (NEW_DATA)");
|
||||
else
|
||||
self->breakout->enable_interrupts(interrupts);
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
|
||||
mp_obj_t BreakoutMSA301_set_interrupt_latch(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_self, ARG_latch_period, ARG_reset_latched };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
||||
{ MP_QSTR_latch_period, MP_ARG_REQUIRED | MP_ARG_INT },
|
||||
{ MP_QSTR_reset_latched, MP_ARG_REQUIRED | MP_ARG_BOOL },
|
||||
};
|
||||
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
breakout_msa301_BreakoutMSA301_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_msa301_BreakoutMSA301_obj_t);
|
||||
|
||||
int latch_period = args[ARG_latch_period].u_int;
|
||||
bool reset_latched = args[ARG_latch_period].u_bool;
|
||||
BreakoutMSA301::InterruptLatchPeriod period;
|
||||
switch(latch_period) {
|
||||
case MSA_LATCH_1MS: period = BreakoutMSA301::LATCH_1MS; break;
|
||||
case MSA_LATCH_2MS: period = BreakoutMSA301::LATCH_2MS; break;
|
||||
case MSA_LATCH_25MS: period = BreakoutMSA301::LATCH_25MS; break;
|
||||
case MSA_LATCH_50MS: period = BreakoutMSA301::LATCH_50MS; break;
|
||||
case MSA_LATCH_100MS: period = BreakoutMSA301::LATCH_100MS; break;
|
||||
case MSA_LATCH_250MS: period = BreakoutMSA301::LATCH_250MS; break;
|
||||
case MSA_LATCH_500MS: period = BreakoutMSA301::LATCH_500MS; break;
|
||||
case MSA_LATCH_1S: period = BreakoutMSA301::LATCH_1S; break;
|
||||
case MSA_LATCH_2S: period = BreakoutMSA301::LATCH_2S; break;
|
||||
case MSA_LATCH_4S: period = BreakoutMSA301::LATCH_4S; break;
|
||||
case MSA_LATCH_8S: period = BreakoutMSA301::LATCH_8S; break;
|
||||
default:
|
||||
mp_raise_ValueError("latch_period out of range. Expected 0 to 10 (LATCH_1MS, LATCH_2MS, LATCH_25MS, LATCH_50MS, LATCH_100MS, LATCH_250MS, LATCH_500MS, LATCH_1S, LATCH_2S, LATCH_4S, or LATCH_8S)");
|
||||
break;
|
||||
}
|
||||
self->breakout->set_interrupt_latch(period, reset_latched);
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
|
||||
mp_obj_t BreakoutMSA301_read_interrupt(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_self, ARG_interrupt };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
||||
{ MP_QSTR_interrupt, MP_ARG_REQUIRED | MP_ARG_INT },
|
||||
};
|
||||
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
breakout_msa301_BreakoutMSA301_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_msa301_BreakoutMSA301_obj_t);
|
||||
|
||||
int interrupt = args[ARG_interrupt].u_int;
|
||||
switch(interrupt) {
|
||||
case BreakoutMSA301::NEW_DATA:
|
||||
case BreakoutMSA301::FREEFALL:
|
||||
case BreakoutMSA301::ACTIVE:
|
||||
case BreakoutMSA301::DOUBLE_TAP:
|
||||
case BreakoutMSA301::SINGLE_TAP:
|
||||
case BreakoutMSA301::ORIENTATION:
|
||||
return mp_obj_new_bool(self->breakout->read_interrupt((BreakoutMSA301::Interrupt)interrupt));
|
||||
default:
|
||||
mp_raise_ValueError("interrupt not valid. Expected 7 (ACTIVE), 16 (DOUBLE_TAP), 32 (SINGLE_TAP), 64 (ORIENTATION), 2048 (FREEFALL), 4096 (NEW_DATA)");
|
||||
break;
|
||||
}
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
// Include MicroPython API.
|
||||
#include "py/runtime.h"
|
||||
#include "py/objstr.h"
|
||||
|
||||
/***** Constants *****/
|
||||
|
||||
//Intentionally does not match numbering used in MSA class
|
||||
enum {
|
||||
MSA_AXIS_X = 0,
|
||||
MSA_AXIS_Y,
|
||||
MSA_AXIS_Z
|
||||
};
|
||||
|
||||
enum {
|
||||
MSA_PORTRAIT = 0b00,
|
||||
MSA_PORTRAIT_INVERTED = 0b01,
|
||||
MSA_LANDSCAPE = 0b10,
|
||||
MSA_LANDSCAPE_INVERTED = 0b11
|
||||
};
|
||||
|
||||
enum {
|
||||
MSA_NORMAL = 0b00,
|
||||
MSA_LOW = 0b01,
|
||||
MSA_SUSPEND = 0b10
|
||||
};
|
||||
|
||||
enum {
|
||||
MSA_G_2 = 0b00,
|
||||
MSA_G_4 = 0b01,
|
||||
MSA_G_8 = 0b10,
|
||||
MSA_G_16 = 0b11
|
||||
};
|
||||
|
||||
enum {
|
||||
MSA_BITS_14 = 0b0000,
|
||||
MSA_BITS_12 = 0b0100,
|
||||
MSA_BITS_10 = 0b1000,
|
||||
MSA_BITS_8 = 0b1100
|
||||
};
|
||||
|
||||
enum {
|
||||
MSA_INVERT_X = 0b1000,
|
||||
MSA_INVERT_Y = 0b0100,
|
||||
MSA_INVERT_Z = 0b0010,
|
||||
MSA_XY_SWAP = 0b0001
|
||||
};
|
||||
|
||||
enum {
|
||||
MSA_NONE = 0,
|
||||
MSA_ACTIVE = 0b0000111,
|
||||
MSA_NEW_DATA = 0b1000000000000,
|
||||
MSA_FREEFALL = 0b0100000000000,
|
||||
MSA_ORIENTATION = 0b1000000,
|
||||
MSA_SINGLE_TAP = 0b0100000,
|
||||
MSA_DOUBLE_TAP = 0b0010000,
|
||||
MSA_Z_ACTIVE = 0b0000100,
|
||||
MSA_Y_ACTIVE = 0b0000010,
|
||||
MSA_X_ACTIVE = 0b0000001
|
||||
};
|
||||
|
||||
//Intentionally does not match numbering used in MSA class
|
||||
enum {
|
||||
MSA_LATCH_1MS = 0,
|
||||
MSA_LATCH_2MS,
|
||||
MSA_LATCH_25MS,
|
||||
MSA_LATCH_50MS,
|
||||
MSA_LATCH_100MS,
|
||||
MSA_LATCH_250MS,
|
||||
MSA_LATCH_500MS,
|
||||
MSA_LATCH_1S,
|
||||
MSA_LATCH_2S,
|
||||
MSA_LATCH_4S,
|
||||
MSA_LATCH_8S,
|
||||
};
|
||||
|
||||
/***** Extern of Class Definition *****/
|
||||
extern const mp_obj_type_t breakout_msa301_BreakoutMSA301_type;
|
||||
|
||||
/***** Extern of Class Methods *****/
|
||||
extern void BreakoutMSA301_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind);
|
||||
extern mp_obj_t BreakoutMSA301_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 BreakoutMSA301_part_id(mp_obj_t self_in);
|
||||
extern mp_obj_t BreakoutMSA301_get_axis(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutMSA301_get_x_axis(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutMSA301_get_y_axis(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutMSA301_get_z_axis(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutMSA301_get_orientation(mp_obj_t self_in);
|
||||
extern mp_obj_t BreakoutMSA301_set_power_mode(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutMSA301_set_range_and_resolution(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutMSA301_set_axis_polarity(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutMSA301_disable_all_interrupts(mp_obj_t self_in);
|
||||
extern mp_obj_t BreakoutMSA301_enable_interrupts(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutMSA301_set_interrupt_latch(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
||||
extern mp_obj_t BreakoutMSA301_read_interrupt(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
|
|
@ -0,0 +1,20 @@
|
|||
set(MOD_NAME breakout_msa301)
|
||||
string(TOUPPER ${MOD_NAME} MOD_NAME_UPPER)
|
||||
add_library(usermod_${MOD_NAME} INTERFACE)
|
||||
|
||||
target_sources(usermod_${MOD_NAME} INTERFACE
|
||||
${CMAKE_CURRENT_LIST_DIR}/${MOD_NAME}.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/${MOD_NAME}.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/../../../libraries/${MOD_NAME}/${MOD_NAME}.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/../../../drivers/msa301/msa301.cpp
|
||||
)
|
||||
|
||||
target_include_directories(usermod_${MOD_NAME} INTERFACE
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
)
|
||||
|
||||
target_compile_definitions(usermod_${MOD_NAME} INTERFACE
|
||||
-DMODULE_${MOD_NAME_UPPER}_ENABLED=1
|
||||
)
|
||||
|
||||
target_link_libraries(usermod INTERFACE usermod_${MOD_NAME})
|
|
@ -0,0 +1,13 @@
|
|||
set(MOD_NAME breakout_msa301)
|
||||
BREAKOUT_MOD_DIR := $(USERMOD_DIR)
|
||||
|
||||
# Add our source files to the respective variables.
|
||||
SRC_USERMOD += $(BREAKOUT_MOD_DIR)/${MOD_NAME}.c
|
||||
SRC_USERMOD_CXX += $(BREAKOUT_MOD_DIR)/${MOD_NAME}.cpp
|
||||
|
||||
# Add our module directory to the include path.
|
||||
CFLAGS_USERMOD += -I$(BREAKOUT_MOD_DIR)
|
||||
CXXFLAGS_USERMOD += -I$(BREAKOUT_MOD_DIR)
|
||||
|
||||
# We use C++ features so have to link against the standard library.
|
||||
LDFLAGS_USERMOD += -lstdc++
|
|
@ -5,6 +5,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/breakout_as7262/micropython.cmake)
|
|||
include(${CMAKE_CURRENT_LIST_DIR}/breakout_roundlcd/micropython.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/breakout_rgbmatrix5x5/micropython.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/breakout_matrix11x7/micropython.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/breakout_msa301/micropython.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/breakout_trackball/micropython.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/breakout_sgp30/micropython.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/breakout_colourlcd240x240/micropython.cmake)
|
||||
|
|
Ładowanie…
Reference in New Issue