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
d4a5ca50
Commit
d4a5ca50
authored
Oct 03, 2016
by
Damien George
Browse files
stmhal/spi: Make machine.SPI class conform to correct API.
Includes both software and hardware SPI implementations.
parent
077dbf4a
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
stmhal/modmachine.c
View file @
d4a5ca50
...
...
@@ -527,10 +527,10 @@ STATIC const mp_map_elem_t machine_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_RTC), (mp_obj_t)&pyb_rtc_type },
{ MP_OBJ_NEW_QSTR(MP_QSTR_ADC), (mp_obj_t)&pyb_adc_type },
#endif
// TODO: Per new API,
both
types below, if called with 1 arg (ID), should still
// TODO: Per new API,
I2C
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
)
&
machine_i2c_type
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_SPI
),
(
mp_obj_t
)
&
pyb
_spi_type
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_SPI
),
(
mp_obj_t
)
&
machine_hard
_spi_type
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_WDT
),
(
mp_obj_t
)
&
pyb_wdt_type
},
#if 0
{ MP_OBJ_NEW_QSTR(MP_QSTR_UART), (mp_obj_t)&pyb_uart_type },
...
...
stmhal/spi.c
View file @
d4a5ca50
This diff is collapsed.
Click to expand it.
stmhal/spi.h
View file @
d4a5ca50
...
...
@@ -31,6 +31,8 @@ extern SPI_HandleTypeDef SPIHandle4;
extern
SPI_HandleTypeDef
SPIHandle5
;
extern
SPI_HandleTypeDef
SPIHandle6
;
extern
const
mp_obj_type_t
pyb_spi_type
;
extern
const
mp_obj_type_t
machine_soft_spi_type
;
extern
const
mp_obj_type_t
machine_hard_spi_type
;
void
spi_init0
(
void
);
void
spi_init
(
SPI_HandleTypeDef
*
spi
,
bool
enable_nss_pin
);
...
...
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