Skip to content

Commit

Permalink
ADD: enable UART1 RTS output on PA15
Browse files Browse the repository at this point in the history
  • Loading branch information
r2axz committed Jun 11, 2021
1 parent ff84936 commit 7c924c6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ or damage may occur.**
|:-------|:-------------:|:--------------|:--------------|:--------------|
| RX | IN | **PA10** | PA3 | **PB11** |
| TX | OUT | PA9 | PA2 | PB10 |
| RTS | OUT | N/A | PA1 | PB14 |
| RTS | OUT | **PA15** | PA1 | PB14 |
| CTS | IN | N/A | PA0 | **PB13** |
| DSR | IN | **PB7** | **PB4** | **PB6** |
| DTR | OUT | PA4 | PA5 | PA6 |
Expand Down
2 changes: 1 addition & 1 deletion device_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static const device_config_t default_device_config = {
{
/* rx */ { .port = GPIOA, .pin = 10, .dir = gpio_dir_input, .pull = gpio_pull_up, .polarity = gpio_polarity_high },
/* tx */ { .port = GPIOA, .pin = 9, .dir = gpio_dir_output, .speed = gpio_speed_medium, .func = gpio_func_alternate, .output = gpio_output_pp, .polarity = gpio_polarity_high },
/* rts */ { .port = 0 }, /* No RTS due to the below reason */
/* rts */ { .port = GPIOA, .pin = 15, .dir = gpio_dir_output, .speed = gpio_speed_medium, .func = gpio_func_general, .output = gpio_output_pp, .polarity = gpio_polarity_low},
/* cts */ { .port = 0 }, /* CTS pin is occupied by USB */
/* dsr */ { .port = GPIOB, .pin = 7, .dir = gpio_dir_input, .pull = gpio_pull_up, .polarity = gpio_polarity_low },
/* dtr */ { .port = GPIOA, .pin = 4, .dir = gpio_dir_output, .speed = gpio_speed_medium, .func = gpio_func_general, .output = gpio_output_pp, .polarity = gpio_polarity_low },
Expand Down
2 changes: 1 addition & 1 deletion usb_cdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static void usb_cdc_set_port_dtr(int port, int dtr_active) {
}

static void usb_cdc_update_port_rts(int port) {
if ((port < USB_CDC_NUM_PORTS) && (port != 0)) {
if ((port < USB_CDC_NUM_PORTS)) {
const gpio_pin_t *rts_pin = &device_config_get()->cdc_config.port_config[port].pins[cdc_pin_rts];
usb_cdc_state_t *cdc_state = &usb_cdc_states[port];
circ_buf_t *rx_buf = &cdc_state->rx_buf;
Expand Down

0 comments on commit 7c924c6

Please sign in to comment.