Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
67d1dca9
Commit
67d1dca9
authored
Sep 18, 2021
by
iabdalkader
Committed by
Damien George
Sep 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stm32/machine_i2c: Use hardware I2C for STM32H7.
parent
9eff4029
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
ports/stm32/i2c.c
ports/stm32/i2c.c
+7
-2
ports/stm32/machine_i2c.c
ports/stm32/machine_i2c.c
+1
-1
No files found.
ports/stm32/i2c.c
View file @
67d1dca9
...
...
@@ -268,7 +268,12 @@ int i2c_write(i2c_t *i2c, const uint8_t *src, size_t len, size_t next_len) {
return
num_acks
;
}
#elif defined(STM32F0) || defined(STM32F7)
#elif defined(STM32F0) || defined(STM32F7) || defined(STM32H7)
#if defined(STM32H7)
#define APB1ENR APB1LENR
#define RCC_APB1ENR_I2C1EN RCC_APB1LENR_I2C1EN
#endif
STATIC
uint16_t
i2c_timeout_ms
[
MICROPY_HW_MAX_I2C
];
...
...
@@ -468,7 +473,7 @@ int i2c_write(i2c_t *i2c, const uint8_t *src, size_t len, size_t next_len) {
#endif
#if defined(STM32F0) || defined(STM32F4) || defined(STM32F7)
#if defined(STM32F0) || defined(STM32F4) || defined(STM32F7)
|| defined(STM32H7)
int
i2c_readfrom
(
i2c_t
*
i2c
,
uint16_t
addr
,
uint8_t
*
dest
,
size_t
len
,
bool
stop
)
{
int
ret
;
...
...
ports/stm32/machine_i2c.c
View file @
67d1dca9
...
...
@@ -38,7 +38,7 @@
#define I2C_POLL_DEFAULT_TIMEOUT_US (50000) // 50ms
#if defined(STM32F0) || defined(STM32F4) || defined(STM32F7)
#if defined(STM32F0) || defined(STM32F4) || defined(STM32F7)
|| defined(STM32H7)
typedef
struct
_machine_hard_i2c_obj_t
{
mp_obj_base_t
base
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment