Merge pull request #5095 from dhalbert/raytac_mdbt50q-rx
Add raytac_mdbt50q-rx
This commit is contained in:
commit
4bcf0d419f
|
@ -345,6 +345,7 @@ jobs:
|
|||
- "qtpy_m0_haxpress"
|
||||
- "raspberry_pi_pico"
|
||||
- "raytac_mdbt50q-db-40"
|
||||
- "raytac_mdbt50q-rx"
|
||||
- "robohatmm1_m4"
|
||||
- "sam32"
|
||||
- "same54_xplained"
|
||||
|
|
|
@ -28,3 +28,4 @@
|
|||
#define MICROPY_HW_MCU_NAME "nRF52840"
|
||||
|
||||
#define MICROPY_HW_LED_STATUS (&pin_P0_13)
|
||||
#define MICROPY_HW_LED_STATUS_INVERTED (1)
|
||||
|
|
|
@ -66,6 +66,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
|
|||
{ MP_ROM_QSTR(MP_QSTR_CTS), MP_ROM_PTR(&pin_P0_07) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_RTS), MP_ROM_PTR(&pin_P0_05) },
|
||||
|
||||
// Note that these are inverted; you must pull them low to turn on the LEDs.
|
||||
{ MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_P0_14) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_P0_13) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_P0_15) },
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* This file is part of the MicroPython project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "supervisor/board.h"
|
||||
|
||||
void board_init(void) {
|
||||
}
|
||||
|
||||
bool board_requests_safe_mode(void) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void reset_board(void) {
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* This file is part of the MicroPython project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2016 Glenn Ruben Bakke
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define MICROPY_HW_BOARD_NAME "MDBT50Q-RX Dongle"
|
||||
#define MICROPY_HW_MCU_NAME "nRF52840"
|
||||
|
||||
#define MICROPY_HW_LED_STATUS (&pin_P1_13)
|
||||
#define MICROPY_HW_LED_STATUS_INVERTED (1)
|
|
@ -0,0 +1,8 @@
|
|||
USB_VID = 0x239A
|
||||
USB_PID = 0x810C
|
||||
USB_PRODUCT = "MDBT50Q-RX Dongle"
|
||||
USB_MANUFACTURER = "Raytac Corporation"
|
||||
|
||||
MCU_CHIP = nrf52840
|
||||
|
||||
INTERNAL_FLASH_FILESYSTEM = 1
|
|
@ -0,0 +1,11 @@
|
|||
#include "shared-bindings/board/__init__.h"
|
||||
|
||||
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR_P0_15), MP_ROM_PTR(&pin_P0_15) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_P0_15) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_P1_13), MP_ROM_PTR(&pin_P1_13) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_INVERTED_LED), MP_ROM_PTR(&pin_P1_13) },
|
||||
};
|
||||
|
||||
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
|
|
@ -101,6 +101,11 @@ uint16_t status_rgb_color[3] = {
|
|||
digitalio_digitalinout_obj_t single_color_led;
|
||||
|
||||
uint8_t rgb_status_brightness = 0xff;
|
||||
|
||||
#ifndef MICROPY_HW_LED_STATUS_INVERTED
|
||||
#define MICROPY_HW_LED_STATUS_INVERTED (0)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if CIRCUITPY_DIGITALIO && (defined(MICROPY_HW_LED_RX) || defined(MICROPY_HW_LED_TX))
|
||||
|
@ -189,7 +194,8 @@ void status_led_init() {
|
|||
|
||||
#elif defined(MICROPY_HW_LED_STATUS)
|
||||
common_hal_digitalio_digitalinout_construct(&single_color_led, MICROPY_HW_LED_STATUS);
|
||||
common_hal_digitalio_digitalinout_switch_to_output(&single_color_led, true, DRIVE_MODE_PUSH_PULL);
|
||||
common_hal_digitalio_digitalinout_switch_to_output(
|
||||
&single_color_led, MICROPY_HW_LED_STATUS_INVERTED == 0, DRIVE_MODE_PUSH_PULL);
|
||||
#endif
|
||||
|
||||
#if CIRCUITPY_DIGITALIO && CIRCUITPY_STATUS_LED
|
||||
|
@ -282,7 +288,8 @@ void new_status_color(uint32_t rgb) {
|
|||
common_hal_pwmio_pwmout_set_duty_cycle(&rgb_status_g, status_rgb_color[1]);
|
||||
common_hal_pwmio_pwmout_set_duty_cycle(&rgb_status_b, status_rgb_color[2]);
|
||||
#elif CIRCUITPY_DIGITALIO && defined(MICROPY_HW_LED_STATUS)
|
||||
common_hal_digitalio_digitalinout_set_value(&single_color_led, rgb_adjusted > 0);
|
||||
common_hal_digitalio_digitalinout_set_value(
|
||||
&single_color_led, (rgb_adjusted > 0) ^ MICROPY_HW_LED_STATUS_INVERTED);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue