Skip to content

Commit

Permalink
upgrade avrgirl-stk500v2, update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
noopkat committed Nov 27, 2015
1 parent 015ae4a commit 7a86377
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 11 deletions.
57 changes: 47 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,51 @@ var attiny85 = {

## Available methods

### quickFlash

This is a convenient, fast way to write to the flash memory of the microchip.

Underneath, this method is doing the following:

1. Enters programming mode
2. Calls writeFlash and writes to the flash memory on the chip
3. Exits programming mode and calls back

It does not erase the chip before writing.

Provide a filepath string, and a callback, respectively. Alternatively, you may also provide a pre-parsed Buffer in in place of the filepath.

Returns a null error upon callback if successful.

```javascript
avrgirl.quickFlash('Blink.cpp.hex', function(error) {
console.log(error);
});
```

### quickEeprom

This is a convenient, fast way to write to the eeprom memory of the microchip.

Underneath, this method is doing the following:

1. Enters programming mode
2. Calls writeEeprom and writes to the eeprom memory on the chip
3. Exits programming mode and calls back

It does not erase the chip before writing.

Provide a filepath string, and a callback, respectively. Alternatively, you may also provide a pre-parsed Buffer in in place of the filepath.

Returns a null error upon callback if successful.

```javascript
avrgirl.quickEeprom('myEeprom.cpp.hex', function(error) {
console.log(error);
});
```



### getChipSignature

Expand Down Expand Up @@ -223,31 +268,23 @@ avrgirl.setParameter(0x94, 0x00, function(error) {

### writeFlash

Writes a buffer to the flash memory of the microchip. Provide a buffer and a callback respectively.
Protip: use the package [intel-hex](https://www.npmjs.com/package/intel-hex) if you need to parse a .hex file into a buffer for this method. See the example.
Writes a buffer to the flash memory of the microchip. Provide a filepath string, and a callback, respectively. Alternatively, you may also provide a pre-parsed Buffer in in place of the filepath.

Returns a null error upon callback if successful.

```javascript
var intelhex = require('intel-hex');
var buffer = fs.readFileSync('Blink.cpp.hex', {encoding: 'utf8'});

avrgirl.writeFlash(buffer, function(error) {
console.log(error);
});
```

### writeEeprom

Writes a buffer to the eeprom memory of the microchip. Provide a buffer and a callback respectively.
Protip: use the package [intel-hex](https://www.npmjs.com/package/intel-hex) if you need to parse a .hex file into a buffer for this method. See the example.
Writes a buffer to the eeprom memory of the microchip. Provide a filepath string, and a callback, respectively. Alternatively, you may also provide a pre-parsed Buffer in in place of the filepath.

Returns a null error upon callback if successful.

```javascript
var intelhex = require('intel-hex');
var buffer = fs.readFileSync('myEeprom.cpp.hex', {encoding: 'utf8'});

avrgirl.writeEeprom(buffer, function(error) {
console.log(error);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"dependencies": {
"async": "^1.4.0",
"avrgirl-chips-json": "^2.0.0",
"avrgirl-stk500v2": "^1.0.3",
"avrgirl-stk500v2": "^1.1.0",
"intel-hex": "^0.1.1",
"usb": "^1.1.0"
},
Expand Down

0 comments on commit 7a86377

Please sign in to comment.