|
7 | 7 | #include <stdint.h> |
8 | 8 | #include <string.h> |
9 | 9 |
|
10 | | -#include <pbdrv/reset.h> |
| 10 | +#include <pbdrv/config.h> |
| 11 | +#include <pbdrv/ioport.h> |
| 12 | + |
11 | 13 | #include <pbio/button.h> |
12 | 14 | #include <pbio/main.h> |
13 | 15 | #include <pbio/os.h> |
| 16 | +#include <pbio/port_interface.h> |
14 | 17 |
|
15 | 18 | #include <pbsys/core.h> |
16 | 19 | #include <pbsys/main.h> |
17 | 20 | #include <pbsys/program_stop.h> |
18 | 21 | #include <pbsys/status.h> |
19 | 22 |
|
| 23 | + |
20 | 24 | #include <nxos/_display.h> |
21 | 25 | #include <nxos/assert.h> |
22 | 26 | #include <nxos/drivers/_aic.h> |
|
29 | 33 | #include <nxos/drivers/systick.h> |
30 | 34 | #include <nxos/interrupts.h> |
31 | 35 |
|
| 36 | +const pbdrv_gpio_t pbdrv_ioport_platform_data_vcc_pin = { |
| 37 | + .bank = NULL, |
| 38 | + .pin = 0, |
| 39 | +}; |
| 40 | + |
| 41 | +const pbdrv_ioport_platform_data_t pbdrv_ioport_platform_data[PBDRV_CONFIG_IOPORT_NUM_DEV] = { |
| 42 | + { |
| 43 | + .port_id = PBIO_PORT_ID_A, |
| 44 | + .motor_driver_index = 0, |
| 45 | + .i2c_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, |
| 46 | + .uart_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, |
| 47 | + .external_port_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, |
| 48 | + .counter_driver_index = 0, |
| 49 | + .pins = NULL, |
| 50 | + .supported_modes = PBIO_PORT_MODE_QUADRATURE, |
| 51 | + }, |
| 52 | + { |
| 53 | + .port_id = PBIO_PORT_ID_B, |
| 54 | + .motor_driver_index = 1, |
| 55 | + .i2c_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, |
| 56 | + .uart_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, |
| 57 | + .external_port_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, |
| 58 | + .counter_driver_index = 1, |
| 59 | + .pins = NULL, |
| 60 | + .supported_modes = PBIO_PORT_MODE_QUADRATURE, |
| 61 | + }, |
| 62 | + { |
| 63 | + .port_id = PBIO_PORT_ID_C, |
| 64 | + .motor_driver_index = 2, |
| 65 | + .i2c_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, |
| 66 | + .uart_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, |
| 67 | + .external_port_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, |
| 68 | + .counter_driver_index = 2, |
| 69 | + .pins = NULL, |
| 70 | + .supported_modes = PBIO_PORT_MODE_QUADRATURE, |
| 71 | + }, |
| 72 | + { |
| 73 | + .port_id = PBIO_PORT_ID_1, |
| 74 | + .motor_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, // todo, power pin, see ev3 |
| 75 | + .external_port_index = 0, |
| 76 | + .counter_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, |
| 77 | + .i2c_driver_index = 0, |
| 78 | + .uart_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, |
| 79 | + .pins = NULL, |
| 80 | + .supported_modes = PBIO_PORT_MODE_NONE, // todo, lego mode, nxt dcm |
| 81 | + }, |
| 82 | + { |
| 83 | + .port_id = PBIO_PORT_ID_2, |
| 84 | + .motor_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, // todo, power pin, see ev3 |
| 85 | + .external_port_index = 1, |
| 86 | + .counter_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, |
| 87 | + .i2c_driver_index = 1, |
| 88 | + .uart_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, |
| 89 | + .pins = NULL, |
| 90 | + .supported_modes = PBIO_PORT_MODE_NONE, // todo, lego mode, nxt dcm |
| 91 | + }, |
| 92 | + { |
| 93 | + .port_id = PBIO_PORT_ID_3, |
| 94 | + .motor_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, // todo, power pin, see ev3 |
| 95 | + .external_port_index = 2, |
| 96 | + .counter_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, |
| 97 | + .i2c_driver_index = 2, |
| 98 | + .uart_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, |
| 99 | + .pins = NULL, |
| 100 | + .supported_modes = PBIO_PORT_MODE_NONE, // todo, lego mode, nxt dcm |
| 101 | + }, |
| 102 | + { |
| 103 | + .port_id = PBIO_PORT_ID_4, |
| 104 | + .motor_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, // todo, power pin, see ev3 |
| 105 | + .external_port_index = 3, |
| 106 | + .counter_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, |
| 107 | + .i2c_driver_index = 3, |
| 108 | + .uart_driver_index = PBDRV_IOPORT_INDEX_NOT_AVAILABLE, |
| 109 | + .pins = NULL, |
| 110 | + .supported_modes = PBIO_PORT_MODE_NONE, // todo, lego mode, nxt dcm |
| 111 | + }, |
| 112 | +}; |
| 113 | + |
32 | 114 | const char *pin = "1234"; |
33 | 115 |
|
34 | 116 | static void legacy_bluetooth_init_blocking(void) { |
|
0 commit comments