Fixes and improvements from Anthony Asterisk

- First in 8051def.h,  it appears the uip_arch-asm.S file was copied from z80 and am unsure it will work properly.  I modified the 8051def.h to prevent the UIP code from using these routines.
- In dma.c the config routine provides access to all of the DMA channel options, except for the word mode flag.  In order to maintain compatibility with any existing code I created a second routine and converted the original routine into a wrapper routine with a fixed word mode value.
- uart.c::uart0_init was missing blocking access to the higher baud rates.  I am not sure why, so I corrected this.
- I also copied over to header files that provide some useful macros from the msp430 cpu.  The files are lpm.h and hwconf.h.  The lpm.h is for switching power modes, I think.  The hwconf.h has various macros for configuring port I/O.  By porting these files the led/button api's can be ported with minimal modifications.
This commit is contained in:
zdshelby 2009-12-22 09:28:14 +00:00
parent e032f7ac2c
commit c5ecde4ca0
7 changed files with 213 additions and 22 deletions

View file

@ -13,9 +13,19 @@ static int (*uart1_input_handler)(unsigned char c);
void
uart0_init(uint32_t speed)
{
if(speed != 115200) {
return;
if(speed == 115200) {
U0BAUD=216; /*115200*/
U0GCR =11; /*LSB first and 115200*/
}
else if(speed == 38400) {
U0BAUD=59; /*38400*/
U0GCR =10; /*LSB first and 38400*/
}
else if(speed == 9600) {
U0BAUD= 59; /* 9600 */
U0GCR = 8; /*LSB first and 9600*/
}
else { return; }
#ifdef UART0_ALTERNATIVE_2
PERCFG |= U0CFG; /*alternative port 2 = P1.5-2*/
@ -39,20 +49,6 @@ uart0_init(uint32_t speed)
P0DIR &= ~0x14; /*CTS & RX in*/
#endif
if(speed == 115200) {
U0BAUD=216; /*115200*/
U0GCR =11; /*LSB first and 115200*/
}
if(speed == 38400) {
U0BAUD=59; /*38400*/
U0GCR =10; /*LSB first and 38400*/
}
if(speed == 9600) {
U0BAUD= 59; /* 9600 */
U0GCR = 8; /*LSB first and 9600*/
}
#ifdef UART0_RTSCTS
U0UCR = 0x42; /*defaults: 8N1, RTS/CTS, high stop bit*/