mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 10:17:45 +08:00
Add an upper half watchdog timer driver
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4604 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
@@ -2651,3 +2651,4 @@
|
|||||||
with OUT SETUP requests.
|
with OUT SETUP requests.
|
||||||
* include/nuttx/watchdog.h: Add the definition of a standard watchdog
|
* include/nuttx/watchdog.h: Add the definition of a standard watchdog
|
||||||
driver interface.
|
driver interface.
|
||||||
|
* drivers/watchdog.c: The "upper half" watchdog timer driver.
|
||||||
|
|||||||
+92
-1
@@ -43,19 +43,110 @@ config RAMLOG
|
|||||||
config CAN
|
config CAN
|
||||||
bool "CAN support"
|
bool "CAN support"
|
||||||
default n
|
default n
|
||||||
|
---help---
|
||||||
|
This selection enables building of the "upper-half" CAN driver.
|
||||||
|
See include/nuttx/can.h for further CAN driver information.
|
||||||
|
|
||||||
|
if CAN
|
||||||
|
config CONFIG_CAN_EXTID
|
||||||
|
bool "CAN extended IDs"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Enables support for the 29-bit extended ID. Default Standard 11-bit IDs.
|
||||||
|
|
||||||
|
config CONFIG_CAN_FIFOSIZE
|
||||||
|
int "CAN driver I/O buffer size"
|
||||||
|
default 8
|
||||||
|
---help---
|
||||||
|
The size of the circular buffer of CAN messages. Default: 8
|
||||||
|
|
||||||
|
config CONFIG_CAN_NPENDINGRTR
|
||||||
|
int "Number of pending RTRs"
|
||||||
|
default 4
|
||||||
|
---help---
|
||||||
|
The size of the list of pending RTR requests. Default: 4
|
||||||
|
|
||||||
|
config CONFIG_CAN_LOOPBACK
|
||||||
|
bool "CAN extended IDs"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
A CAN driver may or may not support a loopback mode for testing. If the
|
||||||
|
driver does support loopback mode, the setting will enable it. (If the
|
||||||
|
driver does not, this setting will have no effect).
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
config PWM
|
config PWM
|
||||||
bool "PWM support"
|
bool "PWM support"
|
||||||
default n
|
default n
|
||||||
|
---help---
|
||||||
|
This selection enables building of the "upper-half" PWM driver.
|
||||||
|
See include/nuttx/pwm.h for further PWM driver information.
|
||||||
|
|
||||||
|
if PWM
|
||||||
|
config PWM_PULSECOUNT
|
||||||
|
bool "PWM pulse count support"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Some hardware will support generation of a fixed number of pulses. This
|
||||||
|
might be used, for example to support a stepper motor. If the hardware
|
||||||
|
will support a fixed pulse count, then this configuration should be set to
|
||||||
|
enable the capability.
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
config I2C
|
config I2C
|
||||||
bool "I2C support"
|
bool "I2C support"
|
||||||
default y
|
default y
|
||||||
|
---help---
|
||||||
|
This selection enables building of the "upper-half" I2C driver.
|
||||||
|
See include/nuttx/i2c.h for further I2C driver information.
|
||||||
|
|
||||||
|
if I2C
|
||||||
|
endif
|
||||||
|
|
||||||
config SPI
|
config SPI
|
||||||
bool "SPI support"
|
bool "SPI support"
|
||||||
default y
|
default y
|
||||||
|
---help---
|
||||||
|
This selection enables building of the "upper-half" SPI driver.
|
||||||
|
See include/nuttx/spi.h for further SPI driver information.
|
||||||
|
|
||||||
|
if SPI
|
||||||
|
config SPI_OWNBUS
|
||||||
|
bool "SPI single device"
|
||||||
|
default y
|
||||||
|
---help---
|
||||||
|
Set if there is only one active device on the SPI bus. No locking or SPI
|
||||||
|
configuration will be performed. It is not necessary for clients to lock,
|
||||||
|
re-configure, etc..
|
||||||
|
|
||||||
|
config SPI_EXCHANGE
|
||||||
|
bool "SPI exchange"
|
||||||
|
default y
|
||||||
|
---help---
|
||||||
|
Driver supports a single exchange method (vs a recvblock() and sndblock ()methods).
|
||||||
|
|
||||||
|
config SPI_CMDDATA
|
||||||
|
bool "SPI CMD/DATA"
|
||||||
|
default y
|
||||||
|
---help---
|
||||||
|
Devices on the SPI bus require out-of-band support to distinguish command
|
||||||
|
transfers from data transfers. Such devices will often support either 9-bit
|
||||||
|
SPI (yech) or 8-bit SPI and a GPIO output that selects between command and data.
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
config WATCHDOG
|
||||||
|
bool "Watchdog timer support"
|
||||||
|
default y
|
||||||
|
---help---
|
||||||
|
This selection enables building of the "upper-half" watchdog timer driver.
|
||||||
|
See include/nuttx/watchdog.h for further watchdog timer driver information.
|
||||||
|
|
||||||
|
if WATCHDOG
|
||||||
|
endif
|
||||||
|
|
||||||
menuconfig ANALOG
|
menuconfig ANALOG
|
||||||
bool "Analog Device(adc,dac) support"
|
bool "Analog Device(adc,dac) support"
|
||||||
default n
|
default n
|
||||||
|
|||||||
@@ -82,6 +82,10 @@ endif
|
|||||||
ifeq ($(CONFIG_PWM),y)
|
ifeq ($(CONFIG_PWM),y)
|
||||||
CSRCS += pwm.c
|
CSRCS += pwm.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_WATCHDOG),y)
|
||||||
|
CSRCS += watchdog.c
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* drivers/pwm.c
|
* drivers/pwm.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
* Private Type Definitions
|
* Private Type Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* This structure describes the state of the upper half drivere */
|
/* This structure describes the state of the upper half driver */
|
||||||
|
|
||||||
struct pwm_upperhalf_s
|
struct pwm_upperhalf_s
|
||||||
{
|
{
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -56,7 +56,7 @@
|
|||||||
*
|
*
|
||||||
* WDIOC_START - Start the watchdog timer
|
* WDIOC_START - Start the watchdog timer
|
||||||
* Argument: Ignored
|
* Argument: Ignored
|
||||||
* WDIOC_START - Stop the watchdog timer
|
* WDIOC_STOP - Stop the watchdog timer
|
||||||
* Argument: Ignored
|
* Argument: Ignored
|
||||||
* WDIOC_GETSTATUS - Get the status of the watchdog timer.
|
* WDIOC_GETSTATUS - Get the status of the watchdog timer.
|
||||||
* Argument: A writeable pointer to struct watchdog_status_s.
|
* Argument: A writeable pointer to struct watchdog_status_s.
|
||||||
@@ -133,7 +133,7 @@ struct watchdog_ops_s
|
|||||||
/* Get the current watchdog timer status */
|
/* Get the current watchdog timer status */
|
||||||
|
|
||||||
CODE int (*getstatus)(FAR struct watchdog_lowerhalf_s *lower,
|
CODE int (*getstatus)(FAR struct watchdog_lowerhalf_s *lower,
|
||||||
FAR watchdog_state_s *status);
|
FAR struct watchdog_status_s *status);
|
||||||
|
|
||||||
/* Set a new timeout value (and reset the watchdog timer) */
|
/* Set a new timeout value (and reset the watchdog timer) */
|
||||||
|
|
||||||
@@ -141,14 +141,14 @@ struct watchdog_ops_s
|
|||||||
uint32_t timeout);
|
uint32_t timeout);
|
||||||
|
|
||||||
/* Don't reset on watchdog timer timeout; instead, call this user provider
|
/* Don't reset on watchdog timer timeout; instead, call this user provider
|
||||||
* timeout handler. NOTE: Providing handler==NULL will store the reset
|
* timeout handler. NOTE: Providing handler==NULL will restore the reset
|
||||||
* behavior.
|
* behavior.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CODE xcpt_t (*capture)(FAR struct watchdog_lowerhalf_s *lower,
|
CODE xcpt_t (*capture)(FAR struct watchdog_lowerhalf_s *lower,
|
||||||
xcpt_t handler);
|
CODE xcpt_t handler);
|
||||||
|
|
||||||
/* An ioctl commands that are not recognized by the "upper-half" driver
|
/* Any ioctl commands that are not recognized by the "upper-half" driver
|
||||||
* are forwarded to the lower half driver through this method.
|
* are forwarded to the lower half driver through this method.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -217,8 +217,8 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
FAR void *watchdog_register(FAR const char *path,
|
EXTERN FAR void *watchdog_register(FAR const char *path,
|
||||||
FAR struct watchdog_lowerhalf_s *lower);
|
FAR struct watchdog_lowerhalf_s *lower);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: watchdog_unregister
|
* Name: watchdog_unregister
|
||||||
|
|||||||
Reference in New Issue
Block a user