... | ... | @@ -90,7 +90,7 @@ const unsigned int auxSerialSpeed=9600; |
|
|
const bool auxSerialFlowctrl=false;
|
|
|
```
|
|
|
## USART driver
|
|
|
The driver for the USART peripheral permits to use all the USART/UART peripherals of any board, setting the wanted baudrate. All the pins linked to the various USART/UART peripherals are defined in the USART.h header file in the format of uNtxM or uNrxM (N = id of the peripheral; M = [absent, 1 or 2] in order to distinguish among different pins with same function; e.g. u1tx1, u1rx1, u5tx, u5rx).
|
|
|
The driver for the USART peripheral permits to use all the USART/UART peripherals of any board, setting the wanted baudrate. All the pins linked to the various USART/UART peripherals are defined in the USART.h header file in the format of uNtxM or uNrxM (N = id of the peripheral; M = [absent, 1 or 2] in order to distinguish among different pins with same function; e.g. u1tx1, u1rx1, u5tx, u5rx). An example of usage is in `tests/drivers/usart/test-usart.cpp`.
|
|
|
|
|
|
### USARTInterface
|
|
|
This class is the abstract class that represents a USART peripheral. It has some abstract methods in order to expose some common features:
|
... | ... | @@ -108,7 +108,7 @@ This is a low level implementation of the USART driver. It supports all the USAR |
|
|
- Destructor: Disables the flags for the generation of the interrupts, disables the IRQ from the NVIC, disables the peripheral and removes his pointer from the ports list.
|
|
|
|
|
|
### STM32SerialWrapper
|
|
|
This is a wrapper of the miosix driver STM32Serial. It supports only the USART 1, 2 and 3. Some notable methods of this driver are:
|
|
|
This is a wrapper of the miosix driver STM32Serial. It supports only the USART 1, 2 and 3. For reading long messages with low baudrates it's needed to wait some milliseconds between the sending and the receiving of the message. Some notable methods of this driver are:
|
|
|
- Constructors: There are two constructors, one will initialize the peripheral with custom pins and the other will initialize automatically the peripheral with the default pins.
|
|
|
- `init`: Creates a device that represents the serial port, adds it to the file system and opens the file that represents the device.
|
|
|
- Destructor: Removes the device from the list of the devices and closes the file of the device. |
|
|
\ No newline at end of file |