Minor fixes to PIC32MX7MMB led controls

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4651 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2012-04-24 18:00:55 +00:00
parent b1cb7ef744
commit cf9b822df7
6 changed files with 94 additions and 21 deletions

View File

@ -193,7 +193,7 @@ o pthreads (sched/)
Priority: Low, probably not that useful Priority: Low, probably not that useful
Title: PTHREAD_PRIO_PROTECT Title: PTHREAD_PRIO_PROTECT
Extended pthread_mutexattr_setprotocol() suport PTHREAD_PRIO_PROTECT: Description: Extended pthread_mutexattr_setprotocol() suport PTHREAD_PRIO_PROTECT:
"When a thread owns one or more mutexes initialized with the "When a thread owns one or more mutexes initialized with the
PTHREAD_PRIO_PROTECT protocol, it shall execute at the higher of its PTHREAD_PRIO_PROTECT protocol, it shall execute at the higher of its
priority or the highest of the priority ceilings of all the mutexes priority or the highest of the priority ceilings of all the mutexes
@ -367,7 +367,7 @@ o Network (net/, drivers/net)
Priority: Medium, The feature is not important, but it is important Priority: Medium, The feature is not important, but it is important
for NuttX to resolve the architectural issues. for NuttX to resolve the architectural issues.
Title: SENTDO() AND MULTIPLE NETWORK INTERFACE SUPPORT Title: SENDTO() AND MULTIPLE NETWORK INTERFACE SUPPORT
Description: sendto() and multiple network interface support: Description: sendto() and multiple network interface support:
When polled, would have to assure that the destination IP When polled, would have to assure that the destination IP
is on the subnet served by the polling driver. is on the subnet served by the polling driver.
@ -1257,6 +1257,14 @@ o ARM/STM32 (arch/arm/src/stm32/)
Status: Open Status: Open
Priority: Low (I am not even sure if this is a problem yet). Priority: Low (I am not even sure if this is a problem yet).
Status: Unfinished STM32 F4 OTG FS Host Driver
Description: A quick-n-dirty leverage of the the LPC17xx host driver was put into
the STM32 source to support development of the STM32 F4 OTG FS host
driver. It is non-functional and still waiting for STM32 F4 logic
to be added. Don't use it!
Status: Open
Priority: Low (unless you need a host driver).
o AVR (arch/avr) o AVR (arch/avr)
^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^

View File

@ -102,11 +102,14 @@
/* The Mikroelektronika PIC32MX7 MMB has 3 user LEDs labeled LED0-2 in the /* The Mikroelektronika PIC32MX7 MMB has 3 user LEDs labeled LED0-2 in the
* schematics: * schematics:
* *
* --- ----- --------------------------------------------------------------
* PIN Board Notes * PIN Board Notes
* --- ----- -------------------------------- * --- ----- --------------------------------------------------------------
* RA0 LED0 Pulled-up, low value illuminates * RA0 LED0 Pulled-up, low value illuminates
* RA1 LED1 Pulled-up, low value illuminates * RA1 LED1 Pulled-up, low value illuminates
* RD9 LED2 Pulled-up, low value illuminates * RD9 LED2 Pulled-up, low value illuminates
* --- LED4 Not controllable by software, indicates MMC/SD activity
* --- LED5 Not controllable by software, indicates power-on
*/ */
/* LED index values for use with pic32mx_setled() */ /* LED index values for use with pic32mx_setled() */

View File

@ -300,8 +300,8 @@ CONFIG_UART6_2STOP=0
# enabled; 0=RMII enabled # enabled; 0=RMII enabled
# #
CONFIG_PHY_KS8721=n CONFIG_PHY_KS8721=n
CONFIG_PHY_DP83848C=y CONFIG_PHY_DP83848C=n
CONFIG_PHY_LAN8720=n CONFIG_PHY_LAN8720=y
CONFIG_PHY_AUTONEG=y CONFIG_PHY_AUTONEG=y
CONFIG_PHY_SPEED100=n CONFIG_PHY_SPEED100=n
CONFIG_PHY_FDUPLEX=y CONFIG_PHY_FDUPLEX=y

View File

@ -49,12 +49,14 @@
/* The Mikroelektronika PIC32MX7 MMB has 3 user LEDs labeled LED0-2 in the /* The Mikroelektronika PIC32MX7 MMB has 3 user LEDs labeled LED0-2 in the
* schematics: * schematics:
* *
* --- ----- -------------------------------- * --- ----- --------------------------------------------------------------
* PIN BOARD NOTES * PIN Board Notes
* --- ----- -------------------------------- * --- ----- --------------------------------------------------------------
* RA0 LED0 Pulled-up, low value illuminates * RA0 LED0 Pulled-up, low value illuminates
* RA1 LED1 Pulled-up, low value illuminates * RA1 LED1 Pulled-up, low value illuminates
* RD9 LED2 Pulled-up, low value illuminates * RD9 LED2 Pulled-up, low value illuminates
* --- LED4 Not controllable by software, indicates MMC/SD activity
* --- LED5 Not controllable by software, indicates power-on
*/ */
/* The Mikroelektronika PIC32MX7 MMB has a joystick: /* The Mikroelektronika PIC32MX7 MMB has a joystick:

View File

@ -61,11 +61,14 @@
/* The Mikroelektronika PIC32MX7 MMB has 3 user LEDs labeled LED0-2 in the /* The Mikroelektronika PIC32MX7 MMB has 3 user LEDs labeled LED0-2 in the
* schematics: * schematics:
* *
* --- ----- --------------------------------------------------------------
* PIN Board Notes * PIN Board Notes
* --- ----- -------------------------------- * --- ----- --------------------------------------------------------------
* RA0 LED0 Pulled-up, low value illuminates * RA0 LED0 Pulled-up, low value illuminates
* RA1 LED1 Pulled-up, low value illuminates * RA1 LED1 Pulled-up, low value illuminates
* RD9 LED2 Pulled-up, low value illuminates * RD9 LED2 Pulled-up, low value illuminates
* --- LED4 Not controllable by software, indicates MMC/SD activity
* --- LED5 Not controllable by software, indicates power-on
* *
* If CONFIG_ARCH_LEDS is defined, then NuttX will control these LEDs as follows: * If CONFIG_ARCH_LEDS is defined, then NuttX will control these LEDs as follows:
* *
@ -83,9 +86,9 @@
* LED_PANIC 5 ON N/C N/C OFF N/C N/C * LED_PANIC 5 ON N/C N/C OFF N/C N/C
*/ */
#define GPIO_LED_0 (GPIO_OUTPUT|GPIO_VALUE_ZERO|GPIO_PORTA|GPIO_PIN0) #define GPIO_LED_0 (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTA|GPIO_PIN0)
#define GPIO_LED_1 (GPIO_OUTPUT|GPIO_VALUE_ZERO|GPIO_PORTA|GPIO_PIN1) #define GPIO_LED_1 (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTA|GPIO_PIN1)
#define GPIO_LED_2 (GPIO_OUTPUT|GPIO_VALUE_ZERO|GPIO_PORTD|GPIO_PIN9) #define GPIO_LED_2 (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTD|GPIO_PIN9)
/* LED Management Definitions ***********************************************/ /* LED Management Definitions ***********************************************/
@ -176,19 +179,21 @@ static const uint16_t g_ledpincfg[PIC32MX_PIC32MX7MMB_NLEDS] =
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
void up_setleds(FAR const struct led_setting_s *setting) void up_setleds(FAR const struct led_setting_s *setting)
{ {
/* LEDs are pulled up so writing a low value (false) illuminates them */
if (setting->led0 != LED_NC) if (setting->led0 != LED_NC)
{ {
pic32mx_gpiowrite(GPIO_LED_0, setting->led0 == LED_ON); pic32mx_gpiowrite(GPIO_LED_0, setting->led0 != LED_ON);
} }
if (setting->led1 != LED_NC) if (setting->led1 != LED_NC)
{ {
pic32mx_gpiowrite(GPIO_LED_1, setting->led1 == LED_ON); pic32mx_gpiowrite(GPIO_LED_1, setting->led1 != LED_ON);
} }
if (setting->led2 != LED_NC) if (setting->led2 != LED_NC)
{ {
pic32mx_gpiowrite(GPIO_LED_2, setting->led2 == LED_ON); pic32mx_gpiowrite(GPIO_LED_2, setting->led2 != LED_ON);
} }
} }
#endif #endif
@ -217,9 +222,11 @@ void pic32mx_ledinit(void)
#ifndef CONFIG_ARCH_LEDS #ifndef CONFIG_ARCH_LEDS
void pic32mx_setled(int led, bool ledon) void pic32mx_setled(int led, bool ledon)
{ {
/* LEDs are pulled up so writing a low value (false) illuminates them */
if ((unsigned)led < PIC32MX_PIC32MX7MMB_NLEDS) if ((unsigned)led < PIC32MX_PIC32MX7MMB_NLEDS)
{ {
pic32mx_gpiowrite(g_ledpincfg[led], ledon); pic32mx_gpiowrite(g_ledpincfg[led], !ledon);
} }
} }
#endif #endif
@ -231,6 +238,8 @@ void pic32mx_setled(int led, bool ledon)
#ifndef CONFIG_ARCH_LEDS #ifndef CONFIG_ARCH_LEDS
void pic32mx_setleds(uint8_t ledset) void pic32mx_setleds(uint8_t ledset)
{ {
/* Call pic32mx_setled() with ledon == true to illuminated the LED */
pic32mx_setled(PIC32MX_PIC32MX7MMB_LED0, (ledset & PIC32MX_PIC32MX7MMB_LED0_BIT) != 0); pic32mx_setled(PIC32MX_PIC32MX7MMB_LED0, (ledset & PIC32MX_PIC32MX7MMB_LED0_BIT) != 0);
pic32mx_setled(PIC32MX_PIC32MX7MMB_LED1, (ledset & PIC32MX_PIC32MX7MMB_LED1_BIT) != 0); pic32mx_setled(PIC32MX_PIC32MX7MMB_LED1, (ledset & PIC32MX_PIC32MX7MMB_LED1_BIT) != 0);
pic32mx_setled(PIC32MX_PIC32MX7MMB_LED2, (ledset & PIC32MX_PIC32MX7MMB_LED2_BIT) != 0); pic32mx_setled(PIC32MX_PIC32MX7MMB_LED2, (ledset & PIC32MX_PIC32MX7MMB_LED2_BIT) != 0);

View File

@ -42,6 +42,57 @@ config RAMLOG
output in a FIFO in RAM. It differs from a pipe in numerous output in a FIFO in RAM. It differs from a pipe in numerous
details as needed to support logging. details as needed to support logging.
if RAMLOG
config RAMLOG_SYSLOG
bool "Use RAMLOG for SYSLOG"
default n
depends on SYSLOG
---help---
Use the RAM logging device for the syslogging interface. If this feature
is enabled (along with SYSLOG), then all debug output (only) will be re-directed
to the circular buffer in RAM. This RAM log can be view from NSH using the
'dmesg'command.
config RAMLOG_CONSOLE
bool "Use RAMLOG for /dev/console"
default n
depends on DEV_CONSOLE
---help---
Use the RAM logging device as a system console. If this feature is enabled (along
with DEV_CONSOLE), then all console output will be re-directed to a circular
buffer in RAM. This is useful, for example, if the only console is a Telnet
console. Then in that case, console output from non-Telnet threads will go to
the circular buffer and can be viewed using the NSH 'dmesg' command.
config RAMLOG_CONSOLE_BUFSIZE
int "RAMLOG buffer size"
default 1024
depends on RAMLOG_SYSLOG || RAMLOG_CONSOLE
---help---
Size of the console RAM log. Default: 1024
config RAMLOG_CRLF
bool "RAMLOG CR/LF"
default n
---help---
Pre-pend a carriage return before every linefeed that goes into the RAM log.
config RAMLOG_NONBLOCKING
bool "RAMLOG non-block reads"
default y
---help---
Reading from the RAMLOG will never block if the RAMLOG is empty. If the RAMLOG
is empty, then zero is returned (usually interpreted as end-of-file).
config RAMLOG_NPOLLWAITERS
int "RAMLOG number of poll waiters"
default 4
depends on !DISABLE_POLL
---help---
The maximum number of threads that may be waiting on the poll method.
endif
config CAN config CAN
bool "CAN support" bool "CAN support"
default n default n
@ -50,25 +101,25 @@ config CAN
See include/nuttx/can.h for further CAN driver information. See include/nuttx/can.h for further CAN driver information.
if CAN if CAN
config CONFIG_CAN_EXTID config CAN_EXTID
bool "CAN extended IDs" bool "CAN extended IDs"
default n default n
---help--- ---help---
Enables support for the 29-bit extended ID. Default Standard 11-bit IDs. Enables support for the 29-bit extended ID. Default Standard 11-bit IDs.
config CONFIG_CAN_FIFOSIZE config CAN_FIFOSIZE
int "CAN driver I/O buffer size" int "CAN driver I/O buffer size"
default 8 default 8
---help--- ---help---
The size of the circular buffer of CAN messages. Default: 8 The size of the circular buffer of CAN messages. Default: 8
config CONFIG_CAN_NPENDINGRTR config CAN_NPENDINGRTR
int "Number of pending RTRs" int "Number of pending RTRs"
default 4 default 4
---help--- ---help---
The size of the list of pending RTR requests. Default: 4 The size of the list of pending RTR requests. Default: 4
config CONFIG_CAN_LOOPBACK config CAN_LOOPBACK
bool "CAN extended IDs" bool "CAN extended IDs"
default n default n
---help--- ---help---
@ -271,7 +322,7 @@ menuconfig SERCOMM_CONSOLE
See http://bb.osmocom.org/trac/wiki/nuttx-bb/run for detailed the usage See http://bb.osmocom.org/trac/wiki/nuttx-bb/run for detailed the usage
of nuttx with sercomm. of nuttx with sercomm.
drivers/sercomm is only built if CONFIG_SERCOMM_CONSOLE in the NuttX drivers/sercomm is only built if SERCOMM_CONSOLE in the NuttX
configuration file. If you attempt to build this driver without configuration file. If you attempt to build this driver without
osmocom-bb, you will get compilation errors because of header files osmocom-bb, you will get compilation errors because of header files
that are needed from the osmocom-bb. that are needed from the osmocom-bb.