From 61dcb7ac2ccea4b2f47cc418e4864e5c5243d886 Mon Sep 17 00:00:00 2001 From: "Phani Pavan K: iDellToast" Date: Sun, 24 Nov 2024 16:35:05 +0530 Subject: [PATCH] added summary block --- 1_Basic_GPIO/digitalOut.md | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/1_Basic_GPIO/digitalOut.md b/1_Basic_GPIO/digitalOut.md index eb9aec4..7d27b35 100644 --- a/1_Basic_GPIO/digitalOut.md +++ b/1_Basic_GPIO/digitalOut.md @@ -1,3 +1,5 @@ +Add table of contents + ## Blinky The classic, helloWorld of embedded programming. This program turns the LED on and off periodically. @@ -134,7 +136,7 @@ The rest of the code is similar to the prior examples, which toggles the LEDS on ## ToggleBlinky -This example uses `gpio_get_out_level` to to get the output level for gicen given gpio port. The above example can be simplified by using this function call, as below. +This example uses `gpio_get_out_level` to to get the output level for gicen given gpio port. The above example can be simplified by using this function call, as below. This function will be covered in DigitalIn.md as well. ```c int LED1 = 11; @@ -227,7 +229,7 @@ Code to turn the fan on and off with a 2 second delay: ## Binary LED Counter -This example uses 5 LEDS to visualize a 5 bit binary counter. Mask commands are used to set the LEDS simultaneously. +This example again uses 5 LEDS to visualize a 5 bit binary counter. Mask commands are used to set the LEDS simultaneously. ```c int pinMask = 0b1111100000000000; @@ -246,3 +248,31 @@ while (true) `gpio_put_masked` has similar characteristics as other masked functions. This will set the output pins according to the second argument simultaneously, `counter<<11` in this case. Counter is left shifted by 11 bits to align with the mask. if counter is `11001`, `counter<<11` will be `1100100000000000`. + +--- + +## Summary + +Below are the API calls used in this document: +### Initializing Calls: +| API call | Arguments | Definition | +| - | - | - | +| `gpio_init` | GP# | Initializes GP# pin | +| `gpio_set_dir` | GP#, | Sets the direction of GP# pin to either read or write | +| `gpio_set_drive_strength` | GP#, GPIO_DRIVE_STRENGTH_#MA | Sets the drive strength of GP# pin to given value | +| `gpio_init_mask` | GP_MASK | Initializes the GP pins highlighted by GP_MASK | +| `gpio_set_dir_masked` | GP_MASK, DIR_MASK | Sets the direction of GP pins highlighted by GP_MASK according to DIR_MASK | + +### Controlling Calls: + +| API call | Arguments | Definition | +| - | - | - | +| `gpio_put` | GP#, | Sets the GP# pin to HIGH or LOW | +| `gpio_put_masked` | GP_MASK, DIR_MASK | Sets the GP pins highlighted by GP_MASK according to DIR_MASK | + +### MISC Calls: + +| API call | Arguments | Definition | +| - | - | - | +| `sleep_ms` | TIME | Pauses the program for given number of milli-seconds when called | +| `stdio_init_all` | -- | Initializes stuff |