flexcomm.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2020 iosabi
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
24 #include <stdint.h>
25 #include "periph_cpu.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
36 typedef enum {
41 
48 int flexcomm_init(FLEXCOMM_Type *dev, flexcom_pselid_t mode);
49 
56 int flexcomm_instance_from_addr(const FLEXCOMM_Type *dev);
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 
int flexcomm_init(FLEXCOMM_Type *dev, flexcom_pselid_t mode)
Initialize a flexcomm module to operate as the selected mode.
int flexcomm_instance_from_addr(const FLEXCOMM_Type *dev)
Obtain the flexcomm block number (0-based) from the address.
flexcom_pselid_t
Flexcomm PSELID values.
Definition: flexcomm.h:36
@ FLEXCOMM_ID_UART
UART mode.
Definition: flexcomm.h:37
@ FLEXCOMM_ID_SPI
SPI mode.
Definition: flexcomm.h:38
@ FLEXCOMM_ID_I2C
I2C mode.
Definition: flexcomm.h:39
Shared CPU specific definitions for the STM32 family.