diff --git a/libs/core/dal.d.ts b/libs/core/dal.d.ts index 32b413d5..3d9b5405 100644 --- a/libs/core/dal.d.ts +++ b/libs/core/dal.d.ts @@ -79,12 +79,15 @@ declare const enum DAL { MICROBIT_BLE_PAIRING_TIMEOUT = 90, MICROBIT_BLE_POWER_LEVELS = 8, MICROBIT_BLE_MAXIMUM_BONDS = 4, - MICROBIT_BLE_EDDYSTONE_URL_ADV_INTERVAL = 400, + MICROBIT_BLE_EDDYSTONE_ADV_INTERVAL = 400, + MICROBIT_BLE_EDDYSTONE_DEFAULT_POWER = 0xF0, + MICROBIT_BLE_DISCONNECT_AFTER_PAIRING_DELAY = 500, // built/yt/yotta_modules/microbit-dal/inc/bluetooth/MicroBitButtonService.h // built/yt/yotta_modules/microbit-dal/inc/bluetooth/MicroBitDFUService.h MICROBIT_DFU_OPCODE_START_DFU = 1, MICROBIT_DFU_HISTOGRAM_WIDTH = 5, MICROBIT_DFU_HISTOGRAM_HEIGHT = 5, + // built/yt/yotta_modules/microbit-dal/inc/bluetooth/MicroBitEddystone.h // built/yt/yotta_modules/microbit-dal/inc/bluetooth/MicroBitEventService.h // built/yt/yotta_modules/microbit-dal/inc/bluetooth/MicroBitIOPinService.h MICROBIT_IO_PIN_SERVICE_PINCOUNT = 19, @@ -124,7 +127,6 @@ declare const enum DAL { MICROBIT_ID_ACCELEROMETER = 4, MICROBIT_ID_COMPASS = 5, MICROBIT_ID_DISPLAY = 6, - MICROBIT_IO_PINS = 20, MICROBIT_ID_IO_P0 = 7, MICROBIT_ID_IO_P1 = 8, MICROBIT_ID_IO_P2 = 9, @@ -133,11 +135,18 @@ declare const enum DAL { MICROBIT_ID_IO_P5 = 12, MICROBIT_ID_IO_P6 = 13, MICROBIT_ID_IO_P7 = 14, + MICROBIT_ID_IO_P8 = 15, MICROBIT_ID_IO_P9 = 16, MICROBIT_ID_IO_P10 = 17, MICROBIT_ID_IO_P11 = 18, + MICROBIT_ID_IO_P12 = 19, + MICROBIT_ID_IO_P13 = 20, + MICROBIT_ID_IO_P14 = 21, + MICROBIT_ID_IO_P15 = 22, + MICROBIT_ID_IO_P16 = 23, MICROBIT_ID_IO_P19 = 24, MICROBIT_ID_IO_P20 = 25, + MICROBIT_ID_IO_P21 = 50, MICROBIT_ID_BUTTON_AB = 26, MICROBIT_ID_GESTURE = 27, MICROBIT_ID_THERMOMETER = 28, @@ -145,17 +154,6 @@ declare const enum DAL { MICROBIT_ID_RADIO_DATA_READY = 30, MICROBIT_ID_MULTIBUTTON_ATTACH = 31, MICROBIT_ID_SERIAL = 32, - CALLIOPE_ID_IO_P3 = 33, - CALLIOPE_ID_IO_P7 = 34, - CALLIOPE_ID_IO_P8 = 35, - CALLIOPE_ID_IO_P9 = 36, - CALLIOPE_ID_IO_P13 = 37, - CALLIOPE_ID_IO_P14 = 38, - CALLIOPE_ID_IO_P15 = 39, - CALLIOPE_ID_IO_P22 = 40, - CALLIOPE_ID_IO_P28 = 41, - CALLIOPE_ID_IO_P29 = 42, - CALLIOPE_ID_IO_P30 = 43, MICROBIT_ID_MESSAGE_BUS_LISTENER = 1021, MICROBIT_ID_NOTIFY_ONE = 1022, MICROBIT_ID_NOTIFY = 1023, @@ -513,6 +511,30 @@ declare const enum DAL { MICROBIT_DISPLAY_ROTATION_90 = 1, MICROBIT_DISPLAY_ROTATION_180 = 2, MICROBIT_DISPLAY_ROTATION_270 = 3, + // built/yt/yotta_modules/microbit-dal/inc/drivers/MicroBitFile.h + // built/yt/yotta_modules/microbit-dal/inc/drivers/MicroBitFileSystem.h + MBFS_FILENAME_LENGTH = 16, + MB_READ = 0x01, + MB_WRITE = 0x02, + MB_CREAT = 0x04, + MB_APPEND = 0x08, + MB_SEEK_SET = 0x01, + MB_SEEK_END = 0x02, + MB_SEEK_CUR = 0x04, + MBFS_STATUS_INITIALISED = 0x01, + MBFS_UNUSED = 0xFFFF, + MBFS_EOF = 0xEFFF, + MBFS_DELETED = 0x0000, + MBFS_DIRECTORY_ENTRY_FREE = 0x8000, + MBFS_DIRECTORY_ENTRY_VALID = 0x4000, + MBFS_DIRECTORY_ENTRY_DIRECTORY = 0x2000, + MBFS_DIRECTORY_ENTRY_NEW = 0xffff, + MBFS_DIRECTORY_ENTRY_DELETED = 0x0000, + MBFS_BLOCK_TYPE_FILE = 1, + MBFS_BLOCK_TYPE_DIRECTORY = 2, + MBFS_BLOCK_TYPE_FILETABLE = 3, + // built/yt/yotta_modules/microbit-dal/inc/drivers/MicroBitFlash.h + PAGE_SIZE = 1024, // built/yt/yotta_modules/microbit-dal/inc/drivers/MicroBitI2C.h MICROBIT_I2C_MAX_RETRIES = 9, // built/yt/yotta_modules/microbit-dal/inc/drivers/MicroBitIO.h @@ -558,7 +580,6 @@ declare const enum DAL { MICROBIT_PIN_EVT_PULSE_LO = 5, PIN_CAPABILITY_DIGITAL = 0x01, PIN_CAPABILITY_ANALOG = 0x02, - PIN_CAPABILITY_TOUCH = 0x04, // built/yt/yotta_modules/microbit-dal/inc/drivers/MicroBitRadio.h MICROBIT_RADIO_STATUS_INITIALISED = 0x0001, MICROBIT_RADIO_BASE_ADDRESS = 0x75626974, diff --git a/libs/core/enums.d.ts b/libs/core/enums.d.ts index cf010a58..e8b9707e 100644 --- a/libs/core/enums.d.ts +++ b/libs/core/enums.d.ts @@ -34,10 +34,10 @@ declare namespace basic { declare enum TouchPin { - P0 = 7, // MICROBIT_ID_IO_P0 - P1 = 8, // MICROBIT_ID_IO_P1 - P2 = 9, // MICROBIT_ID_IO_P2 - P3 = 40, // CALLIOPE_ID_IO_P22 + P0 = 19, // MICROBIT_ID_IO_P12 + P1 = 7, // MICROBIT_ID_IO_P0 + P2 = 8, // MICROBIT_ID_IO_P1 + P3 = 23, // MICROBIT_ID_IO_P16 } @@ -152,17 +152,18 @@ declare namespace input { MICROBIT_ID_IO_P5 = 12, // MICROBIT_ID_IO_P5 MICROBIT_ID_IO_P6 = 13, // MICROBIT_ID_IO_P6 MICROBIT_ID_IO_P7 = 14, // MICROBIT_ID_IO_P7 - //MICROBIT_ID_IO_P8_ = MICROBIT_ID_IO_P8, + MICROBIT_ID_IO_P8 = 15, // MICROBIT_ID_IO_P8 MICROBIT_ID_IO_P9 = 16, // MICROBIT_ID_IO_P9 MICROBIT_ID_IO_P10 = 17, // MICROBIT_ID_IO_P10 MICROBIT_ID_IO_P11 = 18, // MICROBIT_ID_IO_P11 - //MICROBIT_ID_IO_P12_ = MICROBIT_ID_IO_P12, - //MICROBIT_ID_IO_P13_ = MICROBIT_ID_IO_P13, - //MICROBIT_ID_IO_P14_ = MICROBIT_ID_IO_P14, - //MICROBIT_ID_IO_P15_ = MICROBIT_ID_IO_P15, - //MICROBIT_ID_IO_P16_ = MICROBIT_ID_IO_P16, + MICROBIT_ID_IO_P12 = 19, // MICROBIT_ID_IO_P12 + MICROBIT_ID_IO_P13 = 20, // MICROBIT_ID_IO_P13 + MICROBIT_ID_IO_P14 = 21, // MICROBIT_ID_IO_P14 + MICROBIT_ID_IO_P15 = 22, // MICROBIT_ID_IO_P15 + MICROBIT_ID_IO_P16 = 23, // MICROBIT_ID_IO_P16 MICROBIT_ID_IO_P19 = 24, // MICROBIT_ID_IO_P19 MICROBIT_ID_IO_P20 = 25, // MICROBIT_ID_IO_P20 + MICROBIT_ID_IO_P21 = 50, // MICROBIT_ID_IO_P21 MES_DEVICE_INFO_ID = 1103, // MES_DEVICE_INFO_ID MES_SIGNAL_STRENGTH_ID = 1101, // MES_SIGNAL_STRENGTH_ID MES_DPAD_CONTROLLER_ID = 1104, // MES_DPAD_CONTROLLER_ID @@ -263,36 +264,33 @@ declare namespace motors { declare enum DigitalPin { - P0 = 7, // MICROBIT_ID_IO_P0 - P1 = 8, // MICROBIT_ID_IO_P1 - P2 = 9, // MICROBIT_ID_IO_P2 - P3 = 40, // CALLIOPE_ID_IO_P22 + P0 = 19, // MICROBIT_ID_IO_P12 + P1 = 7, // MICROBIT_ID_IO_P0 + P2 = 8, // MICROBIT_ID_IO_P1 + P3 = 23, // MICROBIT_ID_IO_P16 C4 = 10, // MICROBIT_ID_IO_P3 C5 = 11, // MICROBIT_ID_IO_P4 C6 = 17, // MICROBIT_ID_IO_P10 - C7 = 34, // CALLIOPE_ID_IO_P7 - C8 = 35, // CALLIOPE_ID_IO_P8 - C9 = 36, // CALLIOPE_ID_IO_P9 + C7 = 20, // MICROBIT_ID_IO_P13 + C8 = 21, // MICROBIT_ID_IO_P14 + C9 = 22, // MICROBIT_ID_IO_P15 C10 = 16, // MICROBIT_ID_IO_P9 C11 = 14, // MICROBIT_ID_IO_P7 C12 = 13, // MICROBIT_ID_IO_P6 - C13 = 37, // CALLIOPE_ID_IO_P13 - C14 = 38, // CALLIOPE_ID_IO_P14 - C15 = 39, // CALLIOPE_ID_IO_P15 - //P16 = MICROBIT_ID_IO_P16, + C16 = 9, // MICROBIT_ID_IO_P2 + C17 = 15, // MICROBIT_ID_IO_P8 + C18 = 25, // MICROBIT_ID_IO_P20 C19 = 24, // MICROBIT_ID_IO_P19 - C20 = 25, // MICROBIT_ID_IO_P20 } declare enum AnalogPin { - //P0 = MICROBIT_ID_IO_P0, -- does not work analogue - P1 = 8, // MICROBIT_ID_IO_P1 - P2 = 9, // MICROBIT_ID_IO_P2 - //P3 = CALLIOPE_ID_IO_P22, -- does not work analogue + P1 = 7, // MICROBIT_ID_IO_P0 + P2 = 8, // MICROBIT_ID_IO_P1 C4 = 10, // MICROBIT_ID_IO_P3 C5 = 11, // MICROBIT_ID_IO_P4 C6 = 17, // MICROBIT_ID_IO_P10 + MIC = 50, // MICROBIT_ID_IO_P21 } diff --git a/libs/core/pxt.json b/libs/core/pxt.json index 0be59147..0c78549c 100644 --- a/libs/core/pxt.json +++ b/libs/core/pxt.json @@ -43,8 +43,7 @@ "public": true, "dependencies": {}, "yotta": { - "configIsJustDefaults": true, - "config": { + "optionalConfig": { "microbit-dal": { "bluetooth": { "enabled": 0 diff --git a/pxtarget.json b/pxtarget.json index 832ecf54..b7fb3963 100644 --- a/pxtarget.json +++ b/pxtarget.json @@ -21,7 +21,7 @@ "githubPackages": true }, "compile": { - "isNative": false, + "isNative": true, "hasHex": true, "deployDrives": "MINI", "driveName": "MINI", @@ -172,7 +172,7 @@ "githubCorePackage": "calliope-mini/microbit", "gittag": "2.0.0-rc7-calliope-p1", "serviceId": "microbit" - }, + }, "serial": { "manufacturerFilter": "^mbed$", "nameFilter": "^mbed Serial Port",