Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
- Use github markdown feature. See: https://github.com/orgs/community/discussions/16925
  • Loading branch information
pjueon committed Nov 14, 2023
1 parent a8b0d53 commit 010e89b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
10 changes: 5 additions & 5 deletions docs/how_to_link_to_your_project.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

# How to link `JetsonGPIO` to your project
**Note**: To build your code with `JetsonGPIO`, C++11 or higher is required.
> [!IMPORTANT]
> To build your code with `JetsonGPIO`, C++11 or higher is required.
## With CMake

Expand Down Expand Up @@ -34,10 +35,9 @@ target_link_libraries(mytarget JetsonGPIO::JetsonGPIO)

The code will be automatically fetched at configure time and built alongside your project.

Note that with this method will *not* set user permissions, so you will need to set user permissions manually or run your code with root permissions.

To set user permissions, run `scripts/post_install.sh` script.
Assuming you are in `build` directory:
> [!IMPORTANT]
> This method does not automatically set user permissions, so you will need to set them manually or run your code with root permissions.
> To set user permissions, execute the `scripts/post_install.sh` script. Assuming you are in `build` directory:
```
sudo bash ../scripts/post_install.sh
```
Expand Down
17 changes: 7 additions & 10 deletions docs/library_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ GPIO::add_event_detect(channel, GPIO::RISING, callback_fn);
Any object that satisfies the following requirements can be used as a callback function.
- Callable with a `const std::string&` type argument (for the channel name) **OR** without any argument. The return type must be `void`.
- *Note*: If the callback object is **not only** callable with a `const std::string&` type argument **but also** callable without any argument,
the method with a `const std::string&` type argument will be used as a callback function.
> [!NOTE]
> If the callback object is **not only** callable with a `const std::string&` type argument **but also** callable without any argument, the method with a `const std::string&` type argument will be used as a callback function.
- Copy-constructible
- Equality-comparable with same type (ex> func0 == func1)
- Equality-comparable with same type (ex> `func0 == func1`)
Here is a user-defined type callback example:
Expand Down Expand Up @@ -316,16 +316,13 @@ The function returns either `GPIO::IN` or `GPIO::OUT` which are the instances of

#### 11. PWM

See `samples/simple_pwm.cpp` for details on how to use PWM channels.
> [!IMPORTANT]
> The system pinmux must be configured to connect the hardware PWM controlller(s) to the relevant pins. If the pinmux is not configured, PWM signals will not reach the pins! The JetsonGPIO library does not dynamically modify the pinmux configuration to achieve this. Read the [L4T documentation](https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/HR/ConfiguringTheJetsonExpansionHeaders.html) for details on how to configure the pinmux.
The JetsonGPIO library supports PWM only on pins with attached hardware PWM
controllers. Unlike the RPi.GPIO library, the JetsonGPIO library does not
implement Software emulated PWM. Jetson Nano supports 2 PWM channels, and
Jetson AGX Xavier supports 3 PWM channels. Jetson TX1 and TX2 do not support
any PWM channels.
any PWM channels.

The system pinmux must be configured to connect the hardware PWM controlller(s)
to the relevant pins. If the pinmux is not configured, PWM signals will not
reach the pins! The JetsonGPIO library does not dynamically modify the pinmux
configuration to achieve this. Read the [L4T documentation](https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/HR/ConfiguringTheJetsonExpansionHeaders.html) for details on how to
configure the pinmux.
See `samples/simple_pwm.cpp` for details on how to use PWM channels.

0 comments on commit 010e89b

Please sign in to comment.