2014-05-03 18:27:38 -04:00
|
|
|
/*
|
|
|
|
* This file is part of the Micro Python project, http://micropython.org/
|
|
|
|
*
|
|
|
|
* The MIT License (MIT)
|
|
|
|
*
|
|
|
|
* Copyright (c) 2013, 2014 Damien P. George
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2014-03-12 21:06:26 -04:00
|
|
|
// qstrs specific to this port
|
|
|
|
|
|
|
|
Q(help)
|
|
|
|
Q(pyb)
|
2014-04-18 20:28:18 -04:00
|
|
|
Q(unique_id)
|
2014-05-18 05:56:21 -04:00
|
|
|
Q(bootloader)
|
2014-10-22 02:04:38 -04:00
|
|
|
Q(hard_reset)
|
2014-03-12 21:06:26 -04:00
|
|
|
Q(info)
|
|
|
|
Q(sd_test)
|
2014-03-26 16:15:40 -04:00
|
|
|
Q(present)
|
|
|
|
Q(power)
|
2014-04-13 20:45:24 -04:00
|
|
|
Q(wfi)
|
2014-04-18 17:38:09 -04:00
|
|
|
Q(disable_irq)
|
|
|
|
Q(enable_irq)
|
2014-03-12 21:06:26 -04:00
|
|
|
Q(stop)
|
|
|
|
Q(standby)
|
|
|
|
Q(main)
|
2014-03-29 20:00:15 -04:00
|
|
|
Q(usb_mode)
|
2014-03-12 21:06:26 -04:00
|
|
|
Q(sync)
|
|
|
|
Q(gc)
|
|
|
|
Q(repl_info)
|
|
|
|
Q(delay)
|
|
|
|
Q(udelay)
|
|
|
|
Q(servo)
|
|
|
|
Q(pwm)
|
2014-03-26 16:15:40 -04:00
|
|
|
Q(read)
|
2014-04-03 13:32:54 -04:00
|
|
|
Q(readall)
|
|
|
|
Q(readline)
|
2014-03-26 16:15:40 -04:00
|
|
|
Q(write)
|
2014-04-16 10:52:50 -04:00
|
|
|
Q(have_cdc)
|
2014-06-15 04:47:27 -04:00
|
|
|
Q(repl_uart)
|
2014-03-12 21:06:26 -04:00
|
|
|
Q(hid)
|
|
|
|
Q(time)
|
2014-03-22 09:41:02 -04:00
|
|
|
Q(rng)
|
2014-03-12 21:06:26 -04:00
|
|
|
Q(SD)
|
|
|
|
Q(SDcard)
|
2014-04-07 21:08:16 -04:00
|
|
|
Q(FileIO)
|
2014-07-19 11:39:13 -04:00
|
|
|
Q(flush)
|
2014-03-12 21:06:26 -04:00
|
|
|
// Entries for sys.path
|
2014-07-31 18:44:04 -04:00
|
|
|
Q(/flash)
|
|
|
|
Q(/flash/lib)
|
|
|
|
Q(/sd)
|
|
|
|
Q(/sd/lib)
|
2014-04-18 17:38:09 -04:00
|
|
|
Q(millis)
|
2014-08-23 15:21:12 -04:00
|
|
|
Q(micros)
|
2014-09-28 14:21:13 -04:00
|
|
|
Q(elapsed_millis)
|
|
|
|
Q(elapsed_micros)
|
2014-04-18 17:38:09 -04:00
|
|
|
|
2014-10-12 15:23:47 -04:00
|
|
|
// for module weak links
|
|
|
|
Q(re)
|
2014-10-12 18:35:38 -04:00
|
|
|
Q(zlib)
|
2014-10-12 15:23:47 -04:00
|
|
|
Q(json)
|
|
|
|
|
2014-06-11 10:41:14 -04:00
|
|
|
// for file class
|
|
|
|
Q(seek)
|
|
|
|
Q(tell)
|
|
|
|
|
2014-07-31 05:30:42 -04:00
|
|
|
// for USB VCP class
|
|
|
|
Q(USB_VCP)
|
|
|
|
Q(send)
|
|
|
|
Q(recv)
|
|
|
|
Q(timeout)
|
|
|
|
|
2014-04-18 21:17:30 -04:00
|
|
|
// for RTC class
|
|
|
|
Q(RTC)
|
|
|
|
Q(info)
|
|
|
|
Q(datetime)
|
|
|
|
|
2014-04-18 17:38:09 -04:00
|
|
|
// for Pin class
|
2014-03-12 21:06:26 -04:00
|
|
|
Q(Pin)
|
|
|
|
Q(PinAF)
|
|
|
|
Q(PinNamed)
|
2014-04-18 21:17:57 -04:00
|
|
|
Q(init)
|
2014-04-18 17:38:09 -04:00
|
|
|
Q(value)
|
|
|
|
Q(low)
|
|
|
|
Q(high)
|
|
|
|
Q(name)
|
2014-07-22 10:57:36 -04:00
|
|
|
Q(names)
|
|
|
|
Q(af)
|
|
|
|
Q(af_list)
|
2014-04-18 17:38:09 -04:00
|
|
|
Q(port)
|
|
|
|
Q(pin)
|
2014-07-22 10:57:36 -04:00
|
|
|
Q(gpio)
|
2014-04-18 17:38:09 -04:00
|
|
|
Q(mapper)
|
|
|
|
Q(dict)
|
|
|
|
Q(debug)
|
|
|
|
Q(board)
|
|
|
|
Q(cpu)
|
2014-07-22 10:57:36 -04:00
|
|
|
Q(af)
|
|
|
|
Q(mode)
|
|
|
|
Q(pull)
|
|
|
|
Q(index)
|
|
|
|
Q(reg)
|
2014-04-18 17:38:09 -04:00
|
|
|
Q(IN)
|
|
|
|
Q(OUT_PP)
|
|
|
|
Q(OUT_OD)
|
|
|
|
Q(AF_PP)
|
|
|
|
Q(AF_OD)
|
|
|
|
Q(ANALOG)
|
2014-03-12 21:06:26 -04:00
|
|
|
Q(PULL_NONE)
|
|
|
|
Q(PULL_UP)
|
|
|
|
Q(PULL_DOWN)
|
2014-03-22 10:56:32 -04:00
|
|
|
|
2014-04-18 19:54:33 -04:00
|
|
|
// for LED object
|
|
|
|
Q(LED)
|
2014-03-26 16:15:40 -04:00
|
|
|
Q(on)
|
|
|
|
Q(off)
|
|
|
|
Q(toggle)
|
|
|
|
Q(intensity)
|
|
|
|
|
2014-04-21 13:23:50 -04:00
|
|
|
// for Switch class
|
|
|
|
Q(Switch)
|
|
|
|
Q(callback)
|
|
|
|
|
2014-04-21 07:03:09 -04:00
|
|
|
// for UART class
|
|
|
|
Q(UART)
|
2014-04-20 20:14:14 -04:00
|
|
|
Q(baudrate)
|
|
|
|
Q(bits)
|
|
|
|
Q(stop)
|
|
|
|
Q(parity)
|
2014-10-30 20:40:57 -04:00
|
|
|
Q(flow)
|
2014-10-11 12:57:10 -04:00
|
|
|
Q(read_buf_len)
|
|
|
|
Q(buf)
|
|
|
|
Q(len)
|
|
|
|
Q(timeout)
|
|
|
|
Q(timeout_char)
|
2014-04-20 20:14:14 -04:00
|
|
|
Q(init)
|
|
|
|
Q(deinit)
|
2014-10-11 12:57:10 -04:00
|
|
|
Q(any)
|
|
|
|
Q(writechar)
|
|
|
|
Q(readchar)
|
|
|
|
Q(readinto)
|
2014-10-30 20:40:57 -04:00
|
|
|
Q(RTS)
|
|
|
|
Q(CTS)
|
2014-03-26 16:15:40 -04:00
|
|
|
|
2014-10-02 09:34:15 -04:00
|
|
|
// for CAN class
|
2014-11-21 17:24:23 -05:00
|
|
|
#if MICROPY_HW_ENABLE_CAN
|
2014-10-02 09:34:15 -04:00
|
|
|
Q(CAN)
|
|
|
|
Q(prescaler)
|
|
|
|
Q(init)
|
|
|
|
Q(deinit)
|
|
|
|
Q(all)
|
|
|
|
Q(send)
|
|
|
|
Q(recv)
|
|
|
|
Q(addr)
|
|
|
|
Q(fifo)
|
|
|
|
Q(timeout)
|
2014-10-26 16:51:30 -04:00
|
|
|
Q(extframe)
|
2014-11-15 16:28:14 -05:00
|
|
|
Q(sjw)
|
|
|
|
Q(bs1)
|
|
|
|
Q(bs2)
|
2014-11-21 17:24:23 -05:00
|
|
|
Q(bank)
|
|
|
|
Q(params)
|
|
|
|
Q(initfilterbanks)
|
|
|
|
Q(clearfilter)
|
|
|
|
Q(setfilter)
|
2014-10-02 09:34:15 -04:00
|
|
|
Q(NORMAL)
|
|
|
|
Q(LOOPBACK)
|
|
|
|
Q(SILENT)
|
|
|
|
Q(SILENT_LOOPBACK)
|
2014-11-21 17:24:23 -05:00
|
|
|
Q(MASK16)
|
|
|
|
Q(LIST16)
|
|
|
|
Q(MASK32)
|
|
|
|
Q(LIST32)
|
|
|
|
#endif
|
2014-10-02 09:34:15 -04:00
|
|
|
|
2014-04-21 11:48:16 -04:00
|
|
|
// for Timer class
|
|
|
|
Q(Timer)
|
2014-08-20 16:21:11 -04:00
|
|
|
Q(init)
|
|
|
|
Q(deinit)
|
|
|
|
Q(channel)
|
2014-04-21 11:48:16 -04:00
|
|
|
Q(counter)
|
2014-10-04 09:36:39 -04:00
|
|
|
Q(source_freq)
|
2014-04-21 11:48:16 -04:00
|
|
|
Q(prescaler)
|
|
|
|
Q(period)
|
|
|
|
Q(callback)
|
|
|
|
Q(freq)
|
|
|
|
Q(mode)
|
|
|
|
Q(div)
|
2014-08-20 16:21:11 -04:00
|
|
|
Q(UP)
|
|
|
|
Q(DOWN)
|
|
|
|
Q(CENTER)
|
|
|
|
Q(IC)
|
|
|
|
Q(PWM)
|
|
|
|
Q(PWM_INVERTED)
|
|
|
|
Q(OC_TIMING)
|
|
|
|
Q(OC_ACTIVE)
|
|
|
|
Q(OC_INACTIVE)
|
|
|
|
Q(OC_TOGGLE)
|
|
|
|
Q(OC_FORCED_ACTIVE)
|
|
|
|
Q(OC_FORCED_INACTIVE)
|
|
|
|
Q(HIGH)
|
|
|
|
Q(LOW)
|
|
|
|
Q(RISING)
|
|
|
|
Q(FALLING)
|
|
|
|
Q(BOTH)
|
|
|
|
|
|
|
|
// for TimerChannel class
|
|
|
|
Q(TimerChannel)
|
|
|
|
Q(pulse_width)
|
2014-09-22 01:40:42 -04:00
|
|
|
Q(pulse_width_percent)
|
2014-08-20 16:21:11 -04:00
|
|
|
Q(compare)
|
|
|
|
Q(capture)
|
|
|
|
Q(polarity)
|
2014-10-10 12:56:41 -04:00
|
|
|
Q(deadtime)
|
2014-04-21 11:48:16 -04:00
|
|
|
|
2014-04-18 17:38:09 -04:00
|
|
|
// for ExtInt class
|
|
|
|
Q(ExtInt)
|
2014-04-19 19:38:50 -04:00
|
|
|
Q(pin)
|
|
|
|
Q(mode)
|
2014-04-19 20:25:58 -04:00
|
|
|
Q(pull)
|
2014-04-19 19:38:50 -04:00
|
|
|
Q(callback)
|
2014-03-26 16:15:40 -04:00
|
|
|
Q(line)
|
|
|
|
Q(enable)
|
|
|
|
Q(disable)
|
|
|
|
Q(swint)
|
2014-03-26 18:35:55 -04:00
|
|
|
Q(regs)
|
2014-04-18 17:38:09 -04:00
|
|
|
Q(IRQ_RISING)
|
|
|
|
Q(IRQ_FALLING)
|
|
|
|
Q(IRQ_RISING_FALLING)
|
|
|
|
Q(EVT_RISING)
|
|
|
|
Q(EVT_FALLING)
|
|
|
|
Q(EVT_RISING_FALLING)
|
2014-03-26 16:15:40 -04:00
|
|
|
|
|
|
|
// for I2C object
|
|
|
|
Q(I2C)
|
2014-04-20 19:10:04 -04:00
|
|
|
Q(mode)
|
|
|
|
Q(addr)
|
|
|
|
Q(baudrate)
|
|
|
|
Q(gencall)
|
|
|
|
Q(data)
|
|
|
|
Q(memaddr)
|
2014-07-21 22:45:04 -04:00
|
|
|
Q(addr_size)
|
2014-04-20 19:10:04 -04:00
|
|
|
Q(timeout)
|
|
|
|
Q(init)
|
|
|
|
Q(deinit)
|
2014-03-26 16:15:40 -04:00
|
|
|
Q(is_ready)
|
2014-04-15 14:24:13 -04:00
|
|
|
Q(scan)
|
2014-04-20 19:10:04 -04:00
|
|
|
Q(send)
|
|
|
|
Q(recv)
|
2014-03-26 16:15:40 -04:00
|
|
|
Q(mem_read)
|
|
|
|
Q(mem_write)
|
|
|
|
|
2014-04-19 19:16:30 -04:00
|
|
|
// for SPI class
|
|
|
|
Q(SPI)
|
|
|
|
Q(init)
|
|
|
|
Q(deinit)
|
|
|
|
Q(send)
|
|
|
|
Q(recv)
|
|
|
|
Q(send_recv)
|
|
|
|
Q(mode)
|
|
|
|
Q(baudrate)
|
2014-04-20 19:10:04 -04:00
|
|
|
Q(polarity)
|
|
|
|
Q(phase)
|
2014-04-19 19:16:30 -04:00
|
|
|
Q(dir)
|
2014-04-20 20:14:14 -04:00
|
|
|
Q(bits)
|
2014-04-19 19:16:30 -04:00
|
|
|
Q(nss)
|
|
|
|
Q(firstbit)
|
|
|
|
Q(ti)
|
2014-04-20 19:10:04 -04:00
|
|
|
Q(crc)
|
2014-04-19 19:16:30 -04:00
|
|
|
Q(MASTER)
|
|
|
|
Q(SLAVE)
|
2014-04-20 19:10:04 -04:00
|
|
|
Q(MSB)
|
|
|
|
Q(LSB)
|
2014-04-19 19:16:30 -04:00
|
|
|
|
2014-03-26 16:15:40 -04:00
|
|
|
// for Accel object
|
|
|
|
Q(Accel)
|
|
|
|
Q(x)
|
|
|
|
Q(y)
|
|
|
|
Q(z)
|
|
|
|
Q(tilt)
|
|
|
|
Q(filtered_xyz)
|
|
|
|
|
|
|
|
// for ADC object
|
|
|
|
Q(ADC)
|
2014-04-18 17:38:09 -04:00
|
|
|
Q(ADCAll)
|
2014-04-15 14:52:56 -04:00
|
|
|
Q(read_timed)
|
2014-03-26 16:15:40 -04:00
|
|
|
Q(read_channel)
|
|
|
|
Q(read_core_temp)
|
|
|
|
Q(read_core_vbat)
|
|
|
|
Q(read_core_vref)
|
|
|
|
|
2014-04-21 08:06:19 -04:00
|
|
|
// for DAC class
|
2014-03-26 16:15:40 -04:00
|
|
|
Q(DAC)
|
|
|
|
Q(noise)
|
|
|
|
Q(triangle)
|
2014-04-21 08:06:19 -04:00
|
|
|
Q(write)
|
|
|
|
Q(write_timed)
|
|
|
|
Q(data)
|
|
|
|
Q(freq)
|
|
|
|
Q(mode)
|
|
|
|
Q(NORMAL)
|
|
|
|
Q(CIRCULAR)
|
2014-03-26 16:15:40 -04:00
|
|
|
|
|
|
|
// for Servo object
|
|
|
|
Q(Servo)
|
2014-04-08 19:45:45 -04:00
|
|
|
Q(pulse_width)
|
2014-04-21 13:21:07 -04:00
|
|
|
Q(calibration)
|
2014-03-26 16:15:40 -04:00
|
|
|
Q(angle)
|
2014-04-08 19:45:45 -04:00
|
|
|
Q(speed)
|
2014-03-26 16:15:40 -04:00
|
|
|
|
2014-03-22 10:56:32 -04:00
|
|
|
// for os module
|
2014-10-12 15:23:47 -04:00
|
|
|
Q(uos)
|
2014-03-22 10:56:32 -04:00
|
|
|
Q(os)
|
|
|
|
Q(/)
|
2014-07-31 18:44:04 -04:00
|
|
|
Q(flash)
|
|
|
|
Q(sd)
|
|
|
|
Q(chdir)
|
|
|
|
Q(getcwd)
|
2014-03-22 10:56:32 -04:00
|
|
|
Q(listdir)
|
|
|
|
Q(mkdir)
|
|
|
|
Q(remove)
|
|
|
|
Q(rmdir)
|
|
|
|
Q(unlink)
|
|
|
|
Q(sep)
|
2014-07-19 11:39:13 -04:00
|
|
|
Q(stat)
|
2014-03-22 10:56:32 -04:00
|
|
|
Q(urandom)
|
2014-03-22 11:06:29 -04:00
|
|
|
|
|
|
|
// for time module
|
2014-10-12 15:23:47 -04:00
|
|
|
Q(utime)
|
2014-03-22 11:06:29 -04:00
|
|
|
Q(time)
|
2014-05-08 17:25:49 -04:00
|
|
|
Q(localtime)
|
2014-08-19 21:38:38 -04:00
|
|
|
Q(mktime)
|
2014-03-22 11:06:29 -04:00
|
|
|
Q(sleep)
|
2014-03-22 19:53:50 -04:00
|
|
|
|
2014-08-26 12:18:12 -04:00
|
|
|
// for select module
|
2014-10-12 15:23:47 -04:00
|
|
|
Q(uselect)
|
2014-08-26 12:18:12 -04:00
|
|
|
Q(select)
|
|
|
|
Q(poll)
|
|
|
|
Q(register)
|
|
|
|
Q(unregister)
|
|
|
|
Q(modify)
|
|
|
|
|
2014-03-22 19:53:50 -04:00
|
|
|
// for input
|
|
|
|
Q(input)
|
stmhal: Add stm module, which contains some constants for the MCU.
Also contains raw memory read/write functions, read8, read16, read32,
write8, write16, write32. Can now do:
stm.write16(stm.GPIOA + stm.GPIO_BSRRL, 1 << 13)
This turns on the red LED.
With the new constant folding, the above constants for the GPIO address
are actually compiled to constants (and the addition done) at compile
time. For viper code and inline assembler, this optimisation will make
a big difference. In the inline assembler, using these constants would
not be possible without this constant folding.
2014-04-10 17:46:40 -04:00
|
|
|
|
2014-06-14 19:41:47 -04:00
|
|
|
// for LCD class
|
|
|
|
Q(LCD)
|
|
|
|
Q(command)
|
|
|
|
Q(contrast)
|
|
|
|
Q(light)
|
|
|
|
Q(fill)
|
|
|
|
Q(get)
|
|
|
|
Q(pixel)
|
|
|
|
Q(text)
|
|
|
|
Q(show)
|
|
|
|
|
2014-09-30 17:29:49 -04:00
|
|
|
// for usocket module
|
|
|
|
Q(usocket)
|
|
|
|
Q(socket)
|
|
|
|
Q(getaddrinfo)
|
|
|
|
Q(AF_INET)
|
|
|
|
Q(AF_INET6)
|
|
|
|
Q(SOCK_STREAM)
|
|
|
|
Q(SOCK_DGRAM)
|
|
|
|
Q(SOCK_RAW)
|
|
|
|
|
|
|
|
// for network module
|
|
|
|
Q(network)
|
|
|
|
Q(route)
|
|
|
|
|
2014-09-01 17:48:57 -04:00
|
|
|
// for WIZnet5k class
|
2014-09-25 19:57:26 -04:00
|
|
|
#if MICROPY_PY_WIZNET5K
|
2014-09-01 17:48:57 -04:00
|
|
|
Q(wiznet5k)
|
|
|
|
Q(WIZnet5k)
|
|
|
|
Q(regs)
|
|
|
|
Q(ipaddr)
|
|
|
|
Q(socket)
|
|
|
|
Q(family)
|
|
|
|
Q(type)
|
|
|
|
Q(fileno)
|
|
|
|
Q(close)
|
|
|
|
Q(bind)
|
|
|
|
Q(listen)
|
|
|
|
Q(accept)
|
|
|
|
Q(connect)
|
|
|
|
Q(disconnect)
|
|
|
|
Q(send)
|
|
|
|
Q(recv)
|
|
|
|
Q(sendto)
|
|
|
|
Q(recvfrom)
|
|
|
|
Q(gethostbyname)
|
|
|
|
Q(AF_INET)
|
|
|
|
Q(SOCK_STREAM)
|
|
|
|
Q(SOCK_DGRAM)
|
|
|
|
#endif
|
|
|
|
|
2014-09-25 19:57:26 -04:00
|
|
|
// for CC3k class
|
|
|
|
#if MICROPY_PY_CC3K
|
|
|
|
Q(cc3k)
|
|
|
|
Q(CC3k)
|
|
|
|
Q(connect)
|
|
|
|
Q(disconnect)
|
|
|
|
Q(is_connected)
|
|
|
|
Q(ifconfig)
|
|
|
|
Q(patch_version)
|
|
|
|
Q(patch_program)
|
|
|
|
Q(WEP)
|
|
|
|
Q(WPA)
|
|
|
|
Q(WPA2)
|
2014-09-30 17:29:49 -04:00
|
|
|
Q(ssid)
|
|
|
|
Q(key)
|
|
|
|
Q(security)
|
|
|
|
Q(bssid)
|
2014-09-25 19:57:26 -04:00
|
|
|
Q(send)
|
|
|
|
Q(recv)
|
|
|
|
Q(bind)
|
|
|
|
Q(listen)
|
|
|
|
Q(accept)
|
|
|
|
Q(connect)
|
|
|
|
Q(settimeout)
|
|
|
|
Q(setblocking)
|
|
|
|
Q(close)
|
|
|
|
Q(__del__)
|
|
|
|
#endif
|
|
|
|
|
stmhal: Add stm module, which contains some constants for the MCU.
Also contains raw memory read/write functions, read8, read16, read32,
write8, write16, write32. Can now do:
stm.write16(stm.GPIOA + stm.GPIO_BSRRL, 1 << 13)
This turns on the red LED.
With the new constant folding, the above constants for the GPIO address
are actually compiled to constants (and the addition done) at compile
time. For viper code and inline assembler, this optimisation will make
a big difference. In the inline assembler, using these constants would
not be possible without this constant folding.
2014-04-10 17:46:40 -04:00
|
|
|
// for stm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Q(DAC_SR)
|
|
|
|
Q(DAC_SWTRIGR)
|
|
|
|
Q(DBGMCU_APB1FZ)
|
|
|
|
Q(DBGMCU_APB2FZ)
|
|
|
|
Q(DBGMCU_CR)
|
|
|
|
Q(DBGMCU_IDCODE)
|
|
|
|
Q(DMA1)
|
|
|
|
Q(DMA2)
|
|
|
|
Q(DMA_HIFCR)
|
|
|
|
Q(DMA_HISR)
|
|
|
|
Q(DMA_LIFCR)
|
|
|
|
Q(DMA_LISR)
|
|
|
|
Q(EXTI)
|
|
|
|
Q(EXTI_EMR)
|
|
|
|
Q(EXTI_FTSR)
|
|
|
|
Q(EXTI_IMR)
|
|
|
|
Q(EXTI_PR)
|
|
|
|
Q(EXTI_RTSR)
|
|
|
|
Q(EXTI_SWIER)
|
|
|
|
Q(FLASH)
|
|
|
|
Q(FLASH_ACR)
|
|
|
|
Q(FLASH_CR)
|
|
|
|
Q(FLASH_KEYR)
|
|
|
|
Q(FLASH_OPTCR)
|
|
|
|
Q(FLASH_OPTCR1)
|
|
|
|
Q(FLASH_OPTKEYR)
|
|
|
|
Q(FLASH_SR)
|
stmhal: Add stm module, which contains some constants for the MCU.
Also contains raw memory read/write functions, read8, read16, read32,
write8, write16, write32. Can now do:
stm.write16(stm.GPIOA + stm.GPIO_BSRRL, 1 << 13)
This turns on the red LED.
With the new constant folding, the above constants for the GPIO address
are actually compiled to constants (and the addition done) at compile
time. For viper code and inline assembler, this optimisation will make
a big difference. In the inline assembler, using these constants would
not be possible without this constant folding.
2014-04-10 17:46:40 -04:00
|
|
|
Q(GPIOA)
|
|
|
|
Q(GPIOB)
|
|
|
|
Q(GPIOC)
|
|
|
|
Q(GPIOD)
|
2014-04-18 19:32:25 -04:00
|
|
|
Q(GPIOE)
|
|
|
|
Q(GPIOF)
|
|
|
|
Q(GPIOG)
|
|
|
|
Q(GPIOH)
|
|
|
|
Q(GPIOI)
|
|
|
|
Q(GPIO_AFR0)
|
|
|
|
Q(GPIO_AFR1)
|
stmhal: Add stm module, which contains some constants for the MCU.
Also contains raw memory read/write functions, read8, read16, read32,
write8, write16, write32. Can now do:
stm.write16(stm.GPIOA + stm.GPIO_BSRRL, 1 << 13)
This turns on the red LED.
With the new constant folding, the above constants for the GPIO address
are actually compiled to constants (and the addition done) at compile
time. For viper code and inline assembler, this optimisation will make
a big difference. In the inline assembler, using these constants would
not be possible without this constant folding.
2014-04-10 17:46:40 -04:00
|
|
|
Q(GPIO_BSRRH)
|
2014-04-18 19:32:25 -04:00
|
|
|
Q(GPIO_BSRRL)
|
|
|
|
Q(GPIO_IDR)
|
|
|
|
Q(GPIO_LCKR)
|
|
|
|
Q(GPIO_MODER)
|
|
|
|
Q(GPIO_ODR)
|
|
|
|
Q(GPIO_OSPEEDR)
|
|
|
|
Q(GPIO_OTYPER)
|
|
|
|
Q(GPIO_PUPDR)
|
|
|
|
Q(I2C1)
|
|
|
|
Q(I2C2)
|
|
|
|
Q(I2C3)
|
|
|
|
Q(I2C_CCR)
|
|
|
|
Q(I2C_CR1)
|
|
|
|
Q(I2C_CR2)
|
|
|
|
Q(I2C_DR)
|
|
|
|
Q(I2C_FLTR)
|
|
|
|
Q(I2C_OAR1)
|
|
|
|
Q(I2C_OAR2)
|
|
|
|
Q(I2C_SR1)
|
|
|
|
Q(I2C_SR2)
|
|
|
|
Q(I2C_TRISE)
|
|
|
|
Q(IWDG)
|
|
|
|
Q(IWDG_KR)
|
|
|
|
Q(IWDG_PR)
|
|
|
|
Q(IWDG_RLR)
|
|
|
|
Q(IWDG_SR)
|
|
|
|
Q(PWR)
|
|
|
|
Q(PWR_CR)
|
|
|
|
Q(PWR_CSR)
|
|
|
|
Q(RCC)
|
|
|
|
Q(RCC_AHB1ENR)
|
|
|
|
Q(RCC_AHB1LPENR)
|
|
|
|
Q(RCC_AHB1RSTR)
|
|
|
|
Q(RCC_AHB2ENR)
|
|
|
|
Q(RCC_AHB2LPENR)
|
|
|
|
Q(RCC_AHB2RSTR)
|
|
|
|
Q(RCC_AHB3ENR)
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