“C8051F USART程序”的版本间的差异

来自丢石头百科
(文本替换 - 替换“www.waveshare.net”为“{{SERVERNAME}}”)
(文本替换 - 替换“http://{{”为“https://{{”)
 
第11行: 第11行:
 
*
 
*
 
*                                                          (c) Copyright 2005-2010, WaveShare
 
*                                                          (c) Copyright 2005-2010, WaveShare
*                                                                     <a class="Blue_2_12px_" href="http://{{SERVERNAME}}/" style="color: rgb(7, 66, 184);" target="_blank">http://{{SERVERNAME}}
+
*                                                                     <a class="Blue_2_12px_" href="https://{{SERVERNAME}}/" style="color: rgb(7, 66, 184);" target="_blank">https://{{SERVERNAME}}
  
 
*                                                                         All Rights Reserved
 
*                                                                         All Rights Reserved
第54行: 第54行:
 
*
 
*
 
*                                                          (c) Copyright 2005-2010, WaveShare
 
*                                                          (c) Copyright 2005-2010, WaveShare
*                                                                     <a class="Blue_2_12px_" href="http://{{SERVERNAME}}/" style="color: rgb(7, 66, 184);" target="_blank">http://{{SERVERNAME}}
+
*                                                                     <a class="Blue_2_12px_" href="https://{{SERVERNAME}}/" style="color: rgb(7, 66, 184);" target="_blank">https://{{SERVERNAME}}
  
 
*                                                                         All Rights Reserved
 
*                                                                         All Rights Reserved

2021年6月18日 (五) 17:58的最新版本

<tbody></tbody>

/********************************************************************************************************

  • File : ws_usart_port.h
  • Hardware Environment: 
  • Build Environment : Silicon LABs 3.42.00 / uVision3 V3.80 20100913
  • Version : 
  • By : Su Wei Feng
  •                                                           (c) Copyright 2005-2010, WaveShare
  •                                                                      <a class="Blue_2_12px_" href="https://wiki.diustou.com/" style="color: rgb(7, 66, 184);" target="_blank">https://wiki.diustou.com
  •                                                                          All Rights Reserved
                                                                                                                                                                                                                  • /
  1. ifndef _WS_USART_PORT_H_
  2. define _WS_USART_PORT_H_

/*Hardware Environment:DVK501 && F320 EX*/

  1. if defined(_DVK501_F320_EX_)

/**************************************************** USART0 initialization Communication Parameters: 8 Data, 1 Stop, No Parity USART0 Baud Rate: 9600

                                                                                                        • /

void usartInit(void) { XBR0 |= 0x01; P0MDOUT |= 0x10; SCON0 |= 0x10;  CKCON &= ~0x0B; // T1M = 0; SCA1:0 = 01  CKCON |= 0x01; TH1 = 0x64;  TL1 = TH1;  TMOD &= ~0xf0; // TMOD: timer 1 in 8-bit autoreload TMOD |= 0x20;  TR1 = 1;  TI0 = 1;  }

  1. else
  2. warning "USART interface undefined."
  3. endif
  4. include <../../../../library/C8051F/ws_usart.h>
  5. endif /*_WS_USART_PORT_H_*/

  /********************************************************************************************************

  • File : ws_usart.h
  • Hardware Environment: 
  • Build Environment : Silicon LABs 3.42.00 / uVision3 V3.80 20100913
  • Version : 
  • By : Su Wei Feng
  •                                                           (c) Copyright 2005-2010, WaveShare
  •                                                                      <a class="Blue_2_12px_" href="https://wiki.diustou.com/" style="color: rgb(7, 66, 184);" target="_blank">https://wiki.diustou.com
  •                                                                          All Rights Reserved
                                                                                                                                                                                                                  • /
  1. ifndef _WS_USART_H_
  2. define _WS_USART_H_

void putUsart0(uchar c) {  SBUF0 = c; } uint getUsart0(void) { uchar res; res = SBUF0; return res; }

  1. endif /*_WS_USART_H_*/