pin() = integer() | gpio1_1 | gpio1_2 | gpio1_3 | gpio1_4 | gpio2_1 | gpio2_2 | gpio2_3 | gpio2_4 | led1_r | led1_g | led1_b | led2_r | led2_g | led2_b | jumper_1 | jumper_2 | jumper_3 | jumper_4 | jumper_5 | spi1_pin7 | spi1_pin8 | spi1_pin9 | spi1_pin10 | ss1 | ss2 | uart_1_cts | uart_2_txd | uart_3_rxd | uart_4_rts
See the GRiSP Wiki for the physical to atom pin mappings.
pin_type() = periph_a | periph_b | periph_c | periph_d | input | output_0 | output_1
slot() = gpio1 | gpio2 | spi1 | spi2
| clear/1 | Sets a pin to false. |
| configure/2 | Equivalent to configure(Pin, Type, [default]). |
| configure/3 | Configure pin type. |
| configure_slot/2 | Configure slot. |
| get/1 | Gets the value of a pin. |
| set/1 | Sets a pin to true. |
clear(Pin::pin()) -> any()
Sets a pin to false.
led_1 with:
1> grisp_gpio:clear(led1_r). <<>>
configure(Pin::pin(), Type::pin_type()) -> any()
Equivalent to configure(Pin, Type, [default]).
configure(Pin::pin(), Type::pin_type(), Attr::[default]) -> any()
Configure pin type.
configure_slot(Slot::slot(), Config::{T1::pin_type(), T2::pin_type(), T3::pin_type(), T4::pin_type()} | disable_cs | enable_cs) -> ok
Configure slot.
The GPIO slots can be configured with{T1, T2, T3, T4}
and the SPI slots allow the configuration disable_cs | enable_cs.
get(Pin::pin()) -> any()
Gets the value of a pin.
led_1 is on use:
2> grisp_gpio:get(led1_r). falseIn this case it was off.
set(Pin::pin()) -> any()
Sets a pin to true.
led_1 with:
3> grisp_gpio:set(led1_r). <<>>
Generated by EDoc