/****************************************************************************** * * Name: acnamesp.h - Namespace subcomponent prototypes and defines * *****************************************************************************/ /* * Copyright (C) 2000 - 2004, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * Alternatively, this software may be distributed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * * NO WARRANTY * 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 MERCHANTIBILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. */ #ifndef __ACNAMESP_H__ #define __ACNAMESP_H__ /* To search the entire name space, pass this as search_base */ #define ACPI_NS_ALL ((acpi_handle)0) /* * Elements of acpi_ns_properties are bit significant * and should be one-to-one with values of acpi_object_type */ #define ACPI_NS_NORMAL 0 #define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */ #define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */ /* Definitions of the predefined namespace names */ #define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */ #define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */ #define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */ #define ACPI_NS_ROOT_PATH "\\" #define ACPI_NS_SYSTEM_BUS "_SB_" /* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */ #define ACPI_NS_NO_UPSEARCH 0 #define ACPI_NS_SEARCH_PARENT 0x01 #define ACPI_NS_DONT_OPEN_SCOPE 0x02 #define ACPI_NS_NO_PEER_SEARCH 0x04 #define ACPI_NS_ERROR_IF_FOUND 0x08 #define ACPI_NS_WALK_UNLOCK TRUE #define ACPI_NS_WALK_NO_UNLOCK FALSE acpi_status acpi_ns_load_namespace ( void); acpi_status acpi_ns_initialize_objects ( void); acpi_status acpi_ns_initialize_devices ( void); /* Namespace init - nsxfinit */ acpi_status acpi_ns_init_one_device ( acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value); acpi_status acpi_ns_init_one_object ( acpi_handle obj_handle, u32 level, void *context, void **return_value); acpi_status acpi_ns_walk_namespace ( acpi_object_type type, acpi_handle start_object, u32 max_depth, u8 unlock_before_callback, acpi_walk_callback user_function, void *context, void **return_value); struct acpi_namespace_node * acpi_ns_get_next_node ( acpi_object_type type, struct acpi_namespace_node *parent, struct acpi_namespace_node *child); void acpi_ns_delete_namespace_by_owner ( u16 table_id); /* Namespace loading - nsload */ acpi_status acpi_ns_one_complete_parse ( u32 pass_number, struct acpi_table_desc *table_desc); acpi_status acpi_ns_parse_table ( struct acpi_table_desc *table_desc, struct acpi_namespace_node *scope); acpi_status acpi_ns_load_table ( struct acpi_table_desc *table_desc, struct acpi_namespace_node *node); acpi_status acpi_ns_load_table_by_type ( acpi_table_type table_type); /* * Top-level namespace access - nsaccess */ acpi_status acpi_ns_root_initialize ( void); acpi_status acpi_ns_lookup ( union acpi_generic_state *scope_info, char *name, acpi_object_type type, acpi_interpreter_mode interpreter_mode, u32 flags, struct acpi_walk_state *walk_state, struct acpi_namespace_node **ret_node); /* * Named object allocation/deallocation - nsalloc */ struct acpi_namespace_node * acpi_ns_create_node ( u32 name); void acpi_ns_delete_node ( struct acpi_namespace_node *node); void acpi_ns_delete_namespace_subtree ( struct acpi_namespace_node *parent_handle); void acpi_ns_detach_object ( struct acpi_namespace_node *node); void acpi_ns_delete_children ( struct acpi_namespace_node *parent); int acpi_ns_compare_names ( char *name1, char *name2); void acpi_ns_remove_reference ( struct acpi_namespace_node *node); /* * Namespace modification - nsmodify */ acpi_status acpi_ns_unload_namespace ( acpi_handle handle); acpi_status acpi_ns_delete_subtree ( acpi_handle start_handle); /* * Namespace dump/print utilities - nsdump */ void acpi_ns_dump_tables ( acpi_handle search_base, u32 max_depth); void acpi_ns_dump_entry ( acpi_handle handle, u32 debug_level); void acpi_ns_dump_pathname ( acpi_handle handle, char *msg, u32 level, u32
/*
    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

#include "ch.h"
#include "hal.h"
#include "portab.h"

void txend1(UARTDriver *uartp) {

  (void)uartp;
}

void txend2(UARTDriver *uartp) {

  (void)uartp;
}

void rxend(UARTDriver *uartp) {

  (void)uartp;
}

void rxchar(UARTDriver *uartp, uint16_t c) {

  (void)uartp;
  (void)c;
}

void rxerr(UARTDriver *uartp, uartflags_t e) {

  (void)uartp;
  (void)e;
}

/*
 * Application entry point.
 */
int main(void) {
  static const char teststr[] = "0123456789ABCDEF";
  msg_t msg;
  size_t sz;

  /*
   * System initializations.
   * - HAL initialization, this also initializes the configured device drivers
   *   and performs the board-specific initializations.
   * - Kernel initialization, the main() function becomes a thread and the
   *   RTOS is active.
   */
  halInit();
  chSysInit();

  /*
   * Board-dependent setup code.
   */
  portab_setup();

  /*
   * Activates the UART driver 2.
   */
  uartStart(&PORTAB_UART1, &uart_cfg_1);

  /*
   * Blocking API test, send and restart send.
   */
  sz = 3;
  msg = uartSendTimeout(&PORTAB_UART1, &sz, teststr, TIME_INFINITE);
  if (msg != MSG_OK)
    chSysHalt("invalid return code");

  sz = 12;
  msg = uartSendTimeout(&PORTAB_UART1, &sz, teststr, TIME_INFINITE);
  if (msg != MSG_OK)
    chSysHalt("invalid return code");

  sz = 2;
  msg = uartSendTimeout(&PORTAB_UART1, &sz, teststr, TIME_INFINITE);
  if (msg != MSG_OK)
    chSysHalt("invalid return code");

  sz = 16;
  msg = uartSendFullTimeout(&PORTAB_UART1, &sz, teststr, TIME_INFINITE);
  if (msg != MSG_OK)
    chSysHalt("invalid return code");

  sz = 7;
  msg = uartSendFullTimeout(&PORTAB_UART1, &sz, teststr, TIME_INFINITE);
  if (msg != MSG_OK)
    chSysHalt("invalid return code");

  /*
   * Normal main() thread activity.
   */
  while (true) {
    chThdSleepMilliseconds(500);
  }
}