<commit_before>/* Copyright 2014, <NAME>
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * * Redistributions of source code must retain the above copyright notice,
 *   this list of conditions and the following disclaimer.
 *
 * * Redistributions in binary form must reproduce the above copyright notice,
 *   this list of conditions and the following disclaimer in the documentation
 *   and/or other materials provided with the distribution.
 *
 * * Neither the name of the software nor the names of its contributors may be
 *   used to endorse or promote products derived from this software without
 *   specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/** @file
 *
 * @brief Generic UART interface for BSPACM
 *
 * @homepage http://github.com/pabigot/bspacm
 * @copyright Copyright 2014, <NAME>.  Licensed under <a href="http://www.opensource.org/licenses/BSD-3-Clause">BSD-3-Clause</a>
 */

#ifndef BSPACM_PERIPH_UART_H
#define BSPACM_PERIPH_UART_H

#include <bspacm/core.h>

/* Forward declaration */
struct sBSPACMperiphUARToperations;
struct sFIFO;

/** State associated with a UART device.
 *
 * An instance of this structure is uniquely associated with each UART
 * peripheral that is supported by an application. */
typedef struct sBSPACMperiphUARTstate {
  /** Reference to the device.  This is a pointer to the
   * peripheral-specific base CMSIS device structure; interpreted as a
   * @c uint32_t is is the peripheral base address. */
  void * const uart;

  /** A field that contains device-specific auxiliary information that
   * cannot be inferred from the base address.  For example, an
   * identifier for the module clock. */
  union {
    uint32_t u32;               /**< some integral value */
    void * ptr;                 /**< null, or a pointer to an internal structure */
  } const devcfg;

  /** Pointer to the operations table that implements UART
   * functionality for this device.  Users mostly won't need to touch
   * this. */
  const struct sBSPACMperiphUARToperations * const ops;

  /** Pointer to a device-specific software FIFO to hold data to be
   * transmitted.
   *
   * @note The structure referenced by this field is mutated by both<commit_msg>uart: device configuration structure should not be writable<commit_after>/* Copyright 2014, <NAME>
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * * Redistributions of source code must retain the above copyright notice,
 *   this list of conditions and the following disclaimer.
 *
 * * Redistributions in binary form must reproduce the above copyright notice,
 *   this list of conditions and the following disclaimer in the documentation
 *   and/or other materials provided with the distribution.
 *
 * * Neither the name of the software nor the names of its contributors may be
 *   used to endorse or promote products derived from this software without
 *   specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/** @file
 *
 * @brief Generic UART interface for BSPACM
 *
 * @homepage http://github.com/pabigot/bspacm
 * @copyright Copyright 2014, <NAME>.  Licensed under <a href="http://www.opensource.org/licenses/BSD-3-Clause">BSD-3-Clause</a>
 */

#ifndef BSPACM_PERIPH_UART_H
#define BSPACM_PERIPH_UART_H

#include <bspacm/core.h>

/* Forward declaration */
struct sBSPACMperiphUARToperations;
struct sFIFO;

/** State associated with a UART device.
 *
 * An instance of this structure is uniquely associated with each UART
 * peripheral that is supported by an application. */
typedef struct sBSPACMperiphUARTstate {
  /** Reference to the device.  This is a pointer to the
   * peripheral-specific base CMSIS device structure; interpreted as a
   * @c uint32_t is is the peripheral base address. */
  void * const uart;

  /** A field that contains device-specific auxiliary information that
   * cannot be inferred from the base address.  For example, an
   * identifier for the module clock. */
  union {
    uint32_t u32;               /**< some integral value */
    const void * ptr;           /**< null, or a pointer to an internal structure */
  } const devcfg;

  /** Pointer to the operations table that implements UART
   * functionality for this device.  Users mostly won't need to touch
   * this. */
  const struct sBSPACMperiphUARToperations * const ops;

  /** Pointer to a device-specific software FIFO to hold data to be
   * transmitted.
   *
   * @note The structure referenced by this field is mutated by both
{'fraction_non_alphanumeric': 0.06686881583147143, 'fraction_numerical': 0.005106926268751995, 'mean_word_length': 3.7298113207547168, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4011763', 'n_tokens_mistral': 1749, 'n_tokens_neox': 1582, 'n_words': 793}