LCOV - code coverage report
Current view: top level - src/hw - uart.c (source / functions) Hit Total Coverage
Test: trace.info Lines: 6 6 100.0 %
Date: 2023-02-20 11:47:18 Functions: 2 2 100.0 %

          Line data    Source code
       1             : /*------------------------------------------------------------------------------
       2             : --  Solar Orbiter's Low Frequency Receiver Flight Software (LFR FSW),
       3             : --  This file is a part of the LFR FSW
       4             : --  Copyright (C) 2021, Plasma Physics Laboratory - CNRS
       5             : --
       6             : --  This program is free software; you can redistribute it and/or modify
       7             : --  it under the terms of the GNU General Public License as published by
       8             : --  the Free Software Foundation; either version 2 of the License, or
       9             : --  (at your option) any later version.
      10             : --
      11             : --  This program is distributed in the hope that it will be useful,
      12             : --  but WITHOUT ANY WARRANTY; without even the implied warranty of
      13             : --  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      14             : --  GNU General Public License for more details.
      15             : --
      16             : --  You should have received a copy of the GNU General Public License
      17             : --  along with this program; if not, write to the Free Software
      18             : --  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
      19             : -------------------------------------------------------------------------------*/
      20             : /*--                  Author : Alexis Jeandet
      21             : --                   Contact : Alexis Jeandet
      22             : --                      Mail : alexis.jeandet@lpp.polytechnique.fr
      23             : ----------------------------------------------------------------------------*/
      24             : #include "hw/uart.h"
      25             : #include "fsw_debug.h"
      26             : #include "fsw_globals.h"
      27             : #include "hw/lfr_regs.h"
      28             : 
      29             : 
      30          18 : int enable_apbuart_transmitter(
      31             :     void) // set the bit 1, TE Transmitter Enable to 1 in the APBUART control register
      32             : {
      33          18 :     apbuart0->ctrl = APBUART_CTRL_REG_MASK_TE;
      34          18 :     return 0;
      35             : }
      36             : 
      37          18 : void set_apbuart_scaler_reload_register(unsigned int value)
      38             : {
      39             :     /** This function sets the scaler reload register of the apbuart module
      40             :      *
      41             :      * @param regs is the address of the apbuart registers in memory
      42             :      * @param value is the value that will be stored in the scaler register
      43             :      *
      44             :      * The value shall be set by the software to get data on the serial interface.
      45             :      *
      46             :      */
      47          18 :     apbuart0->scaler = value;
      48             :     BOOT_PRINTF("OK  *** apbuart port scaler reload register set to 0x%x\n", value);
      49          18 : }

Generated by: LCOV version 1.14