Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Commit

Permalink
Merge pull request #97 from NordicSemiconductor/update-nrf52833
Browse files Browse the repository at this point in the history
Update device list
  • Loading branch information
chunfantasy authored Oct 14, 2019
2 parents d1e324c + 3a10a95 commit 9946d53
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 6 deletions.
35 changes: 29 additions & 6 deletions doc/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,23 +135,46 @@
*
* @property {integer} deviceType
* Type of device. Value will be equal to one of the following predefined constants:<br/>
*
* <tt>nrfjprogjs.NRF51xxx_xxAA_REV1</tt><br/>
* <tt>nrfjprogjs.NRF51xxx_xxAA_REV2</tt><br/>
* <tt>nrfjprogjs.NRF51xxx_xxAA_REV3</tt><br/>
* <tt>nrfjprogjs.NRF51xxx_xxAB_REV3</tt><br/>
* <tt>nrfjprogjs.NRF51xxx_xxAC_REV3</tt><br/>
* <tt>nrfjprogjs.NRF51802_xxAA_REV3</tt><br/>
* <tt>nrfjprogjs.NRF51801_xxAB_REV3</tt><br/>
*
* <tt>nrfjprogjs.NRF52805_xxAA_REV1</tt><br/>
* <tt>nrfjprogjs.NRF52805_xxAA_FUTURE</tt><br/>
*
* <tt>nrfjprogjs.NRF52810_xxAA_REV1</tt><br/>
* <tt>nrfjprogjs.NRF52810_xxAA_REV2<<</tt><br/>
* <tt>nrfjprogjs.NRF52810_xxAA_FUTURE</tt><br/>
*
* <tt>nrfjprogjs.NRF52811_xxAA_REV1</tt><br/>
* <tt>nrfjprogjs.NRF52811_xxAA_FUTURE</tt><br/>
*
* <tt>nrfjprogjs.NRF52832_xxAA_ENGA</tt><br/>
* <tt>nrfjprogjs.NRF52832_xxAA_ENGB</tt><br/>
* <tt>nrfjprogjs.NRF52832_xxAA_REV1</tt><br/>
* <tt>nrfjprogjs.NRF52840_xxAA_ENGA</tt><br/>
* <tt>nrfjprogjs.NRF52832_xxAA_REV2</tt><br/>
* <tt>nrfjprogjs.NRF52832_xxAA_FUTURE</tt><br/>
* <tt>nrfjprogjs.NRF52840_xxAA_FUTURE</tt><br/>
* <tt>nrfjprogjs.NRF52810_xxAA_REV1</tt><br/>
* <tt>nrfjprogjs.NRF52810_xxAA_FUTURE</tt><br/>
*
* <tt>nrfjprogjs.NRF52832_xxAB_REV1</tt><br/>
* <tt>nrfjprogjs.NRF52832_xxAB_REV2</tt><br/>
* <tt>nrfjprogjs.NRF52832_xxAB_FUTURE</tt><br/>
* <tt>nrfjprogjs.NRF51801_xxAB_REV3</tt><br/>
*
* <tt>nrfjprogjs.NRF52833_xxAA_REV1</tt><br/>
* <tt>nrfjprogjs.NRF52833_xxAA_FUTURE</tt><br/>
*
* <tt>nrfjprogjs.NRF52840_xxAA_ENGA</tt><br/>
* <tt>nrfjprogjs.NRF52840_xxAA_ENGB</tt><br/>
* <tt>nrfjprogjs.NRF52840_xxAA_REV1</tt><br/>
* <tt>nrfjprogjs.NRF52840_xxAA_REV2</tt><br/>
* <tt>nrfjprogjs.NRF52840_xxAA_FUTURE</tt><br/>
*
* <tt>nrfjprogjs.NRF9160_xxAA_REV1</tt><br/>
* <tt>nrfjprogjs.NRF9160_xxAA_FUTURE</tt><br/>
*
* @property {integer} codeAddress Memory address for the start of the non-volatile (flash) memory block.
* Typically <tt>0x0000 0000</tt>.
Expand Down Expand Up @@ -490,7 +513,7 @@ export function programDFU(serialNumber, filename, progressCallback, callback) {
* It shall expect one parameter: ({@link module:pc-nrfjprog-js~Error|Error}).
*/
export function programMcuBootDFU(serialNumber, filename, uart, timeout, progressCallback, callback) {}


/**
* Async function to read memory from the device and write the results into a file.
Expand Down
19 changes: 19 additions & 0 deletions src/highlevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,18 +497,29 @@ void HighLevel::init(v8::Local<v8::FunctionTemplate> target)

void HighLevel::initConsts(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE target)
{
// nRF51 versions
NODE_DEFINE_CONSTANT(target, NRF51xxx_xxAA_REV1); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF51xxx_xxAA_REV2); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF51xxx_xxAA_REV3); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF51xxx_xxAB_REV3); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF51xxx_xxAC_REV3); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF51802_xxAA_REV3); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF51801_xxAB_REV3); // NOLINT(hicpp-signed-bitwise)

// nRF52805 versions
NODE_DEFINE_CONSTANT(target, NRF52805_xxAA_REV1); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF52805_xxAA_FUTURE); // NOLINT(hicpp-signed-bitwise)

// nRF52810 versions
NODE_DEFINE_CONSTANT(target, NRF52810_xxAA_REV1); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF52810_xxAA_REV2); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF52810_xxAA_FUTURE); // NOLINT(hicpp-signed-bitwise)

// nRF52811 versions
NODE_DEFINE_CONSTANT(target, NRF52811_xxAA_REV1); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF52811_xxAA_FUTURE); // NOLINT(hicpp-signed-bitwise)

// nRF52832 versions
NODE_DEFINE_CONSTANT(target, NRF52832_xxAA_ENGA); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF52832_xxAA_ENGB); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF52832_xxAA_REV1); // NOLINT(hicpp-signed-bitwise)
Expand All @@ -517,11 +528,19 @@ void HighLevel::initConsts(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE target)
NODE_DEFINE_CONSTANT(target, NRF52832_xxAB_REV1); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF52832_xxAB_REV2); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF52832_xxAB_FUTURE); // NOLINT(hicpp-signed-bitwise)

// nRF52833 versions
NODE_DEFINE_CONSTANT(target, NRF52833_xxAA_REV1); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF52833_xxAA_FUTURE); // NOLINT(hicpp-signed-bitwise)

// nRF52840 versions
NODE_DEFINE_CONSTANT(target, NRF52840_xxAA_ENGA); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF52840_xxAA_ENGB); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF52840_xxAA_REV1); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF52840_xxAA_REV2); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF52840_xxAA_FUTURE); // NOLINT(hicpp-signed-bitwise)

// nRF9160 versions
NODE_DEFINE_CONSTANT(target, NRF9160_xxAA_REV1); // NOLINT(hicpp-signed-bitwise)
NODE_DEFINE_CONSTANT(target, NRF9160_xxAA_FUTURE); // NOLINT(hicpp-signed-bitwise)

Expand Down
12 changes: 12 additions & 0 deletions src/highlevel_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,25 @@ static name_map_t program_parameter_type_map = {NAME_MAP_ENTRY(INPUT_FORMAT_HEX_
NAME_MAP_ENTRY(INPUT_FORMAT_HEX_STRING)};

static name_map_t device_version_map = {NAME_MAP_ENTRY(UNKNOWN),
// nRF51
NAME_MAP_ENTRY(NRF51xxx_xxAA_REV1),
NAME_MAP_ENTRY(NRF51xxx_xxAA_REV2),
NAME_MAP_ENTRY(NRF51xxx_xxAA_REV3),
NAME_MAP_ENTRY(NRF51xxx_xxAB_REV3),
NAME_MAP_ENTRY(NRF51xxx_xxAC_REV3),
NAME_MAP_ENTRY(NRF51802_xxAA_REV3),
NAME_MAP_ENTRY(NRF51801_xxAB_REV3),
// nRF52805
NAME_MAP_ENTRY(NRF52805_xxAA_REV1),
NAME_MAP_ENTRY(NRF52805_xxAA_FUTURE),
// nRF52810
NAME_MAP_ENTRY(NRF52810_xxAA_REV1),
NAME_MAP_ENTRY(NRF52810_xxAA_REV2),
NAME_MAP_ENTRY(NRF52810_xxAA_FUTURE),
// nRF52811
NAME_MAP_ENTRY(NRF52811_xxAA_REV1),
NAME_MAP_ENTRY(NRF52811_xxAA_FUTURE),
// nRF52832
NAME_MAP_ENTRY(NRF52832_xxAA_ENGA),
NAME_MAP_ENTRY(NRF52832_xxAA_ENGB),
NAME_MAP_ENTRY(NRF52832_xxAA_REV1),
Expand All @@ -135,11 +142,16 @@ static name_map_t device_version_map = {NAME_MAP_ENTRY(UNKNOWN),
NAME_MAP_ENTRY(NRF52832_xxAB_REV1),
NAME_MAP_ENTRY(NRF52832_xxAB_REV2),
NAME_MAP_ENTRY(NRF52832_xxAB_FUTURE),
// nRF52833
NAME_MAP_ENTRY(NRF52833_xxAA_REV1),
NAME_MAP_ENTRY(NRF52833_xxAA_FUTURE),
// nRF52840
NAME_MAP_ENTRY(NRF52840_xxAA_ENGA),
NAME_MAP_ENTRY(NRF52840_xxAA_ENGB),
NAME_MAP_ENTRY(NRF52840_xxAA_REV1),
NAME_MAP_ENTRY(NRF52840_xxAA_REV2),
NAME_MAP_ENTRY(NRF52840_xxAA_FUTURE),
// nRF9160
NAME_MAP_ENTRY(NRF9160_xxAA_REV1),
NAME_MAP_ENTRY(NRF9160_xxAA_FUTURE)};

Expand Down

0 comments on commit 9946d53

Please sign in to comment.