Appiko
hal_ppi.h
1 /*
2  * hal_ppi.h : Basic HAL driver to provide abstraction for PPI peripheral
3  * Copyright (C) 2019 Appiko
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef HAL_PPI_H
20 #define HAL_PPI_H
21 
22 #include "stdint.h"
23 
34 typedef enum
35 {
45  PPI_INVALID_CH = 0x08,
48 
50 
52 typedef struct
53 {
55  uint32_t ppi_id;
57  uint32_t event;
59  uint32_t task;
61  uint32_t fork;
63 
70 
75 void hal_ppi_en_ch (uint32_t ppi_id);
76 
81 void hal_ppi_dis_ch (uint32_t ppi_id);
82 
88 void hal_ppi_set_event (uint32_t ppi_id, uint32_t new_event);
89 
95 void hal_ppi_set_task (uint32_t ppi_id, uint32_t new_task);
96 
102 void hal_ppi_set_fork (uint32_t ppi_id, uint32_t new_fork);
103 
109 #endif /* HAL_PPI_H */
uint32_t event
Definition: hal_ppi.h:57
uint32_t fork
Definition: hal_ppi.h:61
uint32_t task
Definition: hal_ppi.h:59
void hal_ppi_set_fork(uint32_t ppi_id, uint32_t new_fork)
Function to set secondary task for given PPI channel.
Definition: hal_ppi.c:88
void hal_ppi_dis_ch(uint32_t ppi_id)
Function to disable given PPI channel.
Definition: hal_ppi.c:73
ppi_setup_status_t
Definition: hal_ppi.h:34
ppi_setup_status_t hal_ppi_set(hal_ppi_setup_t *setup)
Function to setup a PPI.
Definition: hal_ppi.c:30
void hal_ppi_set_event(uint32_t ppi_id, uint32_t new_event)
Function to set triggering event for given PPI channel.
Definition: hal_ppi.c:78
void hal_ppi_en_ch(uint32_t ppi_id)
Function to Enable given PPI channel.
Definition: hal_ppi.c:68
uint32_t ppi_id
Definition: hal_ppi.h:55
void hal_ppi_set_task(uint32_t ppi_id, uint32_t new_task)
Function to change primary task for given PPI channel.
Definition: hal_ppi.c:83