Skip to content

Commit

Permalink
Rename lib to libserialport
Browse files Browse the repository at this point in the history
Signed-off-by: Euan Torano <[email protected]>
  • Loading branch information
euantorano committed Feb 12, 2017
1 parent c0b5d3f commit 77e8c97
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 78 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# serialport.nim
# libserialport.nim

A library to work with serial ports using pure Nim.

## Installation

```
nimble install serialport
nimble install libserialport
```

## Usage

### Reading from a serial port, into a pre-defined buffer:

```nim
import serialport
import libserialport
let port = openSerialPort("COM3",
baudRate=BaudRate.BR9600, dataBits=DataBits.eight,
stopBits=StopBits.one, parity=Parity.none,
useHardwareFlowControl=true, useSoftwareFlowControl=false)
defer: port.close()
## The baud rate, data bits, stop bits and parity default to 9600, 8, 1 and none - in that order
Expand All @@ -44,12 +45,13 @@ echo "Read ", numRead, " bytes from the serial port: ", readBuffer
### Writing to a serial port:

```nim
import serialport
import libserialport
let port = openSerialPort("COM3",
baudRate=BaudRate.BR9600, dataBits=DataBits.eight,
stopBits=StopBits.one, parity=Parity.none,
useHardwareFlowControl=true, useSoftwareFlowControl=false)
defer: port.close()
## The baud rate, data bits, stop bits and parity default to 9600, 8, 1 and none - in that order
Expand All @@ -76,7 +78,7 @@ port.write(newDataToSend, timeout=5) # Wait for 5 seconds. If the data isn't tra
### Listing serial ports available on the system

```nim
import serialport
import libserialport
for p in listSerialPorts():
echo "Found serial port: ", p
Expand Down
138 changes: 69 additions & 69 deletions docs/serialport.html → docs/libserialport.html
100755 → 100644

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/list_serial_ports.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import serialport
import libserialport

when isMainModule:
proc main() =
Expand Down
2 changes: 1 addition & 1 deletion examples/read_write.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import serialport, os
import libserialport, os

const
writePort: string = "/dev/cu.usbserial-FTZ9WDJA"
Expand Down
2 changes: 1 addition & 1 deletion serialport.nimble → libserialport.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ srcDir = "src"
requires "nim >= 0.15.2"

task docs, "Build documentation":
exec "nim doc2 -o:docs/serialport.html src/serialport.nim"
exec "nim doc2 -o:docs/libserialport.html src/libserialport.nim"
2 changes: 1 addition & 1 deletion src/serialport.nim → src/libserialport.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## A library to work with serial ports using pure Nim.

include serialport/private/list_serialports, serialport/private/common
include libserialport/private/list_serialports, libserialport/private/common

when defined(nimdoc):
proc openSerialPort*(name: string, baudRate: BaudRate = BaudRate.BR9600,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 77e8c97

Please sign in to comment.