.. |br| raw:: html
      
.. _rs232:
RS232 - Serial Port
===================
The ``RS232`` class provides a wrapper for basic UART functionality for RS232#1. |br|
It offers basic functions to configure, send and receive data.
    
The class needs to be initialized with the following parameters:
.. csv-table::
    :header: Parameter name, Value, Description
    :widths: 10, 10, 10
    ``uart_baudrate``, "9600, 19200, 38400, 57600,
    
    115200, 230400, 460800,
    
    921600", RS232#1 baudrate        
Methods
-------
.. automodule:: rs232
   :members:
   :undoc-members:
   :show-inheritance:
   :exclude-members: UART_PORT
.. note:: 
    Since the ``get_uart_id()`` method of the ``RS232`` class returns a microPython UART object, it has all its methods. |br|
    To do not duplicate the documentation, we suggest to take a look at the `official microPython project documentation `_ to see what methods you can additionaly use.
    
    Example of additional methods:
        >>> import sbc
        >>> rs232 = sbc.RS232( 115200 )
        >>> print('There are: ',rs232.any(),' characters to be read')
        There are:  1580  characters to be read
        >>> print(rs232.get_uart_id().readline())
        b'$GNGGA,142222.00,4136.52091,N,00036.70322,E,2,10,1.27,203.6,M,49.8,M,,0000*4D\r\n'