Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
4e0c905d
Commit
4e0c905d
authored
11 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
SAMA5 TWI: Misc improvements during debug (still not getting interupts)
parent
f7573b3f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
arch/arm/src/sama5/chip/sam_twi.h
+3
-0
3 additions, 0 deletions
arch/arm/src/sama5/chip/sam_twi.h
arch/arm/src/sama5/sam_twi.c
+204
-136
204 additions, 136 deletions
arch/arm/src/sama5/sam_twi.c
configs/sama5d3x-ek/src/sam_at24.c
+8
-2
8 additions, 2 deletions
configs/sama5d3x-ek/src/sam_at24.c
with
215 additions
and
138 deletions
arch/arm/src/sama5/chip/sam_twi.h
+
3
−
0
View file @
4e0c905d
...
...
@@ -174,6 +174,9 @@
#define TWI_INT_SCLWS (1 << 10)
/* Bit 10: Clock Wait State */
#define TWI_INT_EOSACC (1 << 11)
/* Bit 11: End Of Slave Access */
#define TWI_INT_ERRORS (0x00000340)
#define TWI_INT_ALL (0x00000f77)
/* TWI Receive Holding Register */
#define TWI_RHR_RXDATA_SHIFT (0)
/* Bits 0-7: Master or Slave Receive Holding Data */
...
...
This diff is collapsed.
Click to expand it.
arch/arm/src/sama5/sam_twi.c
+
204
−
136
View file @
4e0c905d
This diff is collapsed.
Click to expand it.
configs/sama5d3x-ek/src/sam_at24.c
+
8
−
2
View file @
4e0c905d
...
...
@@ -101,25 +101,29 @@ int sam_at24_initialize(int minor)
{
/* No.. Get the I2C bus driver */
fvdbg
(
"Initialize TWI%d
\n
"
,
AT24_BUS
);
i2c
=
up_i2cinitialize
(
AT24_BUS
);
if
(
!
i2c
)
{
fdbg
(
"ERROR: Failed to initialize
I2C port
%d
\n
"
,
AT24_BUS
);
fdbg
(
"ERROR: Failed to initialize
TWI
%d
\n
"
,
AT24_BUS
);
return
-
ENODEV
;
}
/* Now bind the I2C interface to the AT24 I2C EEPROM driver */
fvdbg
(
"Bind the AT24 EEPROM driver to TWI%d
\n
"
,
AT24_BUS
);
mtd
=
at24c_initialize
(
i2c
);
if
(
!
mtd
)
{
fdbg
(
"ERROR: Failed to bind I2C port %d to the AT24 EEPROM driver
\n
"
);
fdbg
(
"ERROR: Failed to bind TWI%d to the AT24 EEPROM driver
\n
"
,
AT24_BUS
);
return
-
ENODEV
;
}
#if defined(CONFIG_SAMA5_AT24_FTL)
/* And finally, use the FTL layer to wrap the MTD driver as a block driver */
fvdbg
(
"Initialize the FTL layer to create /dev/mtdblock%d
\n
"
,
AT24_MINOR
);
ret
=
ftl_initialize
(
AT24_MINOR
,
mtd
);
if
(
ret
<
0
)
{
...
...
@@ -130,6 +134,7 @@ int sam_at24_initialize(int minor)
#elif defined(CONFIG_SAMA5_AT24_NXFFS)
/* Initialize to provide NXFFS on the MTD interface */
fvdbg
(
"Initialize the NXFFS file system
\n
"
);
ret
=
nxffs_initialize
(
mtd
);
if
(
ret
<
0
)
{
...
...
@@ -139,6 +144,7 @@ int sam_at24_initialize(int minor)
/* Mount the file system at /mnt/at24 */
fvdbg
(
"Mount the NXFFS file system at /dev/at24
\n
"
);
ret
=
mount
(
NULL
,
"/mnt/at24"
,
"nxffs"
,
0
,
NULL
);
if
(
ret
<
0
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment