Browse Source

use apb for uart gpio, fix apb usage in gpio

master
Marc Poulhiès 5 years ago
parent
commit
657dbd337f
  1. 6
      src/tiva_gpio.rs
  2. 4
      src/tiva_uart.rs

6
src/tiva_gpio.rs

@ -24,8 +24,10 @@ impl TivaGpio {
// bit-band access
write_bitband!(sysctl::SYSCTL_RCGCGPIO, self.sysctl_idx, 1);
// Use HPB instead of APB
write_bitband!(sysctl::SYSCTL_GPIOHBCTL, self.sysctl_idx, 1);
if self.use_hpb {
// Use HPB instead of APB
write_bitband!(sysctl::SYSCTL_GPIOHBCTL, self.sysctl_idx, 1);
}
}
pub unsafe fn init_pin(&self, pin:u8, mode : TivaGpioMode){

4
src/tiva_uart.rs

@ -25,8 +25,8 @@ const Uart0 : TivaUartConf = TivaUartConf {
gpio : tiva_gpio::TivaGpio{
sysctl_idx:0,
base_addr: memmap::GPIO_PORTA_AHB_BASE,
use_hpb:true
base_addr: memmap::GPIO_PORTA_BASE,
use_hpb:false
},
gpio_rx_pin_i : 0,
gpio_tx_pin_i : 1,

Loading…
Cancel
Save