Skip to content

Commit 569aa90

Browse files
committed
micropython port for HydraBus
1 parent 8bf8404 commit 569aa90

11 files changed

+496
-8
lines changed

README.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
[travis-img]: https://travis-ci.org/micropython/micropython.png?branch=master
33
[travis-repo]: https://travis-ci.org/micropython/micropython
44

5-
The Micro Python project
6-
========================
5+
The Micro Python project (HydraBus port Beta)
6+
==============================================
77
<p align="center">
88
<img src="https://raw2.github.com/micropython/micropython/master/logo/upython-with-micro.jpg" alt="MicroPython Logo"/>
99
</p>
@@ -80,16 +80,19 @@ To build:
8080
$ cd stmhal
8181
$ make
8282

83-
You then need to get your board into DFU mode. On the pyboard, connect the
84-
3V3 pin to the P1/DFU pin with a wire (on PYBv1.0 they are next to each other
85-
on the bottom left of the board, second row from the bottom).
83+
You then need to get your board into DFU mode. On the HydraBus, connect the
84+
3V3 pin to the BOOT1 pin with a wire.
8685

8786
Then to flash the code via USB DFU to your device:
8887

8988
$ make deploy
9089

90+
or
91+
92+
for windows by double clicking on update_fw_usb_dfu_hydrabus.bat
93+
9194
You will need the dfu-util program, on Arch Linux it's dfu-util-git in the
9295
AUR. If the above does not work it may be because you don't have the
9396
correct permissions. Try then:
9497

95-
$ sudo dfu-util -a 0 -D build-PYBV10/firmware.dfu
98+
$ sudo dfu-util -a 0 -D build-HYDRABUS/firmware.dfu

stmhal/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Select the board to build for: if not given on the command line,
2-
# then default to PYBV10.
3-
BOARD ?= PYBV10
2+
# then default to HYDRABUS.
3+
BOARD ?= HYDRABUS
44
ifeq ($(wildcard boards/$(BOARD)/.),)
55
$(error Invalid BOARD specified)
66
endif
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#define HYDRABUSV10
2+
3+
#define MICROPY_HW_BOARD_NAME "HydraBus1.0"
4+
5+
#define MICROPY_HW_HAS_SWITCH (1)
6+
#define MICROPY_HW_HAS_SDCARD (1)
7+
#define MICROPY_HW_HAS_MMA7660 (0)
8+
#define MICROPY_HW_HAS_LIS3DSH (0)
9+
#define MICROPY_HW_HAS_LCD (0)
10+
#define MICROPY_HW_ENABLE_RNG (1)
11+
#define MICROPY_HW_ENABLE_RTC (0)
12+
#define MICROPY_HW_ENABLE_TIMER (1)
13+
#define MICROPY_HW_ENABLE_SERVO (0)
14+
#define MICROPY_HW_ENABLE_DAC (1)
15+
#define MICROPY_HW_ENABLE_I2C1 (1)
16+
#define MICROPY_HW_ENABLE_SPI1 (1)
17+
#define MICROPY_HW_ENABLE_SPI3 (1)
18+
#define MICROPY_HW_ENABLE_CC3K (0)
19+
20+
// USRSW/UBTN (Needs Jumper UBTN) is pulled low. Pressing the button makes the input go high.
21+
#define MICROPY_HW_USRSW_PIN (pin_A0)
22+
#define MICROPY_HW_USRSW_PULL (GPIO_NOPULL)
23+
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_RISING)
24+
#define MICROPY_HW_USRSW_PRESSED (1)
25+
26+
// The HydraBus has 1 LED (Needs jumper on ULED)
27+
#define MICROPY_HW_LED1 (pin_A4) // green
28+
#define MICROPY_HW_LED2 (pin_A4) // same as LED1
29+
#define MICROPY_HW_LED3 (pin_A4) // same as LED1
30+
#define MICROPY_HW_LED4 (pin_A4) // same as LED1
31+
#define MICROPY_HW_LED_OTYPE (GPIO_MODE_OUTPUT_PP)
32+
#define MICROPY_HW_LED_ON(pin) (pin->gpio->BSRRL = pin->pin_mask)
33+
#define MICROPY_HW_LED_OFF(pin) (pin->gpio->BSRRH = pin->pin_mask)
34+
35+
// SD card detect switch (not used, always on)
36+
#define MICROPY_HW_SDCARD_DETECT_PIN (pin_A8)
37+
#define MICROPY_HW_SDCARD_DETECT_PULL (GPIO_PULLUP)
38+
#define MICROPY_HW_SDCARD_DETECT_PRESENT (1)

stmhal/boards/HYDRABUS/pins.csv

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
PC0,PC0
2+
PC1,PC1
3+
PC2,PC2
4+
PC3,PC3
5+
PC4,PC4
6+
PC5,PC5
7+
PC6,PC6
8+
PC7,PC7
9+
PC8,PC8
10+
PC9,PC9
11+
PC10,PC10
12+
PC11,PC11
13+
PC12,PC12
14+
PC13,PC13
15+
PC14,PC14
16+
PC15,PC15
17+
PB0,PB0
18+
PB1,PB1
19+
PB2,PB2
20+
PB3,PB3
21+
PB4,PB4
22+
PB5,PB5
23+
PB6,PB6
24+
PB7,PB7
25+
PB8,PB8
26+
PB9,PB9
27+
PB10,PB10
28+
PB11,PB11
29+
PB12,PB12
30+
VUSB,PB13
31+
USB1D_N,PB14
32+
USB1D_P,PB15
33+
PA0,PA0
34+
PA1,PA1
35+
PA2,PA2
36+
PA3,PA3
37+
PA4,PA4
38+
PA5,PA5
39+
PA6,PA6
40+
PA7,PA7
41+
PA8,PA8
42+
PA9,PA9
43+
PA10,PA10
44+
PA11,PA11
45+
PA12,PA12
46+
PD2,PD2
47+
BOOT0,BOOT0
48+
PA15,PA15

0 commit comments

Comments
 (0)