mirror of
https://github.com/apache/nuttx.git
synced 2026-05-13 10:38:40 +08:00
SAM4L GPIO port addressing fixes; SAM4L Xplained LED support; minor documentation updates
This commit is contained in:
@@ -4896,4 +4896,10 @@
|
||||
file to sam3u_gpio.h (2013-6-4).
|
||||
* nuttx/arch/arm/src/sam34/sam4l_gpio.c: Created GPIO driver for
|
||||
the SAM4L (2013-6-4).
|
||||
|
||||
* nuttx/configs/sam4l-xplained/src/sam_userleds.c: Added.
|
||||
(2013-6-4).
|
||||
* configs/sam4l-xplained/src/sam_userleds.c: Add application
|
||||
LED interfaces (2013-6-5).
|
||||
* arch/arm/src/sam34/sam4l_gpio.c and arch/arm/src/sam34/chip/sam4l_gpio.h:
|
||||
Fix GPIO port address; fix compilation errors (2013-6-5).
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<h1><big><font color="#3c34ec"><i>NuttX Operating System<p>User's Manual</i></font></big></h1>
|
||||
<p><small>by</small></p>
|
||||
<p>Gregory Nutt<p>
|
||||
<p>Last Updated: Aprill 22, 2013</p>
|
||||
<p>Last Updated: June 4, 2013</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -8124,15 +8124,16 @@ int getopt(int argc, FAR char *const argv[], FAR const char *optstring);
|
||||
<ul><pre>
|
||||
#include <stdio.h>
|
||||
|
||||
void clearerr(register FILE *stream);
|
||||
int fclose(FILE *stream);
|
||||
int fflush(FILE *stream);
|
||||
FILE *fdopen(int fd, const char *type);
|
||||
int feof(FILE *stream); /* Prototyped but not implemented */
|
||||
int ferror(FILE *stream); /* Prototyped but not implemented */
|
||||
int feof(FILE *stream);
|
||||
int ferror(FILE *stream);
|
||||
int fileno(FAR FILE *stream);
|
||||
int fgetc(FILE *stream);
|
||||
int fgetpos(FILE *stream, fpos_t *pos);
|
||||
char *fgets(char *s, int n, FILE *stream);
|
||||
FILE *fdopen(int fd, const char *type);
|
||||
FILE *fopen(const char *path, const char *type);
|
||||
int fprintf(FILE *stream, const char *format, ...);
|
||||
int fputc(int c, FILE *stream);
|
||||
@@ -8143,19 +8144,30 @@ int fsetpos(FILE *stream, fpos_t *pos);
|
||||
long ftell(FILE *stream);
|
||||
size_t fwrite(const void *ptr, size_t size, size_t n_items, FILE *stream);
|
||||
char *gets(char *s);
|
||||
int ungetc(int c, FAR FILE *stream);
|
||||
|
||||
int printf(const char *format, ...);
|
||||
int puts(const char *s);
|
||||
int rename(const char *source, const char *target);
|
||||
int snprintf(FAR char *buf, size_t size, const char *format, ...);
|
||||
int sprintf(char *dest, const char *format, ...);
|
||||
int asprintf (FAR char **ptr, FAR const char *fmt, ...);
|
||||
int snprintf(FAR char *buf, size_t size, const char *format, ...);
|
||||
int sscanf(const char *buf, const char *fmt, ...);
|
||||
int ungetc(int c, FILE *stream);
|
||||
void perror(FAR const char *s);
|
||||
int avsprintf(FAR char **ptr, const char *fmt, va_list ap);
|
||||
|
||||
int vprintf(const char *s, va_list ap);
|
||||
int vfprintf(FILE *stream, const char *s, va_list ap);
|
||||
int vsprintf(char *buf, const char *s, va_list ap);
|
||||
int avsprintf(FAR char **ptr, const char *fmt, va_list ap);
|
||||
int vsnprintf(FAR char *buf, size_t size, const char *format, va_list ap);
|
||||
int vsscanf(char *buf, const char *s, va_list ap);
|
||||
int vsprintf(char *buf, const char *s, va_list ap);
|
||||
|
||||
FAR FILE *fdopen(int fd, FAR const char *type);
|
||||
int dprintf(int fd, FAR const char *fmt, ...);
|
||||
int vdprintf(int fd, FAR const char *fmt, va_list ap);
|
||||
|
||||
int statfs(FAR const char *path, FAR struct statfs *buf);
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -105,6 +105,8 @@ static inline int sam_gpiopin(gpio_pinset_t cfgset)
|
||||
*
|
||||
* Description:
|
||||
* Configure a GPIO input pin based on bit-encoded description of the pin.
|
||||
* This function serves the dual role of putting all pins into a known,
|
||||
* initial state. Hence, it is overkill for what really needs to be done.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
@@ -200,10 +202,10 @@ static inline int sam_configinterrupt(uintptr_t base, uint32_t pin,
|
||||
* falling edges.
|
||||
*/
|
||||
|
||||
ret = sam_configinput(base, pin, cfgset)
|
||||
if (ret = OK)
|
||||
ret = sam_configinput(base, pin, cfgset);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Disable rising and falling edge interrupts as requested
|
||||
/* Disable rising and falling edge interrupts as requested
|
||||
* {IMR1, IMR0} Interrupt Mode
|
||||
*
|
||||
* 00 Pin Change <-- We already have this
|
||||
@@ -214,13 +216,13 @@ static inline int sam_configinterrupt(uintptr_t base, uint32_t pin,
|
||||
|
||||
gpio_pinset_t edges = cfgset & GPIO_INT_MASK;
|
||||
|
||||
if (eges = GPIO_INT_RISING)
|
||||
if (edges == GPIO_INT_RISING)
|
||||
{
|
||||
/* Rising only.. disable interrrupts on the falling edge */
|
||||
|
||||
putreg32(pin, base + SAM_GPIO_IMR0S_OFFSET);
|
||||
}
|
||||
else if (edges = GPIO_INT_FALLING)
|
||||
else if (edges == GPIO_INT_FALLING)
|
||||
{
|
||||
/* Falling only.. disable interrrupts on the rising edge */
|
||||
|
||||
@@ -363,7 +365,7 @@ static inline int sam_configperiph(uintptr_t base, uint32_t pin,
|
||||
case _GPIO_FUNCC: /* Function C 010 */
|
||||
putreg32(pin, base + SAM_GPIO_PMR1S_OFFSET);
|
||||
break;
|
||||
|
||||
|
||||
case _GPIO_FUNCE: /* Function E 100 */
|
||||
putreg32(pin, base + SAM_GPIO_PMR2S_OFFSET);
|
||||
break;
|
||||
@@ -397,13 +399,13 @@ static inline int sam_configperiph(uintptr_t base, uint32_t pin,
|
||||
*/
|
||||
|
||||
edges = cfgset & GPIO_INT_MASK;
|
||||
if (eges = GPIO_INT_RISING)
|
||||
if (edges == GPIO_INT_RISING)
|
||||
{
|
||||
/* Rising only.. disable interrrupts on the falling edge */
|
||||
|
||||
putreg32(pin, base + SAM_GPIO_IMR0S_OFFSET);
|
||||
}
|
||||
else if (edges = GPIO_INT_FALLING)
|
||||
else if (edges == GPIO_INT_FALLING)
|
||||
{
|
||||
/* Falling only.. disable interrrupts on the rising edge */
|
||||
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
* PC07 to GND.
|
||||
*
|
||||
* When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will
|
||||
* control LED0. Otherwise, LED0 can be controlled from logic in this file.
|
||||
* control LED0. Otherwise, LED0 can be controlled from user applications
|
||||
* using the logic in this file.
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user