diff options
| author | Aleksa Vučković <56649122+aleksav013@users.noreply.github.com> | 2023-03-10 22:55:42 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-10 22:55:42 +0000 |
| commit | 01905c85caf85f658e6efff8672d873e7a5fd8ad (patch) | |
| tree | 2782af11a61f1f3f828d568019174d67a9fed26f /src/init.c | |
| parent | 30a0aafd0feb6615b17bd226ba82010a6aaeb20b (diff) | |
| parent | f6ebc8903c51435cccfc95915f75d96f73f16fa7 (diff) | |
vladin deo
Diffstat (limited to 'src/init.c')
| -rw-r--r-- | src/init.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/init.c b/src/init.c new file mode 100644 index 0000000..a9f5d63 --- /dev/null +++ b/src/init.c @@ -0,0 +1,32 @@ +#include "pico/stdlib.h" +#include "config.h" +#include "init.h" + +uint8_t map[9]; + +void init_pins(void) +{ + gpio_init(DATA_PIN); + gpio_init(CLOCK_PIN); + gpio_init(LATCH_PIN); + gpio_set_dir(DATA_PIN, GPIO_OUT); + gpio_set_dir(CLOCK_PIN, GPIO_OUT); + gpio_set_dir(LATCH_PIN, GPIO_OUT); + + gpio_init(LED_PIN); + gpio_set_dir(LED_PIN, GPIO_OUT); + gpio_put(LED_PIN, 1); +} + +void init_map(void) +{ + map[0] = CHIP_0; + map[1] = CHIP_1; + map[2] = CHIP_2; + map[3] = CHIP_3; + map[4] = CHIP_4; + map[5] = CHIP_5; + map[6] = CHIP_6; + map[7] = CHIP_7; + map[8] = CHIP_8; +} |
