SHARE
TWEET

Untitled

a guest Oct 10th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <MDR32F9Qx_port.h>
  2. #include <MDR32F9Qx_rst_clk.h>
  3.  
  4. #define DELAY(T) for (i = T; i > 0; i--)
  5. int i;
  6.  
  7. int main() {
  8.     RST_CLK_PCLKcmd(RST_CLK_PCLK_PORTC, ENABLE);
  9.    
  10. /* -----------------------------------------------------------------------------------*/
  11.    
  12. MDR_PORTC->OE        |=  PORT_OE_OUT | (PORT_OE_OUT << 1);
  13.   MDR_PORTC->ANALOG    |=  PORT_MODE_DIGITAL | (PORT_MODE_DIGITAL << 1);
  14.   MDR_PORTC->PULL      |=  (PORT_PULL_UP_ON  << 16) | (PORT_PULL_UP_ON   << 17);
  15.   MDR_PORTC->PWR       |=  PORT_SPEED_FAST | (PORT_SPEED_FAST << 2) ;
  16.            
  17. /* -----------------------------------------------------------------------------------*/
  18.    
  19.     while (1) {
  20.         PORT_SetBits(MDR_PORTC, PORT_Pin_0);
  21.         PORT_ResetBits(MDR_PORTC, PORT_Pin_1);
  22.         DELAY(100000);
  23.         PORT_ResetBits(MDR_PORTC, PORT_Pin_0);
  24.         PORT_SetBits(MDR_PORTC, PORT_Pin_1);
  25.         DELAY(100000);
  26.     }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top