e22b943508
This commit is a combination of about 802 commits from the initial stages of development of this port, up to and including the point where the code was moved to the ports/nrf directory. The following is a digest of the original commits in their original order (most recent listed first), grouped where possible by author. The list is here to give credit for the work and provide some level of traceability and accountability. For the full history of development please consult the following repository: https://github.com/tralamazza/micropython Unless otherwise explicitly state in a sub-directory or file, all code is MIT licensed and the relevant copyright holders are listed in the comment-header of each file. Glenn Ruben Bakke <glennbakke@gmail.com> ports/nrf: Moving nrf51/52 port to new ports directory nrf: Aligning with upstream the use of nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, ...) Glenn Ruben Bakke <glennbakke@gmail.com> nrf/modules/random: Backport of microbit random number generator module Backport of micro:bit random module. Plugged into the port as a general random module for all nrf51/nrf52 targets. Works both with and without Bluetooth LE stack enabled. Behavioral change: seed() method has been removed, as the use of RNG peripheral generates true random sequences and not pseudo-random sequences. Glenn Ruben Bakke <glennbakke@gmail.com> nrf/hal/rng: Adding HAL driver for accessing RNG peripheral The driver also takes care of calling the Bluetooth LE stack for random values if the stack is enabled. The reason for this is that the Bluetooth LE stack take ownership of the NRF_RNG when enabled. Tolerate to enable/disable on the fly, and will choose to use direct access to the peripheral if Bluetooth LE stack is disabled or not compiled in at all. Driver has been included in the top Makefile, and will not be compiled in unless nrf51_hal_conf.h/nrf52_hal_conf.h defines HAL_RNG_MODULE_ENABLED (1). Glenn Ruben Bakke <glennbakke@gmail.com> nrf/boards: Adding Arduino Primo board support (#88) * nrf: Adding Arduino Primo board support * nrf: Adding arduino_primo to target boards table in readme.md * nrf/boards: Activating pyb.LED module for arduino_primo board. * nrf/boards: Removing define not needed for arduino_primo Updating arduino_primo board mpconfigboard.h. Removing a define that was wrongly named. Instead of renaming it, it was removed as it was never used. Glenn Ruben Bakke <glennbakke@gmail.com> nrf: Add support for floating point on nrf52 targets. Duplicating pattern for detecting location of libm, libc and libgcc from teensy port. Activating MICROPY_FLOAT_IMPL (FLOAT) for nrf52 targets and adding libs into the compile. For nrf51 targets it is still set to NONE as code grows to much (about 30k). Some numbers on flash use if MICROPY_FLOAT_IMPL is set to MICROPY_FLOAT_IMPL_FLOAT and math libraries are enabled (lgcc, lc, lm). nrf51: ====== without float support: text data bss dec hex filename 144088 260 30020 174368 2a920 build-pca10028/firmware.elf with float support: text data bss dec hex filename 176228 1336 30020 207584 32ae0 build-pca10028/firmware.elf nrf52: ====== without float support: text data bss dec hex filename 142040 356 36236 178632 2b9c8 build-pca10040/firmware.elf with float support: text data bss dec hex filename 165068 1436 36236 202740 317f4 build-pca10040/firmware.elf Daniel Tralamazza <daniel@tralamazza.com> nrf: add a note for running the nrfjprog tool on Linux, and touch up the make sd comment nrf: clean compiler warnings Glenn Ruben Bakke <glennbakke@gmail.com> nrf/drivers/bluetooth: Speedup Bluetooth LE REPL. Updating mp_hal_stdout_tx_strn_cooked to pass on the whole string to mp_hal_stdout_tx_strn instead of passing byte by byte. Glenn Ruben Bakke <glennbakke@gmail.com> nrf: Use the name MicroPython consistently in comments nrf5: Updating readme with BLE REPL Ben Whitten <ben.whitten@lairdtech.com> nrf/boards: Add DVK BL652 from Laird To build run 'make BOARD=dvk_bl652 SD=s132' To flash with jlink run 'make sd BOARD=dvk_bl652 SD=s132' This will remove the existing licences in the bl652 Ben Whitten <ben.whitten@lairdtech.com> nrf/drivers/bluetooth: Allow s132 to use LFCLK nrf: Add nordic sd folders to the .gitignore Glenn Ruben Bakke <glennbakke@gmail.com> nrf/boards: Updating microbit pin mapping for SPI and I2C. nrf/boards: Correcting feather52 I2C SDA pin assigned to the board. nrf/examples: Update ssd1306 modification example to import correct class. nrf/boards: Activate RTC and Timer module and HAL on pca10056. Also swapping out UART with UART DMA variant on this target board. nrf/boards: Activate RTC, Timer, I2C, ADC and HW_SPI module and HAL on pca10031. nrf/boards: Activate RTC, Timer, I2C and ADC module and HAL on pca10001. nrf/boards: Adding RTC and Timer module and HAL to pca10000. nrf: Updating README. nrf: Removing unused font header. Daniel Tralamazza <daniel@tralamazza.com> rename temperature example Glenn Ruben Bakke <glennbakke@gmail.com> nrf5/examples: Adding ubluepy peripheral example that works across nrf51 and nrf52. The example uses Environmenting Sensing Service to provide the temperature characteristic. The temperature is fetched from the machine.Temp module. One note is that the example uses 1 LED which is not present on all boards. nrf5/modules/ubluepy: Adding new event constant for gatts write (80) events from bluetooth stacks. nrf5/hal/timer: Add support for fetching temperature if bluetooth stack is enabled. nrf5/drivers/bluetooth: Make printf in 'ble_drv_service_add' function part of debug log. Daniel Tralamazza <daniel@tralamazza.com> implement #50 Glenn Ruben Bakke <glennbakke@gmail.com> nrf5/examples: Updating mountsd example with comment from deleted sdcard.py on how to wire SD directly to SPI. nrf5/examples: Removing copy of sdcard.py also found in drivers/sdcard. nrf5/examples: Removing copy of ssd1306 driver, creating a new class that overrides the needed function for i2c. Also adding some example usage in the comment in top of the file for both SPI and I2C variant. nrf5/hal/gpio: Updating toggle inline function to work correctly, currently only used by LED module. nrf5/examples: Renaming servo.py to nrf52_servo.py as it is only implemented machine.PWM for nrf52. nrf5/freeze: Adding generic example to freeze. Hello world with board name as parameter. nrf5/examples: Moving nrf52 specific HW example from freeze to examples to replace test.py with a more generic example. nrf5: Update pyb module, and led module to only be compiled in if MICROPY_HW_HAS_LED is set to 1. nrf5/boards: Updating boards with correct LED count. Also adding new flag, MICROPY_HW_HAS_LED, to select whether the board has LED's at all. If not, this will unselect LED module from being compiled in. nrf5/boards: Updating pca10040 board header to set the LED count. nrf5: Generalize script setting LED(1) on to be applied only when there are leds present on the board. nrf5: Updating mpconfigport.h to set default values for MICROPY_HW_LED_COUNT (0) and MICROPY_HW_LED_PULLUP (0). nrf5/boards/feather52: Update s132 target makefile with dfu-gen and dfu-flash. This enables feather52 with Bluetooth LE. Features to be configured in bluetooth_conf.h. nrf5/boards/feather52: Add SERIAL makeflag if dfu-flash target is used. nrf5: Updating readme.md file based on review comments. nrf5: Update help.c with documentation of CTRL-A and CTRL-B to enter and exit raw REPL mode. nrf5: Updating main.c to support RAW REPL. Update README.md nrf5/modules/music: Updating pitch method to also use configured pin from mpconfigboard.h if set, in the case of lacking kwarg for pin. Also removing some commented out arguments to remove some confusion in the argument list. Done for both play() and pitch(). nrf5/modules/music: Correct parameter checking of pin argument to deside whether to use MUSIC_PIN define or throw an error. If MUSIC_PIN define is configured the pin argument to music module play() can be elided. nrf5/modules/machine: Update timer init to set default IRQ priority before initializing Timer instance. nrf5/hal/timer: Update timer hal to use value provided in init to configure the irq_priority. nrf5/modules/machine: Reserving timer0 instance for bluetooth if compiled in. Leaving timer1 and timer2 for application. Note that music module soft-pwm will also occupy timer1 if enabled. nrf5/modules/machine: Updating timer module to use new hal. Adding new parameters to the init to set period, mode and callback. nrf5/hal/timer: Implementing hal_timer to 1us prescaler. Multiplier inside to get to millisecond resolution. Callback must be registered before starting a timer. nrf5: Makefile cleanup. Removing duplicate include and unused netutils.c used by BLE 6lowpan network which has been removed for now. nrf5/modules/machine: Indention fix in uart module. nrf5/modules/machine: Removing unused code from uart module. nrf5/hal/rtc: Updating hal driver to calculate prescaler a bit more verbose. Using 1 second interval ticks. nrf5/modules/machine: Fixing type in RTC. nrf5/modules/machine: Update rtc init to set default IRQ priority before initializing RTC instance. nrf5/hal/rtc: Aligning RTC (real-time counter) HAL driver with Timer HAL driver. To make api's symetric. Also updating modules/rtc to get aligned with new HAL api. nrf5/drivers/bluetooth: Moving stop condition initialization before call to bluetooth stack write function is done, to make sure that its not overwritten after reception of the write event in case of with_response writes. nrf5/drivers/bluetooth: Removing duplicate static variable declaration. nrf5/modules/ubluepy: Updating characteristic write method to take in an additional keyword, 'with_response'. Default value is False. Only activated in central role. nrf5/drivers/bluetooth: Updating ble_drv_attr_c_write with possibility to do client write with response. Blocking call. nrf5/examples: Adding some notes on which pin layout that has been used in the seeed_tft.py ILI9341 driver for driving the display. nrf5/examples: Shorten name on seeedstudio_tft_shield_v2.py to seeed_tft.py. nrf5/examples: Updating ili9341 example to use new Frambuffer object instead of legacy Framebuffer1. nrf5/examples: Removing seeed.py which used a lcd mono framebuffer has been removed. Matt Trentini <matt.trentini@gmail.com> Adding a README for the nRF5 port Glenn Ruben Bakke <glennbakke@gmail.com> nrf5/examples: Updating documentation in SDCard module example. Correcting typo and adding SD card wireing documentation for direct SPI connection. nrf5/modules/pin: Adding on() and off() methods to Pin object to be forward compatible with upstream master. Legacy high() and low() methods are kept. nrf5/modules/spi: Remove pyb abstraction from SPI module, as there was a bug in transfer of bytes due to casting errors. The update removes the pyb_spi_obj_t wrapper going directly on the machine_hard_spi_obj_t as base for machine SPI objects. SDCard mounting is also tested. nrf5/drivers/bluetooth: Enable ubluepy central by default if running nrf52/s132 bluetooth stack. Maturity of the module is pretty OK now. nrf5/boards/feather52: Updating pins.csv for the feather52 board. nrf5/boards/feather52: Updating LED pull to low. nrf5/boards/feather52: Update SPI pinout. nrf5/main: Move initializaton of modmusic to the module itself. Upon init of the module, the hardware, pwm and ticker will be started. Could be moved back to main if pwm or ticker should be shared among more modules and have to be initialized more global. nrf5/modules/machine/timer: If timer is used in combination with SOFT_PWM (implicitly use of ticker.c) guard the Timer1 instance from being instantiated trough python timer module. Also disable implementation of the HAL IRQ handler which is for now explicitly implemented in ticker.c for Timer1. nrf5/modules/music: Update ticker and modmusic to share global ticks counter as a volatile variable. Use Timer1 hardware peripheral instead of instance 0. Timer0 is not free if used in combination with a bluetooth stack. Update IRQ priority to levels that are compatible in use with a bluetooth stack for both nrf51 and nrf52. Apply nrf51 PAN fixes for Timer1 instead of original Timer0. nrf5/drivers/bluetooth: Updating bluetooth driver to initialize nrf_nvic_state_t struct during declaration of the global variable instead of explicit memset. nrf5/hal/irq: Adding wrappers for handling nvic calls when Bluetooth LE stack is enabled. nrf5/modules/machine: Updating IRQ levels in SPI with IRQ priorities compatible with Bluetooth stacks. nrf5/device: Remove old startup files in asm, which has now been replaced with c-implementation. nrf5: Update Makefile to add c-implementation of startup scripts instead of the .s files. nrf5/device: Adding startup files in .c to replace current asm versions. nrf5/examples: Tuning Bluetooth LE example controller python script after testing out the example live. Motor speed of 100 was not enought to lift the airplane. Also turning was hard without setting higher angle values. The new values are just guessed values. However, the flying experience was good. nrf5/hal/irq: Adding include of nrf_nvic.h if s132 bluetooth stack is used to resolve IRQ function wrappers on newer bluetooth stacks. nrf5/drivers/ticker: Removing unused code. nrf5/examples: Adding music example. Only working if bluetooth stack is not enabled. nrf5/boards/microbit: Disable music and softPWM as there are some issues with the ticker. nrf5: Adding -fstack-usage flag to gcc CFLAGS to be able to trace stack usage on modules. nrf5/drivers/ticker: Removing LowPriority callback from nrf51 as there is only one SoftwareIRQ free if bluetooth stack is enabled. Also setting new IRQ priority on SlowTicker to 3 instead of 2, to interleave with bluetooth stack if needed. Updating all NVIC calls to use hal_irq.h defined static inlines instead of direct access. nrf5/hal/irq: Adding IRQ wrappers if Bluetooth Stack is present. nrf5: Facilitate option to configure away the modble if needed. Enabled if MICROPY_PY_BLE config is enabled in bluetooth_conf.h. nrf5/boards/microbit: Enable music module by default. However, timer and rtc module has to be disabled. Bluetooth support broken. Optimization needed. nrf5/modules/machine: Quickfix. Update timer object to not allow instanciation of Timer(0) if SOFT_PWM is enabled by board. nrf5/hal/timer: Quickfix. Disable IRQ handler if SOFT_PWM is configured to be enabled. Ticker driver has in current driver a seperate IRQ handler for this timer instance. nrf5/drivers/ticker: Add compile config guard in ticker.c to only include the driver if SOFT_PWM is configured in by board. nrf5/drivers/softpwm: Renaming pwm_init to softpwm_init to not collide on symbol name with pwm_init in nrf52 machine PWM object. nrf5: Add modmusic QSTR definition of notes to qstrdefsport.h. nrf5: Update Makefile to include ticker.c and renamed softpwm. Updating also include paths to include modules/music and drivers/. nrf5: Adding include of modmusic.h in main.c. nrf5: Call microbit_music_init0() if enabled in main.c. nrf5/modules/music: Expose public init function for music module. nrf5/modules/music: Update modmusic to use updated includes. Add extern ticks. Add function which implements initialization of pwm and ticker, register ticker callback, and start the pwm and ticker. This corresponds to microbit port main.cpp init. nrf5/drivers/softpwm: Enable use of ticker in softpwm driver. nrf5/drivers/ticker: Adding ticker.c/.h from microbit port. nrf5/drivers/pwm: Renaming pwm.c/.h to softpwm.c/.h nrf5/drivers/pwm: Expose pwm_init() as public function. nrf5/modules/ubluepy: Making peripheral conn_handle volatile. Upon connection event, the variable is accessed in thread mode. However, the main-loop is blocking on conn_handle != 0xFFFF. If this is not volatile, optimized code will not exit the loop. nrf5/drivers/bluetooth: As callback functions are in most usecases are set to NULL upon last event to get public API function out of blocking mode, these function pointers has to be set as volatile, as they are updated to NULL in interrupt context, but read in blocking main-thread. nrf5/examples: Fixing overlapping function names and variable names inside the object. Also removing some print statements. Tuning max angle from -7/7 to -25/25. Glenn Ruben Bakke <glennbakke@gmail.com> Powerup (#26) * nrf5/examples: Adding python example template for PowerUp 3.0 Bluetooth LE controlled Paper Airplane. * nrf5: Enable bluetooth le central while developing powerup 3.0 example. * nrf5/examples: Backing up powerup 3.0 progress. * nrf5/examples: Adding working example on how to control PowerUp 3.0 paper airplane using bluetooth le. * nrf5/bluetooth: Disable central role. Glenn Ruben Bakke <glennbakke@gmail.com> nrf5/modules/ubluepy: Correcting alignment of enum values in modubluepy.h. nrf5/drivers/bluetooth: Add implementation of client attribute write without response. nrf5/modules/ubluepy: Pass on buffer to write in characteristic write central mode. nrf5/modules/ubluepy: Updating characteristic object write function to be role aware. Either peripheral or central (gatts or gattc). Adding dummy call to attr_c_write if central is compiled in. Still in progress to be implemented. nrf5/drivers/bluetooth: Adding template function for attr_c_write. nrf5/drivers/bluetooth: Renaming attr_write and attr_notify to attr_s_write and attr_s_notify to prepare for introduction of attribute write for gatt client. nrf5/modules/ubluepy: Fixing type in ubluepy_peripheral.c. nrf5/modules/ubluepy: Setting peripheral role upon advertise() or connect(). nrf5/drivers/bluetooth: Adding role member to peripheral object to indicate whether Peripheral object is Peripheral or Central role. nrf5/modules/ubluepy: Continue characteristic discovery until nothing more is found during connect proceedure. nrf5/drivers/bluetooth: Refactoring code to group statics for s130 and s132 into the same ifdef. Also adding two empty lines in discovery functions to make it more easy to read. nrf5/drivers/bluetooth: Updating characteristic discovery to signal whether anything was found or not. nrf5/modules/ubluepy: Continue primary service discovery until nothing more is found in connect proceedure. nrf5/drivers/bluetooth: Updating primary service discovery api to take in start handle from where to start the service discovery. Also adjusting return parameter to signal whether anything was found or not. nrf5/modules/ubluepy: Remove duplication GAP event handler registration in peripheral.connect(). Glenn Ruben Bakke <glennbakke@gmail.com> Support address types (#18) * nrf5/modules/ubluepy: Adding new enumeration of address types. * nrf5/modules/ubluepy: Adding constants that can be used from micropython for public and random static address types. * nrf5/modules/ubluepy: Adding support for optionally setting address type in Peripheral.connect(). Public address is used as default. Address types can be retrieved from 'constants'. Either constants.ADDR_TYPE_PUBLIC or constants.ADDR_TYPE_RANDOM_STATIC. * nrf5/modules/ubluepy: Register central GAP event handler before issuing connect to a peripheral. Has to be done before connect() function as a connected event will be propergated upon successfull connection. The handler will set the connection handle which gets connect function out of the busy loop waiting for connection to succeed. * nrf5/modules/ubluepy: Removing duplicate setting of GAP event handler in connect(). Glenn Ruben Bakke <glennbakke@gmail.com> nrf5/modules/ubluepy: Register central GAP event handler before issuing connect to a peripheral. Has to be done before connect() function as a connected event will be propergated upon successfull connection. The handler will set the connection handle which gets connect function out of the busy loop waiting for connection to succeed. nrf5/modules/ubluepy: Fixing compilation bug of wrong variable name when registering gattc event handler in ublupy peripheral connect function (central mode). nrf5/bluetooth: Updating makefiles with updated paths to bluetooth le components after moving files. nrf5/bluetooth: Moving stack download script to drivers/bluetooth folder. nrf5/bluetooth: Move bluetooth driver files to drivers/bluetooth. Move bluetooth stack download script to root folder. nrf5/bluetooth: Guarding implementation against being linked in by surrounding it with BLUETOOTH_SD flag. Flag is only set if SD=<sdname> parameter is provided during make. nrf5/bluetooth: Moving makefile include folder and source files of bluetooth driver, ble uart and ble module to main Makefile. nrf5/bluetooth: Moving help_sd.h and modble.c to modules/ble. nrf5/modules/machine: bugfix after changing to MP_ROM_PTR in machine module local dict. nrf5: Syncing code with upstream master and converting all module and method tables to use MP_ROM macros. Also adding explicit casting of local dicts to (mp_obj_dict_t*). nrf5/modules/timer: Fixing bug in timer_find(). Function allowed to locate index out of range and started to look up in config pointer (index == size of array). nrf5/modules/timer: Remove test which is covered by timer_find() function in the line below. nrf5/modules/timer: Adding locals dict table and adding start/stop template functions. Also adding constants for oneshot and periodic to locals dict. nrf5/modules/timer: Adding timer module to modmachine. nrf5/boards: Adding micro:bit default music pin definition. Also adding config flag for enabling pwm machine module. nrf5/hal/timer: Adding start/stop template functions to hal_timer.h/.c nrf5/Makefile: Adding drivers/pwm.c and modules/music files to the source file list. nrf5/modules/music: Adding config guard in musictunes.c and adding import of mphal.h. nrf5/modules/music: Including mphal.h before config guard in modmusic.c. Also changed name on config guard to MICROPY_PY_MUSIC. Missing PWM functions during linkage will show up if PWM module has not not configured. nrf5/drivers/pwm: Including mphal.h before config guard in pwm.c. nrf5: Updating mpconfigport.h to include music module as builtin. Adding new configuration for enabling music module. Activating MODULE_BUILTIN_INIT in order to run music module init function on import. nrf5/modules/music: Backing up progress in music module. nrf5/drivers/pwm: Updating soft PWM driver to only be included if SOFT_PWM config is set. nrf5/hal/gpio: Add function to clear output register using a pin mask. nrf5: Adding new configuration called MICROPY_PY_MACHINE_SOFT_PWM to mpconfigport.h. This config will enable software defined PWM using timer instead of using dedicated PWM hardware. Aimed to be used in nrf51 targets. nrf5/boards: Removing PWM config set to 0 from pca10001 board. Config will later be re-introduced as SOFT_PWM variant. nrf5/pwm: Updating config name of PWM to hardware PWM to prepare for introduction of soft variant. nrf5/modules/music: Backing up progress in modmusic. nrf5/modules/music: backing up porting progress in modmusic.c. nrf5/modules/music: Commenting out backend function calls in modmusic.c to make module compile for now. nrf5/modules/music: Updating music module to use pin_obj_t instad of microbit_pin_obj_t. Update include to drivers/pwm.h to resolve some undefined functions. nrf5/modules/music: Removing c++ extern definition. Updating include list in modmusic.c. Removing module name from module struct. nrf5/modules/music: Removing include of modmicrobit.h in musictunes.c. nrf5/modules/music: Adding header to expose extern structs defined in musictunes.c nrf5/drivers: Adding copy of microbit soft pwm. nrf5/modules/music: Renaming microbitmusic files to modmusic/music. nrf5/modules/music: Renaming microbit module to music. nrf5/modules/microbit: Copying microbit music module to the port. nrf5/modules/timer: Adding timer3 and timer4 to timer object in case of nrf52 target. nrf5/modules/timer: Optimizing timer object structure and updating the module to use new hal_timer_init structures and parameters. nrf5/hal/timer: Adding empty IRQ handlers for all timers. nrf5/hal/timer: Changing hardcoded hal timer instance base to a lookup, so that IRQ num can be detected automatically without the need of using struct param on it. Size of binary does not increase when using Os. nrf5: Updating example in main.c on how to execute string before REPL is set up, to allow for boards with two leds. Todo for later is to update this code such that it will skip this LED toggle when there are no leds defined. Or use an example not depending on LEDs. nrf5/bluetooth: Updating Bluetooth LE stack download script to allow to be invoked from any parent folder. No need to change directory to bluetooth/ in order to get the correct download target folder position. Using the script location to determine the target folder. nrf5/boards: Adding board target for feather52 using s132 v.2.0.1 application offset even if the device is not using softdevice. To be worked on later. nrf5/boards: decrease size of ISR region from 4k to 1k in custom feather52 linker script to get some more flash space. nrf5/boards: Updating feather52 mpconfigboard.h to use correct uart pins, flow control disabled. Also adjusting leds down to two leds. nrf5/boards: Updating path to custom linker script for feather52 board. nrf5/boards: Renaming bluefruit_nrf52_feather to feather52 to shorten down the name quite drastically. nrf5/boards: Updating path to custom bluefruit feather linker script after renaming board folder. nrf5/boards: Renaming bluefruit_feather to bluefruit_nrf52_feather as it also exist a m0 variant of the board name. nrf5/boards: Updating mpconfigboard.h for bluefruit nrf52 feather with correct board, mcu and platform name. nrf5/boards: Updating adafruit bluefruit nrf52 feather linker script to use 0x1c000 application offset. nrf5/boards: Renaming custom linker script for bluefruit feather to reflect that the purpose of the custom linker script is DFU. The script is diverging from the generic s132 v2 linker script in the offset of the application. nrf5/boards: Adding custom linker script for adafruit nrf52 bluefruit feather to be able to detect application upper boundry in flash. Pointing s132 mk file to use this new custom linker script instead of the generic s132 v2 linker script. nrf5/boards: Adding linker script for nrf52832 s132 v.2.0.1. nrf5/boards: Adding template board makefiles and configs for bluefruit nrf52 feather. Copied from pca10040 target board. Linker script reference updated to use s132 v2.0.1. Non-BLE enable build disabled for now. Board configuration for leds, uart etc has not been updated yet from pca10040 layout. nrf5/bluetooth: Correcting typo in test where s132 API version is settled. nrf5/bluetooth: Updating bluetooth le driver to compile with s132 v.2.0.1 stack. nrf5/bluetooth: Add new compiler flag to signal API variants of the s132 bluetooth le stack. The version is derived from the major number of the stack name. nrf5/bluetooth: Remove hardcoded softdevice version as this now comes as parameter from board makefile. nrf5/boards: Updating makefiles using bluetooth stack to use updated linker script file names. nrf5/boards: Renaming bluetooth stack linker scripts to reflect version of the stack. nrf5/boards: adding some spaces in s132 makefile for pca10040. nrf5/boards: Renaming linker script for nrf52832 using bluetooth stack such that it also holds the version number of the stack. Updating linkerscript using the target linker script. nrf5/bluetooth: Add support for downloading s132_2.0.1 bluetooth stack. nrf5/bluetooth: Switch over to downloaded bluetooth stacks from nordicsemi.com instead of getting them through the SDK's. This will facilitate download of s132 v2.0.0 later. nrf5/bluetooth: Fixing bug found when testing microbit. Newly introduced advertisment data pointer was not cleared on nrf51 targets. Explicit set to NULL as no additional advertisment data is set. Raises a question on why the nrf51 static variable was not zero initialized. To be checked up. nrf5: Removing SDK_ROOT parameter to Makefile. Bluetooth stacks should be downloaded using the download_ble_stack.sh. The script should be run inside the bluetooth folder to work properly. nrf5/bluetooth: Adding back SOFTDEV_HEX as flash tools in main Makefile uses this to locate hex file. nrf5/bluetooth: Including bluetooth stack version in folder name after download to be able to detect if stack has been updated. nrf5/bluetooth: Updating Bluetooth LE stack download script. nrf5/bluetooth: Adding bash script to automate download of bluetooth le stacks nrf5/examples: Adding example to show how to use current PWM module to control servo motors. nrf5/modules/machine: Updating PWM module with two new kwargs parameters. One for setting pulse with more fine grained. This value should not exceed the period value. Also, adding support for setting PWM mode, whether it is LOW duty cycle or HIGH duty cycle. By default, high to low is set (this could be changed). nrf5/hal/pwm: Updating PWM implementation to support manually set duty cycle period. Pulse width has precidence over duty cycle percentage. Also adding support for the two configurable modes, high to low, and low to high, duty cycles. nrf5/hal/pwm: Adding more configuration options to the PWM peripheral wrapper. Possibility to set pulse with manually, and also mode. The mode indicates whether duty cycle is low and then goes high, or if it is high and then go low. Added new type to describe the two modes. nrf5: Adding hal_gpio.c to Makefile's source list. nrf5/modules/machine: Updating Pin module to register a IRQ callback upon GPIO polarity change events. nrf5/hal/gpio: Adding initial gpiote implementation to handle IRQ on polarity change on a gpio. nrf5: Moving initialization of pin til after uart has been initialized for debugging purposes. This will make it possible to use uart to print out debug data when adding gpio irq handlers. nrf5/hal/gpio: Adding some new structures and functions to register irq channels to gpio's using GPIOTE peripheral nrf5/hal/gpio: Adding missing include. nrf5/modules/machine: Style fix in pin object, indention. nrf5/modules/machine: Adding placeholder for irq method to pin object class. nrf5/modules/machine: Adding pin irq type and basic functions and structures. nrf5/hal/gpio: Reintroducing gpio polarity toggle event to be able to reference the short form of adding high_to_low and low_to_high together. nrf5/hal/gpio: Updating hal_gpio.h with some tab-fixes in order to make the file a bit consistent in style. nrf5/hal/gpio: Removing toggle event from the enumeration as that will be a combination of the rising and falling together. nrf5/modules/machine: Removing toggle event trigger as that will be a combination of the rising and falling together. nrf5/modules/machine: Adding new constants to pin object for polarity change triggers using the enumerated values in hal_gpio.h. nrf5/hal/gpio: Adding new enumeration for input polarity change events. nrf5/hal: Moving hal_gpio functions, types and defines from mphalport.h to a new hal_gpio.h. Revert "lib/netutils: Adding some basic parsing and formating of ipv6 address strings. Only working with full length ipv6 strings. Short forms not supported at the moment (for example FE80::1, needs to be expressed as FE80:0000:0000:0000:0000:0000:0000:0001)." nrf5: Removing leftover reference to deleted display module. nrf5/usocket: Removing network modules related to Bluetooth 6lowpan implementation as it depends on SDK libraries for now. Will be moved to seperate working branch. nrf5: Removing custom display, framebuffer and graphics module to make branch contain core components instead of playground modules. nrf5/modules/usocket: Updating import of netutils.h after upmerge with upstream master. nrf5/bluetooth: Add some comment on the destination of the eddystone short-url. nrf5/bluetooth: Updating Eddystone URL to point to https://goo.gl/x46FES which hosts the MicroPython WebBluetooth application which will be able to connect to the Bluetooth LE UART service of the device and create the REPL. nrf5/bluetooth: Adding webbluetooth REPL template. Alternating advertisment of eddystone URL and UART BLE service every 500 ms. Adding new config parameter to bluetooth_conf.h to enable webbluetooth repl. Has to be configured in combination with BLE_NUS. Eddystone URL not pointing to a valid WebBluetooth application at the moment, but rather to micropython.org as a placeholder for now. nrf5/modules/ubluepy: Adding method Peripheral object to stop any ongoing advertisment. Adding compile guard to only include advertise and advertise_stop if peripheral role is compiled in. nrf5/bluetooth: Adding function to stop advertisment if onging nrf5/modules/ubluepy: Adding support for starting advertisment from BLE UART REPL, by delaying registration of gatt/gatts and gattc handlers until needed in advertise or connect. If non connectable advertisment is selected, handlers in peripheral new is not anymore overriding the other peripheral instances which has set the callbacks. nrf5/bluetooth: Adding possibility to configure whether advertisment should be connectable or not. nrf5/bluetooth: Removing legacy advertise function in the bluetooth driver, which only did a hardcoded eddystone beacone advertisment. nrf5/help: Updating ble module help description to also include the address method. nrf5/bluetooth: Renaming the ble module method address_print() to address(), as it will now return a string of the resolved local address. Updating the function to create a string out the local address and return this. nrf5/bluetooth: Update ble_drv_address_get to new api which pass in a address struct to fill by reference. Updating implementation to copy the address data. Also ensuring that the bluetooth stack has been enabled before fetching the address from the bluetooth stack. nrf5/bluetooth: Adding new structure which can hold local address. Updating api prototype for ble_drv_address_get with a address structure by reference. nrf5/bluetooth: Updating help text for ble module to also list up enabled() function which queries the bluetooth stack on whether it is enabled or not. nrf5/bluetooth: Removing advertise from ble module. Removing help text as well. nrf5/examples: Adding python eddystone example using ubluepy api. nrf5/modules/ubluepy: Open up Peripheral advertise method to pass custom data to the bluetooth driver. Allowing method to allow kwargs only if no args is set. To support setting data kwarg only. nrf5/modules/ubluepy: Adding new members to the ublupy advertisment parameters, to hold custom data payload if set. nrf5/bluetooth: Cleaning up stack enable function, to not set device name twice. Also, adding support for setting custom advertisment data. nrf5/modules/ubluepy: Adding compile guard for UBLUEPY_CENTRAL around the char_read() call to ble_drv_attr_c_read(). nrf5/bluetooth: Moving central code inside central bluetooth stack defines to make peripheral only code compile again. nrf5/examples: Updating ubluepy scan example to use constant value from ubluepy instead of hardcoded value. nrf5/examples: Adding example on how to use the ubluepy Scanner object in order to scan for a device name and find the address of the device. This can subsequently be used to perform a Central role connect() using the Peripheral object. nrf5/modules/ubluepy: Turn all attributes (addr, addr_type and rssi) to method calls instead of using common .attr callback. Adding getScanData implementation, which parses the advertisment data and returns a list of tuples containing (ad_type, desc, value). Description is generated by peeking into the ad_types local dicts map table, and do a reverse lookup on the value to find the QSTR. nrf5/modules/ubluepy: Adding ad_types constants in new object. Linking in ad_types object into the ubluepy.constants local dict. nrf5/modules/ubluepy: Expose ubluepy constant objects as externs in modubluepy.h to be able to get access to the local dict tables in order to do a reverse lookup on value to resolve QSTR from external modules in c. nrf5/modules/ubluepy: Upon advertisment event, also store the advertisment data. nrf5/modules/ubluepy: Adding callback function to handle read response if gatt client has issued a read request. Also adding method for returning the uuid instance from the object. nrf5/modules/ubluepy: Adding value data member to the characteristic object. This can hold the value data when gatt client perform a read and value has to be transferred between interrupt and main thread. nrf5/bluetooth: Updating bluetooth driver to support GATT client read of a characteristic value. Data passed to caller in interrupt context, and copy has to be performed. The function call is itself blocking. nrf5/modules/ubluepy: Adding uuid() function to service object to return UUID instance of the service. nrf5/modules/ubluepy: Adding binVal() function to the ubluepy UUID object. For now returning the uint16_t value of the UUID as a small integer. nrf5/modules/ubluepy: Adding dummy function call to ble_drv_attr_c_read. nrf5/bluetooth: Adding new api for reading attribute as gatt client. Renaming old ble_drv_attr_read function to ble_drv_attr_s_read to indicate the server role. nrf5/bluetooth: Adding event handling cases for gatt client read, write and hvx events. nrf5/modules/ubluepy: Tab-fix nrf5/modules/ubluepy: Updating peripheral object to handle characteristic discovery (central mode). nrf5/modules/ubluepy: Adding start and end handle to service object. nrf5/bluetooth: Adding support for central characteristic service discovery. Updating primary service discovery to block until all services has been created in the peripheral object before returning from the bluetooth driver. This pattern is also applied to the characteristic discovery. nrf5/modules/ubluepy: Updating ubluepy peripheral object to new bluetooth driver API. Starting to populate service objects and uuid objects. Also adding the service to the peripheral object throught the regular static function for adding services. Handle value for the primary service is assuming that it is the first element in the handle range; start_handle reported by the service discovery. nrf5/bluetooth: Updating bluetooth driver to do service discovery, doing callbacks to ubluepy upon each individual primary service discovered. Using intermediate structure defined by the driver, to abstract bluetooth stack specific data in ubluepy. nrf5/modules/ubluepy: Adding some work in progress on service discovery. nrf5/bluetooth: Adding implementation to the discover service function. Adding handler for gatt client primary service discovery response events, and passing this to the ubluepy upon reception. nrf5/bluetooth: Adding function parameters and return type to service and characteristic discovery template functions. nrf5/bluetooth: Adding template functions for service discovery in bluetooth driver. nrf5/bluetooth: Adding function to register gattc event handler (central). nrf5/bluetooth: Adding intermediate gattc callback function type in bluetooth driver. nrf5/bluetooth: Turning off debug logging in bluetooth driver, which does not work well with bluetooth REPL mode. nrf5/bluetooth: Fixing some smaller tab errors in the bluetooth driver. nrf5/bluetooth: Updating bluetooth le driver to handle GAP conn param update request. Also updating minor syntax in previous switch case. nrf5/boards: Inrease heap size in the nrf52832 w/s132 bluetooth stack linker script. nrf5/modules/ubluepy: Update connect method to parse dev_addr parameter and pass it to the bluetooth driver, going through a allocated heap buffer. Adding call to the bluetooth driver to issue a connect. Hardcoding address type for now. nrf5/bluetooth: Updating connect function in the bluetooth driver to do a successful connect to a peripheral device. nrf5/modules/ubluepy: Adding template function for central connect() in peripheral object. nrf5/modules/ubluepy: Adding locals dict to Scan Entry introducing function to retreive Scan Data. Not working as expected together with .attr. It looks like locals dict functions are treated to be attributes and cannot be resolved. nrf5/bluetooth: Adding function for connecting to a device (in central role). Not yet tested. nrf5/modules/ubluepy: Return BLE peer address as string instead of bytearray. Updated struct in modubluepy.h to use a mp_obj_t to hold a string instead of a fixed 6-byte array. Stripped down ScanEntry print out to only contain class name, peer address available through addr attribute. nrf5/bluetooth: capture address type in addition to advertisment type in bluetooth advertisment reports. nrf5/modules/ubluepy: Correcting rssi member in scan_entry object to be int instead of uint. nrf5/modules/ubluepy: Adding attribute to ScanEntry object for getting address (returning bytearray), type (returning int) and rssi (returning int). nrf5/modules/ubluepy: Copy address type and rssi to the ScanEntry object upon reception of an advertisment report callback. nrf5/bluetooth: Adding address type to bluetooth stack driver advertisment structure, and fill the member when advertisment report is received. nrf5/modules/ubluepy: Swapping address bytes when copying bluetooth address over to ScanEntry object during advertisment scan report event. nrf5/modules/ubluepy: Extending print of ScanEntry object to also include the bluetooth le address. nrf5/modules/ubluepy: Create new adv report list for each individual scan. Create a new ScanEntry object instance on each advertisment event recieved and append this to the current adv_report list. nrf5/modules/ubluepy: Adding print function to scan_entry object. nrf5/modules/ubluepy: Populating ubluepy_scan_entry_obj_t with members that are interesting to keep for the ScanEntry object. nrf5/bluetooth: Moving callback definitions to bluetooth driver header. Refactoring bluetooth driver, setting new names on callback functions and updating api to use new callback function name prefix. nrf5/modules/ubluepy: Extracting advertisment reports and adding some data to list before returning it in scan() method. nrf5/bluetooth: Adding handling of advertisment reports in bluetooth driver and issue callback to ubluepy. A bit ugly implmentation and has to be re-worked. nrf5/bluetooth: adding adv report data structure to pass to ubluepy upon adv report event. Adding new api for setting callack where to handle advertisment events in ubluepy. nrf5/modules/ubluepy: Adding adv_reports member to scanner object, to hold the result of scan. nrf5/modules/machine: Cleaning up uart a bit more. Removing unused any() method, and aligning print and local dict names to use machine_uart prefix. nrf5/bluetooth: Turn off bluetooth printf logging. nrf5: Add back ublupy scanner and scan entry source files in Makefile. nrf5/bluetooth: Enable implementation in scan start function in the bluetooth stack driver. nrf5/boards: Adjust heap end after increased .data usage in nrf52832 s132 linker script. nrf5/bluetooth: Adding more implementation in scan start function. However, commented out for time beeing, as there is some memory issues when activating central. nrf5: Removing ubluepy scanner and scan entry from Makefile source list until nrf52 central issues has been resolved. nrf5/bluetooth: Correcting indention. nrf5/bluetooth: Adding some implementation to scan_start function. nrf5/modules/ubluepy: Adding scan method to the Scanner object. Adding locals dict table. nrf5/bluetooth: Adding empty scan_start and scan_stop function to the bluetooth driver. nrf5/modules/ubluepy: Adding constructor function to scanner object. nrf5/modules/ubluepy: Adding print function to Scanner object. nrf5/modules/ubluepy: Disable all functions central related functions in the Peripheral object for now, even if MICROPY_PY_UBLUEPY_CENTRAL is enabled. nrf5/modules/ubluepy: Activate Scanner and ScanEntry objects if MICROPY_PY_UBLUPY_CENTRAL is set. nrf5/bluetooth: Adding new configuration flag for s132 bluetooth stack, to enable/disable ubluepy central. Disabled by default. nrf5: Adding ubluepy_scanner.c and ubluepy_scan_entry.c to Makefile source list. nrf5/modules/ubluepy: Adding template object typedefs for scanner and scan entry, and extern definition for scanner and scan_entry object type in modubluepy.h nrf5/modules/ubluepy: Adding templates for central role Scanner and ScanEntry objects. nrf5/uart: Moving UART from pyb to machine module. Glenn Ruben Bakke <glennbakke@gmail.com> nrf5/uart: Refactoring UART module and HAL driver Facilitating for adding second HW uart. Moving pyb_uart into machine_uart. Adding return error codes from hal_uart functions, if the hardware detects an error. Glenn Ruben Bakke <glennbakke@gmail.com> nrf5/modules: Updating uart object to allow baudrate configuration. nrf5/bluetooth: Moving bluetooth_conf.h to port root folder to make it more exposed. nrf5/boards: Remove define of machine PWM module configuration in nrf51 targets, as the device does not have a HW PWM peripheral. nrf5: Disable machine PWM module by default if board does not define it. nrf5/boards: Disable all display modules in pca10028 board config. nrf5: Updated after merge with master. Updating nlr_jump_fail to call __fatal_error in order to provide a non-returning function call. nrf5/boards: Adding more heap memory to the nrf51 256k/32k s110 linker script. Leaving 2k for stack. nrf5/modules/machine: Adding __WFI() on machine.deepsleep() nrf5/modules/machine: Adding __WFE() on machine.sleep() nrf5/modules/machine: Adding enable_irq() and disable_irq() method to the machine module. No implementation yet for the case where bluetooth stack is used. nrf5/modules/rtc: Adding support for stopping and restarting rtc (if periodic) for all the instances of RTC. nrf5/modules: Updating RTC kwarg from type to mode to set ONESHOT or PERIODIC mode. nrf5/modules: Adding support for periodic RTC callback. nrf5/hal: hal_rtc update. Adding current counter value to period value before setting it in the compare register. nrf5/modules: Updating rtc module with non-const machine object list in order to allow setting callback function in constructor. nrf5/hal: Adding initialization of LFCLK if not already enabled in hal_rtc. nrf5/modules: Moving irq priority settings in RTC object to rtc_init0 when initializing the hardware instances. Also modifying comments a bit. Adding simple example in comment above make_new function on how the object is intended to work. nrf5: Updating main.c to initialize the rtc module if enabled. nrf5/modules: Added RTC into the machine module globals dict. nrf5/modules: Updating rtc module. Not working yet. Updated to align with new hal_rtc interface. Added start and stop methods. Allowing callback function set from init. This should be moved to start function, not set in main. nrf5/hal: Updating hal RTC implementation. nrf5/hal: Adding hal_irq.h which defines a set of static inline functions to do nvic irq operations. nrf5/modules: Updating machine uart module to use new hal uart interface name. nrf5/hal: Renaming uart hal function to use hal_uart prefix. nrf5/modules: Updating readfrom function in machine i2c module to use the new hal function which has been implemented. nrf5/hal: Adding untested implementation of twi read. Lacking sensors to test with :) nrf5/boards: Renaming linker script for all nrf51 and nrf52 into more logical names. Updating all boards with new names. nrf5/bluetooth: Updating header guard in bluetooth_conf.h to reflect new filename. nrf5/bluetooth: Updating old references to 'sdk' to use the new folder name 'bluetooth' in makefiles. nrf5: Renaming sdk folder to bluetooth. nrf5: Merging sdk makefiles into bluetooth_common.mk. s1xx_iot is still left out of this refactoring. nrf5: Renaming nrf5_sdk_conf.h to bluetooth_conf.h nrf5: Starting process of renaming files in sdk folder to facilitate renaming of the folder and make it more logical. Transition will be from sdk to bluetooth. nrf5/boards: Adding support for SPI, I2C, ADC, and Temp in machine modules in micro:bit target. Also activating hal drivers for the peripherals. nrf5/sdk: Updating low frequency clock calibration from 4 seconds to 250 ms for stack enable when BLUETOOTH_LFCLK_RC is enabled. nrf5/boards: Updating nrf51822_aa_s110.ld to be more generic, leaving all RAM not used for stack, .bss and .data to the heap. nrf51: Removing stack section from startup file as it got added to the final hex file. Thanks dhylands for helping out. nrf5/boards: Adding BLUETOOTH_LFCLK_RC to CFLAGS in microbit s110 makefile. nrf5/sdk: Adding support for initializing the bluetooth stack using RC oscillator instead of crystal. If BLUETOOTH_LFCLK_RC is set in CFLAGS, this variant of softdevice enable will be activated. nrf5: Initialize repl_display_debugging_info in pyexec.c for cortex-m0 targets. Glenn Ruben Bakke <glennbakke@gmail.com> nrf5/sdk: Updating ringbuffer.h to use volatile variables for start and end. nrf5/sdk: Rename cccd_enable variable to m_cccd_enable in bluetooth le UART driver. Also made the variable volatile. nrf5/modules: Updating example in ubluepy header to use handle instead of data length upon reception of an event. nrf5/modules: Updating ubluepy peripheral to pass handle value to python event handler instead of data length. Data length can be derived from the bytearray structure. nrf5/sdk: Updating bluetooth le driver to handle SEC PARAM REQUEST by replying that pairing is not supported. Moving initialization of adv and tx in progress state variables to stack enable function. nrf5/modules: Enable ubluepy constants for CONNECT and DISCONNECT for other bluetooth stacks than s132. nrf5/sdk: Fixing unaligned access issues for nrf51 (cortex-m0) in bluetooth le driver Glenn Ruben Bakke <glennbakke@gmail.com> nrf5/sdk: Removing SDK dependant BLE UART Service implementation The sdk_12.1.0 nrf52_ble.c implementation was dependent on SDK components. This has been replaced with the ble_uart.c implementation using a standalone bluetooth driver implementation without need of SDK components. Also, sdk.mk has been updated to not use a special linker script. Glenn Ruben Bakke <glennbakke@gmail.com> nrf52: Removing folder to not confuse which folder is in development Glenn Ruben Bakke <glennbakke@gmail.com> nrf5/sdk: Removing ble_repl_linux.py Script does not really work very well with blocking char read and async ble notifications printing data when terminal stdout is blocked by readchar. Bluetooth UART profile implemented in ble_uart.c is now working with tralamazza's nus_console nodejs script. Ref: https://github.com/tralamazza/nus_console Glenn Ruben Bakke <glennbakke@gmail.com> nrf5: Add default config for MICROPY_PY_BLE_NUS (0) Disable Bluetooth UART to be used for REPL by default. Can be overridden in nrf5_sdk_conf.h. It is defined in mpconfigport.h as it is connected to mphalport.c, where the config is used to determine whether default print functions should be using HW UART or Bluetooth UART. Glenn Ruben Bakke <glennbakke@gmail.com> nrf5/sdk: Add ble_uart.c to source list ble_uart.c implements UART Bluetooth service on top of the bluetooth stack driver api calls. Can be enabled to be compiled in by defining MICROPY_PY_BLE_NUS = 1 in nrf5_sdk_conf.h. Glenn Ruben Bakke <glennbakke@gmail.com> nrf5/sdk: Removing include of sdk_12.1.0's build.mk As no sources are needed from the SDK this build makefile can be deleted. Glenn Ruben Bakke <glennbakke@gmail.com> nrf5: Force implementation of tx_str_cooked function if BLE NUS enabled. If BLE UART service has been enabled, the mp_hal_stdout_tx_strn_cooked is not defined by default anymore, and has to be implemented by the UART driver (in this case BLE). Glenn Ruben Bakke <glennbakke@gmail.com> nrf5/sdk: Adding compiler guard around exchange MTU request event. As s110 is not having this event or function call to answer on a MTU exchange request, this is excluded for all other version than s132 for now. Bander Ajba <banderajba@macwan.local> minor documentation and extra tabs removal fixes Glenn Ruben Bakke <glennbakke@gmail.com> nrf5/sdk: Updating BLE UART implementation by swapping TX and RX uuid and characterisitic handling. Removed dummy write delay of 10 ms. nrf5/sdk: Backing up progress in bluetooth le driver. Adding new gap and gatts handlers. Added handling of tx complete events when using notification, responding to MTU request, and setting of default connection parameters. Bander Ajba <banderajba@macwan.local> fixed temp module to allow for instance support did required modification to merge the temperature sensore module Dave Hylands <dhylands@gmail.com> Fix up Makefile dependencies I also didn't see any real reason for mkrules.mk to exist, so I merged the contents into Makefile. Now you can do: ``` make BOARD=pca10028 clean make BOARD=pca10028 flash ``` and it will work properly. Glenn Ruben Bakke <glennbakke@gmail.com> nrf5: Updating Makefile to use correct variable for setting directory of file to freeze as mpy. nrf5: Setting stack top in main.c. Thanks dhylands for pointing this out. nrf5/sdk: Backing up progress in BLE UART driver. Adding ringbuffer in order to poll bytes from recieved data in REPL main loop. nrf5/modules: Updating ubluepy example to print out gatts write events with data. nrf5/boards: Updating pca10028 bluetooth stack targets to have a MCU_SUB_VARIANT. Bander Ajba <banderajba@macwan.local> added support for hardware temperature sensor Glenn Ruben Bakke <glennbakke@gmail.com> nrf5/sdk: Adding macro based ringbuffer written by Philip Thrasher. source: https://github.com/pthrasher/c-generic-ring-buffer/blob/master/ringbuffer.h. Copyright noticed copied into the file, and file reviewed by Philip. nrf5/sdk: Updating bluetooth le driver to extract data length and pointer from the event structure upon gatts write operation. nrf5/modules: Expose ubluepy characteristic and peripheral types as external declaration in ublupy header. nrf5: Updating main to initialize bluetooth le uart module right before bluetooth REPL is started. nrf5/sdk: Updating bluetooth le uart implemenatation to block until cccd is written. nrf5/sdk: Backing up ubluepy version of ble uart service for Bluetooth LE REPL. nrf5/modules: Updating ubluepy example in header to align with bluetooth uart service characteristic's. nrf5/modules: Implementing characteristic write method. Possible to use write for both write and notifications. nrf5/sdk: Remaning bluetooth driver function ble_drv_attr_notif to *_notify. nrf5/modules: Adding props and attrs parameter to ubluepy characteristic constructor to override default values. Adding method for reading characteristic properties. Adding values to the local dict table that gives possibility to OR together a configuration of properties and attributes in the keyword argument during construction. nrf5/sdk: Adding parsing of characteristic properties and attributes (extra descriptions for the characteristic, for now cccd). nrf5/modules: Adding new members to ubluepy characteristic object, props and attrs. Adding enum typedefs for various properties and attributes. nrf5/modules: Syncing uart module code after upmerge with upstream master. nrf5/boards: Releasing more RAM for heap use in the nrf51 s110 linker script. nrf5/modules: Adding new gatts handler and registration of it during creation of a peripheral object. Also, added forwarding to python callback function (for now the same as for GAP). nrf5/modules: Adding new callback type in modubluepy for gatts events. nrf5/sdk: Adding support for setting gatts handler in the bluetooth le driver. nrf5/modules: Adding constant for CCCD uuid in ubluepy constants dict. nrf5: Adding ubluepy_descriptor.c into source list to compile. nrf5/modules: Adding template for ubluepy descriptor class implementation. nrf5/modules: Adding object structure for ubluepy descriptor. nrf5/sdk: Adding template functions for attribute read/write/notify in bluetooth le driver. nrf5/modules: Adding getCharacteristic method in ublupy service class. This function returns the characteristic with the given UUID if found, else None. The UUID parameter has to be of UUID class type, any other value, like strings will throw an exception. nrf5/modules: Updating method documentation in ubluepy peripheral and service. nrf5/modules: Adding new method, getCharacteristics(), in the ubluepy service class. The method returns the list of characteristics which has been added to the service instance. nrf5/modules: Updating method documentation in ubluepy peripheral class. nrf5/modules: Updating ubluepy service. Creating empty characteristic list in constructor. Appending characteristic to the list when added. nrf5/modules: Changed return in ubluepy addService() function to return mp_const_none instead of boolean. nrf5/modules: Correcting tabbing in ubluepy periheral impl. nrf5/modules: Updating ubluepy peripheral. Creating empty service list in constructor. Appending services to the list when added. Added new function for retreiving the service list; getServices(). nrf5/modules: Adding new members in ubluepy peripheral and service object to keep track of child elements. Peripheral will have a list of services, and service will have a list of charactaristics. nrf5/modules: Removing connection handle from python gap event handler callback function. nrf5/modules: Updating ubluepy example in the header file with new function call to add service to a peripheral instance. nrf5/modules: Updating peripheral class to assign periopheral parent pointer to service's thats added. Also added a hook in the bluetooth le event handler to store the connection handle value, to prevent any services or characteristics to handle this value themselves. nrf5/modules: Updating service object to clear pointer to parent peripheral instance. Also assinging pointer to the service when adding a new characteristic. nrf5/modules: Updating print to also include peripheral's connection handle. Setting pointer to service parent instance to NULL. nrf5/modules: Correcting event id numbers for connect and disconnect event in ubluepy_constants.py nrf5/modules: Shuffle order of typedef in ubluepy header. Adding service pointer in characteristic object. Adding peripheral pointer to the service structure. When populated, the characteristic would get access to conn_handle and service handle through pointers. Also service would get access to peripheral instance. nrf5/modules: adding template functions for characteristic read and write. nrf5/modules: Adding constants class to ubluepy which will contain easy access to common bluetooth le numbers and definitions for the bluetooth stack. nrf5/modules: Updating example in ubluepy header with 16-bit uuid's commented out, to show usage. nrf5/sdk: Adding support for adding 16-bit uuid's in advertisment packet. The services in paramter list can mix 16-bit and 128-bit. nrf5/sdk: Updating sdk_common.mk with new filename of bluetooth le driver. nrf5: Updating all includes of softdevice.h to ble_drv.h nrf5/sdk: renaming softdevice.* to ble_drv.* nrf5/sdk: Renaming bluetooth driver functions to have ble_drv* prefix. Updating modules using it. nrf5/sdk: Enable ubluepy module if s110 bluetooth stack is enabled. nrf5/sdk: Updating bluetooth driver to only set periph and central count if s132 bluetooth stack. These parameters does not exist in older stacks. nrf5/modules: Updating bluetooth driver and ubluepy to use explicit gap event handler. Adding connection handle parameter to the gap handler from ubluepy. Resetting advertisment flag if connection event is recieved, in order to allow for subsequent advertisment if disconnected again. Example in ublupy header updated. nrf5: Adding target to flash bluetooth stack when using pyocd-flashtool. nrf5/modules: Guarding callback to python event handler before issue the call in case it is not set. nrf5/modules: Updating ubluepy example to turn led2 on and off when receiving connected and disconnect bluetooth event. nrf5/sdk: Updating bluetooth driver to have configurable logs. nrf5/modules: updating ubluepy and bluetooth driver to support python created event handler. Added registration of callback from ubluepy against the bluetooth driver and dispatching of events to the user supplied python function. nrf5/modules: Splitting includes to be inside or outside of the compile guard in ubluepy. This way, all micropython specific includes will be outside, and internal will be inside. This way, there will not be any dependency towards ubluepy headers if not compiled in. nrf5/modules: Adding two new functions to ubluepy peripheral class to set specific handlers for notificaitons and connection related events. nrf5: Set ubluepy to disabled by default in mpconfigport.h if not configured. nrf5/modules: Moving includes inside config defines to make non-ubluepy targets compile again. nrf5/modules: Adding 'withDelegate' function to peripheral class. nrf5/modules: Adding ubluepy delegate type to modubluepy globals table. nrf5: Adding ubluepy_delegate.c to list of source files to compile. nrf5/modules: Adding new object struct for delegate class and adding a delegate struct member to Peripheral class to bookeep callback object when event occurs. nrf5/modules: Adding template for ubluepy delegate class. nrf5/sdk: Fixing debug print in bluetooth driver to not use >>> prefix. Adding one more print for connection parameter update. nrf5/sdk: Correcting advertisment packet in bluetooth driver in order to make the device connectable. nrf5/sdk: Implementing simple event handler for bluetooth stack driver. nrf5/sdk: Disable all sdk components from being included in the build while implementing ubluepy, overlap in IRQ handler symbol. nrf5/modules: Shortening down the device name to be advertised in the example to make it fit with a 128-bit complete UUID. nrf5/modules: Bugfix in ubluepy_uuid_make_new. Used wrong buffer to register vendor specific uuid to the bluetooth stack. nrf5/sdk: Updating advertisment function in bluetooth le driver to add 128-bit complete service UUID provided in service list to the advertisment packet. nrf5/sdk: Updating advertisment funciton in bluetooth le driver to iterate through services passed in and calculate individiual uuid sizes. nrf5/modules: Updating advertisment method in peripheral class to memset advertisment structure. Also applying service list if set to the advertisment structure. nrf5/modules: Updating ubluepy module header usage example. Correcting enum for UUID types to start index from 1. Expanding advertisment data structure to also include service list members. nrf5/sdk: Adding static boolean for keeping track of whether advertisment is in progress in the bluetooth driver. Now, advertisment can be restarted with new data any time. nrf5/modules: Updating ubluepy peripheral class to use mp_const_none instead of MP_OBJ_NULL for unset values in advertisment method parameter list. Adding extraction of the service list in the advertisment method. The list is not yet handled. nrf5/modules: Adding a few examples in the modubluepy.h to get easier copy paste when implementing. nrf5/sdk: Successful device name advertisment. Added flags to advertisment packet and enable device name byte copy into the advertisment data. nrf5/modules: Turning ubluepy peripheral advertisment function into a keyword argument function so that it would be possible to set device name, service uuids, or manually constructed data payload. nrf5/sdk: Updating softdevice driver with function to set advertisment data and start advertisment. Does not apply device name yet. Work in progress. nrf5/modules: Adding new structure to ubluepy in order to pass advertisment data information to the bluetooth le stack. nrf5/modules: Adding function function to add characteristics to the ubluepy service. Enable function in service's local dict table. nrf5/modules: Adding function in bluetooth le driver to add characteristic to the bluetooth le stack. nrf5/modules: Adding more members to ublue characteristic object structure. nrf5/modules: Adding characteristic class to ubluepy globals table. nrf5/modules: Updating ubluepy characteristic implementation. nrf5/modules: Re-arranging includes in ubluepy_service.c nrf5/modules: Adding ubluepy charactaristic type struct. nrf5/modules: Updating ubluepy with more implementation in UUID and Service. Adding function in bluetooth le driver which adds services to the bluetooth stack. Making service take UUID object and Service type (primary/secondary) as constructor parameter in Service class. nrf5: Adding ubluepy to include path. nrf5/modules: Updating ubluepy UUID class constructor with some naive parsing of 128-bit UUIDs, and pass this to the softdevice driver for registration. nrf5/sdk: Adding new function to the softdevice handler driver to add vendor specific uuids and return an index to the entry back by reference. nrf5/modules: Updating ubluepy UUID class with constructor that can construct an object based on hex value of 16-bit or string of 16-bit prefixed with '0x'. nrf5/modules: Adding Peripheral, Service and UUID class to the ubluepy module globals table. nrf5/modules: Extending the implementation of Peripheral class in ubluepy. nrf5/modules: Extending the implementation of UUID class in ubluepy. nrf5/sdk: Adding configuration to enable the ubluepy peripheral class when using softdevice 132 from the SDK. nrf5: Adding ubluepy module to builtins if bluetooth stack is selected. Disable NUS profile by default. Adding source for ubluepy module into makefile to be included in build. The source is only linked if MICROPY_PY_UBLUEPY is set. nrf5: Aligning code after upmerge with master. Mostly FAT FS related updates. Not tested after merge. nrf5/modules: Adding new and print function to ubluepy peripheral class. Template functions only. nrf5/modules: Adding ubluepy UUID class template. nrf5/modules: Adding ubluepy characteristic class template. nrf5/modules: Adding missing #endif. Also adding to property templates to the lolcal dict. nrf5/modules: Adding ubluepy service class template. nrf5/modules: Updating ubluepy with class function placeholders. nrf5/modules: Renaming ble module folder to ubluepy. nrf5/modules: Adding new template file for ubluepy Peripheral class. nrf5/pyb: Moving pyb module into modules/pyb. nrf5/utime: Moving utime module into modules/utime. nrf5/uos: Moving uos module into modules/uos. nrf5/network: Moving network module into modules/network. Adding include path to network as its needed by the usocket module. nrf5/usocket: Moving usocket module into modules/usocket. nrf5/led: Moving led module into modules/machine. nrf5/led: Moving led module into modules/machine. nrf5/pwm: Moving pwm module into modules/machine. nrf5/rtc: Moving rtc module into modules/machine. nrf5/timer: Moving timer module into modules/machine. nrf5/pin: Moving pin module into modules/machine. nrf5/adc: Moving adc module into modules/machine. nrf5/i2c: Moving i2c module into modules/machine. nrf5/spi: Moving spi module into modules/machine. nrf5/uart: Moving uart module into modules/machine to start converting it into machine module and not pyb. nrf5/machine: Moving modmachine into modules/machine folder. Updating Makefile. nrf5/drivers: Renaming folder to modules. nrf5: Renaming python modules folder to freeze to give the folder its right meaning. The scripts put into this folder will be frozen. nrf5/drivers: Adding template for ubluepy module. nrf5/sdk: Adding compilation config whether to include BLE NUS implementation. Config found in sdk/nrf5_sdk_conf.h. NUS enabled for s132 targets by default. nrf5: Fallback to HW UART when not Bluetooth LE UART has been enabled. nrf5: Updating main.c to use MICROPY_PY_BLE_NUS as switch for regular uart initialization or bluetooth le uart initialization. nrf5/sdk: Adding work-in-progress script to connect to bluetooth le REPL using bluepy python module in linux. nrf5/boards: Updating board makefiles for s132 and s1xx target for pca10040 (nrf52832) by adding sub variant and device define to the makefiles. nrf5/examples: Updating ssd1306.py example with a comment describing proceedure on how to use the I2C variant of the driver. nrf5/hal: Line wrapping params in hal_spi.c to make it easier to read. nrf5/hal: Updating hal_twi.c tx implementation to a working state. STARTTX only issued once, before looping bytes. nrf5/examples: Updating ssd1306.py driver to work with i2c master write implementation. nrf5/hal: Updating hal_twi.c with tx function. Gets multiple startup bytes for each clocked byte. nrf5/hal: Updating hal_twi.c with tx function which partly works. Bytes are clocked out a bit out of order. nrf5/hal: Started implementation of hal_twi.c (non-DMA). Init function started. nrf5: Removing hal_twie.c from being compiled in. nrf5: Renaming configuration define in board configs using i2c from MICROPY_PY_MACHINE_HW_I2C to MICROPY_PY_MACHINE_I2C as the config is overlapping with the latter. nrf5: Renaming configuration define in board configs using i2c from MICROPY_PY_MACHINE_HW_I2C to MICROPY_PY_MACHINE_I2C as the config is overlapping with the latter. nrf5: Making i2c configurable from board configuration in case board has to sacrifice the i2c machine module. nrf5/boards: Activating all display drivers in pca10056 board. nrf5/boards: Updating s110 SD linker script for micro:bit. nrf5/i2c: Making use of hal twi tx function in writeto function. nrf5/hal: Updating twi driver with template functions. nrf5/hal: Updating TWI DMA implementation. Suspend not working on tx. Rx not implemented yet. nrf5/hal: Updating twi master tx with stop parameter. nrf5/hal: Adding i2c master functions for tx and rx in hal header. nrf5/hal: Adding new macros functions to mphalport.h which are used by extmod i2c machine module. nrf5/i2c: Adopting use of extmod/machine_i2c module as base for port's machine i2c module. nrf5/i2c: Backing up before trying out extmod i2c integration. nrf5: Adding i2c class to machine module globals table. nrf5: Updating main.c to initialize the i2c machine module if selected. nrf5/i2c: Updating i2c machine module with new constructor parameters to set scl and sda pins. Also updating print funciton to debug pin number and port number for the gpio set. nrf5/i2c: Updating i2c module to new new hal api, as master is initialized with its own init function. nrf5/hal: Adding members to TWI config struct, device address and scl/sda pin. Renaming and adding function such that twi slave and master has seperate init function. Started implementation of master init function for nrf52 using DMA (hal_twie.c). nrf5/i2c: Updating module to use new struct layout from hal_twi.h nrf5/hal: Updating TWI with frequency enums. nrf5/examples: Updating game file to use ssd1305 display driver. nrf5/drivers: Updating examples in comment in oled ssd1305 object to use the draw module. nrf5/hal: Fixing nrf51 SPI pin configuration to use pin member of struct. nrf5/boards: Updating boards to comply to new style of configuring pins for uart and spi. nrf5/boards: Updating board configuration for pca10056 (nrf52840) with new pin configuration scheme for SPI and UART. nrf5/hal: Updating hal QSPI header with define guard to filter out usage of undefined structures and names when compiling against non-52840 targets. nrf5/drivers: Updating display objects to use new SPI pin configuration in print function. nrf5/hal: Updating SPI DMA variant with more frequencies, and allowing rx and tx buffers to be NULL. nrf5/uart: Updating uart module to use new config hal config structure members for pins. Changing board config provided pins to use const pointers from generated pins instead of pin name. nrf5/hal: Updating uart hal to use pointers to Pin objects instead of uint pin and port number. nrf5/hal: Updating uart hal to use pointers to Pin objects instead of uint pin and port number. nrf5: Updating modmachine to add SPI in globals dict when MICROPY_PY_MACHINE_HW_SPI define is set. This diverge from regular MICROPY_PY_MACHINE_SPI config. Fixes missing SPI in the machine module after renaming port SPI enable define. nrf5: Updating main.c to enable SPI if MICROPY_PY_MACHINE_HW_SPI is set. This diverge from regular MICROPY_PY_MACHINE_SPI config. Fixing missing init of SPI after renaming port SPI enable define. nrf5/spi: Adding multiple instances of machine SPI depending on which chip is targeted (nrf51/nrf52832/nrf52540). Updating board config requirement to give variable name of const pointer to Pin instead of a Pin name. Adding support of giving keyword set mosi/miso/clk pin through constructor. nrf5/hal: Updating SPI hal with full list of SPI interfaces as lookup tables for all devices. Updating init struct to pass Pin instance pointers instead of uint pin number and ports. nrf5/drivers: Activate ssd1289 object in the display module. nrf5/boards: Adding ssd1289 lcd module in pca10040 (nrf52832) board. nrf5: Adding ssd1289 driver and python module into build. nrf5/drivers: Adding ssd1289 lcd tft driver and python module. nrf5/hal: Fixing compile issues in quad SPI driver. nrf5/hal: Updating Quad SPI hal driver. nrf5/hal: Aligning assignment in hal_adc.c nrf5/hal: Adding more types to quad SPI header. nrf5: Syncing code after upmerge with master. nrf5/hal: Updating clock frequency enums and lookup table for quad spi. nrf5/hal: Adding QSPI base and IRQ num in c-file. nrf5/hal: Adding hal template files for 32mhz Quad SPI peripheral. nrf5/drivers: Optimizing update_line in ili9341 driver a bit. nrf5/drivers: Adding space in macro. nrf5/drivers: Adding rgb16.h with macro to convert 5-6-5 rgb values into a 16-bit value. nrf5: Adding configuration defines for SSD1289 lcd driver. nrf5: Removing old framebuffer implementation. nrf5: Remove old framebuffer implementation from being included into the build. nrf5/drivers: Enable framebuffer and graphics module to be compiled in by default if display is selected into the compilation. nrf5/drivers: Updating epaper driver sld00200p to use new framebuffer. nrf5/drivers: Removing debug printf's from epaper display python module. nrf5/drivers: Updating python example in comment for ls0xxb7dxx display module. nrf5/boards: Enable LS0XXB7DXXX display module in pca10056 board config. nrf5/drivers: Adding ls0xxb7dxx to display module. nrf5: Adding ssd1305 and ls0xxb7dxxx (sharp memory display) drivers to be included in build. nrf5/drivers: Updating sharp memory display driver and python module to a working state. nrf5/spi: Adding posibility to configure SPI firstbit mode to LSB or MSB. Default is MSB. Updating python module and hal driver. nrf5/drivers: Tuning memory lcd driver a bit. Fixing small mp_printf usage bug. nrf5/drivers: Adding sharp memory display driver. For now hardcoded to 2.7 inch variant. nrf5: Adding configuration define for sharp memory display series in mpconfigport.h preparing for driver to be included. nrf5/boards: Enable ssd1305 oled display to be default for pca10028 for now. nrf5/drivers: Adding ssd1305 oled driver. This is very similar to ssd1306, so a merge will happen soon. nrf5/drivers: Adding ssd1305 oled driver. This is very similar to ssd1306, so a merge will happen soon. nrf5/drivers: Updating ili9341 display object to use new framebuffer. nrf5/drivers: Updating ili9341 driver to use new framebuffer, and removing the compressed param from the line update function. nrf5: Adding micropython mem_info() to be included in mpconfigport.h. nrf5/drivers: Adding example in comment on how to use the ili9341 driver with nrf51/pca10028 board. nrf5/examples: Adding a extra global variable to the game which breaks the game execution. nrf5/examples: Adding 2048 game using OLED SSD1306 128x64 display and analog joystick. nrf52/boards: Increasing the stack and heap in pca10056 (nrf52840) target from 2k/32k to 40k/128k to debug some buffer problems when running large frozen python programs. nrf51/boards: Increasing heap and stack size in the pca10028 board. nrf51/boards: Enable display driver and oled ssd1306 (also bringing in framebuffer and graphics module) into the pca10028 target. nrf5: Enable display/framebuffer.c and graphic/draw.c into the build. nrf5/drivers: Adding defines to exclude implementation of draw.c module if not enabled. nrf5: Adding configuration defines for the graphics module (draw) and enabling this by default if using oled ssd1306 display which has a compatible python object definition. nrf5/drivers: Adding draw module with circle, rectangle and text functions. Can be used by any display object which implements display callback functions. nrf5/drivers: Moving oled ssd1306 driver over to new framebuffer layout. Moving some of the draw algorithms into the object in order to optimize the speed on writing data from the framebuffer. nrf5/hal: Removing stdio.h include in adce.c which were used for debugging. nrf5/boards: Adding ADC pins in pins.csv file for pca10056 (nrf52840). nrf52/hal: Adding adce (saadc) implementation for nrf52 to sample values on a channel. nrf5/adc: Adding all 8 instances to adc python module. Valid for both nrf51 and nrf52. nrf5/drivers: Adding new structures to moddisplay. Adding a display_t structure to cast all other displays into, to retrieve function pointer table of a display object type. Also adding the function table structure which needs to be filled by any display object. nrf5/drivers: Adding a new framebuffer implementation to replace the mono_fb. nrf5/boards: Updating pca10028 (nrf51) board config. Enable SPI machine module. Enable flow control on UART. Correcting SPI CLK, MISO and MOSI pin assignments. nrf5/adc: Updating adc module and hal with a new interface. No need for keeping peripheral base address in structure when there is only one peripheral (nrf51). nrf5/rtc: Correcting RTC1 base error in rtc template. nrf5: Adding adc module to machine module. nrf5/hal: Updating hal_adc* with more api functions. nrf5/adc: Adding updated adc module. nrf5/boards: Enabling ADCE (SAADC) variant of adc hal to match hardware on nrf52 series. nrf5/boards: Adding ADC config to pca10028 pins.csv nrf5/boards: Tuning linker script for nrf51822_ac to get some more heap. nrf5: Updating nrf51_af.csv to reflect pins having ADC on the chip. nrf5/boards: Updating make-pins.py to generate ADC pin settings from board pins.csv. nrf5/hal: Updating hal_adc header to use correct Type for ADC on nrf52. nrf5/adc: Updating module to compile. nrf5/boards: Enable ADC machine module for pca10028, pca10040 and pca10056. nrf5: Add add ADC machine module into build. nrf5: Adding new config for ADC module in mpconfigport.h. nrf5/adc: Adding ADC machine module base files. Implementation missing. nrf5: Adding hal_adc* into build. nrf5/boards: Enable ADC/SAADC hal for pca10028 (nrf51), pca10040 (nrf52832) and pca10056 (nrf52840) boards. nrf5/hal: Removing chip variant guard for hal_adc*, and let this be up to the hal conf file to not mess up at the moment. nrf5: Add i2c.c, i2c machine module, and hal_twi into build. nrf5/boards: Enable hardware I2C machine module for pca10028 (nrf51), pca10040 (nrf52832) and pca10056 (nrf52840) boards. nrf5/boards: Enable TWI hal for pca10028 (nrf51), pca10040 (nrf52832) and pca10056 (nrf52840) boards. nrf5/i2c: Adding files for hardware i2c machine module and adding config param in mpconfigport to disable by default. nrf5/hal: Adding template files for TWI (i2c) hal. nrf5/hal: Adding template files for ADC hal. nrf5/drivers: Correcting tabbing in oled ssd1306 c-module. nrf5/boards: Enable SSD1306 spi driver for pca10040 (nrf52832) and pca10056 (nrf52840) boards. nrf5/drivers: Adding SSD1306 SPI display driver. Not complete, but can do fill screen operation atm. nrf5/drivers: Adding epaper display example script in comment for pca10056 / nrf52840 in the display module. nrf5/boards: Enable PWM module and epaper display module in pca10056 board config. nrf5/drivers: Adding some more delay on bootup to ensure display recovers after reset. nrf5/examples: Adding copy of ssd1306.py driver hardcoded with SPI and Pin assignments. nrf5/drivers: Updating ili9341 driver to set CS high after cmd or data write. nrf5/drivers: Extending print function for ili9341 object to also print out gpio port of the SPI pins. nrf5/boards: Giving a bit more heap for nrf52840 linker script. nrf5/drivers: bugfix of the sld00200p driver. Stopping the pwm instead of restarting it. Shuffle placement of static function. nrf5/drivers: Correcting object print function to also include port number of the SPI pins. Correcting usage script example in comment. nrf5/drivers: Adding an initial script as comment for ili9341 on nrf52840/pca10056 in the driver module comment. nrf5/examples: Removing tabs from epaper python script usage comment, so that it is easier to copy paste. nrf5/hal: Refining if-defs to set up GPIO base pointers in mphalport.h nrf5/devices: Removing define which clutters ported modules from nrf.h. nrf5/boards: Enabling spi in pca10056 hal config. nrf5/boards: Enabling ili9341 display drivers and to be compiled in on pca10056 target board. Updating SPI configuration with gpio port. nrf5/boards: Enabling display drivers/spi/pwm to be compiled in on pca10040 target board. Updating SPI configuration with gpio port. nrf5/hal: Correcting SPI psel port position define name to the one defined in nrf52840_bitfields.h nrf5/led: Hardcoding GPIO port 0 for Led module for now. nrf5/hal: Changing import of nrf52 includes in hal_uarte.c to not be explicit. Now only nrf.h is included. nrf5: Updating pin, spi and uart to use port configuration for gpio pins. Update pin generation script, macros for PIN generation. Updating macros for setting pin values adding new port parameter to select the correct GPIO peripheral port. nrf5/boards: Disable SPI hal from pca10001 board. nrf5/boards: Disable SPI/Timer/RTC hal from microbit board. nrf5: Exclude import of pwm.h in modmachine.c if MICROPY_PY_MACHINE_PWM is not set, as nrf51 does not yet have this module yet. nrf5: Exclude import of pwm.h in main.c if MICROPY_PY_MACHINE_PWM is not set, as nrf51 does not yet have this module yet. nrf5/drivers: Block nrf51 from compiling epaper_sld00200p for the moment. There is no soft-pwm present yet, and including pwm would just make compilation fail now. nrf5/hal: Making nrf51/2_hal.h go trough nrf.h to find bitfields and other mcu headers instead of explicit include. nrf5/boards: Adding more pins to nrf52840 / pca10056 target board. nrf5/pin: Adding more pins to nrf52_af.csv file for nrf52840. Port '1' will be prefixed 'B'. nrf5/pin: Adding PORT_B to Pin port enum to reflect gpio port 1 on nrf52840. nrf5/boards: Updating all board configs with gpio port configuration for uart/spi pins. Leds still not defined by gpio port. nrf5/devices: Updating header files for nrf51 and nrf52. Adding headers for nrf52840. nrf5: Updating to use new nrfjprog in makefile. Needed for nrf52840 targets. Changed from pinreset to debug reset. nrf5/boards: Updating makefiles to use system.c files based on sub-variant of mcu. nrf5/devices: Renaming system.c files for nrf51 and nrf52 to be more explicit on which version of chip they are referring to. nrf5/drivers: Backing up working epaper display (sld00200p shield) driver before refactoring. nrf5/drivers: Fixing parenthesis in ILI9341 __str__ print function. nrf5/pwm: Moving out object types to header file so that it can be resused by other modules. nrf5/drivers: Updating a working version of ili9341 module and driver. About 10 times faster than python implementation to update a full screen. nrf5: Started to split up lcd_mono_fb such that it can be used as a c-library and python module with the same implementaton. nrf5/hal: Adding include of stdbool.h in hal_spi.h as it is used by the header. nrf5/drivers: Adding preliminary file for ili9341 lcd driver. nrf5/hal: Adding support for NULL pointer to be set if no rx buffer is of interest in SPI rx_tx function. nrf5: Adding ili9341 class and driver files in Makefile to be included in build. nrf5/drivers: Adding template files for upcomming ili9341 driver. nrf5/drivers: Adding lcd ili9341 object implementation to make a new instance. print implemented for debugging pins assigned to the display driver. No interaction yet with the hal driver. nrf5/drivers: Adding ILI9341 class to the display global dict. nrf5/boards: Changing tft lcd display name from SLD10261P to ILI9341 in pca10040 board configuration. nrf5: Moving out mp_obj_framebuf_t to the header file to get access to it from other modules. Exposing helper function to make new framebuffer object from c-code. nrf5: Trimming down display configurations in mpconfigport.h nrf5/spi: Moving *_spi_obj_t out of implementation file to header. Setting hal init structure in the object structure instead of making a temp struct to configure hal. This would enable lookup of the spi settings later. nrf5: Removing epaper, lcd and oled modules from Makefile source list as the display modules has been moved to display root folder. nrf5/drivers: Removing one level of module hierarchy in display drivers. Removed epaper, lcd and oled modules, making import of classes happen directly from display module. nrf5/drivers: Creating python object implementation (locals) to be used for epaper sld00200p. nrf5: Moving color defines in lcd_mono_fb from .c to .h so that it can be reused by other modules. nrf5: Enable MICROPY_FINALISER and REPL_AUTO_INDENT. nrf5/drivers: Adding requirement for nrf52 target on the epaper sld00200p for now. There is no ported PWM module for nrf51 target yet. Hence, soft PWM for nrf51 needs to be added. nrf5: Adding suffix to _obj on epaper_sld00200p module. nrf5: Correcting define name for epaper sld00200p, missing 0. nrf5/drivers: Enable EPAPER_SLD00200P in epaper module globals table. nrf5/drivers: Adding missing file for epaper module / driver. nrf5/modules: Moving python scripts to examples folder to free up some flash space on constrained targets as modules folder is used as frozen files folder. nrf5/boards: Enable display module to be built in. Also adding one epaper display and one tft lcd to test display module when porting the corresponding drivers to micropython. nrf5/drivers: Removing external decleration of display module in header. nrf5/drivers: Renaming display module to mp_module prefix as it is going to be inbuilt. ifdef'ing all submodules based on type of display configured through mpconfigport.h nrf5/drivers: Adding ifdef sourrounding the implementation of module. Configurable with mpconfigport.h. nrf5: Adding display module to port builtins. nrf5/drivers: Adding driver files to makefile. Implicitly adding display module. nrf5/drivers: Adding template for c-implementation of lcd, epaper and oled drivers as a display module. nrf5/modules: Updating to correct name of display in epaper driver. nrf5/modules: Adding python epaper display driver. Currently colors have been reversed. nrf5/hal: Fixing bug in mp_hal_pin_read in mphalport.h which tried to read an OUT register. Corrected to read the IN register. nrf5: Adding sleep_us to modutime.c and exposing mp_hal_delay_us in hal/hal_time.h nrf5/lcd: Updating framebuffer with double buffer for epaper displays. Moving statics into instance struct. Adding new function to refresh using old buffer, such that epaper can get a cleaner image after update. nrf5/boards: Adding initial microbit build files and board configurations. nrf5: Makefile option to set FLASHER when doing flash target. If defined in board .mk file, this will be used, else nrfjprog will be used by default (segger). This opens up for using pyocd flashtool and still run 'make flash'. nrf5/boards: Updating pca10028 board config to not define RTS/CTS pins when HWFC is set to 0. nrf5/uart: Making compile time exclusion of RTS/CTS if not defined to use flow control by board configuration. nrf5/spi: Removing automatic chip select (NSS) in hal_spi.c. Also removing configuration of this pin as it is confusing to pass it if not used. User of SPI has to set the NSS/CS itself. nrf5/modules: Updating PWM test python script to cope with new api. nrf5/hal: Fixing some issues in PWM stop function. Doing a proper stop and disable the peripheral. nrf5/pwm: Implementing start and stop call to hal on init and deinit as hal_init does not longer start the PWM automatically. nrf5/hal: Exposing two new PWM hal functions start() and stop(). nrf5/hal: Moving enablement of PWM task from init to a start function. Also activating code in stop function to stop the PWM. nrf5/modules: Adding licence text on seeedstudio tft shield python modules. nrf52/boards: Tuning linker script for nrf52832 when using iot softdevice. Need more heap for LCD framebuffer. nrf5/lcd: Adding lcd_mono_fb.c to source list in the makefile. Adding define in implementation to de-select the file from being included. Adding module to PORT BUILTIN in mpconfigport.h nrf52/sdk: Correcting path to iot softdevice if SDK is enabled. nrf5: Adding help text for CTRL-D (soft reset) and and CTRL-E (paste mode) in help.c nrf5: Adding handling of CTRL+D to reset chip in main.c. Call to NVIC System Reset is issued. nrf5/lcd: Correcting indention (tabs with space) in framebuffer module source and header. nrf5/lcd: Changing framebuffer to use petme128 8x8 font. This is vertical font. Code modified to flip and mirror the font when rendering a character. Adding copy of the font from stmhal. nrf5/modules: Adding new driver for seeedstudio tft shield v2, using new framebuffer module which handles faster update on single lines, callback driven write on each line which is touched in the framebuffer. nrf5/lcd: Adding header file for lcd_mono_fb. nrf5/lcd: Updating brackets in framebuffer module. nrf5/lcd: Renaming variable name from m_ to p_ nrf5/lcd: Cleaning up a bit in lcd framebuffer. nrf5/lcd: Adding work in progress monochrome lcd framebuffer driver which only updates modified (dirty) display lines. nrf5/modules: Updating pulse test to set output direction on the LED pin used in the test. nrf5/modules: Updating seeedstudio tft lcd driver to render using already existing framebuffer implementation. nrf5/boards: Bouncing up heap to 32k on pca10040 to allow for application to allocate 9600bytes+ framebuffer when using LCD screen (240x320). nrf5/modules: Adding a function to get access to the SD card flash drive on the seeedstudio tft shield. nrf5/modules: Adding new python script to initialize and clear the display on Seeedstudio 2.8 TFT Touch Shield v2. nrf5/modules: Updating documentation on sdcard.py copy to use new params in the example description nrf5/modules: Updating mountsd, SD card test script with new params. nrf5/pin: Merging input and output pin configuration to one comon function. Adding implementation in Pin class to be able to configure mode and pull. Updating drivers which uses gpio pin configuration to use new function parameters. nrf5: Adding rtc.c which implements the machine rtc module to be included in build. nrf5/boards: Enable MICROPY_PY_MACHINE_RTC in pca10028 (nrf51) and pca10040 (nrf52) targets. nrf5/hal: Adding empty init function in hal_rtc.c nrf5/hal: Adding structures and init function prototype to hal_rtc.h. nrf5: Setting MICROPY_PY_MACHINE_RTC to disabled by default (during development) in mpconfigport.h. This can be overriden by board config. nrf5/rtc: Adding skeleton for machine rtc module for nrf51/52. nrf5: Adding timer.c which implements the machine timer module to be included in build. nrf5: Setting MICROPY_PY_MACHINE_TIMER to disabled by default (during development) in mpconfigport.h. This can be overriden by board config. nrf5/boards: Enable MICROPY_PY_MACHINE_TIMER in pca10028 (nrf51) and pca10040 (nrf52) targets. nrf5: Adding initialization of timer module if enabled by MICROPY_PY_MACHINE_TIMER. nrf5/timer: Adding initializaton of id field for Timer_HandleTypeDef's. Adding simple print function. Adding make_new function. Enabling the functions in machine_timer_type. nrf5/hal: Adding empty init function in hal_timer.c nrf5/hal: Adding structures and init function prototype to hal_timer.h. nrf5/timer: Adding skeleton for machine timer module for nrf51/52. nrf/boards: Adding RTC and TIMER hal to be linked in when implemented. Enable one board for nrf51 and one for nrf52 for ease of debugging when implementing the hal. nrf5: Adding rtc and timer hal to Makefile. nrf5/hal: Adding skeleton files for rtc and timer driver. nrf5/modules: Updating pulse example to work with Pin object instead of hard coded pin number. nrf5/pwm: Switching from hardcoded pin number to Pin object type as input to the new() function. Also changing the parameter from kw to arg. nrf5/modules: updating test python file with correct PWM frequency type. nrf5/modules: Adding a python test file with function to dim a specific led (17). nrf5/pwm: Updating pwm module with freq function which re-initilises the PWM instance such that new frequency will be applied. nrf5/pwm: Initializing pwm instances in main.c if enabled by MICROPY_PY_MACHINE_PWM. nrf5/pwm: Adding api to initialize pwm instances. nrf5: Updating mpconfigport.h to set a default for PWM machine module to be enabled by default, if not disabled in a board config. Refactoring order in the file. nrf52: Set names to be used on PWM0-2 in board config. For nrf52840, the PWM3 is excluded as repo does not have latest headers to reflect this yet. Bump up to be done soon. nrf52: Enable PWM HAL for both pca10040 (nrf52832) and pca10056 (nrf52840). nrf51: Disable MICROPY_PY_MACHINE_PWM for now in all nrf51 target boards as sw impl. is not yet included in the repo. nrf5: Only enable hal_pwm.c if nrf52 target as nrf51 must have a sw implementation. nrf5/pwm: Adding pwm to modmachine.c nrf5/hal: Updating PWM header file with init function prototype. Also added PWM_HandleTypeDef structure that can be used in the pwm python module. nrf5/pwm: Updating PWM dict table to have freq and duty function. Also added creation of default objects based on PWM name set in board config. Adding ifdef surrounding the import of hal_pwm.h as this module might be used by software implmentation of PWM later. nrf5/pwm: Removing include of hal_pwm.h as pwm.c might not use a hal, but sw implementation. nrf5: Updating makefile to compile in pwm.c and hal_pwm.c nrf5/boards: Adding config flag for HAL_PWM in pca10040 and pca10056. nrf5: Adding pwm work in progress machine PWM module. nrf5/hal: Starting implementation of PWM hal to be used by PWM python module later. nrf5: Adding initial board files for pca10056. The files are not complete (only 32 pins are added for now). UART REPL, leds, and Pins (up to 31) are functional. nrf5: Updating comment in linker script for nrf52832 and nrf52840 to distinguish between the two nrf52 variants. nrf5: Adding new linker script for nrf52840. nrf5: updating flash size comment in nrf52832 linker script. lib/netutils: Adding some basic parsing and formating of ipv6 address strings. Only working with full length ipv6 strings. Short forms not supported at the moment (for example FE80::1, needs to be expressed as FE80:0000:0000:0000:0000:0000:0000:0001). nrf5: Updating port with new content. SPI, SDcard (trough sdcard.py), Pin, and machine module. Also adding some basic modules depending on SDK and bluetooth stack from nordic semiconductor. NUS is module copied from original port by tralamazza, and new basic module for 6lowpan over BLE which can be used by modnetwork and modusocket. Basic BLE module to enable bluetooth stack and start a eddystone advertisment is kept, and still works without SDK, even if in the SDK folder (its placed there as it needs bluetooth stack from an SDK). Renaming softdevice folder to sdk. Removing unused 'NRF_SOFTDEVICE' compile variable from all board .mk softdevice targets. Fixing main Makefile CFLAGS concatination error when setting softdevice param Daniel Tralamazza <daniel@tralamazza.com> ignore default build folders move softdevice (SD) specific code from the main Makefile to their respective board/SD makefiles Glenn Ruben Bakke <glennbakke@gmail.com> Updating Makefile by removing unwanted LDFLAG setting cpu to cortex-m0 in all cases. Updating modble.c method doc of address_print() to reflect the actual function name. Base support for nrf51 and nrf52 base without depending on SDK. SoftDevice usage optional. Daniel Tralamazza <daniel@tralamazza.com> remove dup declaration mp_builtin_open_obj init Date of "init" commit: Wed Jun 22 22:34:11 2016 +0200
2418 lines
183 KiB
C
2418 lines
183 KiB
C
|
|
/****************************************************************************************************//**
|
|
* @file nrf52840.h
|
|
*
|
|
* @brief CMSIS Cortex-M4 Peripheral Access Layer Header File for
|
|
* nrf52840 from Nordic Semiconductor.
|
|
*
|
|
* @version V1
|
|
* @date 18. November 2016
|
|
*
|
|
* @note Generated with SVDConv V2.81d
|
|
* from CMSIS SVD File 'nrf52840.svd' Version 1,
|
|
*
|
|
* @par Copyright (c) 2016, Nordic Semiconductor ASA
|
|
* All rights reserved.
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without
|
|
* modification, are permitted provided that the following conditions are met:
|
|
*
|
|
* * Redistributions of source code must retain the above copyright notice, this
|
|
* list of conditions and the following disclaimer.
|
|
*
|
|
* * Redistributions in binary form must reproduce the above copyright notice,
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
* and/or other materials provided with the distribution.
|
|
*
|
|
* * Neither the name of Nordic Semiconductor ASA nor the names of its
|
|
* contributors may be used to endorse or promote products derived from
|
|
* this software without specific prior written permission.
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
*
|
|
*
|
|
*******************************************************************************************************/
|
|
|
|
|
|
|
|
/** @addtogroup Nordic Semiconductor
|
|
* @{
|
|
*/
|
|
|
|
/** @addtogroup nrf52840
|
|
* @{
|
|
*/
|
|
|
|
#ifndef NRF52840_H
|
|
#define NRF52840_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
|
|
/* ------------------------- Interrupt Number Definition ------------------------ */
|
|
|
|
typedef enum {
|
|
/* ------------------- Cortex-M4 Processor Exceptions Numbers ------------------- */
|
|
Reset_IRQn = -15, /*!< 1 Reset Vector, invoked on Power up and warm reset */
|
|
NonMaskableInt_IRQn = -14, /*!< 2 Non maskable Interrupt, cannot be stopped or preempted */
|
|
HardFault_IRQn = -13, /*!< 3 Hard Fault, all classes of Fault */
|
|
MemoryManagement_IRQn = -12, /*!< 4 Memory Management, MPU mismatch, including Access Violation
|
|
and No Match */
|
|
BusFault_IRQn = -11, /*!< 5 Bus Fault, Pre-Fetch-, Memory Access Fault, other address/memory
|
|
related Fault */
|
|
UsageFault_IRQn = -10, /*!< 6 Usage Fault, i.e. Undef Instruction, Illegal State Transition */
|
|
SVCall_IRQn = -5, /*!< 11 System Service Call via SVC instruction */
|
|
DebugMonitor_IRQn = -4, /*!< 12 Debug Monitor */
|
|
PendSV_IRQn = -2, /*!< 14 Pendable request for system service */
|
|
SysTick_IRQn = -1, /*!< 15 System Tick Timer */
|
|
/* --------------------- nrf52840 Specific Interrupt Numbers -------------------- */
|
|
POWER_CLOCK_IRQn = 0, /*!< 0 POWER_CLOCK */
|
|
RADIO_IRQn = 1, /*!< 1 RADIO */
|
|
UARTE0_UART0_IRQn = 2, /*!< 2 UARTE0_UART0 */
|
|
SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQn= 3, /*!< 3 SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0 */
|
|
SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn= 4, /*!< 4 SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1 */
|
|
NFCT_IRQn = 5, /*!< 5 NFCT */
|
|
GPIOTE_IRQn = 6, /*!< 6 GPIOTE */
|
|
SAADC_IRQn = 7, /*!< 7 SAADC */
|
|
TIMER0_IRQn = 8, /*!< 8 TIMER0 */
|
|
TIMER1_IRQn = 9, /*!< 9 TIMER1 */
|
|
TIMER2_IRQn = 10, /*!< 10 TIMER2 */
|
|
RTC0_IRQn = 11, /*!< 11 RTC0 */
|
|
TEMP_IRQn = 12, /*!< 12 TEMP */
|
|
RNG_IRQn = 13, /*!< 13 RNG */
|
|
ECB_IRQn = 14, /*!< 14 ECB */
|
|
CCM_AAR_IRQn = 15, /*!< 15 CCM_AAR */
|
|
WDT_IRQn = 16, /*!< 16 WDT */
|
|
RTC1_IRQn = 17, /*!< 17 RTC1 */
|
|
QDEC_IRQn = 18, /*!< 18 QDEC */
|
|
COMP_LPCOMP_IRQn = 19, /*!< 19 COMP_LPCOMP */
|
|
SWI0_EGU0_IRQn = 20, /*!< 20 SWI0_EGU0 */
|
|
SWI1_EGU1_IRQn = 21, /*!< 21 SWI1_EGU1 */
|
|
SWI2_EGU2_IRQn = 22, /*!< 22 SWI2_EGU2 */
|
|
SWI3_EGU3_IRQn = 23, /*!< 23 SWI3_EGU3 */
|
|
SWI4_EGU4_IRQn = 24, /*!< 24 SWI4_EGU4 */
|
|
SWI5_EGU5_IRQn = 25, /*!< 25 SWI5_EGU5 */
|
|
TIMER3_IRQn = 26, /*!< 26 TIMER3 */
|
|
TIMER4_IRQn = 27, /*!< 27 TIMER4 */
|
|
PWM0_IRQn = 28, /*!< 28 PWM0 */
|
|
PDM_IRQn = 29, /*!< 29 PDM */
|
|
MWU_IRQn = 32, /*!< 32 MWU */
|
|
PWM1_IRQn = 33, /*!< 33 PWM1 */
|
|
PWM2_IRQn = 34, /*!< 34 PWM2 */
|
|
SPIM2_SPIS2_SPI2_IRQn = 35, /*!< 35 SPIM2_SPIS2_SPI2 */
|
|
RTC2_IRQn = 36, /*!< 36 RTC2 */
|
|
I2S_IRQn = 37, /*!< 37 I2S */
|
|
FPU_IRQn = 38, /*!< 38 FPU */
|
|
USBD_IRQn = 39, /*!< 39 USBD */
|
|
UARTE1_IRQn = 40, /*!< 40 UARTE1 */
|
|
QSPI_IRQn = 41, /*!< 41 QSPI */
|
|
CRYPTOCELL_IRQn = 42, /*!< 42 CRYPTOCELL */
|
|
SPIM3_IRQn = 43, /*!< 43 SPIM3 */
|
|
PWM3_IRQn = 45 /*!< 45 PWM3 */
|
|
} IRQn_Type;
|
|
|
|
|
|
/** @addtogroup Configuration_of_CMSIS
|
|
* @{
|
|
*/
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ Processor and Core Peripheral Section ================ */
|
|
/* ================================================================================ */
|
|
|
|
/* ----------------Configuration of the Cortex-M4 Processor and Core Peripherals---------------- */
|
|
#define __CM4_REV 0x0001 /*!< Cortex-M4 Core Revision */
|
|
#define __MPU_PRESENT 1 /*!< MPU present or not */
|
|
#define __NVIC_PRIO_BITS 3 /*!< Number of Bits used for Priority Levels */
|
|
#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
|
|
#define __FPU_PRESENT 1 /*!< FPU present or not */
|
|
/** @} */ /* End of group Configuration_of_CMSIS */
|
|
|
|
#include "core_cm4.h" /*!< Cortex-M4 processor and core peripherals */
|
|
#include "system_nrf52840.h" /*!< nrf52840 System */
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ Device Specific Peripheral Section ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/** @addtogroup Device_Peripheral_Registers
|
|
* @{
|
|
*/
|
|
|
|
|
|
/* ------------------- Start of section using anonymous unions ------------------ */
|
|
#if defined(__CC_ARM)
|
|
#pragma push
|
|
#pragma anon_unions
|
|
#elif defined(__ICCARM__)
|
|
#pragma language=extended
|
|
#elif defined(__GNUC__)
|
|
/* anonymous unions are enabled by default */
|
|
#elif defined(__TMS470__)
|
|
/* anonymous unions are enabled by default */
|
|
#elif defined(__TASKING__)
|
|
#pragma warning 586
|
|
#else
|
|
#warning Not supported compiler type
|
|
#endif
|
|
|
|
|
|
typedef struct {
|
|
__I uint32_t PART; /*!< Part code */
|
|
__I uint32_t VARIANT; /*!< Part variant (hardware version and production configuration). */
|
|
__I uint32_t PACKAGE; /*!< Package option */
|
|
__I uint32_t RAM; /*!< RAM variant */
|
|
__I uint32_t FLASH; /*!< Flash variant */
|
|
__IO uint32_t UNUSED0[3]; /*!< Description collection[0]: Unspecified */
|
|
} FICR_INFO_Type;
|
|
|
|
typedef struct {
|
|
__I uint32_t A0; /*!< Slope definition A0. */
|
|
__I uint32_t A1; /*!< Slope definition A1. */
|
|
__I uint32_t A2; /*!< Slope definition A2. */
|
|
__I uint32_t A3; /*!< Slope definition A3. */
|
|
__I uint32_t A4; /*!< Slope definition A4. */
|
|
__I uint32_t A5; /*!< Slope definition A5. */
|
|
__I uint32_t B0; /*!< y-intercept B0. */
|
|
__I uint32_t B1; /*!< y-intercept B1. */
|
|
__I uint32_t B2; /*!< y-intercept B2. */
|
|
__I uint32_t B3; /*!< y-intercept B3. */
|
|
__I uint32_t B4; /*!< y-intercept B4. */
|
|
__I uint32_t B5; /*!< y-intercept B5. */
|
|
__I uint32_t T0; /*!< Segment end T0. */
|
|
__I uint32_t T1; /*!< Segment end T1. */
|
|
__I uint32_t T2; /*!< Segment end T2. */
|
|
__I uint32_t T3; /*!< Segment end T3. */
|
|
__I uint32_t T4; /*!< Segment end T4. */
|
|
} FICR_TEMP_Type;
|
|
|
|
typedef struct {
|
|
__I uint32_t TAGHEADER0; /*!< Default header for NFC Tag. Software can read these values to
|
|
populate NFCID1_3RD_LAST, NFCID1_2ND_LAST and NFCID1_LAST. */
|
|
__I uint32_t TAGHEADER1; /*!< Default header for NFC Tag. Software can read these values to
|
|
populate NFCID1_3RD_LAST, NFCID1_2ND_LAST and NFCID1_LAST. */
|
|
__I uint32_t TAGHEADER2; /*!< Default header for NFC Tag. Software can read these values to
|
|
populate NFCID1_3RD_LAST, NFCID1_2ND_LAST and NFCID1_LAST. */
|
|
__I uint32_t TAGHEADER3; /*!< Default header for NFC Tag. Software can read these values to
|
|
populate NFCID1_3RD_LAST, NFCID1_2ND_LAST and NFCID1_LAST. */
|
|
} FICR_NFC_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t POWER; /*!< Description cluster[0]: RAM0 power control register */
|
|
__O uint32_t POWERSET; /*!< Description cluster[0]: RAM0 power control set register */
|
|
__O uint32_t POWERCLR; /*!< Description cluster[0]: RAM0 power control clear register */
|
|
__I uint32_t RESERVED0;
|
|
} POWER_RAM_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t RTS; /*!< Pin select for RTS signal */
|
|
__IO uint32_t TXD; /*!< Pin select for TXD signal */
|
|
__IO uint32_t CTS; /*!< Pin select for CTS signal */
|
|
__IO uint32_t RXD; /*!< Pin select for RXD signal */
|
|
} UARTE_PSEL_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< Data pointer */
|
|
__IO uint32_t MAXCNT; /*!< Maximum number of bytes in receive buffer */
|
|
__I uint32_t AMOUNT; /*!< Number of bytes transferred in the last transaction */
|
|
} UARTE_RXD_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< Data pointer */
|
|
__IO uint32_t MAXCNT; /*!< Maximum number of bytes in transmit buffer */
|
|
__I uint32_t AMOUNT; /*!< Number of bytes transferred in the last transaction */
|
|
} UARTE_TXD_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t RTS; /*!< Pin select for RTS */
|
|
__IO uint32_t TXD; /*!< Pin select for TXD */
|
|
__IO uint32_t CTS; /*!< Pin select for CTS */
|
|
__IO uint32_t RXD; /*!< Pin select for RXD */
|
|
} UART_PSEL_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t SCK; /*!< Pin select for SCK */
|
|
__IO uint32_t MOSI; /*!< Pin select for MOSI signal */
|
|
__IO uint32_t MISO; /*!< Pin select for MISO signal */
|
|
__IO uint32_t CSN; /*!< Pin select for CSN */
|
|
} SPIM_PSEL_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< Data pointer */
|
|
__IO uint32_t MAXCNT; /*!< Maximum number of bytes in receive buffer */
|
|
__I uint32_t AMOUNT; /*!< Number of bytes transferred in the last transaction */
|
|
__IO uint32_t LIST; /*!< EasyDMA list type */
|
|
} SPIM_RXD_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< Data pointer */
|
|
__IO uint32_t MAXCNT; /*!< Number of bytes in transmit buffer */
|
|
__I uint32_t AMOUNT; /*!< Number of bytes transferred in the last transaction */
|
|
__IO uint32_t LIST; /*!< EasyDMA list type */
|
|
} SPIM_TXD_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t RXDELAY; /*!< Sample delay for input serial data on MISO */
|
|
__IO uint32_t CSNDUR; /*!< Minimum duration between edge of CSN and edge of SCK and minimum
|
|
duration CSN must stay high between transactions */
|
|
} SPIM_IFTIMING_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t SCK; /*!< Pin select for SCK */
|
|
__IO uint32_t MISO; /*!< Pin select for MISO signal */
|
|
__IO uint32_t MOSI; /*!< Pin select for MOSI signal */
|
|
__IO uint32_t CSN; /*!< Pin select for CSN signal */
|
|
} SPIS_PSEL_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< RXD data pointer */
|
|
__IO uint32_t MAXCNT; /*!< Maximum number of bytes in receive buffer */
|
|
__I uint32_t AMOUNT; /*!< Number of bytes received in last granted transaction */
|
|
} SPIS_RXD_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< TXD data pointer */
|
|
__IO uint32_t MAXCNT; /*!< Maximum number of bytes in transmit buffer */
|
|
__I uint32_t AMOUNT; /*!< Number of bytes transmitted in last granted transaction */
|
|
} SPIS_TXD_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t SCL; /*!< Pin select for SCL signal */
|
|
__IO uint32_t SDA; /*!< Pin select for SDA signal */
|
|
} TWIM_PSEL_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< Data pointer */
|
|
__IO uint32_t MAXCNT; /*!< Maximum number of bytes in receive buffer */
|
|
__I uint32_t AMOUNT; /*!< Number of bytes transferred in the last transaction */
|
|
__IO uint32_t LIST; /*!< EasyDMA list type */
|
|
} TWIM_RXD_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< Data pointer */
|
|
__IO uint32_t MAXCNT; /*!< Maximum number of bytes in transmit buffer */
|
|
__I uint32_t AMOUNT; /*!< Number of bytes transferred in the last transaction */
|
|
__IO uint32_t LIST; /*!< EasyDMA list type */
|
|
} TWIM_TXD_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t SCL; /*!< Pin select for SCL signal */
|
|
__IO uint32_t SDA; /*!< Pin select for SDA signal */
|
|
} TWIS_PSEL_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< RXD Data pointer */
|
|
__IO uint32_t MAXCNT; /*!< Maximum number of bytes in RXD buffer */
|
|
__I uint32_t AMOUNT; /*!< Number of bytes transferred in the last RXD transaction */
|
|
} TWIS_RXD_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< TXD Data pointer */
|
|
__IO uint32_t MAXCNT; /*!< Maximum number of bytes in TXD buffer */
|
|
__I uint32_t AMOUNT; /*!< Number of bytes transferred in the last TXD transaction */
|
|
} TWIS_TXD_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t SCK; /*!< Pin select for SCK */
|
|
__IO uint32_t MOSI; /*!< Pin select for MOSI signal */
|
|
__IO uint32_t MISO; /*!< Pin select for MISO signal */
|
|
} SPI_PSEL_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t SCL; /*!< Pin select for SCL */
|
|
__IO uint32_t SDA; /*!< Pin select for SDA */
|
|
} TWI_PSEL_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t RX; /*!< Result of last incoming frame */
|
|
} NFCT_FRAMESTATUS_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t FRAMECONFIG; /*!< Configuration of outgoing frames */
|
|
__IO uint32_t AMOUNT; /*!< Size of outgoing frame */
|
|
} NFCT_TXD_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t FRAMECONFIG; /*!< Configuration of incoming frames */
|
|
__I uint32_t AMOUNT; /*!< Size of last incoming frame */
|
|
} NFCT_RXD_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t LIMITH; /*!< Description cluster[0]: Last results is equal or above CH[0].LIMIT.HIGH */
|
|
__IO uint32_t LIMITL; /*!< Description cluster[0]: Last results is equal or below CH[0].LIMIT.LOW */
|
|
} SAADC_EVENTS_CH_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PSELP; /*!< Description cluster[0]: Input positive pin selection for CH[0] */
|
|
__IO uint32_t PSELN; /*!< Description cluster[0]: Input negative pin selection for CH[0] */
|
|
__IO uint32_t CONFIG; /*!< Description cluster[0]: Input configuration for CH[0] */
|
|
__IO uint32_t LIMIT; /*!< Description cluster[0]: High/low limits for event monitoring
|
|
a channel */
|
|
} SAADC_CH_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< Data pointer */
|
|
__IO uint32_t MAXCNT; /*!< Maximum number of buffer words to transfer */
|
|
__I uint32_t AMOUNT; /*!< Number of buffer words transferred since last START */
|
|
} SAADC_RESULT_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t LED; /*!< Pin select for LED signal */
|
|
__IO uint32_t A; /*!< Pin select for A signal */
|
|
__IO uint32_t B; /*!< Pin select for B signal */
|
|
} QDEC_PSEL_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< Description cluster[0]: Beginning address in Data RAM of sequence
|
|
A */
|
|
__IO uint32_t CNT; /*!< Description cluster[0]: Amount of values (duty cycles) in sequence
|
|
A */
|
|
__IO uint32_t REFRESH; /*!< Description cluster[0]: Amount of additional PWM periods between
|
|
samples loaded to compare register (load every CNT+1 PWM periods) */
|
|
__IO uint32_t ENDDELAY; /*!< Description cluster[0]: Time added after the sequence */
|
|
__I uint32_t RESERVED1[4];
|
|
} PWM_SEQ_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t OUT[4]; /*!< Description collection[0]: Output pin select for PWM channel
|
|
0 */
|
|
} PWM_PSEL_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t CLK; /*!< Pin number configuration for PDM CLK signal */
|
|
__IO uint32_t DIN; /*!< Pin number configuration for PDM DIN signal */
|
|
} PDM_PSEL_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< RAM address pointer to write samples to with EasyDMA */
|
|
__IO uint32_t MAXCNT; /*!< Number of samples to allocate memory for in EasyDMA mode */
|
|
} PDM_SAMPLE_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t ADDR; /*!< Description cluster[0]: Configure the word-aligned start address
|
|
of region 0 to protect */
|
|
__IO uint32_t SIZE; /*!< Description cluster[0]: Size of region to protect counting from
|
|
address ACL[0].ADDR. Write '0' as no effect. */
|
|
__IO uint32_t PERM; /*!< Description cluster[0]: Access permissions for region 0 as defined
|
|
by start address ACL[0].ADDR and size ACL[0].SIZE */
|
|
__IO uint32_t UNUSED0; /*!< Unspecified */
|
|
} ACL_ACL_Type;
|
|
|
|
typedef struct {
|
|
__O uint32_t EN; /*!< Description cluster[0]: Enable channel group 0 */
|
|
__O uint32_t DIS; /*!< Description cluster[0]: Disable channel group 0 */
|
|
} PPI_TASKS_CHG_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t EEP; /*!< Description cluster[0]: Channel 0 event end-point */
|
|
__IO uint32_t TEP; /*!< Description cluster[0]: Channel 0 task end-point */
|
|
} PPI_CH_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t TEP; /*!< Description cluster[0]: Channel 0 task end-point */
|
|
} PPI_FORK_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t WA; /*!< Description cluster[0]: Write access to region 0 detected */
|
|
__IO uint32_t RA; /*!< Description cluster[0]: Read access to region 0 detected */
|
|
} MWU_EVENTS_REGION_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t WA; /*!< Description cluster[0]: Write access to peripheral region 0
|
|
detected */
|
|
__IO uint32_t RA; /*!< Description cluster[0]: Read access to peripheral region 0 detected */
|
|
} MWU_EVENTS_PREGION_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t SUBSTATWA; /*!< Description cluster[0]: Source of event/interrupt in region
|
|
0, write access detected while corresponding subregion was enabled
|
|
for watching */
|
|
__IO uint32_t SUBSTATRA; /*!< Description cluster[0]: Source of event/interrupt in region
|
|
0, read access detected while corresponding subregion was enabled
|
|
for watching */
|
|
} MWU_PERREGION_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t START; /*!< Description cluster[0]: Start address for region 0 */
|
|
__IO uint32_t END; /*!< Description cluster[0]: End address of region 0 */
|
|
__I uint32_t RESERVED2[2];
|
|
} MWU_REGION_Type;
|
|
|
|
typedef struct {
|
|
__I uint32_t START; /*!< Description cluster[0]: Reserved for future use */
|
|
__I uint32_t END; /*!< Description cluster[0]: Reserved for future use */
|
|
__IO uint32_t SUBS; /*!< Description cluster[0]: Subregions of region 0 */
|
|
__I uint32_t RESERVED3;
|
|
} MWU_PREGION_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t MODE; /*!< I2S mode. */
|
|
__IO uint32_t RXEN; /*!< Reception (RX) enable. */
|
|
__IO uint32_t TXEN; /*!< Transmission (TX) enable. */
|
|
__IO uint32_t MCKEN; /*!< Master clock generator enable. */
|
|
__IO uint32_t MCKFREQ; /*!< Master clock generator frequency. */
|
|
__IO uint32_t RATIO; /*!< MCK / LRCK ratio. */
|
|
__IO uint32_t SWIDTH; /*!< Sample width. */
|
|
__IO uint32_t ALIGN; /*!< Alignment of sample within a frame. */
|
|
__IO uint32_t FORMAT; /*!< Frame format. */
|
|
__IO uint32_t CHANNELS; /*!< Enable channels. */
|
|
} I2S_CONFIG_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< Receive buffer RAM start address. */
|
|
} I2S_RXD_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< Transmit buffer RAM start address. */
|
|
} I2S_TXD_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t MAXCNT; /*!< Size of RXD and TXD buffers. */
|
|
} I2S_RXTXD_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t MCK; /*!< Pin select for MCK signal. */
|
|
__IO uint32_t SCK; /*!< Pin select for SCK signal. */
|
|
__IO uint32_t LRCK; /*!< Pin select for LRCK signal. */
|
|
__IO uint32_t SDIN; /*!< Pin select for SDIN signal. */
|
|
__IO uint32_t SDOUT; /*!< Pin select for SDOUT signal. */
|
|
} I2S_PSEL_Type;
|
|
|
|
typedef struct {
|
|
__I uint32_t EPIN[8]; /*!< Description collection[0]: IN endpoint halted status. Can be
|
|
used as is as response to a GetStatus() request to endpoint. */
|
|
__I uint32_t RESERVED4;
|
|
__I uint32_t EPOUT[8]; /*!< Description collection[0]: OUT endpoint halted status. Can be
|
|
used as is as response to a GetStatus() request to endpoint. */
|
|
} USBD_HALTED_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t EPOUT[8]; /*!< Description collection[0]: Amount of bytes received last in
|
|
the data stage of this OUT endpoint */
|
|
__IO uint32_t ISOOUT; /*!< Amount of bytes received last on this iso OUT data endpoint */
|
|
} USBD_SIZE_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< Description cluster[0]: Data pointer */
|
|
__IO uint32_t MAXCNT; /*!< Description cluster[0]: Maximum number of bytes to transfer */
|
|
__I uint32_t AMOUNT; /*!< Description cluster[0]: Number of bytes transferred in the last
|
|
transaction */
|
|
__I uint32_t RESERVED5[2];
|
|
} USBD_EPIN_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< Data pointer */
|
|
__IO uint32_t MAXCNT; /*!< Maximum number of bytes to transfer */
|
|
__I uint32_t AMOUNT; /*!< Number of bytes transferred in the last transaction */
|
|
} USBD_ISOIN_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< Description cluster[0]: Data pointer */
|
|
__IO uint32_t MAXCNT; /*!< Description cluster[0]: Maximum number of bytes to transfer */
|
|
__I uint32_t AMOUNT; /*!< Description cluster[0]: Number of bytes transferred in the last
|
|
transaction */
|
|
__I uint32_t RESERVED6[2];
|
|
} USBD_EPOUT_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< Data pointer */
|
|
__IO uint32_t MAXCNT; /*!< Maximum number of bytes to transfer */
|
|
__I uint32_t AMOUNT; /*!< Number of bytes transferred in the last transaction */
|
|
} USBD_ISOOUT_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t SRC; /*!< Flash memory source address */
|
|
__IO uint32_t DST; /*!< RAM destination address */
|
|
__IO uint32_t CNT; /*!< Read transfer length */
|
|
} QSPI_READ_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t DST; /*!< Flash destination address */
|
|
__IO uint32_t SRC; /*!< RAM source address */
|
|
__IO uint32_t CNT; /*!< Write transfer length */
|
|
} QSPI_WRITE_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t PTR; /*!< Start address of flash block to be erased */
|
|
__IO uint32_t LEN; /*!< Size of block to be erased. */
|
|
} QSPI_ERASE_Type;
|
|
|
|
typedef struct {
|
|
__IO uint32_t SCK; /*!< Pin select for serial clock SCK */
|
|
__IO uint32_t CSN; /*!< Pin select for chip select signal CSN. */
|
|
__I uint32_t RESERVED7;
|
|
__IO uint32_t IO0; /*!< Pin select for serial data MOSI/IO0. */
|
|
__IO uint32_t IO1; /*!< Pin select for serial data MISO/IO1. */
|
|
__IO uint32_t IO2; /*!< Pin select for serial data IO2. */
|
|
__IO uint32_t IO3; /*!< Pin select for serial data IO3. */
|
|
} QSPI_PSEL_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ FICR ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Factory Information Configuration Registers (FICR)
|
|
*/
|
|
|
|
typedef struct { /*!< FICR Structure */
|
|
__I uint32_t RESERVED0[4];
|
|
__I uint32_t CODEPAGESIZE; /*!< Code memory page size */
|
|
__I uint32_t CODESIZE; /*!< Code memory size */
|
|
__I uint32_t RESERVED1[18];
|
|
__I uint32_t DEVICEID[2]; /*!< Description collection[0]: Device identifier */
|
|
__I uint32_t RESERVED2[6];
|
|
__I uint32_t ER[4]; /*!< Description collection[0]: Encryption root, word 0 */
|
|
__I uint32_t IR[4]; /*!< Description collection[0]: Identity Root, word 0 */
|
|
__I uint32_t DEVICEADDRTYPE; /*!< Device address type */
|
|
__I uint32_t DEVICEADDR[2]; /*!< Description collection[0]: Device address 0 */
|
|
__I uint32_t RESERVED3[21];
|
|
FICR_INFO_Type INFO; /*!< Device info */
|
|
__I uint32_t RESERVED4[185];
|
|
FICR_TEMP_Type TEMP; /*!< Registers storing factory TEMP module linearization coefficients */
|
|
__I uint32_t RESERVED5[2];
|
|
FICR_NFC_Type NFC; /*!< Unspecified */
|
|
} NRF_FICR_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ UICR ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief User Information Configuration Registers (UICR)
|
|
*/
|
|
|
|
typedef struct { /*!< UICR Structure */
|
|
__IO uint32_t UNUSED0; /*!< Unspecified */
|
|
__IO uint32_t UNUSED1; /*!< Unspecified */
|
|
__IO uint32_t UNUSED2; /*!< Unspecified */
|
|
__I uint32_t RESERVED0;
|
|
__IO uint32_t UNUSED3; /*!< Unspecified */
|
|
__IO uint32_t NRFFW[15]; /*!< Description collection[0]: Reserved for Nordic firmware design */
|
|
__IO uint32_t NRFHW[12]; /*!< Description collection[0]: Reserved for Nordic hardware design */
|
|
__IO uint32_t CUSTOMER[32]; /*!< Description collection[0]: Reserved for customer */
|
|
__I uint32_t RESERVED1[64];
|
|
__IO uint32_t PSELRESET[2]; /*!< Description collection[0]: Mapping of the nRESET function */
|
|
__IO uint32_t APPROTECT; /*!< Access port protection */
|
|
__IO uint32_t NFCPINS; /*!< Setting of pins dedicated to NFC functionality: NFC antenna
|
|
or GPIO */
|
|
__I uint32_t RESERVED2[60];
|
|
__IO uint32_t EXTSUPPLY; /*!< Enable external circuitry to be supplied from VDD pin. Applicable
|
|
in 'High voltage mode' only. */
|
|
__IO uint32_t REGOUT0; /*!< GPIO reference voltage / external output supply voltage in 'High
|
|
voltage mode'. */
|
|
} NRF_UICR_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ POWER ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Power control (POWER)
|
|
*/
|
|
|
|
typedef struct { /*!< POWER Structure */
|
|
__I uint32_t RESERVED0[30];
|
|
__O uint32_t TASKS_CONSTLAT; /*!< Enable constant latency mode */
|
|
__O uint32_t TASKS_LOWPWR; /*!< Enable low power mode (variable latency) */
|
|
__I uint32_t RESERVED1[34];
|
|
__IO uint32_t EVENTS_POFWARN; /*!< Power failure warning */
|
|
__I uint32_t RESERVED2[2];
|
|
__IO uint32_t EVENTS_SLEEPENTER; /*!< CPU entered WFI/WFE sleep */
|
|
__IO uint32_t EVENTS_SLEEPEXIT; /*!< CPU exited WFI/WFE sleep */
|
|
__IO uint32_t EVENTS_USBDETECTED; /*!< Voltage supply detected on VBUS */
|
|
__IO uint32_t EVENTS_USBREMOVED; /*!< Voltage supply removed from VBUS */
|
|
__IO uint32_t EVENTS_USBPWRRDY; /*!< USB 3.3 V supply ready */
|
|
__I uint32_t RESERVED3[119];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED4[61];
|
|
__IO uint32_t RESETREAS; /*!< Reset reason */
|
|
__I uint32_t RESERVED5[9];
|
|
__I uint32_t RAMSTATUS; /*!< Deprecated register - RAM status register */
|
|
__I uint32_t RESERVED6[3];
|
|
__I uint32_t USBREGSTATUS; /*!< USB supply status */
|
|
__I uint32_t RESERVED7[49];
|
|
__O uint32_t SYSTEMOFF; /*!< System OFF register */
|
|
__I uint32_t RESERVED8[3];
|
|
__IO uint32_t POFCON; /*!< Power failure comparator configuration */
|
|
__I uint32_t RESERVED9[2];
|
|
__IO uint32_t GPREGRET; /*!< General purpose retention register */
|
|
__IO uint32_t GPREGRET2; /*!< General purpose retention register */
|
|
__I uint32_t RESERVED10[21];
|
|
__IO uint32_t DCDCEN; /*!< Enable DC/DC converter for REG1 stage. */
|
|
__I uint32_t RESERVED11;
|
|
__IO uint32_t DCDCEN0; /*!< Enable DC/DC converter for REG0 stage. */
|
|
__I uint32_t RESERVED12[47];
|
|
__I uint32_t MAINREGSTATUS; /*!< Main supply status */
|
|
__I uint32_t RESERVED13[175];
|
|
POWER_RAM_Type RAM[9]; /*!< Unspecified */
|
|
} NRF_POWER_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ CLOCK ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Clock control (CLOCK)
|
|
*/
|
|
|
|
typedef struct { /*!< CLOCK Structure */
|
|
__O uint32_t TASKS_HFCLKSTART; /*!< Start HFCLK crystal oscillator */
|
|
__O uint32_t TASKS_HFCLKSTOP; /*!< Stop HFCLK crystal oscillator */
|
|
__O uint32_t TASKS_LFCLKSTART; /*!< Start LFCLK source */
|
|
__O uint32_t TASKS_LFCLKSTOP; /*!< Stop LFCLK source */
|
|
__O uint32_t TASKS_CAL; /*!< Start calibration of LFRC or LFULP oscillator */
|
|
__O uint32_t TASKS_CTSTART; /*!< Start calibration timer */
|
|
__O uint32_t TASKS_CTSTOP; /*!< Stop calibration timer */
|
|
__I uint32_t RESERVED0[57];
|
|
__IO uint32_t EVENTS_HFCLKSTARTED; /*!< HFCLK oscillator started */
|
|
__IO uint32_t EVENTS_LFCLKSTARTED; /*!< LFCLK started */
|
|
__I uint32_t RESERVED1;
|
|
__IO uint32_t EVENTS_DONE; /*!< Calibration of LFCLK RC oscillator complete event */
|
|
__IO uint32_t EVENTS_CTTO; /*!< Calibration timer timeout */
|
|
__I uint32_t RESERVED2[124];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED3[63];
|
|
__I uint32_t HFCLKRUN; /*!< Status indicating that HFCLKSTART task has been triggered */
|
|
__I uint32_t HFCLKSTAT; /*!< HFCLK status */
|
|
__I uint32_t RESERVED4;
|
|
__I uint32_t LFCLKRUN; /*!< Status indicating that LFCLKSTART task has been triggered */
|
|
__I uint32_t LFCLKSTAT; /*!< LFCLK status */
|
|
__I uint32_t LFCLKSRCCOPY; /*!< Copy of LFCLKSRC register, set when LFCLKSTART task was triggered */
|
|
__I uint32_t RESERVED5[62];
|
|
__IO uint32_t LFCLKSRC; /*!< Clock source for the LFCLK */
|
|
__I uint32_t RESERVED6[7];
|
|
__IO uint32_t CTIV; /*!< Calibration timer interval */
|
|
__I uint32_t RESERVED7[8];
|
|
__IO uint32_t TRACECONFIG; /*!< Clocking options for the Trace Port debug interface */
|
|
} NRF_CLOCK_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ RADIO ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief 2.4 GHz Radio (RADIO)
|
|
*/
|
|
|
|
typedef struct { /*!< RADIO Structure */
|
|
__O uint32_t TASKS_TXEN; /*!< Enable RADIO in TX mode */
|
|
__O uint32_t TASKS_RXEN; /*!< Enable RADIO in RX mode */
|
|
__O uint32_t TASKS_START; /*!< Start RADIO */
|
|
__O uint32_t TASKS_STOP; /*!< Stop RADIO */
|
|
__O uint32_t TASKS_DISABLE; /*!< Disable RADIO */
|
|
__O uint32_t TASKS_RSSISTART; /*!< Start the RSSI and take one single sample of the receive signal
|
|
strength. */
|
|
__O uint32_t TASKS_RSSISTOP; /*!< Stop the RSSI measurement */
|
|
__O uint32_t TASKS_BCSTART; /*!< Start the bit counter */
|
|
__O uint32_t TASKS_BCSTOP; /*!< Stop the bit counter */
|
|
__O uint32_t TASKS_EDSTART; /*!< Start the Energy Detect measurement used in IEEE 802.15.4 mode */
|
|
__O uint32_t TASKS_EDSTOP; /*!< Stop the Energy Detect measurement */
|
|
__O uint32_t TASKS_CCASTART; /*!< Start the Clear Channel Assessment used in IEEE 802.15.4 mode */
|
|
__O uint32_t TASKS_CCASTOP; /*!< Stop the Clear Channel Assessment */
|
|
__I uint32_t RESERVED0[51];
|
|
__IO uint32_t EVENTS_READY; /*!< RADIO has ramped up and is ready to be started */
|
|
__IO uint32_t EVENTS_ADDRESS; /*!< Address sent or received */
|
|
__IO uint32_t EVENTS_PAYLOAD; /*!< Packet payload sent or received */
|
|
__IO uint32_t EVENTS_END; /*!< Packet sent or received */
|
|
__IO uint32_t EVENTS_DISABLED; /*!< RADIO has been disabled */
|
|
__IO uint32_t EVENTS_DEVMATCH; /*!< A device address match occurred on the last received packet */
|
|
__IO uint32_t EVENTS_DEVMISS; /*!< No device address match occurred on the last received packet */
|
|
__IO uint32_t EVENTS_RSSIEND; /*!< Sampling of receive signal strength complete. */
|
|
__I uint32_t RESERVED1[2];
|
|
__IO uint32_t EVENTS_BCMATCH; /*!< Bit counter reached bit count value. */
|
|
__I uint32_t RESERVED2;
|
|
__IO uint32_t EVENTS_CRCOK; /*!< Packet received with CRC ok */
|
|
__IO uint32_t EVENTS_CRCERROR; /*!< Packet received with CRC error */
|
|
__IO uint32_t EVENTS_FRAMESTART; /*!< IEEE 802.15.4 length field received */
|
|
__IO uint32_t EVENTS_EDEND; /*!< Sampling of Energy Detection complete. A new ED sample is ready
|
|
for readout from the RADIO.EDSAMPLE register */
|
|
__IO uint32_t EVENTS_EDSTOPPED; /*!< The sampling of Energy Detection has stopped */
|
|
__IO uint32_t EVENTS_CCAIDLE; /*!< Wireless medium in idle - clear to send */
|
|
__IO uint32_t EVENTS_CCABUSY; /*!< Wireless medium busy - do not send */
|
|
__IO uint32_t EVENTS_CCASTOPPED; /*!< The CCA has stopped */
|
|
__IO uint32_t EVENTS_RATEBOOST; /*!< Ble_LR CI field received, receive mode is changed from Ble_LR125Kbit
|
|
to Ble_LR500Kbit. */
|
|
__IO uint32_t EVENTS_TXREADY; /*!< RADIO has ramped up and is ready to be started TX path */
|
|
__IO uint32_t EVENTS_RXREADY; /*!< RADIO has ramped up and is ready to be started RX path */
|
|
__IO uint32_t EVENTS_MHRMATCH; /*!< MAC Header match found. */
|
|
__I uint32_t RESERVED3[40];
|
|
__IO uint32_t SHORTS; /*!< Shortcut register */
|
|
__I uint32_t RESERVED4[64];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED5[61];
|
|
__I uint32_t CRCSTATUS; /*!< CRC status */
|
|
__I uint32_t RESERVED6;
|
|
__I uint32_t RXMATCH; /*!< Received address */
|
|
__I uint32_t RXCRC; /*!< CRC field of previously received packet */
|
|
__I uint32_t DAI; /*!< Device address match index */
|
|
__I uint32_t RESERVED7[60];
|
|
__IO uint32_t PACKETPTR; /*!< Packet pointer */
|
|
__IO uint32_t FREQUENCY; /*!< Frequency */
|
|
__IO uint32_t TXPOWER; /*!< Output power */
|
|
__IO uint32_t MODE; /*!< Data rate and modulation */
|
|
__IO uint32_t PCNF0; /*!< Packet configuration register 0 */
|
|
__IO uint32_t PCNF1; /*!< Packet configuration register 1 */
|
|
__IO uint32_t BASE0; /*!< Base address 0 */
|
|
__IO uint32_t BASE1; /*!< Base address 1 */
|
|
__IO uint32_t PREFIX0; /*!< Prefixes bytes for logical addresses 0-3 */
|
|
__IO uint32_t PREFIX1; /*!< Prefixes bytes for logical addresses 4-7 */
|
|
__IO uint32_t TXADDRESS; /*!< Transmit address select */
|
|
__IO uint32_t RXADDRESSES; /*!< Receive address select */
|
|
__IO uint32_t CRCCNF; /*!< CRC configuration */
|
|
__IO uint32_t CRCPOLY; /*!< CRC polynomial */
|
|
__IO uint32_t CRCINIT; /*!< CRC initial value */
|
|
__I uint32_t RESERVED8;
|
|
__IO uint32_t TIFS; /*!< Inter Frame Spacing in us */
|
|
__I uint32_t RSSISAMPLE; /*!< RSSI sample */
|
|
__I uint32_t RESERVED9;
|
|
__I uint32_t STATE; /*!< Current radio state */
|
|
__IO uint32_t DATAWHITEIV; /*!< Data whitening initial value */
|
|
__I uint32_t RESERVED10[2];
|
|
__IO uint32_t BCC; /*!< Bit counter compare */
|
|
__I uint32_t RESERVED11[39];
|
|
__IO uint32_t DAB[8]; /*!< Description collection[0]: Device address base segment 0 */
|
|
__IO uint32_t DAP[8]; /*!< Description collection[0]: Device address prefix 0 */
|
|
__IO uint32_t DACNF; /*!< Device address match configuration */
|
|
__IO uint32_t MHRMATCHCONF; /*!< Search Pattern Configuration */
|
|
__IO uint32_t MHRMATCHMAS; /*!< Pattern mask */
|
|
__I uint32_t RESERVED12;
|
|
__IO uint32_t MODECNF0; /*!< Radio mode configuration register 0 */
|
|
__I uint32_t RESERVED13[3];
|
|
__IO uint32_t SFD; /*!< IEEE 802.15.4 Start of Frame Delimiter */
|
|
__IO uint32_t EDCNT; /*!< IEEE 802.15.4 Energy Detect Loop Count */
|
|
__IO uint32_t EDSAMPLE; /*!< IEEE 802.15.4 Energy Detect Level */
|
|
__IO uint32_t CCACTRL; /*!< IEEE 802.15.4 Clear Channel Assessment Control */
|
|
__I uint32_t RESERVED14[611];
|
|
__IO uint32_t POWER; /*!< Peripheral power control */
|
|
} NRF_RADIO_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ UARTE ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief UART with EasyDMA 0 (UARTE)
|
|
*/
|
|
|
|
typedef struct { /*!< UARTE Structure */
|
|
__O uint32_t TASKS_STARTRX; /*!< Start UART receiver */
|
|
__O uint32_t TASKS_STOPRX; /*!< Stop UART receiver */
|
|
__O uint32_t TASKS_STARTTX; /*!< Start UART transmitter */
|
|
__O uint32_t TASKS_STOPTX; /*!< Stop UART transmitter */
|
|
__I uint32_t RESERVED0[7];
|
|
__O uint32_t TASKS_FLUSHRX; /*!< Flush RX FIFO into RX buffer */
|
|
__I uint32_t RESERVED1[52];
|
|
__IO uint32_t EVENTS_CTS; /*!< CTS is activated (set low). Clear To Send. */
|
|
__IO uint32_t EVENTS_NCTS; /*!< CTS is deactivated (set high). Not Clear To Send. */
|
|
__IO uint32_t EVENTS_RXDRDY; /*!< Data received in RXD (but potentially not yet transferred to
|
|
Data RAM) */
|
|
__I uint32_t RESERVED2;
|
|
__IO uint32_t EVENTS_ENDRX; /*!< Receive buffer is filled up */
|
|
__I uint32_t RESERVED3[2];
|
|
__IO uint32_t EVENTS_TXDRDY; /*!< Data sent from TXD */
|
|
__IO uint32_t EVENTS_ENDTX; /*!< Last TX byte transmitted */
|
|
__IO uint32_t EVENTS_ERROR; /*!< Error detected */
|
|
__I uint32_t RESERVED4[7];
|
|
__IO uint32_t EVENTS_RXTO; /*!< Receiver timeout */
|
|
__I uint32_t RESERVED5;
|
|
__IO uint32_t EVENTS_RXSTARTED; /*!< UART receiver has started */
|
|
__IO uint32_t EVENTS_TXSTARTED; /*!< UART transmitter has started */
|
|
__I uint32_t RESERVED6;
|
|
__IO uint32_t EVENTS_TXSTOPPED; /*!< Transmitter stopped */
|
|
__I uint32_t RESERVED7[41];
|
|
__IO uint32_t SHORTS; /*!< Shortcut register */
|
|
__I uint32_t RESERVED8[63];
|
|
__IO uint32_t INTEN; /*!< Enable or disable interrupt */
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED9[93];
|
|
__IO uint32_t ERRORSRC; /*!< Error source Note : this register is read / write one to clear. */
|
|
__I uint32_t RESERVED10[31];
|
|
__IO uint32_t ENABLE; /*!< Enable UART */
|
|
__I uint32_t RESERVED11;
|
|
UARTE_PSEL_Type PSEL; /*!< Unspecified */
|
|
__I uint32_t RESERVED12[3];
|
|
__IO uint32_t BAUDRATE; /*!< Baud rate. Accuracy depends on the HFCLK source selected. */
|
|
__I uint32_t RESERVED13[3];
|
|
UARTE_RXD_Type RXD; /*!< RXD EasyDMA channel */
|
|
__I uint32_t RESERVED14;
|
|
UARTE_TXD_Type TXD; /*!< TXD EasyDMA channel */
|
|
__I uint32_t RESERVED15[7];
|
|
__IO uint32_t CONFIG; /*!< Configuration of parity and hardware flow control */
|
|
} NRF_UARTE_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ UART ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Universal Asynchronous Receiver/Transmitter (UART)
|
|
*/
|
|
|
|
typedef struct { /*!< UART Structure */
|
|
__O uint32_t TASKS_STARTRX; /*!< Start UART receiver */
|
|
__O uint32_t TASKS_STOPRX; /*!< Stop UART receiver */
|
|
__O uint32_t TASKS_STARTTX; /*!< Start UART transmitter */
|
|
__O uint32_t TASKS_STOPTX; /*!< Stop UART transmitter */
|
|
__I uint32_t RESERVED0[3];
|
|
__O uint32_t TASKS_SUSPEND; /*!< Suspend UART */
|
|
__I uint32_t RESERVED1[56];
|
|
__IO uint32_t EVENTS_CTS; /*!< CTS is activated (set low). Clear To Send. */
|
|
__IO uint32_t EVENTS_NCTS; /*!< CTS is deactivated (set high). Not Clear To Send. */
|
|
__IO uint32_t EVENTS_RXDRDY; /*!< Data received in RXD */
|
|
__I uint32_t RESERVED2[4];
|
|
__IO uint32_t EVENTS_TXDRDY; /*!< Data sent from TXD */
|
|
__I uint32_t RESERVED3;
|
|
__IO uint32_t EVENTS_ERROR; /*!< Error detected */
|
|
__I uint32_t RESERVED4[7];
|
|
__IO uint32_t EVENTS_RXTO; /*!< Receiver timeout */
|
|
__I uint32_t RESERVED5[46];
|
|
__IO uint32_t SHORTS; /*!< Shortcut register */
|
|
__I uint32_t RESERVED6[64];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED7[93];
|
|
__IO uint32_t ERRORSRC; /*!< Error source */
|
|
__I uint32_t RESERVED8[31];
|
|
__IO uint32_t ENABLE; /*!< Enable UART */
|
|
__I uint32_t RESERVED9;
|
|
UART_PSEL_Type PSEL; /*!< Unspecified */
|
|
__I uint32_t RXD; /*!< RXD register */
|
|
__O uint32_t TXD; /*!< TXD register */
|
|
__I uint32_t RESERVED10;
|
|
__IO uint32_t BAUDRATE; /*!< Baud rate. Accuracy depends on the HFCLK source selected. */
|
|
__I uint32_t RESERVED11[17];
|
|
__IO uint32_t CONFIG; /*!< Configuration of parity and hardware flow control */
|
|
} NRF_UART_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ SPIM ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Serial Peripheral Interface Master with EasyDMA 0 (SPIM)
|
|
*/
|
|
|
|
typedef struct { /*!< SPIM Structure */
|
|
__I uint32_t RESERVED0[4];
|
|
__O uint32_t TASKS_START; /*!< Start SPI transaction */
|
|
__O uint32_t TASKS_STOP; /*!< Stop SPI transaction */
|
|
__I uint32_t RESERVED1;
|
|
__O uint32_t TASKS_SUSPEND; /*!< Suspend SPI transaction */
|
|
__O uint32_t TASKS_RESUME; /*!< Resume SPI transaction */
|
|
__I uint32_t RESERVED2[56];
|
|
__IO uint32_t EVENTS_STOPPED; /*!< SPI transaction has stopped */
|
|
__I uint32_t RESERVED3[2];
|
|
__IO uint32_t EVENTS_ENDRX; /*!< End of RXD buffer reached */
|
|
__I uint32_t RESERVED4;
|
|
__IO uint32_t EVENTS_END; /*!< End of RXD buffer and TXD buffer reached */
|
|
__I uint32_t RESERVED5;
|
|
__IO uint32_t EVENTS_ENDTX; /*!< End of TXD buffer reached */
|
|
__I uint32_t RESERVED6[10];
|
|
__IO uint32_t EVENTS_STARTED; /*!< Transaction started */
|
|
__I uint32_t RESERVED7[44];
|
|
__IO uint32_t SHORTS; /*!< Shortcut register */
|
|
__I uint32_t RESERVED8[64];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED9[61];
|
|
__IO uint32_t STALLSTAT; /*!< Stall status for EasyDMA RAM accesses. The fields in this register
|
|
is set to STALL by hardware whenever a stall occurres and can
|
|
be cleared (set to NOSTALL) by the CPU. */
|
|
__I uint32_t RESERVED10[63];
|
|
__IO uint32_t ENABLE; /*!< Enable SPIM */
|
|
__I uint32_t RESERVED11;
|
|
SPIM_PSEL_Type PSEL; /*!< Unspecified */
|
|
__I uint32_t RESERVED12[3];
|
|
__IO uint32_t FREQUENCY; /*!< SPI frequency. Accuracy depends on the HFCLK source selected. */
|
|
__I uint32_t RESERVED13[3];
|
|
SPIM_RXD_Type RXD; /*!< RXD EasyDMA channel */
|
|
SPIM_TXD_Type TXD; /*!< TXD EasyDMA channel */
|
|
__IO uint32_t CONFIG; /*!< Configuration register */
|
|
__I uint32_t RESERVED14[2];
|
|
SPIM_IFTIMING_Type IFTIMING; /*!< Unspecified */
|
|
__I uint32_t RESERVED15[22];
|
|
__IO uint32_t ORC; /*!< Byte transmitted after TXD.MAXCNT bytes have been transmitted
|
|
in the case when RXD.MAXCNT is greater than TXD.MAXCNT */
|
|
} NRF_SPIM_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ SPIS ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief SPI Slave 0 (SPIS)
|
|
*/
|
|
|
|
typedef struct { /*!< SPIS Structure */
|
|
__I uint32_t RESERVED0[9];
|
|
__O uint32_t TASKS_ACQUIRE; /*!< Acquire SPI semaphore */
|
|
__O uint32_t TASKS_RELEASE; /*!< Release SPI semaphore, enabling the SPI slave to acquire it */
|
|
__I uint32_t RESERVED1[54];
|
|
__IO uint32_t EVENTS_END; /*!< Granted transaction completed */
|
|
__I uint32_t RESERVED2[2];
|
|
__IO uint32_t EVENTS_ENDRX; /*!< End of RXD buffer reached */
|
|
__I uint32_t RESERVED3[5];
|
|
__IO uint32_t EVENTS_ACQUIRED; /*!< Semaphore acquired */
|
|
__I uint32_t RESERVED4[53];
|
|
__IO uint32_t SHORTS; /*!< Shortcut register */
|
|
__I uint32_t RESERVED5[64];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED6[61];
|
|
__I uint32_t SEMSTAT; /*!< Semaphore status register */
|
|
__I uint32_t RESERVED7[15];
|
|
__IO uint32_t STATUS; /*!< Status from last transaction */
|
|
__I uint32_t RESERVED8[47];
|
|
__IO uint32_t ENABLE; /*!< Enable SPI slave */
|
|
__I uint32_t RESERVED9;
|
|
SPIS_PSEL_Type PSEL; /*!< Unspecified */
|
|
__I uint32_t RESERVED10[7];
|
|
SPIS_RXD_Type RXD; /*!< Unspecified */
|
|
__I uint32_t RESERVED11;
|
|
SPIS_TXD_Type TXD; /*!< Unspecified */
|
|
__I uint32_t RESERVED12;
|
|
__IO uint32_t CONFIG; /*!< Configuration register */
|
|
__I uint32_t RESERVED13;
|
|
__IO uint32_t DEF; /*!< Default character. Character clocked out in case of an ignored
|
|
transaction. */
|
|
__I uint32_t RESERVED14[24];
|
|
__IO uint32_t ORC; /*!< Over-read character */
|
|
} NRF_SPIS_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ TWIM ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief I2C compatible Two-Wire Master Interface with EasyDMA 0 (TWIM)
|
|
*/
|
|
|
|
typedef struct { /*!< TWIM Structure */
|
|
__O uint32_t TASKS_STARTRX; /*!< Start TWI receive sequence */
|
|
__I uint32_t RESERVED0;
|
|
__O uint32_t TASKS_STARTTX; /*!< Start TWI transmit sequence */
|
|
__I uint32_t RESERVED1[2];
|
|
__O uint32_t TASKS_STOP; /*!< Stop TWI transaction. Must be issued while the TWI master is
|
|
not suspended. */
|
|
__I uint32_t RESERVED2;
|
|
__O uint32_t TASKS_SUSPEND; /*!< Suspend TWI transaction */
|
|
__O uint32_t TASKS_RESUME; /*!< Resume TWI transaction */
|
|
__I uint32_t RESERVED3[56];
|
|
__IO uint32_t EVENTS_STOPPED; /*!< TWI stopped */
|
|
__I uint32_t RESERVED4[7];
|
|
__IO uint32_t EVENTS_ERROR; /*!< TWI error */
|
|
__I uint32_t RESERVED5[8];
|
|
__IO uint32_t EVENTS_SUSPENDED; /*!< Last byte has been sent out after the SUSPEND task has been
|
|
issued, TWI traffic is now suspended. */
|
|
__IO uint32_t EVENTS_RXSTARTED; /*!< Receive sequence started */
|
|
__IO uint32_t EVENTS_TXSTARTED; /*!< Transmit sequence started */
|
|
__I uint32_t RESERVED6[2];
|
|
__IO uint32_t EVENTS_LASTRX; /*!< Byte boundary, starting to receive the last byte */
|
|
__IO uint32_t EVENTS_LASTTX; /*!< Byte boundary, starting to transmit the last byte */
|
|
__I uint32_t RESERVED7[39];
|
|
__IO uint32_t SHORTS; /*!< Shortcut register */
|
|
__I uint32_t RESERVED8[63];
|
|
__IO uint32_t INTEN; /*!< Enable or disable interrupt */
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED9[110];
|
|
__IO uint32_t ERRORSRC; /*!< Error source */
|
|
__I uint32_t RESERVED10[14];
|
|
__IO uint32_t ENABLE; /*!< Enable TWIM */
|
|
__I uint32_t RESERVED11;
|
|
TWIM_PSEL_Type PSEL; /*!< Unspecified */
|
|
__I uint32_t RESERVED12[5];
|
|
__IO uint32_t FREQUENCY; /*!< TWI frequency. Accuracy depends on the HFCLK source selected. */
|
|
__I uint32_t RESERVED13[3];
|
|
TWIM_RXD_Type RXD; /*!< RXD EasyDMA channel */
|
|
TWIM_TXD_Type TXD; /*!< TXD EasyDMA channel */
|
|
__I uint32_t RESERVED14[13];
|
|
__IO uint32_t ADDRESS; /*!< Address used in the TWI transfer */
|
|
} NRF_TWIM_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ TWIS ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief I2C compatible Two-Wire Slave Interface with EasyDMA 0 (TWIS)
|
|
*/
|
|
|
|
typedef struct { /*!< TWIS Structure */
|
|
__I uint32_t RESERVED0[5];
|
|
__O uint32_t TASKS_STOP; /*!< Stop TWI transaction */
|
|
__I uint32_t RESERVED1;
|
|
__O uint32_t TASKS_SUSPEND; /*!< Suspend TWI transaction */
|
|
__O uint32_t TASKS_RESUME; /*!< Resume TWI transaction */
|
|
__I uint32_t RESERVED2[3];
|
|
__O uint32_t TASKS_PREPARERX; /*!< Prepare the TWI slave to respond to a write command */
|
|
__O uint32_t TASKS_PREPARETX; /*!< Prepare the TWI slave to respond to a read command */
|
|
__I uint32_t RESERVED3[51];
|
|
__IO uint32_t EVENTS_STOPPED; /*!< TWI stopped */
|
|
__I uint32_t RESERVED4[7];
|
|
__IO uint32_t EVENTS_ERROR; /*!< TWI error */
|
|
__I uint32_t RESERVED5[9];
|
|
__IO uint32_t EVENTS_RXSTARTED; /*!< Receive sequence started */
|
|
__IO uint32_t EVENTS_TXSTARTED; /*!< Transmit sequence started */
|
|
__I uint32_t RESERVED6[4];
|
|
__IO uint32_t EVENTS_WRITE; /*!< Write command received */
|
|
__IO uint32_t EVENTS_READ; /*!< Read command received */
|
|
__I uint32_t RESERVED7[37];
|
|
__IO uint32_t SHORTS; /*!< Shortcut register */
|
|
__I uint32_t RESERVED8[63];
|
|
__IO uint32_t INTEN; /*!< Enable or disable interrupt */
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED9[113];
|
|
__IO uint32_t ERRORSRC; /*!< Error source */
|
|
__I uint32_t MATCH; /*!< Status register indicating which address had a match */
|
|
__I uint32_t RESERVED10[10];
|
|
__IO uint32_t ENABLE; /*!< Enable TWIS */
|
|
__I uint32_t RESERVED11;
|
|
TWIS_PSEL_Type PSEL; /*!< Unspecified */
|
|
__I uint32_t RESERVED12[9];
|
|
TWIS_RXD_Type RXD; /*!< RXD EasyDMA channel */
|
|
__I uint32_t RESERVED13;
|
|
TWIS_TXD_Type TXD; /*!< TXD EasyDMA channel */
|
|
__I uint32_t RESERVED14[14];
|
|
__IO uint32_t ADDRESS[2]; /*!< Description collection[0]: TWI slave address 0 */
|
|
__I uint32_t RESERVED15;
|
|
__IO uint32_t CONFIG; /*!< Configuration register for the address match mechanism */
|
|
__I uint32_t RESERVED16[10];
|
|
__IO uint32_t ORC; /*!< Over-read character. Character sent out in case of an over-read
|
|
of the transmit buffer. */
|
|
} NRF_TWIS_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ SPI ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Serial Peripheral Interface 0 (SPI)
|
|
*/
|
|
|
|
typedef struct { /*!< SPI Structure */
|
|
__I uint32_t RESERVED0[66];
|
|
__IO uint32_t EVENTS_READY; /*!< TXD byte sent and RXD byte received */
|
|
__I uint32_t RESERVED1[126];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED2[125];
|
|
__IO uint32_t ENABLE; /*!< Enable SPI */
|
|
__I uint32_t RESERVED3;
|
|
SPI_PSEL_Type PSEL; /*!< Unspecified */
|
|
__I uint32_t RESERVED4;
|
|
__I uint32_t RXD; /*!< RXD register */
|
|
__IO uint32_t TXD; /*!< TXD register */
|
|
__I uint32_t RESERVED5;
|
|
__IO uint32_t FREQUENCY; /*!< SPI frequency. Accuracy depends on the HFCLK source selected. */
|
|
__I uint32_t RESERVED6[11];
|
|
__IO uint32_t CONFIG; /*!< Configuration register */
|
|
} NRF_SPI_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ TWI ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief I2C compatible Two-Wire Interface 0 (TWI)
|
|
*/
|
|
|
|
typedef struct { /*!< TWI Structure */
|
|
__O uint32_t TASKS_STARTRX; /*!< Start TWI receive sequence */
|
|
__I uint32_t RESERVED0;
|
|
__O uint32_t TASKS_STARTTX; /*!< Start TWI transmit sequence */
|
|
__I uint32_t RESERVED1[2];
|
|
__O uint32_t TASKS_STOP; /*!< Stop TWI transaction */
|
|
__I uint32_t RESERVED2;
|
|
__O uint32_t TASKS_SUSPEND; /*!< Suspend TWI transaction */
|
|
__O uint32_t TASKS_RESUME; /*!< Resume TWI transaction */
|
|
__I uint32_t RESERVED3[56];
|
|
__IO uint32_t EVENTS_STOPPED; /*!< TWI stopped */
|
|
__IO uint32_t EVENTS_RXDREADY; /*!< TWI RXD byte received */
|
|
__I uint32_t RESERVED4[4];
|
|
__IO uint32_t EVENTS_TXDSENT; /*!< TWI TXD byte sent */
|
|
__I uint32_t RESERVED5;
|
|
__IO uint32_t EVENTS_ERROR; /*!< TWI error */
|
|
__I uint32_t RESERVED6[4];
|
|
__IO uint32_t EVENTS_BB; /*!< TWI byte boundary, generated before each byte that is sent or
|
|
received */
|
|
__I uint32_t RESERVED7[3];
|
|
__IO uint32_t EVENTS_SUSPENDED; /*!< TWI entered the suspended state */
|
|
__I uint32_t RESERVED8[45];
|
|
__IO uint32_t SHORTS; /*!< Shortcut register */
|
|
__I uint32_t RESERVED9[64];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED10[110];
|
|
__IO uint32_t ERRORSRC; /*!< Error source */
|
|
__I uint32_t RESERVED11[14];
|
|
__IO uint32_t ENABLE; /*!< Enable TWI */
|
|
__I uint32_t RESERVED12;
|
|
TWI_PSEL_Type PSEL; /*!< Unspecified */
|
|
__I uint32_t RESERVED13[2];
|
|
__I uint32_t RXD; /*!< RXD register */
|
|
__IO uint32_t TXD; /*!< TXD register */
|
|
__I uint32_t RESERVED14;
|
|
__IO uint32_t FREQUENCY; /*!< TWI frequency. Accuracy depends on the HFCLK source selected. */
|
|
__I uint32_t RESERVED15[24];
|
|
__IO uint32_t ADDRESS; /*!< Address used in the TWI transfer */
|
|
} NRF_TWI_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ NFCT ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief NFC-A compatible radio (NFCT)
|
|
*/
|
|
|
|
typedef struct { /*!< NFCT Structure */
|
|
__O uint32_t TASKS_ACTIVATE; /*!< Activate NFCT peripheral for incoming and outgoing frames, change
|
|
state to activated */
|
|
__O uint32_t TASKS_DISABLE; /*!< Disable NFCT peripheral */
|
|
__O uint32_t TASKS_SENSE; /*!< Enable NFC sense field mode, change state to sense mode */
|
|
__O uint32_t TASKS_STARTTX; /*!< Start transmission of an outgoing frame, change state to transmit */
|
|
__I uint32_t RESERVED0[3];
|
|
__O uint32_t TASKS_ENABLERXDATA; /*!< Initializes the EasyDMA for receive. */
|
|
__I uint32_t RESERVED1;
|
|
__O uint32_t TASKS_GOIDLE; /*!< Force state machine to IDLE state */
|
|
__O uint32_t TASKS_GOSLEEP; /*!< Force state machine to SLEEP_A state */
|
|
__I uint32_t RESERVED2[53];
|
|
__IO uint32_t EVENTS_READY; /*!< The NFCT peripheral is ready to receive and send frames */
|
|
__IO uint32_t EVENTS_FIELDDETECTED; /*!< Remote NFC field detected */
|
|
__IO uint32_t EVENTS_FIELDLOST; /*!< Remote NFC field lost */
|
|
__IO uint32_t EVENTS_TXFRAMESTART; /*!< Marks the start of the first symbol of a transmitted frame */
|
|
__IO uint32_t EVENTS_TXFRAMEEND; /*!< Marks the end of the last transmitted on-air symbol of a frame */
|
|
__IO uint32_t EVENTS_RXFRAMESTART; /*!< Marks the end of the first symbol of a received frame */
|
|
__IO uint32_t EVENTS_RXFRAMEEND; /*!< Received data has been checked (CRC, parity) and transferred
|
|
to RAM, and EasyDMA has ended accessing the RX buffer */
|
|
__IO uint32_t EVENTS_ERROR; /*!< NFC error reported. The ERRORSTATUS register contains details
|
|
on the source of the error. */
|
|
__I uint32_t RESERVED3[2];
|
|
__IO uint32_t EVENTS_RXERROR; /*!< NFC RX frame error reported. The FRAMESTATUS.RX register contains
|
|
details on the source of the error. */
|
|
__IO uint32_t EVENTS_ENDRX; /*!< RX buffer (as defined by PACKETPTR and MAXLEN) in Data RAM full. */
|
|
__IO uint32_t EVENTS_ENDTX; /*!< Transmission of data in RAM has ended, and EasyDMA has ended
|
|
accessing the TX buffer */
|
|
__I uint32_t RESERVED4;
|
|
__IO uint32_t EVENTS_AUTOCOLRESSTARTED; /*!< Auto collision resolution process has started */
|
|
__I uint32_t RESERVED5[3];
|
|
__IO uint32_t EVENTS_COLLISION; /*!< NFC auto collision resolution error reported. */
|
|
__IO uint32_t EVENTS_SELECTED; /*!< NFC auto collision resolution successfully completed */
|
|
__IO uint32_t EVENTS_STARTED; /*!< EasyDMA is ready to receive or send frames. */
|
|
__I uint32_t RESERVED6[43];
|
|
__IO uint32_t SHORTS; /*!< Shortcut register */
|
|
__I uint32_t RESERVED7[63];
|
|
__IO uint32_t INTEN; /*!< Enable or disable interrupt */
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED8[62];
|
|
__IO uint32_t ERRORSTATUS; /*!< NFC Error Status register */
|
|
__I uint32_t RESERVED9;
|
|
NFCT_FRAMESTATUS_Type FRAMESTATUS; /*!< Unspecified */
|
|
__I uint32_t NFCTAGSTATE; /*!< NfcTag state register */
|
|
__I uint32_t RESERVED10[10];
|
|
__I uint32_t FIELDPRESENT; /*!< Indicates the presence or not of a valid field */
|
|
__I uint32_t RESERVED11[49];
|
|
__IO uint32_t FRAMEDELAYMIN; /*!< Minimum frame delay */
|
|
__IO uint32_t FRAMEDELAYMAX; /*!< Maximum frame delay */
|
|
__IO uint32_t FRAMEDELAYMODE; /*!< Configuration register for the Frame Delay Timer */
|
|
__IO uint32_t PACKETPTR; /*!< Packet pointer for TXD and RXD data storage in Data RAM */
|
|
__IO uint32_t MAXLEN; /*!< Size of the RAM buffer allocated to TXD and RXD data storage
|
|
each */
|
|
NFCT_TXD_Type TXD; /*!< Unspecified */
|
|
NFCT_RXD_Type RXD; /*!< Unspecified */
|
|
__I uint32_t RESERVED12[26];
|
|
__IO uint32_t NFCID1_LAST; /*!< Last NFCID1 part (4, 7 or 10 bytes ID) */
|
|
__IO uint32_t NFCID1_2ND_LAST; /*!< Second last NFCID1 part (7 or 10 bytes ID) */
|
|
__IO uint32_t NFCID1_3RD_LAST; /*!< Third last NFCID1 part (10 bytes ID) */
|
|
__IO uint32_t AUTOCOLRESCONFIG; /*!< Controls the auto collision resolution function. This setting
|
|
must be done before the NFCT peripheral is enabled. */
|
|
__IO uint32_t SENSRES; /*!< NFC-A SENS_RES auto-response settings */
|
|
__IO uint32_t SELRES; /*!< NFC-A SEL_RES auto-response settings */
|
|
} NRF_NFCT_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ GPIOTE ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief GPIO Tasks and Events (GPIOTE)
|
|
*/
|
|
|
|
typedef struct { /*!< GPIOTE Structure */
|
|
__O uint32_t TASKS_OUT[8]; /*!< Description collection[0]: Task for writing to pin specified
|
|
in CONFIG[0].PSEL. Action on pin is configured in CONFIG[0].POLARITY. */
|
|
__I uint32_t RESERVED0[4];
|
|
__O uint32_t TASKS_SET[8]; /*!< Description collection[0]: Task for writing to pin specified
|
|
in CONFIG[0].PSEL. Action on pin is to set it high. */
|
|
__I uint32_t RESERVED1[4];
|
|
__O uint32_t TASKS_CLR[8]; /*!< Description collection[0]: Task for writing to pin specified
|
|
in CONFIG[0].PSEL. Action on pin is to set it low. */
|
|
__I uint32_t RESERVED2[32];
|
|
__IO uint32_t EVENTS_IN[8]; /*!< Description collection[0]: Event generated from pin specified
|
|
in CONFIG[0].PSEL */
|
|
__I uint32_t RESERVED3[23];
|
|
__IO uint32_t EVENTS_PORT; /*!< Event generated from multiple input GPIO pins with SENSE mechanism
|
|
enabled */
|
|
__I uint32_t RESERVED4[97];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED5[129];
|
|
__IO uint32_t CONFIG[8]; /*!< Description collection[0]: Configuration for OUT[n], SET[n]
|
|
and CLR[n] tasks and IN[n] event */
|
|
} NRF_GPIOTE_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ SAADC ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Analog to Digital Converter (SAADC)
|
|
*/
|
|
|
|
typedef struct { /*!< SAADC Structure */
|
|
__O uint32_t TASKS_START; /*!< Start the ADC and prepare the result buffer in RAM */
|
|
__O uint32_t TASKS_SAMPLE; /*!< Take one ADC sample, if scan is enabled all channels are sampled */
|
|
__O uint32_t TASKS_STOP; /*!< Stop the ADC and terminate any on-going conversion */
|
|
__O uint32_t TASKS_CALIBRATEOFFSET; /*!< Starts offset auto-calibration */
|
|
__I uint32_t RESERVED0[60];
|
|
__IO uint32_t EVENTS_STARTED; /*!< The ADC has started */
|
|
__IO uint32_t EVENTS_END; /*!< The ADC has filled up the Result buffer */
|
|
__IO uint32_t EVENTS_DONE; /*!< A conversion task has been completed. Depending on the mode,
|
|
multiple conversions might be needed for a result to be transferred
|
|
to RAM. */
|
|
__IO uint32_t EVENTS_RESULTDONE; /*!< A result is ready to get transferred to RAM. */
|
|
__IO uint32_t EVENTS_CALIBRATEDONE; /*!< Calibration is complete */
|
|
__IO uint32_t EVENTS_STOPPED; /*!< The ADC has stopped */
|
|
SAADC_EVENTS_CH_Type EVENTS_CH[8]; /*!< Unspecified */
|
|
__I uint32_t RESERVED1[106];
|
|
__IO uint32_t INTEN; /*!< Enable or disable interrupt */
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED2[61];
|
|
__I uint32_t STATUS; /*!< Status */
|
|
__I uint32_t RESERVED3[63];
|
|
__IO uint32_t ENABLE; /*!< Enable or disable ADC */
|
|
__I uint32_t RESERVED4[3];
|
|
SAADC_CH_Type CH[8]; /*!< Unspecified */
|
|
__I uint32_t RESERVED5[24];
|
|
__IO uint32_t RESOLUTION; /*!< Resolution configuration */
|
|
__IO uint32_t OVERSAMPLE; /*!< Oversampling configuration. OVERSAMPLE should not be combined
|
|
with SCAN. The RESOLUTION is applied before averaging, thus
|
|
for high OVERSAMPLE a higher RESOLUTION should be used. */
|
|
__IO uint32_t SAMPLERATE; /*!< Controls normal or continuous sample rate */
|
|
__I uint32_t RESERVED6[12];
|
|
SAADC_RESULT_Type RESULT; /*!< RESULT EasyDMA channel */
|
|
} NRF_SAADC_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ TIMER ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Timer/Counter 0 (TIMER)
|
|
*/
|
|
|
|
typedef struct { /*!< TIMER Structure */
|
|
__O uint32_t TASKS_START; /*!< Start Timer */
|
|
__O uint32_t TASKS_STOP; /*!< Stop Timer */
|
|
__O uint32_t TASKS_COUNT; /*!< Increment Timer (Counter mode only) */
|
|
__O uint32_t TASKS_CLEAR; /*!< Clear time */
|
|
__O uint32_t TASKS_SHUTDOWN; /*!< Deprecated register - Shut down timer */
|
|
__I uint32_t RESERVED0[11];
|
|
__O uint32_t TASKS_CAPTURE[6]; /*!< Description collection[0]: Capture Timer value to CC[0] register */
|
|
__I uint32_t RESERVED1[58];
|
|
__IO uint32_t EVENTS_COMPARE[6]; /*!< Description collection[0]: Compare event on CC[0] match */
|
|
__I uint32_t RESERVED2[42];
|
|
__IO uint32_t SHORTS; /*!< Shortcut register */
|
|
__I uint32_t RESERVED3[64];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED4[61];
|
|
__I uint32_t STATUS; /*!< Timer status */
|
|
__I uint32_t RESERVED5[64];
|
|
__IO uint32_t MODE; /*!< Timer mode selection */
|
|
__IO uint32_t BITMODE; /*!< Configure the number of bits used by the TIMER */
|
|
__I uint32_t RESERVED6;
|
|
__IO uint32_t PRESCALER; /*!< Timer prescaler register */
|
|
__I uint32_t RESERVED7[11];
|
|
__IO uint32_t CC[6]; /*!< Description collection[0]: Capture/Compare register 0 */
|
|
} NRF_TIMER_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ RTC ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Real time counter 0 (RTC)
|
|
*/
|
|
|
|
typedef struct { /*!< RTC Structure */
|
|
__O uint32_t TASKS_START; /*!< Start RTC COUNTER */
|
|
__O uint32_t TASKS_STOP; /*!< Stop RTC COUNTER */
|
|
__O uint32_t TASKS_CLEAR; /*!< Clear RTC COUNTER */
|
|
__O uint32_t TASKS_TRIGOVRFLW; /*!< Set COUNTER to 0xFFFFF0 */
|
|
__I uint32_t RESERVED0[60];
|
|
__IO uint32_t EVENTS_TICK; /*!< Event on COUNTER increment */
|
|
__IO uint32_t EVENTS_OVRFLW; /*!< Event on COUNTER overflow */
|
|
__I uint32_t RESERVED1[14];
|
|
__IO uint32_t EVENTS_COMPARE[4]; /*!< Description collection[0]: Compare event on CC[0] match */
|
|
__I uint32_t RESERVED2[109];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED3[13];
|
|
__IO uint32_t EVTEN; /*!< Enable or disable event routing */
|
|
__IO uint32_t EVTENSET; /*!< Enable event routing */
|
|
__IO uint32_t EVTENCLR; /*!< Disable event routing */
|
|
__I uint32_t RESERVED4[110];
|
|
__I uint32_t COUNTER; /*!< Current COUNTER value */
|
|
__IO uint32_t PRESCALER; /*!< 12 bit prescaler for COUNTER frequency (32768/(PRESCALER+1)).Must
|
|
be written when RTC is stopped */
|
|
__I uint32_t RESERVED5[13];
|
|
__IO uint32_t CC[4]; /*!< Description collection[0]: Compare register 0 */
|
|
} NRF_RTC_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ TEMP ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Temperature Sensor (TEMP)
|
|
*/
|
|
|
|
typedef struct { /*!< TEMP Structure */
|
|
__O uint32_t TASKS_START; /*!< Start temperature measurement */
|
|
__O uint32_t TASKS_STOP; /*!< Stop temperature measurement */
|
|
__I uint32_t RESERVED0[62];
|
|
__IO uint32_t EVENTS_DATARDY; /*!< Temperature measurement complete, data ready */
|
|
__I uint32_t RESERVED1[128];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED2[127];
|
|
__I int32_t TEMP; /*!< Temperature in degC (0.25deg steps) */
|
|
__I uint32_t RESERVED3[5];
|
|
__IO uint32_t A0; /*!< Slope of 1st piece wise linear function */
|
|
__IO uint32_t A1; /*!< Slope of 2nd piece wise linear function */
|
|
__IO uint32_t A2; /*!< Slope of 3rd piece wise linear function */
|
|
__IO uint32_t A3; /*!< Slope of 4th piece wise linear function */
|
|
__IO uint32_t A4; /*!< Slope of 5th piece wise linear function */
|
|
__IO uint32_t A5; /*!< Slope of 6th piece wise linear function */
|
|
__I uint32_t RESERVED4[2];
|
|
__IO uint32_t B0; /*!< y-intercept of 1st piece wise linear function */
|
|
__IO uint32_t B1; /*!< y-intercept of 2nd piece wise linear function */
|
|
__IO uint32_t B2; /*!< y-intercept of 3rd piece wise linear function */
|
|
__IO uint32_t B3; /*!< y-intercept of 4th piece wise linear function */
|
|
__IO uint32_t B4; /*!< y-intercept of 5th piece wise linear function */
|
|
__IO uint32_t B5; /*!< y-intercept of 6th piece wise linear function */
|
|
__I uint32_t RESERVED5[2];
|
|
__IO uint32_t T0; /*!< End point of 1st piece wise linear function */
|
|
__IO uint32_t T1; /*!< End point of 2nd piece wise linear function */
|
|
__IO uint32_t T2; /*!< End point of 3rd piece wise linear function */
|
|
__IO uint32_t T3; /*!< End point of 4th piece wise linear function */
|
|
__IO uint32_t T4; /*!< End point of 5th piece wise linear function */
|
|
} NRF_TEMP_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ RNG ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Random Number Generator (RNG)
|
|
*/
|
|
|
|
typedef struct { /*!< RNG Structure */
|
|
__O uint32_t TASKS_START; /*!< Task starting the random number generator */
|
|
__O uint32_t TASKS_STOP; /*!< Task stopping the random number generator */
|
|
__I uint32_t RESERVED0[62];
|
|
__IO uint32_t EVENTS_VALRDY; /*!< Event being generated for every new random number written to
|
|
the VALUE register */
|
|
__I uint32_t RESERVED1[63];
|
|
__IO uint32_t SHORTS; /*!< Shortcut register */
|
|
__I uint32_t RESERVED2[64];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED3[126];
|
|
__IO uint32_t CONFIG; /*!< Configuration register */
|
|
__I uint32_t VALUE; /*!< Output random number */
|
|
} NRF_RNG_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ ECB ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief AES ECB Mode Encryption (ECB)
|
|
*/
|
|
|
|
typedef struct { /*!< ECB Structure */
|
|
__O uint32_t TASKS_STARTECB; /*!< Start ECB block encrypt */
|
|
__O uint32_t TASKS_STOPECB; /*!< Abort a possible executing ECB operation */
|
|
__I uint32_t RESERVED0[62];
|
|
__IO uint32_t EVENTS_ENDECB; /*!< ECB block encrypt complete */
|
|
__IO uint32_t EVENTS_ERRORECB; /*!< ECB block encrypt aborted because of a STOPECB task or due to
|
|
an error */
|
|
__I uint32_t RESERVED1[127];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED2[126];
|
|
__IO uint32_t ECBDATAPTR; /*!< ECB block encrypt memory pointers */
|
|
} NRF_ECB_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ CCM ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief AES CCM Mode Encryption (CCM)
|
|
*/
|
|
|
|
typedef struct { /*!< CCM Structure */
|
|
__O uint32_t TASKS_KSGEN; /*!< Start generation of key-stream. This operation will stop by
|
|
itself when completed. */
|
|
__O uint32_t TASKS_CRYPT; /*!< Start encryption/decryption. This operation will stop by itself
|
|
when completed. */
|
|
__O uint32_t TASKS_STOP; /*!< Stop encryption/decryption */
|
|
__O uint32_t TASKS_RATEOVERRIDE; /*!< Override DATARATE setting in MODE register with the contents
|
|
of the RATEOVERRIDE register for any ongoing encryption/decryption */
|
|
__I uint32_t RESERVED0[60];
|
|
__IO uint32_t EVENTS_ENDKSGEN; /*!< Key-stream generation complete */
|
|
__IO uint32_t EVENTS_ENDCRYPT; /*!< Encrypt/decrypt complete */
|
|
__IO uint32_t EVENTS_ERROR; /*!< Deprecated register - CCM error event */
|
|
__I uint32_t RESERVED1[61];
|
|
__IO uint32_t SHORTS; /*!< Shortcut register */
|
|
__I uint32_t RESERVED2[64];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED3[61];
|
|
__I uint32_t MICSTATUS; /*!< MIC check result */
|
|
__I uint32_t RESERVED4[63];
|
|
__IO uint32_t ENABLE; /*!< Enable */
|
|
__IO uint32_t MODE; /*!< Operation mode */
|
|
__IO uint32_t CNFPTR; /*!< Pointer to data structure holding AES key and NONCE vector */
|
|
__IO uint32_t INPTR; /*!< Input pointer */
|
|
__IO uint32_t OUTPTR; /*!< Output pointer */
|
|
__IO uint32_t SCRATCHPTR; /*!< Pointer to data area used for temporary storage */
|
|
__IO uint32_t MAXPACKETSIZE; /*!< Length of key-stream generated when MODE.LENGTH = Extended. */
|
|
__IO uint32_t RATEOVERRIDE; /*!< Data rate override setting. */
|
|
} NRF_CCM_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ AAR ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Accelerated Address Resolver (AAR)
|
|
*/
|
|
|
|
typedef struct { /*!< AAR Structure */
|
|
__O uint32_t TASKS_START; /*!< Start resolving addresses based on IRKs specified in the IRK
|
|
data structure */
|
|
__I uint32_t RESERVED0;
|
|
__O uint32_t TASKS_STOP; /*!< Stop resolving addresses */
|
|
__I uint32_t RESERVED1[61];
|
|
__IO uint32_t EVENTS_END; /*!< Address resolution procedure complete */
|
|
__IO uint32_t EVENTS_RESOLVED; /*!< Address resolved */
|
|
__IO uint32_t EVENTS_NOTRESOLVED; /*!< Address not resolved */
|
|
__I uint32_t RESERVED2[126];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED3[61];
|
|
__I uint32_t STATUS; /*!< Resolution status */
|
|
__I uint32_t RESERVED4[63];
|
|
__IO uint32_t ENABLE; /*!< Enable AAR */
|
|
__IO uint32_t NIRK; /*!< Number of IRKs */
|
|
__IO uint32_t IRKPTR; /*!< Pointer to IRK data structure */
|
|
__I uint32_t RESERVED5;
|
|
__IO uint32_t ADDRPTR; /*!< Pointer to the resolvable address */
|
|
__IO uint32_t SCRATCHPTR; /*!< Pointer to data area used for temporary storage */
|
|
} NRF_AAR_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ WDT ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Watchdog Timer (WDT)
|
|
*/
|
|
|
|
typedef struct { /*!< WDT Structure */
|
|
__O uint32_t TASKS_START; /*!< Start the watchdog */
|
|
__I uint32_t RESERVED0[63];
|
|
__IO uint32_t EVENTS_TIMEOUT; /*!< Watchdog timeout */
|
|
__I uint32_t RESERVED1[128];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED2[61];
|
|
__I uint32_t RUNSTATUS; /*!< Run status */
|
|
__I uint32_t REQSTATUS; /*!< Request status */
|
|
__I uint32_t RESERVED3[63];
|
|
__IO uint32_t CRV; /*!< Counter reload value */
|
|
__IO uint32_t RREN; /*!< Enable register for reload request registers */
|
|
__IO uint32_t CONFIG; /*!< Configuration register */
|
|
__I uint32_t RESERVED4[60];
|
|
__O uint32_t RR[8]; /*!< Description collection[0]: Reload request 0 */
|
|
} NRF_WDT_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ QDEC ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Quadrature Decoder (QDEC)
|
|
*/
|
|
|
|
typedef struct { /*!< QDEC Structure */
|
|
__O uint32_t TASKS_START; /*!< Task starting the quadrature decoder */
|
|
__O uint32_t TASKS_STOP; /*!< Task stopping the quadrature decoder */
|
|
__O uint32_t TASKS_READCLRACC; /*!< Read and clear ACC and ACCDBL */
|
|
__O uint32_t TASKS_RDCLRACC; /*!< Read and clear ACC */
|
|
__O uint32_t TASKS_RDCLRDBL; /*!< Read and clear ACCDBL */
|
|
__I uint32_t RESERVED0[59];
|
|
__IO uint32_t EVENTS_SAMPLERDY; /*!< Event being generated for every new sample value written to
|
|
the SAMPLE register */
|
|
__IO uint32_t EVENTS_REPORTRDY; /*!< Non-null report ready */
|
|
__IO uint32_t EVENTS_ACCOF; /*!< ACC or ACCDBL register overflow */
|
|
__IO uint32_t EVENTS_DBLRDY; /*!< Double displacement(s) detected */
|
|
__IO uint32_t EVENTS_STOPPED; /*!< QDEC has been stopped */
|
|
__I uint32_t RESERVED1[59];
|
|
__IO uint32_t SHORTS; /*!< Shortcut register */
|
|
__I uint32_t RESERVED2[64];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED3[125];
|
|
__IO uint32_t ENABLE; /*!< Enable the quadrature decoder */
|
|
__IO uint32_t LEDPOL; /*!< LED output pin polarity */
|
|
__IO uint32_t SAMPLEPER; /*!< Sample period */
|
|
__I int32_t SAMPLE; /*!< Motion sample value */
|
|
__IO uint32_t REPORTPER; /*!< Number of samples to be taken before REPORTRDY and DBLRDY events
|
|
can be generated */
|
|
__I int32_t ACC; /*!< Register accumulating the valid transitions */
|
|
__I int32_t ACCREAD; /*!< Snapshot of the ACC register, updated by the READCLRACC or RDCLRACC
|
|
task */
|
|
QDEC_PSEL_Type PSEL; /*!< Unspecified */
|
|
__IO uint32_t DBFEN; /*!< Enable input debounce filters */
|
|
__I uint32_t RESERVED4[5];
|
|
__IO uint32_t LEDPRE; /*!< Time period the LED is switched ON prior to sampling */
|
|
__I uint32_t ACCDBL; /*!< Register accumulating the number of detected double transitions */
|
|
__I uint32_t ACCDBLREAD; /*!< Snapshot of the ACCDBL, updated by the READCLRACC or RDCLRDBL
|
|
task */
|
|
} NRF_QDEC_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ COMP ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Comparator (COMP)
|
|
*/
|
|
|
|
typedef struct { /*!< COMP Structure */
|
|
__O uint32_t TASKS_START; /*!< Start comparator */
|
|
__O uint32_t TASKS_STOP; /*!< Stop comparator */
|
|
__O uint32_t TASKS_SAMPLE; /*!< Sample comparator value */
|
|
__I uint32_t RESERVED0[61];
|
|
__IO uint32_t EVENTS_READY; /*!< COMP is ready and output is valid */
|
|
__IO uint32_t EVENTS_DOWN; /*!< Downward crossing */
|
|
__IO uint32_t EVENTS_UP; /*!< Upward crossing */
|
|
__IO uint32_t EVENTS_CROSS; /*!< Downward or upward crossing */
|
|
__I uint32_t RESERVED1[60];
|
|
__IO uint32_t SHORTS; /*!< Shortcut register */
|
|
__I uint32_t RESERVED2[63];
|
|
__IO uint32_t INTEN; /*!< Enable or disable interrupt */
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED3[61];
|
|
__I uint32_t RESULT; /*!< Compare result */
|
|
__I uint32_t RESERVED4[63];
|
|
__IO uint32_t ENABLE; /*!< COMP enable */
|
|
__IO uint32_t PSEL; /*!< Pin select */
|
|
__IO uint32_t REFSEL; /*!< Reference source select */
|
|
__IO uint32_t EXTREFSEL; /*!< External reference select */
|
|
__I uint32_t RESERVED5[8];
|
|
__IO uint32_t TH; /*!< Threshold configuration for hysteresis unit */
|
|
__IO uint32_t MODE; /*!< Mode configuration */
|
|
__IO uint32_t HYST; /*!< Comparator hysteresis enable */
|
|
__IO uint32_t ISOURCE; /*!< Current source select on analog input */
|
|
} NRF_COMP_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ LPCOMP ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Low Power Comparator (LPCOMP)
|
|
*/
|
|
|
|
typedef struct { /*!< LPCOMP Structure */
|
|
__O uint32_t TASKS_START; /*!< Start comparator */
|
|
__O uint32_t TASKS_STOP; /*!< Stop comparator */
|
|
__O uint32_t TASKS_SAMPLE; /*!< Sample comparator value */
|
|
__I uint32_t RESERVED0[61];
|
|
__IO uint32_t EVENTS_READY; /*!< LPCOMP is ready and output is valid */
|
|
__IO uint32_t EVENTS_DOWN; /*!< Downward crossing */
|
|
__IO uint32_t EVENTS_UP; /*!< Upward crossing */
|
|
__IO uint32_t EVENTS_CROSS; /*!< Downward or upward crossing */
|
|
__I uint32_t RESERVED1[60];
|
|
__IO uint32_t SHORTS; /*!< Shortcut register */
|
|
__I uint32_t RESERVED2[64];
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED3[61];
|
|
__I uint32_t RESULT; /*!< Compare result */
|
|
__I uint32_t RESERVED4[63];
|
|
__IO uint32_t ENABLE; /*!< Enable LPCOMP */
|
|
__IO uint32_t PSEL; /*!< Input pin select */
|
|
__IO uint32_t REFSEL; /*!< Reference select */
|
|
__IO uint32_t EXTREFSEL; /*!< External reference select */
|
|
__I uint32_t RESERVED5[4];
|
|
__IO uint32_t ANADETECT; /*!< Analog detect configuration */
|
|
__I uint32_t RESERVED6[5];
|
|
__IO uint32_t HYST; /*!< Comparator hysteresis enable */
|
|
} NRF_LPCOMP_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ SWI ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Software interrupt 0 (SWI)
|
|
*/
|
|
|
|
typedef struct { /*!< SWI Structure */
|
|
__I uint32_t UNUSED; /*!< Unused. */
|
|
} NRF_SWI_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ EGU ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Event Generator Unit 0 (EGU)
|
|
*/
|
|
|
|
typedef struct { /*!< EGU Structure */
|
|
__O uint32_t TASKS_TRIGGER[16]; /*!< Description collection[0]: Trigger 0 for triggering the corresponding
|
|
TRIGGERED[0] event */
|
|
__I uint32_t RESERVED0[48];
|
|
__IO uint32_t EVENTS_TRIGGERED[16]; /*!< Description collection[0]: Event number 0 generated by triggering
|
|
the corresponding TRIGGER[0] task */
|
|
__I uint32_t RESERVED1[112];
|
|
__IO uint32_t INTEN; /*!< Enable or disable interrupt */
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
} NRF_EGU_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ PWM ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Pulse Width Modulation Unit 0 (PWM)
|
|
*/
|
|
|
|
typedef struct { /*!< PWM Structure */
|
|
__I uint32_t RESERVED0;
|
|
__O uint32_t TASKS_STOP; /*!< Stops PWM pulse generation on all channels at the end of current
|
|
PWM period, and stops sequence playback */
|
|
__O uint32_t TASKS_SEQSTART[2]; /*!< Description collection[0]: Loads the first PWM value on all
|
|
enabled channels from sequence 0, and starts playing that sequence
|
|
at the rate defined in SEQ[0]REFRESH and/or DECODER.MODE. Causes
|
|
PWM generation to start it was not running. */
|
|
__O uint32_t TASKS_NEXTSTEP; /*!< Steps by one value in the current sequence on all enabled channels
|
|
if DECODER.MODE=NextStep. Does not cause PWM generation to start
|
|
it was not running. */
|
|
__I uint32_t RESERVED1[60];
|
|
__IO uint32_t EVENTS_STOPPED; /*!< Response to STOP task, emitted when PWM pulses are no longer
|
|
generated */
|
|
__IO uint32_t EVENTS_SEQSTARTED[2]; /*!< Description collection[0]: First PWM period started on sequence
|
|
0 */
|
|
__IO uint32_t EVENTS_SEQEND[2]; /*!< Description collection[0]: Emitted at end of every sequence
|
|
0, when last value from RAM has been applied to wave counter */
|
|
__IO uint32_t EVENTS_PWMPERIODEND; /*!< Emitted at the end of each PWM period */
|
|
__IO uint32_t EVENTS_LOOPSDONE; /*!< Concatenated sequences have been played the amount of times
|
|
defined in LOOP.CNT */
|
|
__I uint32_t RESERVED2[56];
|
|
__IO uint32_t SHORTS; /*!< Shortcut register */
|
|
__I uint32_t RESERVED3[63];
|
|
__IO uint32_t INTEN; /*!< Enable or disable interrupt */
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED4[125];
|
|
__IO uint32_t ENABLE; /*!< PWM module enable register */
|
|
__IO uint32_t MODE; /*!< Selects operating mode of the wave counter */
|
|
__IO uint32_t COUNTERTOP; /*!< Value up to which the pulse generator counter counts */
|
|
__IO uint32_t PRESCALER; /*!< Configuration for PWM_CLK */
|
|
__IO uint32_t DECODER; /*!< Configuration of the decoder */
|
|
__IO uint32_t LOOP; /*!< Amount of playback of a loop */
|
|
__I uint32_t RESERVED5[2];
|
|
PWM_SEQ_Type SEQ[2]; /*!< Unspecified */
|
|
PWM_PSEL_Type PSEL; /*!< Unspecified */
|
|
} NRF_PWM_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ PDM ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Pulse Density Modulation (Digital Microphone) Interface (PDM)
|
|
*/
|
|
|
|
typedef struct { /*!< PDM Structure */
|
|
__O uint32_t TASKS_START; /*!< Starts continuous PDM transfer */
|
|
__O uint32_t TASKS_STOP; /*!< Stops PDM transfer */
|
|
__I uint32_t RESERVED0[62];
|
|
__IO uint32_t EVENTS_STARTED; /*!< PDM transfer has started */
|
|
__IO uint32_t EVENTS_STOPPED; /*!< PDM transfer has finished */
|
|
__IO uint32_t EVENTS_END; /*!< The PDM has written the last sample specified by SAMPLE.MAXCNT
|
|
(or the last sample after a STOP task has been received) to
|
|
Data RAM */
|
|
__I uint32_t RESERVED1[125];
|
|
__IO uint32_t INTEN; /*!< Enable or disable interrupt */
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED2[125];
|
|
__IO uint32_t ENABLE; /*!< PDM module enable register */
|
|
__IO uint32_t PDMCLKCTRL; /*!< PDM clock generator control */
|
|
__IO uint32_t MODE; /*!< Defines the routing of the connected PDM microphones' signals */
|
|
__I uint32_t RESERVED3[3];
|
|
__IO uint32_t GAINL; /*!< Left output gain adjustment */
|
|
__IO uint32_t GAINR; /*!< Right output gain adjustment */
|
|
__IO uint32_t RATIO; /*!< Selects the ratio between PDM_CLK and output sample rate. Change
|
|
PDMCLKCTRL accordingly. */
|
|
__I uint32_t RESERVED4[7];
|
|
PDM_PSEL_Type PSEL; /*!< Unspecified */
|
|
__I uint32_t RESERVED5[6];
|
|
PDM_SAMPLE_Type SAMPLE; /*!< Unspecified */
|
|
} NRF_PDM_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ NVMC ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Non Volatile Memory Controller (NVMC)
|
|
*/
|
|
|
|
typedef struct { /*!< NVMC Structure */
|
|
__I uint32_t RESERVED0[256];
|
|
__I uint32_t READY; /*!< Ready flag */
|
|
__I uint32_t RESERVED1[64];
|
|
__IO uint32_t CONFIG; /*!< Configuration register */
|
|
|
|
union {
|
|
__IO uint32_t ERASEPCR1; /*!< Deprecated register - Register for erasing a page in Code area.
|
|
Equivalent to ERASEPAGE. */
|
|
__IO uint32_t ERASEPAGE; /*!< Register for erasing a page in Code area */
|
|
};
|
|
__IO uint32_t ERASEALL; /*!< Register for erasing all non-volatile user memory */
|
|
__IO uint32_t ERASEPCR0; /*!< Deprecated register - Register for erasing a page in Code area.
|
|
Equivalent to ERASEPAGE. */
|
|
__IO uint32_t ERASEUICR; /*!< Register for erasing User Information Configuration Registers */
|
|
__I uint32_t RESERVED2[10];
|
|
__IO uint32_t ICACHECNF; /*!< I-Code cache configuration register. */
|
|
__I uint32_t RESERVED3;
|
|
__IO uint32_t IHIT; /*!< I-Code cache hit counter. */
|
|
__IO uint32_t IMISS; /*!< I-Code cache miss counter. */
|
|
} NRF_NVMC_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ ACL ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Access control lists (ACL)
|
|
*/
|
|
|
|
typedef struct { /*!< ACL Structure */
|
|
__I uint32_t RESERVED0[449];
|
|
__IO uint32_t DISABLEINDEBUG; /*!< Disable all ACL protection mechanisms for regions while in debug
|
|
mode */
|
|
__I uint32_t RESERVED1[62];
|
|
ACL_ACL_Type ACL[8]; /*!< Unspecified */
|
|
} NRF_ACL_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ PPI ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Programmable Peripheral Interconnect (PPI)
|
|
*/
|
|
|
|
typedef struct { /*!< PPI Structure */
|
|
PPI_TASKS_CHG_Type TASKS_CHG[6]; /*!< Channel group tasks */
|
|
__I uint32_t RESERVED0[308];
|
|
__IO uint32_t CHEN; /*!< Channel enable register */
|
|
__IO uint32_t CHENSET; /*!< Channel enable set register */
|
|
__IO uint32_t CHENCLR; /*!< Channel enable clear register */
|
|
__I uint32_t RESERVED1;
|
|
PPI_CH_Type CH[20]; /*!< PPI Channel */
|
|
__I uint32_t RESERVED2[148];
|
|
__IO uint32_t CHG[6]; /*!< Description collection[0]: Channel group 0 */
|
|
__I uint32_t RESERVED3[62];
|
|
PPI_FORK_Type FORK[32]; /*!< Fork */
|
|
} NRF_PPI_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ MWU ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Memory Watch Unit (MWU)
|
|
*/
|
|
|
|
typedef struct { /*!< MWU Structure */
|
|
__I uint32_t RESERVED0[64];
|
|
MWU_EVENTS_REGION_Type EVENTS_REGION[4]; /*!< Unspecified */
|
|
__I uint32_t RESERVED1[16];
|
|
MWU_EVENTS_PREGION_Type EVENTS_PREGION[2]; /*!< Unspecified */
|
|
__I uint32_t RESERVED2[100];
|
|
__IO uint32_t INTEN; /*!< Enable or disable interrupt */
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED3[5];
|
|
__IO uint32_t NMIEN; /*!< Enable or disable non-maskable interrupt */
|
|
__IO uint32_t NMIENSET; /*!< Enable non-maskable interrupt */
|
|
__IO uint32_t NMIENCLR; /*!< Disable non-maskable interrupt */
|
|
__I uint32_t RESERVED4[53];
|
|
MWU_PERREGION_Type PERREGION[2]; /*!< Unspecified */
|
|
__I uint32_t RESERVED5[64];
|
|
__IO uint32_t REGIONEN; /*!< Enable/disable regions watch */
|
|
__IO uint32_t REGIONENSET; /*!< Enable regions watch */
|
|
__IO uint32_t REGIONENCLR; /*!< Disable regions watch */
|
|
__I uint32_t RESERVED6[57];
|
|
MWU_REGION_Type REGION[4]; /*!< Unspecified */
|
|
__I uint32_t RESERVED7[32];
|
|
MWU_PREGION_Type PREGION[2]; /*!< Unspecified */
|
|
} NRF_MWU_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ I2S ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Inter-IC Sound (I2S)
|
|
*/
|
|
|
|
typedef struct { /*!< I2S Structure */
|
|
__O uint32_t TASKS_START; /*!< Starts continuous I2S transfer. Also starts MCK generator when
|
|
this is enabled. */
|
|
__O uint32_t TASKS_STOP; /*!< Stops I2S transfer. Also stops MCK generator. Triggering this
|
|
task will cause the {event:STOPPED} event to be generated. */
|
|
__I uint32_t RESERVED0[63];
|
|
__IO uint32_t EVENTS_RXPTRUPD; /*!< The RXD.PTR register has been copied to internal double-buffers.
|
|
When the I2S module is started and RX is enabled, this event
|
|
will be generated for every RXTXD.MAXCNT words that are received
|
|
on the SDIN pin. */
|
|
__IO uint32_t EVENTS_STOPPED; /*!< I2S transfer stopped. */
|
|
__I uint32_t RESERVED1[2];
|
|
__IO uint32_t EVENTS_TXPTRUPD; /*!< The TDX.PTR register has been copied to internal double-buffers.
|
|
When the I2S module is started and TX is enabled, this event
|
|
will be generated for every RXTXD.MAXCNT words that are sent
|
|
on the SDOUT pin. */
|
|
__I uint32_t RESERVED2[122];
|
|
__IO uint32_t INTEN; /*!< Enable or disable interrupt */
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED3[125];
|
|
__IO uint32_t ENABLE; /*!< Enable I2S module. */
|
|
I2S_CONFIG_Type CONFIG; /*!< Unspecified */
|
|
__I uint32_t RESERVED4[3];
|
|
I2S_RXD_Type RXD; /*!< Unspecified */
|
|
__I uint32_t RESERVED5;
|
|
I2S_TXD_Type TXD; /*!< Unspecified */
|
|
__I uint32_t RESERVED6[3];
|
|
I2S_RXTXD_Type RXTXD; /*!< Unspecified */
|
|
__I uint32_t RESERVED7[3];
|
|
I2S_PSEL_Type PSEL; /*!< Unspecified */
|
|
} NRF_I2S_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ FPU ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief FPU (FPU)
|
|
*/
|
|
|
|
typedef struct { /*!< FPU Structure */
|
|
__I uint32_t UNUSED; /*!< Unused. */
|
|
} NRF_FPU_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ USBD ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief Universal Serial Bus device (USBD)
|
|
*/
|
|
|
|
typedef struct { /*!< USBD Structure */
|
|
__I uint32_t RESERVED0;
|
|
__O uint32_t TASKS_STARTEPIN[8]; /*!< Description collection[0]: Captures the EPIN[0].PTR, EPIN[0].MAXCNT
|
|
and EPIN[0].CONFIG registers values, and enables endpoint IN
|
|
0 to respond to traffic from host */
|
|
__O uint32_t TASKS_STARTISOIN; /*!< Captures the ISOIN.PTR, ISOIN.MAXCNT and ISOIN.CONFIG registers
|
|
values, and enables sending data on iso endpoint */
|
|
__O uint32_t TASKS_STARTEPOUT[8]; /*!< Description collection[0]: Captures the EPOUT[0].PTR, EPOUT[0].MAXCNT
|
|
and EPOUT[0].CONFIG registers values, and enables endpoint 0
|
|
to respond to traffic from host */
|
|
__O uint32_t TASKS_STARTISOOUT; /*!< Captures the ISOOUT.PTR, ISOOUT.MAXCNT and ISOOUT.CONFIG registers
|
|
values, and enables receiving of data on iso endpoint */
|
|
__O uint32_t TASKS_EP0RCVOUT; /*!< Allows OUT data stage on control endpoint 0 */
|
|
__O uint32_t TASKS_EP0STATUS; /*!< Allows status stage on control endpoint 0 */
|
|
__O uint32_t TASKS_EP0STALL; /*!< STALLs data and status stage on control endpoint 0 */
|
|
__O uint32_t TASKS_DPDMDRIVE; /*!< Forces D+ and D-lines to the state defined in the DPDMVALUE
|
|
register */
|
|
__O uint32_t TASKS_DPDMNODRIVE; /*!< Stops forcing D+ and D- lines to any state (USB engine takes
|
|
control) */
|
|
__I uint32_t RESERVED1[40];
|
|
__IO uint32_t EVENTS_USBRESET; /*!< Signals that a USB reset condition has been detected on the
|
|
USB lines */
|
|
__IO uint32_t EVENTS_STARTED; /*!< Confirms that the EPIN[n].PTR, EPIN[n].MAXCNT, EPIN[n].CONFIG,
|
|
or EPOUT[n].PTR, EPOUT[n].MAXCNT and EPOUT[n].CONFIG registers
|
|
have been captured on all endpoints reported in the EPSTATUS
|
|
register */
|
|
__IO uint32_t EVENTS_ENDEPIN[8]; /*!< Description collection[0]: The whole EPIN[0] buffer has been
|
|
consumed. The RAM buffer can be accessed safely by software. */
|
|
__IO uint32_t EVENTS_EP0DATADONE; /*!< An acknowledged data transfer has taken place on the control
|
|
endpoint */
|
|
__IO uint32_t EVENTS_ENDISOIN; /*!< The whole ISOIN buffer has been consumed. The RAM buffer can
|
|
be accessed safely by software. */
|
|
__IO uint32_t EVENTS_ENDEPOUT[8]; /*!< Description collection[0]: The whole EPOUT[0] buffer has been
|
|
consumed. The RAM buffer can be accessed safely by software. */
|
|
__IO uint32_t EVENTS_ENDISOOUT; /*!< The whole ISOOUT buffer has been consumed. The RAM buffer can
|
|
be accessed safely by software. */
|
|
__IO uint32_t EVENTS_SOF; /*!< Signals that a SOF (start of frame) condition has been detected
|
|
on the USB lines */
|
|
__IO uint32_t EVENTS_USBEVENT; /*!< An event or an error not covered by specific events has occurred,
|
|
check EVENTCAUSE register to find the cause */
|
|
__IO uint32_t EVENTS_EP0SETUP; /*!< A valid SETUP token has been received (and acknowledged) on
|
|
the control endpoint */
|
|
__IO uint32_t EVENTS_EPDATA; /*!< A data transfer has occurred on a data endpoint, indicated by
|
|
the EPDATASTATUS register */
|
|
__IO uint32_t EVENTS_ACCESSFAULT; /*!< Access to an unavailable USB register has been attempted (software
|
|
or EasyDMA). This event can get fired even when USBD is not
|
|
ENABLEd. */
|
|
__I uint32_t RESERVED2[38];
|
|
__IO uint32_t SHORTS; /*!< Shortcut register */
|
|
__I uint32_t RESERVED3[63];
|
|
__IO uint32_t INTEN; /*!< Enable or disable interrupt */
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED4[61];
|
|
__IO uint32_t EVENTCAUSE; /*!< Details on event that caused the USBEVENT event */
|
|
__I uint32_t BUSSTATE; /*!< Provides the logic state of the D+ and D- lines */
|
|
__I uint32_t RESERVED5[6];
|
|
USBD_HALTED_Type HALTED; /*!< Unspecified */
|
|
__I uint32_t RESERVED6;
|
|
__IO uint32_t EPSTATUS; /*!< Provides information on which endpoint's EasyDMA registers have
|
|
been captured */
|
|
__IO uint32_t EPDATASTATUS; /*!< Provides information on which endpoint(s) an acknowledged data
|
|
transfer has occurred (EPDATA event) */
|
|
__I uint32_t USBADDR; /*!< Device USB address */
|
|
__I uint32_t RESERVED7[3];
|
|
__I uint32_t BMREQUESTTYPE; /*!< SETUP data, byte 0, bmRequestType */
|
|
__I uint32_t BREQUEST; /*!< SETUP data, byte 1, bRequest */
|
|
__I uint32_t WVALUEL; /*!< SETUP data, byte 2, LSB of wValue */
|
|
__I uint32_t WVALUEH; /*!< SETUP data, byte 3, MSB of wValue */
|
|
__I uint32_t WINDEXL; /*!< SETUP data, byte 4, LSB of wIndex */
|
|
__I uint32_t WINDEXH; /*!< SETUP data, byte 5, MSB of wIndex */
|
|
__I uint32_t WLENGTHL; /*!< SETUP data, byte 6, LSB of wLength */
|
|
__I uint32_t WLENGTHH; /*!< SETUP data, byte 7, MSB of wLength */
|
|
USBD_SIZE_Type SIZE; /*!< Unspecified */
|
|
__I uint32_t RESERVED8[15];
|
|
__IO uint32_t ENABLE; /*!< Enable USB */
|
|
__IO uint32_t USBPULLUP; /*!< Control of the USB pull-up */
|
|
__IO uint32_t DPDMVALUE; /*!< State at which the DPDMDRIVE task will force D+ and D-. The
|
|
DPDMNODRIVE task reverts the control of the lines to MAC IP
|
|
(no forcing). */
|
|
__IO uint32_t DTOGGLE; /*!< Data toggle control and status. */
|
|
__IO uint32_t EPINEN; /*!< Endpoint IN enable */
|
|
__IO uint32_t EPOUTEN; /*!< Endpoint OUT enable */
|
|
__O uint32_t EPSTALL; /*!< STALL endpoints */
|
|
__IO uint32_t ISOSPLIT; /*!< Controls the split of ISO buffers */
|
|
__I uint32_t FRAMECNTR; /*!< Returns the current value of the start of frame counter */
|
|
__I uint32_t RESERVED9[3];
|
|
__IO uint32_t ISOINCONFIG; /*!< Controls the response of the ISO IN endpoint to an IN token
|
|
when no data is ready to be sent */
|
|
__I uint32_t RESERVED10[51];
|
|
USBD_EPIN_Type EPIN[8]; /*!< Unspecified */
|
|
USBD_ISOIN_Type ISOIN; /*!< Unspecified */
|
|
__I uint32_t RESERVED11[21];
|
|
USBD_EPOUT_Type EPOUT[8]; /*!< Unspecified */
|
|
USBD_ISOOUT_Type ISOOUT; /*!< Unspecified */
|
|
} NRF_USBD_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ QSPI ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief External flash interface (QSPI)
|
|
*/
|
|
|
|
typedef struct { /*!< QSPI Structure */
|
|
__O uint32_t TASKS_ACTIVATE; /*!< Activate QSPI interface */
|
|
__O uint32_t TASKS_READSTART; /*!< Start transfer from external flash memory to internal RAM */
|
|
__O uint32_t TASKS_WRITESTART; /*!< Start transfer from internal RAM to external flash memory */
|
|
__O uint32_t TASKS_ERASESTART; /*!< Start external flash memory erase operation */
|
|
__I uint32_t RESERVED0[60];
|
|
__IO uint32_t EVENTS_READY; /*!< QSPI peripheral is ready. This event will be generated as a
|
|
response to any QSPI task. */
|
|
__I uint32_t RESERVED1[127];
|
|
__IO uint32_t INTEN; /*!< Enable or disable interrupt */
|
|
__IO uint32_t INTENSET; /*!< Enable interrupt */
|
|
__IO uint32_t INTENCLR; /*!< Disable interrupt */
|
|
__I uint32_t RESERVED2[125];
|
|
__IO uint32_t ENABLE; /*!< Enable QSPI peripheral and acquire the pins selected in PSELn
|
|
registers */
|
|
QSPI_READ_Type READ; /*!< Unspecified */
|
|
QSPI_WRITE_Type WRITE; /*!< Unspecified */
|
|
QSPI_ERASE_Type ERASE; /*!< Unspecified */
|
|
QSPI_PSEL_Type PSEL; /*!< Unspecified */
|
|
__IO uint32_t XIPOFFSET; /*!< Address offset into the external memory for Execute in Place
|
|
operation. */
|
|
__IO uint32_t IFCONFIG0; /*!< Interface configuration. */
|
|
__I uint32_t RESERVED3[46];
|
|
__IO uint32_t IFCONFIG1; /*!< Interface configuration. */
|
|
__I uint32_t STATUS; /*!< Status register. */
|
|
__I uint32_t RESERVED4[3];
|
|
__IO uint32_t DPMDUR; /*!< Set the duration required to enter/exit deep power-down mode
|
|
(DPM). */
|
|
__I uint32_t RESERVED5[3];
|
|
__IO uint32_t ADDRCONF; /*!< Extended address configuration. */
|
|
__I uint32_t RESERVED6[3];
|
|
__IO uint32_t CINSTRCONF; /*!< Custom instruction configuration register. */
|
|
__IO uint32_t CINSTRDAT0; /*!< Custom instruction data register 0. */
|
|
__IO uint32_t CINSTRDAT1; /*!< Custom instruction data register 1. */
|
|
__IO uint32_t IFTIMING; /*!< SPI interface timing. */
|
|
} NRF_QSPI_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ GPIO ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief GPIO Port 1 (GPIO)
|
|
*/
|
|
|
|
typedef struct { /*!< GPIO Structure */
|
|
__I uint32_t RESERVED0[321];
|
|
__IO uint32_t OUT; /*!< Write GPIO port */
|
|
__IO uint32_t OUTSET; /*!< Set individual bits in GPIO port */
|
|
__IO uint32_t OUTCLR; /*!< Clear individual bits in GPIO port */
|
|
__I uint32_t IN; /*!< Read GPIO port */
|
|
__IO uint32_t DIR; /*!< Direction of GPIO pins */
|
|
__IO uint32_t DIRSET; /*!< DIR set register */
|
|
__IO uint32_t DIRCLR; /*!< DIR clear register */
|
|
__IO uint32_t LATCH; /*!< Latch register indicating what GPIO pins that have met the criteria
|
|
set in the PIN_CNF[n].SENSE registers */
|
|
__IO uint32_t DETECTMODE; /*!< Select between default DETECT signal behaviour and LDETECT mode */
|
|
__I uint32_t RESERVED1[118];
|
|
__IO uint32_t PIN_CNF[32]; /*!< Description collection[0]: Configuration of GPIO pins */
|
|
} NRF_GPIO_Type;
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ CRYPTOCELL ================ */
|
|
/* ================================================================================ */
|
|
|
|
|
|
/**
|
|
* @brief ARM CryptoCell register interface (CRYPTOCELL)
|
|
*/
|
|
|
|
typedef struct { /*!< CRYPTOCELL Structure */
|
|
__I uint32_t RESERVED0[320];
|
|
__IO uint32_t ENABLE; /*!< Control power and clock for ARM CryptoCell subsystem */
|
|
} NRF_CRYPTOCELL_Type;
|
|
|
|
|
|
/* -------------------- End of section using anonymous unions ------------------- */
|
|
#if defined(__CC_ARM)
|
|
#pragma pop
|
|
#elif defined(__ICCARM__)
|
|
/* leave anonymous unions enabled */
|
|
#elif defined(__GNUC__)
|
|
/* anonymous unions are enabled by default */
|
|
#elif defined(__TMS470__)
|
|
/* anonymous unions are enabled by default */
|
|
#elif defined(__TASKING__)
|
|
#pragma warning restore
|
|
#else
|
|
#warning Not supported compiler type
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ Peripheral memory map ================ */
|
|
/* ================================================================================ */
|
|
|
|
#define NRF_FICR_BASE 0x10000000UL
|
|
#define NRF_UICR_BASE 0x10001000UL
|
|
#define NRF_POWER_BASE 0x40000000UL
|
|
#define NRF_CLOCK_BASE 0x40000000UL
|
|
#define NRF_RADIO_BASE 0x40001000UL
|
|
#define NRF_UARTE0_BASE 0x40002000UL
|
|
#define NRF_UART0_BASE 0x40002000UL
|
|
#define NRF_SPIM0_BASE 0x40003000UL
|
|
#define NRF_SPIS0_BASE 0x40003000UL
|
|
#define NRF_TWIM0_BASE 0x40003000UL
|
|
#define NRF_TWIS0_BASE 0x40003000UL
|
|
#define NRF_SPI0_BASE 0x40003000UL
|
|
#define NRF_TWI0_BASE 0x40003000UL
|
|
#define NRF_SPIM1_BASE 0x40004000UL
|
|
#define NRF_SPIS1_BASE 0x40004000UL
|
|
#define NRF_TWIM1_BASE 0x40004000UL
|
|
#define NRF_TWIS1_BASE 0x40004000UL
|
|
#define NRF_SPI1_BASE 0x40004000UL
|
|
#define NRF_TWI1_BASE 0x40004000UL
|
|
#define NRF_NFCT_BASE 0x40005000UL
|
|
#define NRF_GPIOTE_BASE 0x40006000UL
|
|
#define NRF_SAADC_BASE 0x40007000UL
|
|
#define NRF_TIMER0_BASE 0x40008000UL
|
|
#define NRF_TIMER1_BASE 0x40009000UL
|
|
#define NRF_TIMER2_BASE 0x4000A000UL
|
|
#define NRF_RTC0_BASE 0x4000B000UL
|
|
#define NRF_TEMP_BASE 0x4000C000UL
|
|
#define NRF_RNG_BASE 0x4000D000UL
|
|
#define NRF_ECB_BASE 0x4000E000UL
|
|
#define NRF_CCM_BASE 0x4000F000UL
|
|
#define NRF_AAR_BASE 0x4000F000UL
|
|
#define NRF_WDT_BASE 0x40010000UL
|
|
#define NRF_RTC1_BASE 0x40011000UL
|
|
#define NRF_QDEC_BASE 0x40012000UL
|
|
#define NRF_COMP_BASE 0x40013000UL
|
|
#define NRF_LPCOMP_BASE 0x40013000UL
|
|
#define NRF_SWI0_BASE 0x40014000UL
|
|
#define NRF_EGU0_BASE 0x40014000UL
|
|
#define NRF_SWI1_BASE 0x40015000UL
|
|
#define NRF_EGU1_BASE 0x40015000UL
|
|
#define NRF_SWI2_BASE 0x40016000UL
|
|
#define NRF_EGU2_BASE 0x40016000UL
|
|
#define NRF_SWI3_BASE 0x40017000UL
|
|
#define NRF_EGU3_BASE 0x40017000UL
|
|
#define NRF_SWI4_BASE 0x40018000UL
|
|
#define NRF_EGU4_BASE 0x40018000UL
|
|
#define NRF_SWI5_BASE 0x40019000UL
|
|
#define NRF_EGU5_BASE 0x40019000UL
|
|
#define NRF_TIMER3_BASE 0x4001A000UL
|
|
#define NRF_TIMER4_BASE 0x4001B000UL
|
|
#define NRF_PWM0_BASE 0x4001C000UL
|
|
#define NRF_PDM_BASE 0x4001D000UL
|
|
#define NRF_NVMC_BASE 0x4001E000UL
|
|
#define NRF_ACL_BASE 0x4001E000UL
|
|
#define NRF_PPI_BASE 0x4001F000UL
|
|
#define NRF_MWU_BASE 0x40020000UL
|
|
#define NRF_PWM1_BASE 0x40021000UL
|
|
#define NRF_PWM2_BASE 0x40022000UL
|
|
#define NRF_SPIM2_BASE 0x40023000UL
|
|
#define NRF_SPIS2_BASE 0x40023000UL
|
|
#define NRF_SPI2_BASE 0x40023000UL
|
|
#define NRF_RTC2_BASE 0x40024000UL
|
|
#define NRF_I2S_BASE 0x40025000UL
|
|
#define NRF_FPU_BASE 0x40026000UL
|
|
#define NRF_USBD_BASE 0x40027000UL
|
|
#define NRF_UARTE1_BASE 0x40028000UL
|
|
#define NRF_QSPI_BASE 0x40029000UL
|
|
#define NRF_SPIM3_BASE 0x4002B000UL
|
|
#define NRF_PWM3_BASE 0x4002D000UL
|
|
#define NRF_P0_BASE 0x50000000UL
|
|
#define NRF_P1_BASE 0x50000300UL
|
|
#define NRF_CRYPTOCELL_BASE 0x5002A000UL
|
|
|
|
|
|
/* ================================================================================ */
|
|
/* ================ Peripheral declaration ================ */
|
|
/* ================================================================================ */
|
|
|
|
#define NRF_FICR ((NRF_FICR_Type *) NRF_FICR_BASE)
|
|
#define NRF_UICR ((NRF_UICR_Type *) NRF_UICR_BASE)
|
|
#define NRF_POWER ((NRF_POWER_Type *) NRF_POWER_BASE)
|
|
#define NRF_CLOCK ((NRF_CLOCK_Type *) NRF_CLOCK_BASE)
|
|
#define NRF_RADIO ((NRF_RADIO_Type *) NRF_RADIO_BASE)
|
|
#define NRF_UARTE0 ((NRF_UARTE_Type *) NRF_UARTE0_BASE)
|
|
#define NRF_UART0 ((NRF_UART_Type *) NRF_UART0_BASE)
|
|
#define NRF_SPIM0 ((NRF_SPIM_Type *) NRF_SPIM0_BASE)
|
|
#define NRF_SPIS0 ((NRF_SPIS_Type *) NRF_SPIS0_BASE)
|
|
#define NRF_TWIM0 ((NRF_TWIM_Type *) NRF_TWIM0_BASE)
|
|
#define NRF_TWIS0 ((NRF_TWIS_Type *) NRF_TWIS0_BASE)
|
|
#define NRF_SPI0 ((NRF_SPI_Type *) NRF_SPI0_BASE)
|
|
#define NRF_TWI0 ((NRF_TWI_Type *) NRF_TWI0_BASE)
|
|
#define NRF_SPIM1 ((NRF_SPIM_Type *) NRF_SPIM1_BASE)
|
|
#define NRF_SPIS1 ((NRF_SPIS_Type *) NRF_SPIS1_BASE)
|
|
#define NRF_TWIM1 ((NRF_TWIM_Type *) NRF_TWIM1_BASE)
|
|
#define NRF_TWIS1 ((NRF_TWIS_Type *) NRF_TWIS1_BASE)
|
|
#define NRF_SPI1 ((NRF_SPI_Type *) NRF_SPI1_BASE)
|
|
#define NRF_TWI1 ((NRF_TWI_Type *) NRF_TWI1_BASE)
|
|
#define NRF_NFCT ((NRF_NFCT_Type *) NRF_NFCT_BASE)
|
|
#define NRF_GPIOTE ((NRF_GPIOTE_Type *) NRF_GPIOTE_BASE)
|
|
#define NRF_SAADC ((NRF_SAADC_Type *) NRF_SAADC_BASE)
|
|
#define NRF_TIMER0 ((NRF_TIMER_Type *) NRF_TIMER0_BASE)
|
|
#define NRF_TIMER1 ((NRF_TIMER_Type *) NRF_TIMER1_BASE)
|
|
#define NRF_TIMER2 ((NRF_TIMER_Type *) NRF_TIMER2_BASE)
|
|
#define NRF_RTC0 ((NRF_RTC_Type *) NRF_RTC0_BASE)
|
|
#define NRF_TEMP ((NRF_TEMP_Type *) NRF_TEMP_BASE)
|
|
#define NRF_RNG ((NRF_RNG_Type *) NRF_RNG_BASE)
|
|
#define NRF_ECB ((NRF_ECB_Type *) NRF_ECB_BASE)
|
|
#define NRF_CCM ((NRF_CCM_Type *) NRF_CCM_BASE)
|
|
#define NRF_AAR ((NRF_AAR_Type *) NRF_AAR_BASE)
|
|
#define NRF_WDT ((NRF_WDT_Type *) NRF_WDT_BASE)
|
|
#define NRF_RTC1 ((NRF_RTC_Type *) NRF_RTC1_BASE)
|
|
#define NRF_QDEC ((NRF_QDEC_Type *) NRF_QDEC_BASE)
|
|
#define NRF_COMP ((NRF_COMP_Type *) NRF_COMP_BASE)
|
|
#define NRF_LPCOMP ((NRF_LPCOMP_Type *) NRF_LPCOMP_BASE)
|
|
#define NRF_SWI0 ((NRF_SWI_Type *) NRF_SWI0_BASE)
|
|
#define NRF_EGU0 ((NRF_EGU_Type *) NRF_EGU0_BASE)
|
|
#define NRF_SWI1 ((NRF_SWI_Type *) NRF_SWI1_BASE)
|
|
#define NRF_EGU1 ((NRF_EGU_Type *) NRF_EGU1_BASE)
|
|
#define NRF_SWI2 ((NRF_SWI_Type *) NRF_SWI2_BASE)
|
|
#define NRF_EGU2 ((NRF_EGU_Type *) NRF_EGU2_BASE)
|
|
#define NRF_SWI3 ((NRF_SWI_Type *) NRF_SWI3_BASE)
|
|
#define NRF_EGU3 ((NRF_EGU_Type *) NRF_EGU3_BASE)
|
|
#define NRF_SWI4 ((NRF_SWI_Type *) NRF_SWI4_BASE)
|
|
#define NRF_EGU4 ((NRF_EGU_Type *) NRF_EGU4_BASE)
|
|
#define NRF_SWI5 ((NRF_SWI_Type *) NRF_SWI5_BASE)
|
|
#define NRF_EGU5 ((NRF_EGU_Type *) NRF_EGU5_BASE)
|
|
#define NRF_TIMER3 ((NRF_TIMER_Type *) NRF_TIMER3_BASE)
|
|
#define NRF_TIMER4 ((NRF_TIMER_Type *) NRF_TIMER4_BASE)
|
|
#define NRF_PWM0 ((NRF_PWM_Type *) NRF_PWM0_BASE)
|
|
#define NRF_PDM ((NRF_PDM_Type *) NRF_PDM_BASE)
|
|
#define NRF_NVMC ((NRF_NVMC_Type *) NRF_NVMC_BASE)
|
|
#define NRF_ACL ((NRF_ACL_Type *) NRF_ACL_BASE)
|
|
#define NRF_PPI ((NRF_PPI_Type *) NRF_PPI_BASE)
|
|
#define NRF_MWU ((NRF_MWU_Type *) NRF_MWU_BASE)
|
|
#define NRF_PWM1 ((NRF_PWM_Type *) NRF_PWM1_BASE)
|
|
#define NRF_PWM2 ((NRF_PWM_Type *) NRF_PWM2_BASE)
|
|
#define NRF_SPIM2 ((NRF_SPIM_Type *) NRF_SPIM2_BASE)
|
|
#define NRF_SPIS2 ((NRF_SPIS_Type *) NRF_SPIS2_BASE)
|
|
#define NRF_SPI2 ((NRF_SPI_Type *) NRF_SPI2_BASE)
|
|
#define NRF_RTC2 ((NRF_RTC_Type *) NRF_RTC2_BASE)
|
|
#define NRF_I2S ((NRF_I2S_Type *) NRF_I2S_BASE)
|
|
#define NRF_FPU ((NRF_FPU_Type *) NRF_FPU_BASE)
|
|
#define NRF_USBD ((NRF_USBD_Type *) NRF_USBD_BASE)
|
|
#define NRF_UARTE1 ((NRF_UARTE_Type *) NRF_UARTE1_BASE)
|
|
#define NRF_QSPI ((NRF_QSPI_Type *) NRF_QSPI_BASE)
|
|
#define NRF_SPIM3 ((NRF_SPIM_Type *) NRF_SPIM3_BASE)
|
|
#define NRF_PWM3 ((NRF_PWM_Type *) NRF_PWM3_BASE)
|
|
#define NRF_P0 ((NRF_GPIO_Type *) NRF_P0_BASE)
|
|
#define NRF_P1 ((NRF_GPIO_Type *) NRF_P1_BASE)
|
|
#define NRF_CRYPTOCELL ((NRF_CRYPTOCELL_Type *) NRF_CRYPTOCELL_BASE)
|
|
|
|
|
|
/** @} */ /* End of group Device_Peripheral_Registers */
|
|
/** @} */ /* End of group nrf52840 */
|
|
/** @} */ /* End of group Nordic Semiconductor */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
|
|
#endif /* nrf52840_H */
|
|
|