_usarta
objects are universal synchronous asynchronous receivers transmitters.
_usarta
objects support several modes:
- asynchronous
- synchronous
- smartcard
- singlewire
- irda
- lin
Actions
configure
:
hw |
hwa ( configure, usart1,
[ mode, asynchronous ]
[ bps, BPS, ]
[ databits, 8 | 9, ]
[ parity, none, even, odd, ]
[ stopbits, 1 | 2, ]
[ receiver, enabled | disabled, ]
[ transmitter, enabled | disabled, ]
);
Counter used as encoder:
hw |
hwa ( configure, encoder(counter2),
);
read:
uint16_t v =
hw( read, usart1 );
Interrupts
hw |
hwa ( turn, (systick,irq), on | off );
if (
hw( read, (systick,irq) )
Registers
- sr
- cts
- lbd
- txe
- tc
- rxne
- idle
- ore
- ne
- fe
- pe
- dr
- brr
- cr1
- ue
- m
- wake
- pce
- ps
- peie
- txeie
- tcie
- rxneie
- idleie
- te
- re
- rwu
- sbk
- cr2
- linen
- stop
- clken
- cpol
- cpha
- lbcl
- lbdie
- lbdl
- add
- cr3
- ctsie
- ctse
- rtse
- dmat
- dmar
- scen
- nack
- hdsel
- irlp
- iren
- eie
- gtpr