#include <stdint.h>
#include <stdbool.h>
#include "micros_interrupts.h"
Go to the source code of this file.
◆ MICROS_COM1_PORT
#define MICROS_COM1_PORT 0x3F8 |
◆ MICROS_COM2_PORT
#define MICROS_COM2_PORT 0x2F8 |
◆ MICROS_COM3_PORT
#define MICROS_COM3_PORT 0x3E8 |
◆ MICROS_COM4_PORT
#define MICROS_COM4_PORT 0x2E8 |
◆ MICROS_PARITY_EVEN
#define MICROS_PARITY_EVEN 3 |
◆ MICROS_PARITY_MARK
#define MICROS_PARITY_MARK 5 |
◆ MICROS_PARITY_NONE
#define MICROS_PARITY_NONE 0 |
◆ MICROS_PARITY_ODD
#define MICROS_PARITY_ODD 1 |
◆ MICROS_PARITY_SPACE
#define MICROS_PARITY_SPACE 7 |
◆ micros_serial_init()
void micros_serial_init |
( |
unsigned int |
port, |
|
|
unsigned int |
baud_rate, |
|
|
unsigned int |
data_bits, |
|
|
unsigned int |
stop_bits, |
|
|
unsigned int |
parity |
|
) |
| |
Inits serial port.
Inits serial port with the specified parameters
- Parameters
-
port | Serial port ID (MICROS_COMx_PORT). |
baud_rate | Speed of the serial port in bauds. |
data_bits | Data length (set 8 for default). |
stop_bits | Stop bits for the single message (set 1 for default). |
parity | Parity of the message (set MICROS_PARITY_NONE for default). |
◆ micros_serial_is_busy()
bool micros_serial_is_busy |
( |
unsigned int |
port | ) |
|
Checks if the specified serial port is busy.
Checks if the specified serial port is busy.
- Parameters
-
port | Serial port ID (MICROS_COMx_PORT). |
- Returns
- True if the specified serial port is busy, otherwise false.
◆ micros_serial_is_queue_empty()
bool micros_serial_is_queue_empty |
( |
unsigned int |
port | ) |
|
Checks if the specified serial port queue is empty.
Checks if the specified serial port queue is empty.
- Parameters
-
port | Serial port ID (MICROS_COMx_PORT). |
- Returns
- True if the specified serial port queue is empty, otherwise false.
◆ micros_serial_receive()
char micros_serial_receive |
( |
unsigned int |
port | ) |
|
Reads a char on the specified serial port.
Reads a char on the specified serial port.
- Parameters
-
port | Serial port ID (MICROS_COMx_PORT). |
- Returns
- True if the specified serial port queue is empty, otherwise false.
◆ micros_serial_send()
void micros_serial_send |
( |
unsigned int |
port, |
|
|
char |
c |
|
) |
| |
Sends a char on the specified serial port.
Sends a char on the specified serial port.
- Parameters
-
port | Serial port ID (MICROS_COMx_PORT). |
c | Char to send. |
◆ micros_serial_send_string()
void micros_serial_send_string |
( |
unsigned int |
port, |
|
|
char * |
str |
|
) |
| |
Sends a string on the specified serial port.
Sends a string on the specified serial port.
- Parameters
-
port | Serial port ID (MICROS_COMx_PORT). |
string | String to send. |