Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
e4f963a3
Commit
e4f963a3
authored
Apr 12, 2016
by
Damien George
Browse files
stmhal: Use new generic I2C object in machine module.
parent
69a1aaf6
Changes
3
Hide whitespace changes
Inline
Side-by-side
stmhal/modmachine.c
View file @
e4f963a3
...
...
@@ -31,6 +31,7 @@
#include
"py/runtime.h"
#include
"py/mphal.h"
#include
"extmod/machine_mem.h"
#include
"extmod/machine_i2c.h"
#include
"lib/fatfs/ff.h"
#include
"lib/fatfs/diskio.h"
#include
"gccollect.h"
...
...
@@ -449,7 +450,7 @@ STATIC const mp_map_elem_t machine_module_globals_table[] = {
#endif
// TODO: Per new API, both types below, if called with 1 arg (ID), should still
// initialize master mode on the peripheral.
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_I2C
),
(
mp_obj_t
)
&
pyb
_i2c_type
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_I2C
),
(
mp_obj_t
)
&
machine
_i2c_type
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_SPI
),
(
mp_obj_t
)
&
pyb_spi_type
},
#if 0
{ MP_OBJ_NEW_QSTR(MP_QSTR_UART), (mp_obj_t)&pyb_uart_type },
...
...
stmhal/mpconfigport.h
View file @
e4f963a3
...
...
@@ -90,6 +90,7 @@
#define MICROPY_PY_UHEAPQ (1)
#define MICROPY_PY_UHASHLIB (1)
#define MICROPY_PY_MACHINE (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
#define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE (0)
...
...
stmhal/mphalport.h
View file @
e4f963a3
...
...
@@ -35,6 +35,10 @@ void mp_hal_set_interrupt_char(int c); // -1 to disable
#define mp_hal_delay_ms HAL_Delay
#define mp_hal_ticks_ms HAL_GetTick
// needed for machine.I2C
#include
"stmhal/systick.h"
#define mp_hal_delay_us_fast(us) sys_tick_udelay(us)
// C-level pin HAL
#include
"stmhal/pin.h"
#define mp_hal_pin_obj_t pin_obj_t
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment