Export constants from DAL in dal.d.ts

This commit is contained in:
Michal Moskal 2016-04-01 14:14:57 -07:00
parent 4b3efd434e
commit 7c564ebaab
4 changed files with 470 additions and 181 deletions

View File

@ -2,192 +2,105 @@ enum EventCreationMode {
/** /**
* MicroBitEvent is initialised, and no further processing takes place. * MicroBitEvent is initialised, and no further processing takes place.
*/ */
//% enumVal=CREATE_ONLY CreateOnly = DAL.CREATE_ONLY as number,
CreateOnly,
/** /**
* MicroBitEvent is initialised, and queued on the MicroBitMessageBus. * MicroBitEvent is initialised, and queued on the MicroBitMessageBus.
*/ */
//% enumVal=CREATE_AND_QUEUE CreateAndQueue = DAL.CREATE_AND_QUEUE as number,
CreateAndQueue,
/** /**
* MicroBitEvent is initialised, and its event handlers are immediately fired (not suitable for use in interrupts!). * MicroBitEvent is initialised, and its event handlers are immediately fired (not suitable for use in interrupts!).
*/ */
//% enumVal=CREATE_AND_FIRE CreateAndFire = DAL.CREATE_AND_FIRE as number,
CreateAndFire
} }
enum EventBusSource { enum EventBusSource {
//% enumVal=MICROBIT_ID_BUTTON_A MICROBIT_ID_BUTTON_A = DAL.MICROBIT_ID_BUTTON_A as number,
MICROBIT_ID_BUTTON_A, MICROBIT_ID_BUTTON_B = DAL.MICROBIT_ID_BUTTON_B as number,
//% enumVal=MICROBIT_ID_BUTTON_B MICROBIT_ID_BUTTON_AB = DAL.MICROBIT_ID_BUTTON_AB as number,
MICROBIT_ID_BUTTON_B, MICROBIT_ID_RADIO = DAL.MICROBIT_ID_RADIO as number,
//% enumVal=MICROBIT_ID_BUTTON_AB MICROBIT_ID_GESTURE = DAL.MICROBIT_ID_GESTURE as number,
MICROBIT_ID_BUTTON_AB, MICROBIT_ID_ACCELEROMETER = DAL.MICROBIT_ID_ACCELEROMETER as number,
//% enumVal=MICROBIT_ID_RADIO MICROBIT_ID_IO_P0 = DAL.MICROBIT_ID_IO_P0 as number,
MICROBIT_ID_RADIO, MICROBIT_ID_IO_P1 = DAL.MICROBIT_ID_IO_P1 as number,
//% enumVal=MICROBIT_ID_GESTURE MICROBIT_ID_IO_P2 = DAL.MICROBIT_ID_IO_P2 as number,
MICROBIT_ID_GESTURE, MICROBIT_ID_IO_P3 = DAL.MICROBIT_ID_IO_P3 as number,
//% enumVal=MICROBIT_ID_ACCELEROMETER MICROBIT_ID_IO_P4 = DAL.MICROBIT_ID_IO_P4 as number,
MICROBIT_ID_ACCELEROMETER, MICROBIT_ID_IO_P5 = DAL.MICROBIT_ID_IO_P5 as number,
//% enumVal=MICROBIT_ID_IO_P0 MICROBIT_ID_IO_P6 = DAL.MICROBIT_ID_IO_P6 as number,
MICROBIT_ID_IO_P0, MICROBIT_ID_IO_P7 = DAL.MICROBIT_ID_IO_P7 as number,
//% enumVal=MICROBIT_ID_IO_P1 MICROBIT_ID_IO_P8 = DAL.MICROBIT_ID_IO_P8 as number,
MICROBIT_ID_IO_P1, MICROBIT_ID_IO_P9 = DAL.MICROBIT_ID_IO_P9 as number,
//% enumVal=MICROBIT_ID_IO_P2 MICROBIT_ID_IO_P10 = DAL.MICROBIT_ID_IO_P10 as number,
MICROBIT_ID_IO_P2, MICROBIT_ID_IO_P11 = DAL.MICROBIT_ID_IO_P11 as number,
//% enumVal=MICROBIT_ID_IO_P3 MICROBIT_ID_IO_P12 = DAL.MICROBIT_ID_IO_P12 as number,
MICROBIT_ID_IO_P3, MICROBIT_ID_IO_P13 = DAL.MICROBIT_ID_IO_P13 as number,
//% enumVal=MICROBIT_ID_IO_P4 MICROBIT_ID_IO_P14 = DAL.MICROBIT_ID_IO_P14 as number,
MICROBIT_ID_IO_P4, MICROBIT_ID_IO_P15 = DAL.MICROBIT_ID_IO_P15 as number,
//% enumVal=MICROBIT_ID_IO_P5 MICROBIT_ID_IO_P16 = DAL.MICROBIT_ID_IO_P16 as number,
MICROBIT_ID_IO_P5, MICROBIT_ID_IO_P19 = DAL.MICROBIT_ID_IO_P19 as number,
//% enumVal=MICROBIT_ID_IO_P6 MICROBIT_ID_IO_P20 = DAL.MICROBIT_ID_IO_P20 as number,
MICROBIT_ID_IO_P6, MES_DEVICE_INFO_ID = DAL.MES_DEVICE_INFO_ID as number,
//% enumVal=MICROBIT_ID_IO_P7 MES_SIGNAL_STRENGTH_ID = DAL.MES_SIGNAL_STRENGTH_ID as number,
MICROBIT_ID_IO_P7, MES_DPAD_CONTROLLER_ID = DAL.MES_DPAD_CONTROLLER_ID as number,
//% enumVal=MICROBIT_ID_IO_P8 MES_BROADCAST_GENERAL_ID = DAL.MES_BROADCAST_GENERAL_ID as number,
MICROBIT_ID_IO_P8,
//% enumVal=MICROBIT_ID_IO_P9
MICROBIT_ID_IO_P9,
//% enumVal=MICROBIT_ID_IO_P10
MICROBIT_ID_IO_P10,
//% enumVal=MICROBIT_ID_IO_P11
MICROBIT_ID_IO_P11,
//% enumVal=MICROBIT_ID_IO_P12
MICROBIT_ID_IO_P12,
//% enumVal=MICROBIT_ID_IO_P13
MICROBIT_ID_IO_P13,
//% enumVal=MICROBIT_ID_IO_P14
MICROBIT_ID_IO_P14,
//% enumVal=MICROBIT_ID_IO_P15
MICROBIT_ID_IO_P15,
//% enumVal=MICROBIT_ID_IO_P16
MICROBIT_ID_IO_P16,
//% enumVal=MICROBIT_ID_IO_P19
MICROBIT_ID_IO_P19,
//% enumVal=MICROBIT_ID_IO_P20
MICROBIT_ID_IO_P20,
//% enumVal=MES_DEVICE_INFO_ID
MES_DEVICE_INFO_ID,
//% enumVal=MES_SIGNAL_STRENGTH_ID
MES_SIGNAL_STRENGTH_ID,
//% enumVal=MES_DPAD_CONTROLLER_ID
MES_DPAD_CONTROLLER_ID,
//% enumVal=MES_BROADCAST_GENERAL_ID
MES_BROADCAST_GENERAL_ID,
} }
enum EventBusValue { enum EventBusValue {
//% enumVal=MICROBIT_EVT_ANY MICROBIT_EVT_ANY = DAL.MICROBIT_EVT_ANY as number,
MICROBIT_EVT_ANY, MICROBIT_BUTTON_EVT_CLICK = DAL.MICROBIT_BUTTON_EVT_CLICK as number,
//% enumVal=MICROBIT_BUTTON_EVT_CLICK MICROBIT_RADIO_EVT_DATAGRAM = DAL.MICROBIT_RADIO_EVT_DATAGRAM as number,
MICROBIT_BUTTON_EVT_CLICK, MICROBIT_ACCELEROMETER_EVT_DATA_UPDATE = DAL.MICROBIT_ACCELEROMETER_EVT_DATA_UPDATE as number,
//% enumVal=MICROBIT_RADIO_EVT_DATAGRAM MES_ALERT_EVT_ALARM1 = DAL.MES_ALERT_EVT_ALARM1 as number,
MICROBIT_RADIO_EVT_DATAGRAM, MES_ALERT_EVT_ALARM2 = DAL.MES_ALERT_EVT_ALARM2 as number,
//% enumVal=MICROBIT_ACCELEROMETER_EVT_DATA_UPDATE MES_ALERT_EVT_ALARM3 = DAL.MES_ALERT_EVT_ALARM3 as number,
MICROBIT_ACCELEROMETER_EVT_DATA_UPDATE, MES_ALERT_EVT_ALARM4 = DAL.MES_ALERT_EVT_ALARM4 as number,
//% enumVal=MES_ALERT_EVT_ALARM1 MES_ALERT_EVT_ALARM5 = DAL.MES_ALERT_EVT_ALARM5 as number,
MES_ALERT_EVT_ALARM1, MES_ALERT_EVT_ALARM6 = DAL.MES_ALERT_EVT_ALARM6 as number,
//% enumVal=MES_ALERT_EVT_ALARM2 MES_ALERT_EVT_DISPLAY_TOAST = DAL.MES_ALERT_EVT_DISPLAY_TOAST as number,
MES_ALERT_EVT_ALARM2, MES_ALERT_EVT_FIND_MY_PHONE = DAL.MES_ALERT_EVT_FIND_MY_PHONE as number,
//% enumVal=MES_ALERT_EVT_ALARM3 MES_ALERT_EVT_PLAY_RINGTONE = DAL.MES_ALERT_EVT_PLAY_RINGTONE as number,
MES_ALERT_EVT_ALARM3, MES_ALERT_EVT_PLAY_SOUND = DAL.MES_ALERT_EVT_PLAY_SOUND as number,
//% enumVal=MES_ALERT_EVT_ALARM4 MES_ALERT_EVT_VIBRATE = DAL.MES_ALERT_EVT_VIBRATE as number,
MES_ALERT_EVT_ALARM4, MES_CAMERA_EVT_LAUNCH_PHOTO_MODE = DAL.MES_CAMERA_EVT_LAUNCH_PHOTO_MODE as number,
//% enumVal=MES_ALERT_EVT_ALARM5 MES_CAMERA_EVT_LAUNCH_VIDEO_MODE = DAL.MES_CAMERA_EVT_LAUNCH_VIDEO_MODE as number,
MES_ALERT_EVT_ALARM5, MES_CAMERA_EVT_START_VIDEO_CAPTURE = DAL.MES_CAMERA_EVT_START_VIDEO_CAPTURE as number,
//% enumVal=MES_ALERT_EVT_ALARM6 MES_CAMERA_EVT_STOP_PHOTO_MODE = DAL.MES_CAMERA_EVT_STOP_PHOTO_MODE as number,
MES_ALERT_EVT_ALARM6, MES_CAMERA_EVT_STOP_VIDEO_CAPTURE = DAL.MES_CAMERA_EVT_STOP_VIDEO_CAPTURE as number,
//% enumVal=MES_ALERT_EVT_DISPLAY_TOAST MES_CAMERA_EVT_STOP_VIDEO_MODE = DAL.MES_CAMERA_EVT_STOP_VIDEO_MODE as number,
MES_ALERT_EVT_DISPLAY_TOAST, MES_CAMERA_EVT_TAKE_PHOTO = DAL.MES_CAMERA_EVT_TAKE_PHOTO as number,
//% enumVal=MES_ALERT_EVT_FIND_MY_PHONE MES_CAMERA_EVT_TOGGLE_FRONT_REAR = DAL.MES_CAMERA_EVT_TOGGLE_FRONT_REAR as number,
MES_ALERT_EVT_FIND_MY_PHONE, MES_DEVICE_DISPLAY_OFF = DAL.MES_DEVICE_DISPLAY_OFF as number,
//% enumVal=MES_ALERT_EVT_PLAY_RINGTONE MES_DEVICE_DISPLAY_ON = DAL.MES_DEVICE_DISPLAY_ON as number,
MES_ALERT_EVT_PLAY_RINGTONE, MES_DEVICE_GESTURE_DEVICE_SHAKEN = DAL.MES_DEVICE_GESTURE_DEVICE_SHAKEN as number,
//% enumVal=MES_ALERT_EVT_PLAY_SOUND MES_DEVICE_INCOMING_CALL = DAL.MES_DEVICE_INCOMING_CALL as number,
MES_ALERT_EVT_PLAY_SOUND, MES_DEVICE_INCOMING_MESSAGE = DAL.MES_DEVICE_INCOMING_MESSAGE as number,
//% enumVal=MES_ALERT_EVT_VIBRATE MES_DEVICE_ORIENTATION_LANDSCAPE = DAL.MES_DEVICE_ORIENTATION_LANDSCAPE as number,
MES_ALERT_EVT_VIBRATE, MES_DEVICE_ORIENTATION_PORTRAIT = DAL.MES_DEVICE_ORIENTATION_PORTRAIT as number,
//% enumVal=MES_CAMERA_EVT_LAUNCH_PHOTO_MODE MES_DPAD_BUTTON_1_DOWN = DAL.MES_DPAD_BUTTON_1_DOWN as number,
MES_CAMERA_EVT_LAUNCH_PHOTO_MODE, MES_DPAD_BUTTON_1_UP = DAL.MES_DPAD_BUTTON_1_UP as number,
//% enumVal=MES_CAMERA_EVT_LAUNCH_VIDEO_MODE MES_DPAD_BUTTON_2_DOWN = DAL.MES_DPAD_BUTTON_2_DOWN as number,
MES_CAMERA_EVT_LAUNCH_VIDEO_MODE, MES_DPAD_BUTTON_2_UP = DAL.MES_DPAD_BUTTON_2_UP as number,
//% enumVal=MES_CAMERA_EVT_START_VIDEO_CAPTURE MES_DPAD_BUTTON_3_DOWN = DAL.MES_DPAD_BUTTON_3_DOWN as number,
MES_CAMERA_EVT_START_VIDEO_CAPTURE, MES_DPAD_BUTTON_3_UP = DAL.MES_DPAD_BUTTON_3_UP as number,
//% enumVal=MES_CAMERA_EVT_STOP_PHOTO_MODE MES_DPAD_BUTTON_4_DOWN = DAL.MES_DPAD_BUTTON_4_DOWN as number,
MES_CAMERA_EVT_STOP_PHOTO_MODE, MES_DPAD_BUTTON_4_UP = DAL.MES_DPAD_BUTTON_4_UP as number,
//% enumVal=MES_CAMERA_EVT_STOP_VIDEO_CAPTURE MES_DPAD_BUTTON_A_DOWN = DAL.MES_DPAD_BUTTON_A_DOWN as number,
MES_CAMERA_EVT_STOP_VIDEO_CAPTURE, MES_DPAD_BUTTON_A_UP = DAL.MES_DPAD_BUTTON_A_UP as number,
//% enumVal=MES_CAMERA_EVT_STOP_VIDEO_MODE MES_DPAD_BUTTON_B_DOWN = DAL.MES_DPAD_BUTTON_B_DOWN as number,
MES_CAMERA_EVT_STOP_VIDEO_MODE, MES_DPAD_BUTTON_B_UP = DAL.MES_DPAD_BUTTON_B_UP as number,
//% enumVal=MES_CAMERA_EVT_TAKE_PHOTO MES_DPAD_BUTTON_C_DOWN = DAL.MES_DPAD_BUTTON_C_DOWN as number,
MES_CAMERA_EVT_TAKE_PHOTO, MES_DPAD_BUTTON_C_UP = DAL.MES_DPAD_BUTTON_C_UP as number,
//% enumVal=MES_CAMERA_EVT_TOGGLE_FRONT_REAR MES_DPAD_BUTTON_D_DOWN = DAL.MES_DPAD_BUTTON_D_DOWN as number,
MES_CAMERA_EVT_TOGGLE_FRONT_REAR, MES_DPAD_BUTTON_D_UP = DAL.MES_DPAD_BUTTON_D_UP as number,
//% enumVal=MES_DEVICE_DISPLAY_OFF MES_REMOTE_CONTROL_EVT_FORWARD = DAL.MES_REMOTE_CONTROL_EVT_FORWARD as number,
MES_DEVICE_DISPLAY_OFF, MES_REMOTE_CONTROL_EVT_NEXTTRACK = DAL.MES_REMOTE_CONTROL_EVT_NEXTTRACK as number,
//% enumVal=MES_DEVICE_DISPLAY_ON MES_REMOTE_CONTROL_EVT_PAUSE = DAL.MES_REMOTE_CONTROL_EVT_PAUSE as number,
MES_DEVICE_DISPLAY_ON, MES_REMOTE_CONTROL_EVT_PLAY = DAL.MES_REMOTE_CONTROL_EVT_PLAY as number,
//% enumVal=MES_DEVICE_GESTURE_DEVICE_SHAKEN MES_REMOTE_CONTROL_EVT_PREVTRACK = DAL.MES_REMOTE_CONTROL_EVT_PREVTRACK as number,
MES_DEVICE_GESTURE_DEVICE_SHAKEN, MES_REMOTE_CONTROL_EVT_REWIND = DAL.MES_REMOTE_CONTROL_EVT_REWIND as number,
//% enumVal=MES_DEVICE_INCOMING_CALL MES_REMOTE_CONTROL_EVT_STOP = DAL.MES_REMOTE_CONTROL_EVT_STOP as number,
MES_DEVICE_INCOMING_CALL, MES_REMOTE_CONTROL_EVT_VOLUMEDOWN = DAL.MES_REMOTE_CONTROL_EVT_VOLUMEDOWN as number,
//% enumVal=MES_DEVICE_INCOMING_MESSAGE MES_REMOTE_CONTROL_EVT_VOLUMEUP = DAL.MES_REMOTE_CONTROL_EVT_VOLUMEUP as number,
MES_DEVICE_INCOMING_MESSAGE,
//% enumVal=MES_DEVICE_ORIENTATION_LANDSCAPE
MES_DEVICE_ORIENTATION_LANDSCAPE,
//% enumVal=MES_DEVICE_ORIENTATION_PORTRAIT
MES_DEVICE_ORIENTATION_PORTRAIT,
//% enumVal=MES_DPAD_BUTTON_1_DOWN
MES_DPAD_BUTTON_1_DOWN,
//% enumVal=MES_DPAD_BUTTON_1_UP
MES_DPAD_BUTTON_1_UP,
//% enumVal=MES_DPAD_BUTTON_2_DOWN
MES_DPAD_BUTTON_2_DOWN,
//% enumVal=MES_DPAD_BUTTON_2_UP
MES_DPAD_BUTTON_2_UP,
//% enumVal=MES_DPAD_BUTTON_3_DOWN
MES_DPAD_BUTTON_3_DOWN,
//% enumVal=MES_DPAD_BUTTON_3_UP
MES_DPAD_BUTTON_3_UP,
//% enumVal=MES_DPAD_BUTTON_4_DOWN
MES_DPAD_BUTTON_4_DOWN,
//% enumVal=MES_DPAD_BUTTON_4_UP
MES_DPAD_BUTTON_4_UP,
//% enumVal=MES_DPAD_BUTTON_A_DOWN
MES_DPAD_BUTTON_A_DOWN,
//% enumVal=MES_DPAD_BUTTON_A_UP
MES_DPAD_BUTTON_A_UP,
//% enumVal=MES_DPAD_BUTTON_B_DOWN
MES_DPAD_BUTTON_B_DOWN,
//% enumVal=MES_DPAD_BUTTON_B_UP
MES_DPAD_BUTTON_B_UP,
//% enumVal=MES_DPAD_BUTTON_C_DOWN
MES_DPAD_BUTTON_C_DOWN,
//% enumVal=MES_DPAD_BUTTON_C_UP
MES_DPAD_BUTTON_C_UP,
//% enumVal=MES_DPAD_BUTTON_D_DOWN
MES_DPAD_BUTTON_D_DOWN,
//% enumVal=MES_DPAD_BUTTON_D_UP
MES_DPAD_BUTTON_D_UP,
//% enumVal=MES_REMOTE_CONTROL_EVT_FORWARD
MES_REMOTE_CONTROL_EVT_FORWARD,
//% enumVal=MES_REMOTE_CONTROL_EVT_NEXTTRACK
MES_REMOTE_CONTROL_EVT_NEXTTRACK,
//% enumVal=MES_REMOTE_CONTROL_EVT_PAUSE
MES_REMOTE_CONTROL_EVT_PAUSE,
//% enumVal=MES_REMOTE_CONTROL_EVT_PLAY
MES_REMOTE_CONTROL_EVT_PLAY,
//% enumVal=MES_REMOTE_CONTROL_EVT_PREVTRACK
MES_REMOTE_CONTROL_EVT_PREVTRACK,
//% enumVal=MES_REMOTE_CONTROL_EVT_REWIND
MES_REMOTE_CONTROL_EVT_REWIND,
//% enumVal=MES_REMOTE_CONTROL_EVT_STOP
MES_REMOTE_CONTROL_EVT_STOP,
//% enumVal=MES_REMOTE_CONTROL_EVT_VOLUMEDOWN
MES_REMOTE_CONTROL_EVT_VOLUMEDOWN,
//% enumVal=MES_REMOTE_CONTROL_EVT_VOLUMEUP
MES_REMOTE_CONTROL_EVT_VOLUMEUP,
} }
//% weight=1 color="#333333" //% weight=1 color="#333333"

378
libs/microbit/dal.d.ts vendored Normal file
View File

@ -0,0 +1,378 @@
// Auto-generated. Do not edit.
declare const enum DAL {
// DynamicPwm.h
NO_PWMS = 3,
MICROBIT_DEFAULT_PWM_PERIOD = 20000,
PWM_PERSISTENCE_TRANSIENT = 1,
PWM_PERSISTENCE_PERSISTENT = 2,
// ErrorNo.h
MICROBIT_OK = 0,
MICROBIT_INVALID_PARAMETER = -1001,
MICROBIT_NOT_SUPPORTED = -1002,
MICROBIT_CALIBRATION_IN_PROGRESS = -1003,
MICROBIT_CALIBRATION_REQUIRED = -1004,
MICROBIT_NO_RESOURCES = -1005,
MICROBIT_BUSY = -1006,
MICROBIT_CANCELLED = -1007,
MICROBIT_I2C_ERROR = -1010,
MICROBIT_OOM = 20,
MICROBIT_HEAP_ERROR = 30,
MICROBIT_NULL_DEREFERENCE = 40,
// ExternalEvents.h
MICROBIT_ID_BLE = 1000,
// MESEvents.h
MES_REMOTE_CONTROL_ID = 1001,
MES_REMOTE_CONTROL_EVT_PLAY = 1,
MES_REMOTE_CONTROL_EVT_PAUSE = 2,
MES_REMOTE_CONTROL_EVT_STOP = 3,
MES_REMOTE_CONTROL_EVT_NEXTTRACK = 4,
MES_REMOTE_CONTROL_EVT_PREVTRACK = 5,
MES_REMOTE_CONTROL_EVT_FORWARD = 6,
MES_REMOTE_CONTROL_EVT_REWIND = 7,
MES_REMOTE_CONTROL_EVT_VOLUMEUP = 8,
MES_REMOTE_CONTROL_EVT_VOLUMEDOWN = 9,
MES_CAMERA_ID = 1002,
MES_CAMERA_EVT_LAUNCH_PHOTO_MODE = 1,
MES_CAMERA_EVT_LAUNCH_VIDEO_MODE = 2,
MES_CAMERA_EVT_TAKE_PHOTO = 3,
MES_CAMERA_EVT_START_VIDEO_CAPTURE = 4,
MES_CAMERA_EVT_STOP_VIDEO_CAPTURE = 5,
MES_CAMERA_EVT_STOP_PHOTO_MODE = 6,
MES_CAMERA_EVT_STOP_VIDEO_MODE = 7,
MES_CAMERA_EVT_TOGGLE_FRONT_REAR = 8,
MES_ALERTS_ID = 1004,
MES_ALERT_EVT_DISPLAY_TOAST = 1,
MES_ALERT_EVT_VIBRATE = 2,
MES_ALERT_EVT_PLAY_SOUND = 3,
MES_ALERT_EVT_PLAY_RINGTONE = 4,
MES_ALERT_EVT_FIND_MY_PHONE = 5,
MES_ALERT_EVT_ALARM1 = 6,
MES_ALERT_EVT_ALARM2 = 7,
MES_ALERT_EVT_ALARM3 = 8,
MES_ALERT_EVT_ALARM4 = 9,
MES_ALERT_EVT_ALARM5 = 10,
MES_ALERT_EVT_ALARM6 = 11,
MES_SIGNAL_STRENGTH_ID = 1101,
MES_SIGNAL_STRENGTH_EVT_NO_BAR = 1,
MES_SIGNAL_STRENGTH_EVT_ONE_BAR = 2,
MES_SIGNAL_STRENGTH_EVT_TWO_BAR = 3,
MES_SIGNAL_STRENGTH_EVT_THREE_BAR = 4,
MES_SIGNAL_STRENGTH_EVT_FOUR_BAR = 5,
MES_DEVICE_INFO_ID = 1103,
MES_DEVICE_ORIENTATION_LANDSCAPE = 1,
MES_DEVICE_ORIENTATION_PORTRAIT = 2,
MES_DEVICE_GESTURE_NONE = 3,
MES_DEVICE_GESTURE_DEVICE_SHAKEN = 4,
MES_DEVICE_DISPLAY_OFF = 5,
MES_DEVICE_DISPLAY_ON = 6,
MES_DEVICE_INCOMING_CALL = 7,
MES_DEVICE_INCOMING_MESSAGE = 8,
MES_DPAD_CONTROLLER_ID = 1104,
MES_DPAD_BUTTON_A_DOWN = 1,
MES_DPAD_BUTTON_A_UP = 2,
MES_DPAD_BUTTON_B_DOWN = 3,
MES_DPAD_BUTTON_B_UP = 4,
MES_DPAD_BUTTON_C_DOWN = 5,
MES_DPAD_BUTTON_C_UP = 6,
MES_DPAD_BUTTON_D_DOWN = 7,
MES_DPAD_BUTTON_D_UP = 8,
MES_DPAD_BUTTON_1_DOWN = 9,
MES_DPAD_BUTTON_1_UP = 10,
MES_DPAD_BUTTON_2_DOWN = 11,
MES_DPAD_BUTTON_2_UP = 12,
MES_DPAD_BUTTON_3_DOWN = 13,
MES_DPAD_BUTTON_3_UP = 14,
MES_DPAD_BUTTON_4_DOWN = 15,
MES_DPAD_BUTTON_4_UP = 16,
MES_BROADCAST_GENERAL_ID = 2000,
// ManagedString.h
// ManagedType.h
// Matrix4.h
// MemberFunctionCallback.h
// MicroBit.h
MICROBIT_FLAG_SCHEDULER_RUNNING = 0x00000001,
MICROBIT_FLAG_ACCELEROMETER_RUNNING = 0x00000002,
MICROBIT_FLAG_DISPLAY_RUNNING = 0x00000004,
MICROBIT_FLAG_COMPASS_RUNNING = 0x00000008,
MICROBIT_NAME_LENGTH = 5,
MICROBIT_NAME_CODE_LETTERS = 5,
NRF51822_RNG_ADDRESS = 0x4000D000,
// MicroBitAccelerometer.h
MICROBIT_ACCEL_PITCH_ROLL_VALID = 0x01,
MMA8653_DEFAULT_ADDR = 0x3A,
MMA8653_STATUS = 0x00,
MMA8653_OUT_X_MSB = 0x01,
MMA8653_WHOAMI = 0x0D,
MMA8653_XYZ_DATA_CFG = 0x0E,
MMA8653_CTRL_REG1 = 0x2A,
MMA8653_CTRL_REG2 = 0x2B,
MMA8653_CTRL_REG3 = 0x2C,
MMA8653_CTRL_REG4 = 0x2D,
MMA8653_CTRL_REG5 = 0x2E,
MMA8653_WHOAMI_VAL = 0x5A,
MMA8653_SAMPLE_RANGES = 3,
MMA8653_SAMPLE_RATES = 8,
MICROBIT_ACCELEROMETER_EVT_DATA_UPDATE = 1,
MICROBIT_ACCELEROMETER_EVT_TILT_UP = 1,
MICROBIT_ACCELEROMETER_EVT_TILT_DOWN = 2,
MICROBIT_ACCELEROMETER_EVT_TILT_LEFT = 3,
MICROBIT_ACCELEROMETER_EVT_TILT_RIGHT = 4,
MICROBIT_ACCELEROMETER_EVT_FACE_UP = 5,
MICROBIT_ACCELEROMETER_EVT_FACE_DOWN = 6,
MICROBIT_ACCELEROMETER_EVT_FREEFALL = 7,
MICROBIT_ACCELEROMETER_EVT_3G = 8,
MICROBIT_ACCELEROMETER_EVT_6G = 9,
MICROBIT_ACCELEROMETER_EVT_8G = 10,
MICROBIT_ACCELEROMETER_EVT_SHAKE = 11,
MICROBIT_ACCELEROMETER_REST_TOLERANCE = 200,
MICROBIT_ACCELEROMETER_TILT_TOLERANCE = 200,
MICROBIT_ACCELEROMETER_FREEFALL_TOLERANCE = 400,
MICROBIT_ACCELEROMETER_SHAKE_TOLERANCE = 1000,
MICROBIT_ACCELEROMETER_3G_TOLERANCE = 3072,
MICROBIT_ACCELEROMETER_6G_TOLERANCE = 6144,
MICROBIT_ACCELEROMETER_8G_TOLERANCE = 8192,
MICROBIT_ACCELEROMETER_GESTURE_DAMPING = 10,
MICROBIT_ACCELEROMETER_SHAKE_DAMPING = 10,
MICROBIT_ACCELEROMETER_SHAKE_COUNT_THRESHOLD = 4,
GESTURE_NONE = 0,
GESTURE_UP = 1,
GESTURE_DOWN = 2,
GESTURE_LEFT = 3,
GESTURE_RIGHT = 4,
GESTURE_FACE_UP = 5,
GESTURE_FACE_DOWN = 6,
GESTURE_FREEFALL = 7,
GESTURE_3G = 8,
GESTURE_6G = 9,
GESTURE_8G = 10,
GESTURE_SHAKE = 11,
// MicroBitAccelerometerService.h
// MicroBitBLEManager.h
MICROBIT_BLE_PAIR_REQUEST = 0x01,
MICROBIT_BLE_PAIR_COMPLETE = 0x02,
MICROBIT_BLE_PAIR_PASSCODE = 0x04,
MICROBIT_BLE_PAIR_SUCCESSFUL = 0x08,
MICROBIT_BLE_PAIRING_TIMEOUT = 90,
MICROBIT_BLE_POWER_LEVELS = 8,
MICROBIT_BLE_MAXIMUM_BONDS = 4,
// MicroBitButton.h
MICROBIT_BUTTON_EVT_DOWN = 1,
MICROBIT_BUTTON_EVT_UP = 2,
MICROBIT_BUTTON_EVT_CLICK = 3,
MICROBIT_BUTTON_EVT_LONG_CLICK = 4,
MICROBIT_BUTTON_EVT_HOLD = 5,
MICROBIT_BUTTON_EVT_DOUBLE_CLICK = 6,
MICROBIT_BUTTON_LONG_CLICK_TIME = 1000,
MICROBIT_BUTTON_HOLD_TIME = 1500,
MICROBIT_BUTTON_STATE = 1,
MICROBIT_BUTTON_STATE_HOLD_TRIGGERED = 2,
MICROBIT_BUTTON_STATE_CLICK = 4,
MICROBIT_BUTTON_STATE_LONG_CLICK = 8,
MICROBIT_BUTTON_SIGMA_MIN = 0,
MICROBIT_BUTTON_SIGMA_MAX = 12,
MICROBIT_BUTTON_SIGMA_THRESH_HI = 8,
MICROBIT_BUTTON_SIGMA_THRESH_LO = 2,
MICROBIT_BUTTON_DOUBLE_CLICK_THRESH = 50,
MICROBIT_BUTTON_SIMPLE_EVENTS = 0,
MICROBIT_BUTTON_ALL_EVENTS = 1,
// MicroBitButtonService.h
// MicroBitCompass.h
MAG3110_DEFAULT_ADDR = 0x1D,
MAG_DR_STATUS = 0x00,
MAG_OUT_X_MSB = 0x01,
MAG_OUT_X_LSB = 0x02,
MAG_OUT_Y_MSB = 0x03,
MAG_OUT_Y_LSB = 0x04,
MAG_OUT_Z_MSB = 0x05,
MAG_OUT_Z_LSB = 0x06,
MAG_WHOAMI = 0x07,
MAG_SYSMOD = 0x08,
MAG_OFF_X_MSB = 0x09,
MAG_OFF_X_LSB = 0x0A,
MAG_OFF_Y_MSB = 0x0B,
MAG_OFF_Y_LSB = 0x0C,
MAG_OFF_Z_MSB = 0x0D,
MAG_OFF_Z_LSB = 0x0E,
MAG_DIE_TEMP = 0x0F,
MAG_CTRL_REG1 = 0x10,
MAG_CTRL_REG2 = 0x11,
MAG3110_SAMPLE_RATES = 11,
MICROBIT_COMPASS_EVT_CAL_REQUIRED = 1,
MICROBIT_COMPASS_EVT_CAL_START = 2,
MICROBIT_COMPASS_EVT_CAL_END = 3,
MICROBIT_COMPASS_EVT_DATA_UPDATE = 4,
MICROBIT_COMPASS_EVT_CONFIG_NEEDED = 5,
MICROBIT_COMPASS_EVT_CALIBRATE = 6,
MICROBIT_COMPASS_STATUS_CALIBRATED = 1,
MICROBIT_COMPASS_STATUS_CALIBRATING = 2,
MAG3110_WHOAMI_VAL = 0xC4,
// MicroBitCompat.h
// MicroBitComponent.h
MICROBIT_ID_BUTTON_A = 1,
MICROBIT_ID_BUTTON_B = 2,
MICROBIT_ID_BUTTON_RESET = 3,
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,
MICROBIT_ID_IO_P3 = 10,
MICROBIT_ID_IO_P4 = 11,
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_BUTTON_AB = 26,
MICROBIT_ID_GESTURE = 27,
MICROBIT_ID_THERMOMETER = 28,
MICROBIT_ID_RADIO = 29,
MICROBIT_ID_RADIO_DATA_READY = 30,
MICROBIT_ID_MULTIBUTTON_ATTACH = 31,
MICROBIT_ID_MESSAGE_BUS_LISTENER = 1021,
MICROBIT_ID_NOTIFY_ONE = 1022,
MICROBIT_ID_NOTIFY = 1023,
// MicroBitCoordinateSystem.h
RAW = 0,
SIMPLE_CARTESIAN = 1,
NORTH_EAST_DOWN = 2,
// MicroBitDFUService.h
MICROBIT_DFU_OPCODE_START_DFU = 1,
MICROBIT_DFU_OPCODE_START_PAIR = 2,
MICROBIT_DFU_HISTOGRAM_WIDTH = 5,
MICROBIT_DFU_HISTOGRAM_HEIGHT = 5,
// MicroBitDisplay.h
MICROBIT_DISPLAY_EVT_ANIMATION_COMPLETE = 1,
MICROBIT_DISPLAY_EVT_FREE = 2,
MICROBIT_DISPLAY_EVT_LIGHT_SENSE = 4,
MICROBIT_DISPLAY_WIDTH = 5,
MICROBIT_DISPLAY_HEIGHT = 5,
MICROBIT_DISPLAY_SPACING = 1,
MICROBIT_DISPLAY_ERROR_CHARS = 4,
MICROBIT_DISPLAY_GREYSCALE_BIT_DEPTH = 8,
MICROBIT_DISPLAY_ANIMATE_DEFAULT_POS = -255,
MICROBIT_DISPLAY_ROW_RESET = 0x20,
ANIMATION_MODE_NONE = 0,
ANIMATION_MODE_STOPPED = 1,
ANIMATION_MODE_SCROLL_TEXT = 2,
ANIMATION_MODE_PRINT_TEXT = 3,
ANIMATION_MODE_SCROLL_IMAGE = 4,
ANIMATION_MODE_ANIMATE_IMAGE = 5,
ANIMATION_MODE_PRINT_CHARACTER = 6,
DISPLAY_MODE_BLACK_AND_WHITE = 0,
DISPLAY_MODE_GREYSCALE = 1,
DISPLAY_MODE_BLACK_AND_WHITE_LIGHT_SENSE = 2,
MICROBIT_DISPLAY_ROTATION_0 = 0,
MICROBIT_DISPLAY_ROTATION_90 = 1,
MICROBIT_DISPLAY_ROTATION_180 = 2,
MICROBIT_DISPLAY_ROTATION_270 = 3,
// MicroBitEvent.h
CREATE_ONLY = 0,
CREATE_AND_QUEUE = 1,
CREATE_AND_FIRE = 2,
// MicroBitEventService.h
// MicroBitFiber.h
MICROBIT_FLAG_DATA_READY = 0x01,
MICROBIT_FIBER_FLAG_FOB = 0x01,
MICROBIT_FIBER_FLAG_PARENT = 0x02,
MICROBIT_FIBER_FLAG_CHILD = 0x04,
MICROBIT_FIBER_FLAG_DO_NOT_PAGE = 0x08,
// MicroBitFont.h
MICROBIT_FONT_WIDTH = 5,
MICROBIT_FONT_HEIGHT = 5,
MICROBIT_FONT_ASCII_START = 32,
MICROBIT_FONT_ASCII_END = 126,
// MicroBitHeapAllocator.h
MICROBIT_HEAP_COUNT = 2,
MICROBIT_HEAP_BLOCK_FREE = 0x80000000,
// MicroBitI2C.h
MICROBIT_I2C_MAX_RETRIES = 9,
// MicroBitIO.h
// MicroBitIOPinService.h
MICROBIT_IO_PIN_SERVICE_PINCOUNT = 20,
MICROBIT_IO_PIN_SERVICE_DATA_SIZE = 10,
// MicroBitImage.h
// MicroBitLEDService.h
// MicroBitLightSensor.h
MICROBIT_LIGHT_SENSOR_CHAN_NUM = 3,
MICROBIT_LIGHT_SENSOR_AN_SET_TIME = 4000,
MICROBIT_LIGHT_SENSOR_TICK_PERIOD = 5,
MICROBIT_LIGHT_SENSOR_MAX_VALUE = 338,
MICROBIT_LIGHT_SENSOR_MIN_VALUE = 75,
// MicroBitListener.h
MESSAGE_BUS_LISTENER_PARAMETERISED = 0x0001,
MESSAGE_BUS_LISTENER_METHOD = 0x0002,
MESSAGE_BUS_LISTENER_BUSY = 0x0004,
MESSAGE_BUS_LISTENER_REENTRANT = 0x0008,
MESSAGE_BUS_LISTENER_QUEUE_IF_BUSY = 0x0010,
MESSAGE_BUS_LISTENER_DROP_IF_BUSY = 0x0020,
MESSAGE_BUS_LISTENER_NONBLOCKING = 0x0040,
MESSAGE_BUS_LISTENER_URGENT = 0x0080,
MESSAGE_BUS_LISTENER_DELETING = 0x8000,
// MicroBitMagnetometerService.h
// MicroBitMatrixMaps.h
NO_CONN = 0,
// MicroBitMessageBus.h
MICROBIT_CONTROL_BUS_ID = 0,
MICROBIT_ID_ANY = 0,
MICROBIT_EVT_ANY = 0,
// MicroBitMultiButton.h
MICROBIT_MULTI_BUTTON_STATE_1 = 0x01,
MICROBIT_MULTI_BUTTON_STATE_2 = 0x02,
MICROBIT_MULTI_BUTTON_HOLD_TRIGGERED_1 = 0x04,
MICROBIT_MULTI_BUTTON_HOLD_TRIGGERED_2 = 0x08,
MICROBIT_MULTI_BUTTON_SUPRESSED_1 = 0X10,
MICROBIT_MULTI_BUTTON_SUPRESSED_2 = 0x20,
MICROBIT_MULTI_BUTTON_ATTACHED = 0x40,
// MicroBitPanic.h
// MicroBitPin.h
IO_STATUS_DIGITAL_IN = 0x01,
IO_STATUS_DIGITAL_OUT = 0x02,
IO_STATUS_ANALOG_IN = 0x04,
IO_STATUS_ANALOG_OUT = 0x08,
IO_STATUS_TOUCH_IN = 0x10,
IO_STATUS_EVENTBUS_ENABLED = 0x80,
MICROBIT_PIN_MAX_OUTPUT = 1023,
MICROBIT_PIN_MAX_SERVO_RANGE = 180,
MICROBIT_PIN_DEFAULT_SERVO_RANGE = 2000,
MICROBIT_PIN_DEFAULT_SERVO_CENTER = 1500,
PIN_CAPABILITY_DIGITAL = 0x01,
PIN_CAPABILITY_ANALOG = 0x02,
PIN_CAPABILITY_TOUCH = 0x04,
// MicroBitRadio.h
MICROBIT_RADIO_STATUS_INITIALISED = 0x0001,
MICROBIT_RADIO_BASE_ADDRESS = 0x75626974,
MICROBIT_RADIO_DEFAULT_GROUP = 0,
MICROBIT_RADIO_DEFAULT_TX_POWER = 6,
MICROBIT_RADIO_DEFAULT_FREQUENCY = 7,
MICROBIT_RADIO_MAX_PACKET_SIZE = 32,
MICROBIT_RADIO_HEADER_SIZE = 4,
MICROBIT_RADIO_MAXIMUM_RX_BUFFERS = 4,
MICROBIT_RADIO_PROTOCOL_DATAGRAM = 1,
MICROBIT_RADIO_PROTOCOL_EVENTBUS = 2,
MICROBIT_RADIO_EVT_DATAGRAM = 1,
// MicroBitRadioDatagram.h
// MicroBitRadioEvent.h
// MicroBitSerial.h
MICROBIT_SERIAL_DEFAULT_BAUD_RATE = 115200,
MICROBIT_SERIAL_BUFFER_SIZE = 20,
// MicroBitStorage.h
MICROBIT_STORAGE_CONFIG_MAGIC = 0xCAFECAFE,
// MicroBitTemperatureService.h
// MicroBitThermometer.h
MICROBIT_THERMOMETER_PERIOD = 1000,
MICROBIT_THERMOMETER_EVT_UPDATE = 1,
// PacketBuffer.h
// RefCounted.h
}

View File

@ -1,11 +1,8 @@
enum Button { enum Button {
//% enumval=MICROBIT_ID_BUTTON_A A = DAL.MICROBIT_ID_BUTTON_A as number,
A, B = DAL.MICROBIT_ID_BUTTON_B as number,
//% enumval=MICROBIT_ID_BUTTON_B
B,
//% enumval=MICROBIT_ID_BUTTON_AB
//% block="A+B" //% block="A+B"
AB, AB = DAL.MICROBIT_ID_BUTTON_AB as number,
} }
enum Dimension { enum Dimension {

View File

@ -4,6 +4,7 @@
"installedVersion": "tsmdvf", "installedVersion": "tsmdvf",
"files": [ "files": [
"README.md", "README.md",
"dal.d.ts",
"core.d.ts", "core.d.ts",
"mbit.ts", "mbit.ts",
"images.ts", "images.ts",