mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 01:33:34 +08:00
Resync new repository with old repo r5166
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5154 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
@@ -78,7 +79,7 @@ struct adc_msg_s
|
||||
{
|
||||
uint8_t am_channel; /* The 8-bit ADC Channel */
|
||||
int32_t am_data; /* ADC convert result (4 bytes) */
|
||||
} __attribute__((__packed__));
|
||||
} packed_struct;
|
||||
|
||||
struct adc_fifo_s
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/compiler.h
|
||||
*
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -92,6 +92,14 @@
|
||||
# define reentrant_function
|
||||
# define naked_function
|
||||
|
||||
/* The inline_function attribute informs GCC that the function should always
|
||||
* be inlined, regardless of the level of optimization. The noinline_function
|
||||
* indicates that the function should never be inlined.
|
||||
*/
|
||||
|
||||
# define inline_function __attribute__ ((always_inline))
|
||||
# define noinline_function __attribute__ ((noinline))
|
||||
|
||||
/* GCC has does not use storage classes to qualify addressing */
|
||||
|
||||
# define FAR
|
||||
@@ -224,10 +232,15 @@
|
||||
# define noreturn_function
|
||||
# define packed_struct
|
||||
|
||||
/* SDCC does support "naked" function s*/
|
||||
/* SDCC does support "naked" functions */
|
||||
|
||||
# define naked_function __naked
|
||||
|
||||
/* SDCC does not support forced inlining. */
|
||||
|
||||
# define inline_function
|
||||
# define noinline_function
|
||||
|
||||
/* The reentrant attribute informs SDCC that the function
|
||||
* must be reentrant. In this case, SDCC will store input
|
||||
* arguments on the stack to support reentrancy.
|
||||
@@ -320,11 +333,13 @@
|
||||
# define weak_function
|
||||
# define weak_const_function
|
||||
|
||||
/* The Zilog compiler does not support the noreturn, packed, or naked attributes */
|
||||
/* The Zilog compiler does not support the noreturn, packed, naked attributes */
|
||||
|
||||
# define noreturn_function
|
||||
# define packed_struct
|
||||
# define naked_function
|
||||
# define inline_function
|
||||
# define noinline_function
|
||||
|
||||
/* The Zilog compiler does not support the reentrant attribute */
|
||||
|
||||
@@ -406,7 +421,8 @@
|
||||
# define packed_struct
|
||||
# define reentrant_function
|
||||
# define naked_function
|
||||
|
||||
# define inline_function
|
||||
# define noinline_function
|
||||
|
||||
# define FAR
|
||||
# define NEAR
|
||||
|
||||
@@ -92,11 +92,10 @@ extern "C" {
|
||||
* Set up one granule allocator instance. Allocations will be aligned to
|
||||
* the alignment size (log2align; allocations will be in units of the
|
||||
* granule size (log2gran). Larger granules will give better performance
|
||||
* and less overhead but more losses of memory due to alignment
|
||||
* quantization waste. Additional memory waste can occur form alignment;
|
||||
* log2align should be set to 0 unless you are using the granule allocator
|
||||
* to manage DMA memory and your hardware has specific memory alignment
|
||||
* requirements.
|
||||
* and less overhead but more losses of memory due to quantization waste.
|
||||
* Additional memory waste can occur from alignment; log2align should be
|
||||
* set to 0 unless you are using the granule allocator to manage DMA memory
|
||||
* and your hardware has specific memory alignment requirements.
|
||||
*
|
||||
* Geneneral Usage Summary. This is an example using the GCC section
|
||||
* attribute to position a DMA heap in memory (logic in the linker script
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/i2c.h
|
||||
*
|
||||
* Copyright(C) 2009-2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright(C) 2009-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -47,6 +47,16 @@
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
/* If a dynamic timeout is selected, then a non-negative, non-zero micro-
|
||||
* seconds per byte vale must be provided as well.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_STM32_I2C_DYNTIMEO
|
||||
# if CONFIG_STM32_I2C_DYNTIMEO_USECPERBYTE < 1
|
||||
# warning "Ignoring CONFIG_STM32_I2C_DYNTIMEO because of CONFIG_STM32_I2C_DYNTIMEO_USECPERBYTE"
|
||||
# undef CONFIG_STM32_I2C_DYNTIMEO
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* I2C address calculation. Convert 7- and 10-bit address to 8-bit and
|
||||
* 16-bit read/write address
|
||||
@@ -323,7 +333,19 @@ EXTERN FAR struct i2c_dev_s *up_i2cinitialize(int port);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
EXTERN int up_i2cuninitialize(FAR struct i2c_dev_s * dev);
|
||||
EXTERN int up_i2cuninitialize(FAR struct i2c_dev_s *dev);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: up_i2creset
|
||||
*
|
||||
* Description:
|
||||
* Reset an I2C bus
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_I2C_RESET
|
||||
EXTERN int up_i2creset(FAR struct i2c_dev_s *dev);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
||||
@@ -220,6 +220,19 @@ EXTERN FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_dev_s *dev);
|
||||
|
||||
EXTERN FAR struct mtd_dev_s *sst25_initialize(FAR struct spi_dev_s *dev);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Name: w25_initialize
|
||||
*
|
||||
* Description:
|
||||
* Create an initialized MTD device instance. MTD devices are not registered
|
||||
* in the file system, but are created as instances that can be bound to
|
||||
* other functions (such as a block or character driver front end).
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
EXTERN FAR struct mtd_dev_s *w25_initialize(FAR struct spi_dev_s *dev);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -85,6 +85,22 @@ struct enc_stats_s
|
||||
/* The ENC28J60 normal provides interrupts to the MCU via a GPIO pin. The
|
||||
* following structure provides an MCU-independent mechanixm for controlling
|
||||
* the ENC28J60 GPIO interrupt.
|
||||
*
|
||||
* The ENC32J60 interrupt is an active low, *level* interrupt. "When an
|
||||
* interrupt occurs, the interrupt flag is set. If the interrupt is enabled
|
||||
* in the EIE register and the INTIE global interrupt enable bit is set, the
|
||||
* INT pin will be driven low"
|
||||
*
|
||||
* "When an enabled interrupt occurs, the interrupt pin will remain low until
|
||||
* all flags which are causing the interrupt are cleared or masked off
|
||||
* (enable bit is cleared) by the host controller." However, the interrupt
|
||||
* will behave like a falling edge interrupt because "After an interrupt
|
||||
* occurs, the host controller [clears] the global enable bit for the
|
||||
* interrupt pin before servicing the interrupt. Clearing the enable bit
|
||||
* will cause the interrupt pin to return to the non-asserted state (high).
|
||||
* Doing so will prevent the host controller from missing a falling edge
|
||||
* should another interrupt occur while the immediate interrupt is being
|
||||
* serviced."
|
||||
*/
|
||||
|
||||
struct enc_lower_s
|
||||
|
||||
Reference in New Issue
Block a user