extmod/modmachine: Clean up decls of machine types to use common ones.

The machine_i2c_type, machine_spi_type and machine_timer_type symbols are
already declared in extmod/modmachine.h and should not be declared anywhere
else.

Also move declarations of machine_pin_type and machine_rtc_type to the
common header in extmod.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2023-10-26 11:39:40 +11:00
parent 5b4a2baff6
commit 90023b4dcf
59 changed files with 44 additions and 87 deletions

View File

@@ -2,6 +2,7 @@
#include "py/obj.h"
#include "py/mphal.h"
#include "extmod/modmachine.h"
#include "pin.h"
#define PIN_AF(_name, _af_mode, _input_daisy, _instance, _input_register, _pad_config) \

View File

@@ -28,7 +28,7 @@
#include "py/mphal.h"
#include "py/mperrno.h"
#include "extmod/machine_i2c.h"
#include "modmachine.h"
#include "extmod/modmachine.h"
#include CLOCK_CONFIG_H
#include "pin.h"

View File

@@ -29,6 +29,7 @@
#include "py/runtime.h"
#include "shared/runtime/mpirq.h"
#include "shared/timeutils/timeutils.h"
#include "extmod/modmachine.h"
#include "modmachine.h"
#include "ticks.h"
#include "fsl_snvs_lp.h"

View File

@@ -29,7 +29,7 @@
#include "py/mphal.h"
#include "py/mperrno.h"
#include "extmod/machine_spi.h"
#include "modmachine.h"
#include "extmod/modmachine.h"
#include CLOCK_CONFIG_H
#include "fsl_cache.h"

View File

@@ -73,8 +73,6 @@ typedef struct _iomux_table_t {
uint32_t configRegister;
} iomux_table_t;
extern const mp_obj_type_t machine_uart_type;
STATIC const uint8_t uart_index_table[] = MICROPY_HW_UART_INDEX;
STATIC LPUART_Type *uart_base_ptr_table[] = LPUART_BASE_PTRS;
static const iomux_table_t iomux_table_uart[] = {

View File

@@ -29,11 +29,7 @@
#include "py/obj.h"
extern const mp_obj_type_t machine_i2c_type;
extern const mp_obj_type_t machine_rtc_type;
extern const mp_obj_type_t machine_sdcard_type;
extern const mp_obj_type_t machine_spi_type;
extern const mp_obj_type_t machine_timer_type;
void machine_adc_init(void);
void machine_pin_irq_deinit(void);

View File

@@ -25,6 +25,7 @@
*/
#include "py/runtime.h"
#include "extmod/modmachine.h"
#include "pin.h"

View File

@@ -140,7 +140,6 @@ typedef struct _machine_pin_irq_obj_t {
// ------------------------------------------------------------------------------------------------------------------ //
extern const mp_obj_type_t machine_pin_type;
extern const mp_obj_type_t machine_pin_af_type;
// ------------------------------------------------------------------------------------------------------------------ //