![]() |
GaIA BIOS Library
|
Buffered access to serial communication ports. More...
Data Structures | |
| struct | ser_ch_data_t |
| Serial Channel Data Provides serial buffers. More... | |
Macros | |
| #define | TXBLEN 0x200 |
| Tx Buffer length. | |
| #define | RXBLEN 0x200 |
| Rx Buffer length. | |
Functions | |
| ser_ch_data_t * | buf_serch_init (uint8_t port_id, uint8_t frame, uint8_t baudrate) |
| Initializes the serial channel. | |
| bool | buf_serch_deinit (ser_ch_data_t *ch) |
| Deinitializes the serial channel. | |
| void | buf_serch_chgbaud (ser_ch_data_t *ch, uint8_t baudrate) |
| Changes baudrate for the serial channel. | |
| ser_ch_data_t * | buf_serch_get (uint8_t ch_id) |
| Gets a reference to the serial channel. | |
| bool | buf_serch_out_empty (ser_ch_data_t *ch) |
| Checks whether the out buffer is empty or not. | |
| bool | buf_serch_out_ready (ser_ch_data_t *ch) |
| Checks whether ther is room in the out buffer. | |
| bool | buf_serch_put_char (ser_ch_data_t *ch, uint16_t c) |
| Puts a character in the out buffer. | |
| bool | buf_serch_char_ready (ser_ch_data_t *ch) |
| Returns true if a character is ready. | |
| uint16_t | buf_serch_get_char (ser_ch_data_t *ch) |
| Gets e character from buffer. | |
Buffered access to serial communication ports.
These functions initialize and access a buffered serial channel. A buffered serial channel is associated to one and only one serial port. A channel provides buffered access to the serial port.
| bool buf_serch_char_ready | ( | ser_ch_data_t * | ch | ) |
Returns true if a character is ready.
| ch | - reference to the serial channel. |
| void buf_serch_chgbaud | ( | ser_ch_data_t * | ch, |
| uint8_t | baudrate ) |
Changes baudrate for the serial channel.
| ch | - reference to the serial channel data structure. |
| baudrate | - the baudrate. |
| bool buf_serch_deinit | ( | ser_ch_data_t * | ch | ) |
Deinitializes the serial channel.
| ch | - reference to the serial channel data structure. |
| ser_ch_data_t * buf_serch_get | ( | uint8_t | ch_id | ) |
Gets a reference to the serial channel.
| ch_id | - serial channel id. |
| uint16_t buf_serch_get_char | ( | ser_ch_data_t * | ch | ) |
Gets e character from buffer.
This function must be called only when gwa_serch_char_ready has previously returned true.
| ch | - reference to the serial channel. |
| ser_ch_data_t * buf_serch_init | ( | uint8_t | port_id, |
| uint8_t | frame, | ||
| uint8_t | baudrate ) |
Initializes the serial channel.
| port_id | - serial port id. |
| frame | - frame type. |
| baudrate | - the baudrate. |
| bool buf_serch_out_empty | ( | ser_ch_data_t * | ch | ) |
Checks whether the out buffer is empty or not.
| ch | - reference to the serial channel. |
| bool buf_serch_out_ready | ( | ser_ch_data_t * | ch | ) |
Checks whether ther is room in the out buffer.
| ch | - reference to the serial channel. |
| bool buf_serch_put_char | ( | ser_ch_data_t * | ch, |
| uint16_t | c ) |
Puts a character in the out buffer.
| c | - character to be sent. |
| ch | - reference to the serial channel. |