Skip to content

Commit

Permalink
AT32F4: Support new board V4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
keirf committed Jul 21, 2023
1 parent c0bc1b1 commit 80b8999
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions inc/mcu/at32/f4.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ extern unsigned int sram_kb;
enum {
F4SM_v4 = 0,
F4SM_v4_slim,
F4SM_v4_1,
};

/* Core floppy pin assignments vary between F4 submodels (except INDEX, RDATA,
Expand Down
6 changes: 6 additions & 0 deletions src/mcu/at32f4/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ const static struct board_config _board_config[] = {
.hse_byp = TRUE,
.user_pins = _user_pins_v4_slim,
.msel_pins = _msel_pins_v4_slim },
[F4SM_v4_1] = {
.hse_mhz = 8,
.flippy = TRUE,
.user_pins = _user_pins_v4,
.msel_pins = _msel_pins_v4 },
};

const struct core_floppy_pins *core_floppy_pins;
Expand Down Expand Up @@ -143,6 +148,7 @@ static void mcu_board_init(void)
{
switch (gw_info.hw_submodel) {
case F4SM_v4:
case F4SM_v4_1:
gpio_pull_up_pins(gpioa, 0x0101); /* PA0,8 */
gpio_pull_up_pins(gpiob, 0x1803); /* PB0-1,11-12 */
gpio_pull_up_pins(gpioc, 0xffff); /* PC0-15 */
Expand Down
1 change: 1 addition & 0 deletions src/mcu/at32f4/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ static uint8_t mcu_get_floppy_pin(unsigned int pin, uint8_t *p_level)
{
switch (gw_info.hw_submodel) {
case F4SM_v4:
case F4SM_v4_1:
if (pin == 34) {
*p_level = gpio_read_pin(gpiob, 15);
return ACK_OKAY;
Expand Down
1 change: 1 addition & 0 deletions src/mcu/at32f4/testmode.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ uint8_t testmode_init(void)
{
switch (gw_info.hw_submodel) {
case F4SM_v4:
case F4SM_v4_1:
return ACK_OKAY;
}
return ACK_BAD_COMMAND;
Expand Down

0 comments on commit 80b8999

Please sign in to comment.