Skip to content

Commit e3f8777

Browse files
author
Daniel Campora
committed
cc3200: Implement new Pin API.
1 parent ec8589e commit e3f8777

11 files changed

Lines changed: 237 additions & 187 deletions

File tree

cc3200/boards/cc3200_prefix.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@
4444
{ &pin_type }, \
4545
.name = MP_QSTR_ ## p_pin_name, \
4646
.port = PORT_A ## p_port, \
47-
.type = PIN_TYPE_STD, \
47+
.pull = PIN_TYPE_STD, \
4848
.bit = (p_bit), \
4949
.pin_num = (p_pin_num), \
5050
.af = PIN_MODE_0, \
5151
.strength = PIN_STRENGTH_4MA, \
5252
.mode = GPIO_DIR_MODE_IN, \
53+
.value = 0, \
5354
.isused = false, \
5455
}

cc3200/boards/make-pins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def print(self):
107107
for pin in self.cpu_pins:
108108
if pin.is_board_pin():
109109
pin.print()
110-
self.print_named('cpu', self.cpu_pins)
110+
self.print_named('board', self.cpu_pins)
111111
print('')
112112

113113
def print_header(self, hdr_filename):

cc3200/misc/mperror.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void mperror_init0 (void) {
9494
MAP_GPIODirModeSet(MICROPY_SYS_LED_PORT, MICROPY_SYS_LED_PORT_PIN, GPIO_DIR_MODE_OUT);
9595
#else
9696
// configure the system led
97-
pin_config ((pin_obj_t *)&MICROPY_SYS_LED_GPIO, PIN_MODE_0, GPIO_DIR_MODE_OUT, PIN_TYPE_STD, PIN_STRENGTH_6MA);
97+
pin_config ((pin_obj_t *)&MICROPY_SYS_LED_GPIO, PIN_MODE_0, GPIO_DIR_MODE_OUT, PIN_TYPE_STD, 0, PIN_STRENGTH_6MA);
9898
#endif
9999
mperror_heart_beat.enabled = true;
100100
mperror_heartbeat_switch_off();

cc3200/misc/pin_named_pins.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ STATIC void pin_named_pins_obj_print(const mp_print_t *print, mp_obj_t self_in,
4343
mp_printf(print, "<Pin.%q>", self->name);
4444
}
4545

46-
const mp_obj_type_t pin_cpu_pins_obj_type = {
46+
const mp_obj_type_t pin_board_pins_obj_type = {
4747
{ &mp_type_type },
48-
.name = MP_QSTR_cpu,
48+
.name = MP_QSTR_board,
4949
.print = pin_named_pins_obj_print,
50-
.locals_dict = (mp_obj_t)&pin_cpu_pins_locals_dict,
50+
.locals_dict = (mp_obj_t)&pin_board_pins_locals_dict,
5151
};
5252

5353
pin_obj_t *pin_find_named_pin(const mp_obj_dict_t *named_pins, mp_obj_t name) {

cc3200/mods/pybadc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ STATIC pyb_adc_obj_t pyb_adc_obj[PYB_ADC_NUM_CHANNELS] = { {.pin = &pin_GP2, .ch
8989
******************************************************************************/
9090
STATIC void pybadc_init (pyb_adc_obj_t *self) {
9191
// configure the pin in analog mode
92-
pin_config (self->pin, PIN_MODE_0, GPIO_DIR_MODE_IN, PYBPIN_ANALOG_TYPE, PIN_STRENGTH_2MA);
92+
pin_config (self->pin, -1, PIN_TYPE_ANALOG, PIN_TYPE_STD, -1, PIN_STRENGTH_2MA);
9393
// enable the ADC channel
9494
MAP_ADCChannelEnable(ADC_BASE, self->channel);
9595
// enable and configure the timer

0 commit comments

Comments
 (0)