Mercurial > ecos-v3_0-branch
comparison packages/devs/serial/mips/jmr3904/current/src/tx3904_serial.c @ 115:6ed91473a1cd ecos-sw-2000-08-21
Merge from eCos master repository on 2000-08-21-22:40:54-BST
| author | jlarmour |
|---|---|
| date | Fri, 25 Aug 2000 17:32:38 +0000 |
| parents | 6736c52df507 |
| children | e0c0827131d1 |
comparison
equal
deleted
inserted
replaced
| 114:5ad2b71d525e | 115:6ed91473a1cd |
|---|---|
| 66 static bool tx3904_serial_putc(serial_channel *chan, unsigned char c); | 66 static bool tx3904_serial_putc(serial_channel *chan, unsigned char c); |
| 67 static Cyg_ErrNo tx3904_serial_lookup(struct cyg_devtab_entry **tab, | 67 static Cyg_ErrNo tx3904_serial_lookup(struct cyg_devtab_entry **tab, |
| 68 struct cyg_devtab_entry *sub_tab, | 68 struct cyg_devtab_entry *sub_tab, |
| 69 const char *name); | 69 const char *name); |
| 70 static unsigned char tx3904_serial_getc(serial_channel *chan); | 70 static unsigned char tx3904_serial_getc(serial_channel *chan); |
| 71 static bool tx3904_serial_set_config(serial_channel *chan, cyg_serial_info_t *config); | 71 static Cyg_ErrNo tx3904_serial_set_config(serial_channel *chan, cyg_uint32 key, |
| 72 const void *xbuf, cyg_uint32 *len); | |
| 72 static void tx3904_serial_start_xmit(serial_channel *chan); | 73 static void tx3904_serial_start_xmit(serial_channel *chan); |
| 73 static void tx3904_serial_stop_xmit(serial_channel *chan); | 74 static void tx3904_serial_stop_xmit(serial_channel *chan); |
| 74 | 75 |
| 75 #ifndef CYGPKG_IO_SERIAL_TX39_JMR3904_POLLED_MODE | 76 #ifndef CYGPKG_IO_SERIAL_TX39_JMR3904_POLLED_MODE |
| 76 static cyg_uint32 tx3904_serial_ISR(cyg_vector_t vector, cyg_addrword_t data, cyg_addrword_t *regs); | 77 static cyg_uint32 tx3904_serial_ISR(cyg_vector_t vector, cyg_addrword_t data, cyg_addrword_t *regs); |
| 558 return c; | 559 return c; |
| 559 } | 560 } |
| 560 | 561 |
| 561 //------------------------------------------------------------------------- | 562 //------------------------------------------------------------------------- |
| 562 | 563 |
| 563 bool | 564 static Cyg_ErrNo |
| 564 tx3904_serial_set_config(serial_channel *chan, cyg_serial_info_t *config) | 565 tx3904_serial_set_config(serial_channel *chan, cyg_uint32 key, |
| 565 { | 566 const void *xbuf, cyg_uint32 *len) |
| 566 return tx3904_serial_config_port(chan, config, false); | 567 { |
| 568 switch (key) { | |
| 569 case CYG_IO_SET_CONFIG_SERIAL_INFO: | |
| 570 { | |
| 571 cyg_serial_info_t *config = (cyg_serial_info_t *)xbuf; | |
| 572 if ( *len < sizeof(cyg_serial_info_t) ) { | |
| 573 return -EINVAL; | |
| 574 } | |
| 575 *len = sizeof(cyg_serial_info_t); | |
| 576 if ( true != tx3904_serial_config_port(chan, config, false) ) | |
| 577 return -EINVAL; | |
| 578 } | |
| 579 break; | |
| 580 default: | |
| 581 return -EINVAL; | |
| 582 } | |
| 583 return ENOERR; | |
| 567 } | 584 } |
| 568 | 585 |
| 569 //------------------------------------------------------------------------- | 586 //------------------------------------------------------------------------- |
| 570 // Enable the transmitter on the device | 587 // Enable the transmitter on the device |
| 571 | 588 |
