Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
Loading...
Searching...
No Matches
flexcomm.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2020 iosabi
3
*
4
* This file is subject to the terms and conditions of the GNU Lesser General
5
* Public License v2.1. See the file LICENSE in the top level directory for more
6
* details.
7
*/
8
25
#ifndef FLEXCOMM_H
26
#define FLEXCOMM_H
27
28
#include <stdint.h>
29
#include "
periph_cpu.h
"
30
31
#ifdef __cplusplus
32
extern
"C"
{
33
#endif
34
40
typedef
enum
{
41
FLEXCOMM_ID_UART
= 1,
42
FLEXCOMM_ID_SPI
= 2,
43
FLEXCOMM_ID_I2C
= 3,
44
}
flexcom_pselid_t
;
45
52
int
flexcomm_init
(FLEXCOMM_Type *dev,
flexcom_pselid_t
mode);
53
60
int
flexcomm_instance_from_addr
(
const
FLEXCOMM_Type *dev);
61
62
#ifdef __cplusplus
63
}
64
#endif
65
66
#endif
/* FLEXCOMM_H */
flexcomm_init
int flexcomm_init(FLEXCOMM_Type *dev, flexcom_pselid_t mode)
Initialize a flexcomm module to operate as the selected mode.
flexcomm_instance_from_addr
int flexcomm_instance_from_addr(const FLEXCOMM_Type *dev)
Obtain the flexcomm block number (0-based) from the address.
flexcom_pselid_t
flexcom_pselid_t
Flexcomm PSELID values.
Definition
flexcomm.h:40
FLEXCOMM_ID_UART
@ FLEXCOMM_ID_UART
UART mode.
Definition
flexcomm.h:41
FLEXCOMM_ID_SPI
@ FLEXCOMM_ID_SPI
SPI mode.
Definition
flexcomm.h:42
FLEXCOMM_ID_I2C
@ FLEXCOMM_ID_I2C
I2C mode.
Definition
flexcomm.h:43
periph_cpu.h
Shared CPU specific definitions for the STM32 family.
Generated on Sat Dec 21 2024 20:58:02 by
1.9.8