コード例 #1
0
void serieport_init(void) {
	RCC_PeriphClockCmd(RCC_USART6, ENABLE);
	RCC_PeriphClockCmd(RCC_GPIOC, ENABLE);
    init_GPIO(GPIOC, GPIO_Pin_6 | GPIO_Pin_7, GPIO_Mode_AF, GPIO_Fast_Speed, GPIO_OType_PP, GPIO_PuPd_UP);
	GPIO_PinAFConfig(GPIOC, GPIO_PinSource6, GPIO_AF_USART6);
	GPIO_PinAFConfig(GPIOC, GPIO_PinSource7, GPIO_AF_USART6);
	init_SCI(USART6, 9600, USART_WordLength_8b, USART_StopBits_1, USART_Parity_No, USART_Mode_Rx | USART_Mode_Tx, USART_HardwareFlowControl_None);
}
コード例 #2
0
ファイル: main.c プロジェクト: kuromi546/ENSC451-MiniProj2
/**********************MAIN***********/
void main(void) {  
  DisableInterrupts;
  
  init();
  init_LCD();
  init_TSCR(128);   //1,2,4,8,16,32,64,128 
  init_SCI();
  
  EnableInterrupts;
  
  for(;;);     
}