File tree Expand file tree Collapse file tree 6 files changed +594
-0
lines changed Expand file tree Collapse file tree 6 files changed +594
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ set(MICROPY_SOURCE_PORT
100
100
mpthreadport.c
101
101
rp2_flash.c
102
102
rp2_pio.c
103
+ rp2_dma.c
103
104
tusb_port.c
104
105
uart.c
105
106
)
@@ -125,6 +126,7 @@ set(MICROPY_SOURCE_QSTR
125
126
${PROJECT_SOURCE_DIR} /modutime.c
126
127
${PROJECT_SOURCE_DIR} /rp2_flash.c
127
128
${PROJECT_SOURCE_DIR} /rp2_pio.c
129
+ ${PROJECT_SOURCE_DIR} /rp2_dma.c
128
130
)
129
131
130
132
set (PICO_SDK_COMPONENTS
Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ int main(int argc, char **argv) {
106
106
readline_init0 ();
107
107
machine_pin_init ();
108
108
rp2_pio_init ();
109
+ rp2_dma_init ();
109
110
110
111
// Execute _boot.py to set up the filesystem.
111
112
pyexec_frozen_module ("_boot.py" );
@@ -136,6 +137,7 @@ int main(int argc, char **argv) {
136
137
137
138
soft_reset_exit :
138
139
mp_printf (MP_PYTHON_PRINTER , "MPY: soft reboot\n" );
140
+ rp2_dma_deinit ();
139
141
rp2_pio_deinit ();
140
142
machine_pin_deinit ();
141
143
#if MICROPY_PY_THREAD
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ STATIC const mp_rom_map_elem_t rp2_module_globals_table[] = {
32
32
{ MP_ROM_QSTR (MP_QSTR_Flash ), MP_ROM_PTR (& rp2_flash_type ) },
33
33
{ MP_ROM_QSTR (MP_QSTR_PIO ), MP_ROM_PTR (& rp2_pio_type ) },
34
34
{ MP_ROM_QSTR (MP_QSTR_StateMachine ), MP_ROM_PTR (& rp2_state_machine_type ) },
35
+ { MP_ROM_QSTR (MP_QSTR_DMA ), MP_ROM_PTR (& rp2_dma_type ) },
36
+ { MP_ROM_QSTR (MP_QSTR_DMAConfig ), MP_ROM_PTR (& rp2_dma_config_type ) },
37
+ { MP_ROM_QSTR (MP_QSTR_buffer_address ), MP_ROM_PTR (& rp2_dma_buffer_address_obj ) },
35
38
};
36
39
STATIC MP_DEFINE_CONST_DICT (rp2_module_globals , rp2_module_globals_table );
37
40
Original file line number Diff line number Diff line change 31
31
extern const mp_obj_type_t rp2_flash_type ;
32
32
extern const mp_obj_type_t rp2_pio_type ;
33
33
extern const mp_obj_type_t rp2_state_machine_type ;
34
+ extern const mp_obj_type_t rp2_dma_type ;
35
+ extern const mp_obj_type_t rp2_dma_config_type ;
36
+
37
+ MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN (rp2_dma_buffer_address_obj );
38
+
34
39
35
40
void rp2_pio_init (void );
36
41
void rp2_pio_deinit (void );
37
42
43
+ void rp2_dma_init (void );
44
+ void rp2_dma_deinit (void );
45
+
38
46
#endif // MICROPY_INCLUDED_RP2_MODRP2_H
Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ extern const struct _mp_obj_module_t mp_module_utime;
177
177
void *rp2_state_machine_irq_obj[8]; \
178
178
void *rp2_uart_rx_buffer[2]; \
179
179
void *rp2_uart_tx_buffer[2]; \
180
+ void *rp2_dma_irq_obj[NUM_DMA_CHANNELS]; \
180
181
181
182
#define MP_STATE_PORT MP_STATE_VM
182
183
You can’t perform that action at this time.
0 commit comments