Mercurial > ecos-v3_0-branch
comparison packages/devs/serial/arm/aeb/current/src/aeb_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 |
|---|---|
| 65 static bool aeb_serial_putc(serial_channel *chan, unsigned char c); | 65 static bool aeb_serial_putc(serial_channel *chan, unsigned char c); |
| 66 static Cyg_ErrNo aeb_serial_lookup(struct cyg_devtab_entry **tab, | 66 static Cyg_ErrNo aeb_serial_lookup(struct cyg_devtab_entry **tab, |
| 67 struct cyg_devtab_entry *sub_tab, | 67 struct cyg_devtab_entry *sub_tab, |
| 68 const char *name); | 68 const char *name); |
| 69 static unsigned char aeb_serial_getc(serial_channel *chan); | 69 static unsigned char aeb_serial_getc(serial_channel *chan); |
| 70 static bool aeb_serial_set_config(serial_channel *chan, cyg_serial_info_t *config); | 70 static Cyg_ErrNo aeb_serial_set_config(serial_channel *chan, |
| 71 cyg_uint32 key, | |
| 72 const void *xbuf, cyg_uint32 *len); | |
| 71 static void aeb_serial_start_xmit(serial_channel *chan); | 73 static void aeb_serial_start_xmit(serial_channel *chan); |
| 72 static void aeb_serial_stop_xmit(serial_channel *chan); | 74 static void aeb_serial_stop_xmit(serial_channel *chan); |
| 73 | 75 |
| 74 static cyg_uint32 aeb_serial_ISR(cyg_vector_t vector, cyg_addrword_t data); | 76 static cyg_uint32 aeb_serial_ISR(cyg_vector_t vector, cyg_addrword_t data); |
| 75 static void aeb_serial_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data); | 77 static void aeb_serial_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data); |
| 262 c = port->REG_RHR; | 264 c = port->REG_RHR; |
| 263 return c; | 265 return c; |
| 264 } | 266 } |
| 265 | 267 |
| 266 // Set up the device characteristics; baud rate, etc. | 268 // Set up the device characteristics; baud rate, etc. |
| 267 static bool | 269 static Cyg_ErrNo |
| 268 aeb_serial_set_config(serial_channel *chan, cyg_serial_info_t *config) | 270 aeb_serial_set_config(serial_channel *chan, cyg_uint32 key, |
| 269 { | 271 const void *xbuf, cyg_uint32 *len) |
| 270 return aeb_serial_config_port(chan, config, false); | 272 { |
| 273 switch (key) { | |
| 274 case CYG_IO_SET_CONFIG_SERIAL_INFO: | |
| 275 { | |
| 276 cyg_serial_info_t *config = (cyg_serial_info_t *)xbuf; | |
| 277 if ( *len < sizeof(cyg_serial_info_t) ) { | |
| 278 return -EINVAL; | |
| 279 } | |
| 280 *len = sizeof(cyg_serial_info_t); | |
| 281 if ( true != aeb_serial_config_port(chan, config, false) ) | |
| 282 return -EINVAL; | |
| 283 } | |
| 284 break; | |
| 285 default: | |
| 286 return -EINVAL; | |
| 287 } | |
| 288 return ENOERR; | |
| 271 } | 289 } |
| 272 | 290 |
| 273 // Enable the transmitter on the device | 291 // Enable the transmitter on the device |
| 274 static void | 292 static void |
| 275 aeb_serial_start_xmit(serial_channel *chan) | 293 aeb_serial_start_xmit(serial_channel *chan) |
