Skip to content

[USART] Update USART class with better standards

During the development of the I2C driver, a lot of interesting considerations have been made. Since I2C driver takes some mechanics from the USART driver, I think that this can be improved too.

Some changes that could be done also in the USART driver are:

  • Handle the problem of multiple independent instantiations of the same bus;
  • Turn the ports variable as a static variable in the .cpp file;
  • Change the convention on ifdefs: check if the actual peripheral exists and not filter them by boards;
  • Handle the case if the peripheral to be used doesn't exist;
  • Maybe add a limit of N_MAX_POLLING in the busy-waits;
  • Try to exploit all the interrupts;
  • Consider not using mutexes by default, maybe make a USARTSync class instead
  • Use logger instead of traces
  • Use asserts
  • Do not use enum for prefixed Baudrates
Edited by Emilio Corigliano