Skip to content

Commit

Permalink
fix init gpio
Browse files Browse the repository at this point in the history
  • Loading branch information
adeepn committed Jan 12, 2021
1 parent ca9d4bd commit 85d8ef9
Showing 1 changed file with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,22 @@ configure_gpio() {
echo "${0}: Configure GPIOs ..."

# Discrete inputs
configure_gpio "472 ${GPIO_DIRECTION_INPUT} ${GPIO_ACTIVE_HIGH}"
configure_gpio "471 ${GPIO_DIRECTION_INPUT} ${GPIO_ACTIVE_HIGH}"
configure_gpio "470 ${GPIO_DIRECTION_INPUT} ${GPIO_ACTIVE_HIGH}"
configure_gpio "469 ${GPIO_DIRECTION_INPUT} ${GPIO_ACTIVE_HIGH}"
configure_gpio "472" "${GPIO_DIRECTION_INPUT}" "${GPIO_ACTIVE_HIGH}"
configure_gpio "471" "${GPIO_DIRECTION_INPUT}" "${GPIO_ACTIVE_HIGH}"
configure_gpio "470" "${GPIO_DIRECTION_INPUT}" "${GPIO_ACTIVE_HIGH}"
configure_gpio "469" "${GPIO_DIRECTION_INPUT}" "${GPIO_ACTIVE_HIGH}"
# Relays
configure_gpio "456 ${GPIO_DIRECTION_OUTPUT} ${GPIO_ACTIVE_HIGH}"
configure_gpio "455 ${GPIO_DIRECTION_OUTPUT} ${GPIO_ACTIVE_HIGH}"
configure_gpio "454 ${GPIO_DIRECTION_OUTPUT} ${GPIO_ACTIVE_HIGH}"
configure_gpio "456" "${GPIO_DIRECTION_OUTPUT}" "${GPIO_ACTIVE_HIGH}"
configure_gpio "455" "${GPIO_DIRECTION_OUTPUT}" "${GPIO_ACTIVE_HIGH}"
configure_gpio "454" "${GPIO_DIRECTION_OUTPUT}" "${GPIO_ACTIVE_HIGH}"
# ZigBee module
configure_gpio "467 ${GPIO_DIRECTION_OUTPUT} ${GPIO_ACTIVE_HIGH}"
configure_gpio "462 ${GPIO_DIRECTION_OUTPUT} ${GPIO_ACTIVE_HIGH}"
configure_gpio "467" "${GPIO_DIRECTION_OUTPUT}" "${GPIO_ACTIVE_HIGH}"
configure_gpio "462" "${GPIO_DIRECTION_OUTPUT}" "${GPIO_ACTIVE_HIGH}"
# LEDs
configure_gpio "452 ${GPIO_DIRECTION_OUTPUT} ${GPIO_ACTIVE_LOW}"
configure_gpio "453 ${GPIO_DIRECTION_OUTPUT} ${GPIO_ACTIVE_LOW}"
configure_gpio "452" "${GPIO_DIRECTION_OUTPUT}" "${GPIO_ACTIVE_LOW}"
configure_gpio "453" "${GPIO_DIRECTION_OUTPUT}" "${GPIO_ACTIVE_LOW}"
# Button
configure_gpio "436 ${GPIO_DIRECTION_INPUT} ${GPIO_ACTIVE_LOW}"

configure_gpio "436" "${GPIO_DIRECTION_INPUT}" "${GPIO_ACTIVE_LOW}"

echo "${0}: Turn off LEDs ..."
echo 0 > /sys/class/gpio/gpio452/value
Expand Down

0 comments on commit 85d8ef9

Please sign in to comment.