Developer World
Spresense SDK Library v3.2.0-ebc0364
hostif.h
Go to the documentation of this file.
1/****************************************************************************
2 * arch/arm/include/cxd56xx/hostif.h
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one or more
5 * contributor license agreements. See the NOTICE file distributed with
6 * this work for additional information regarding copyright ownership. The
7 * ASF licenses this file to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance with the
9 * License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 * License for the specific language governing permissions and limitations
17 * under the License.
18 *
19 ****************************************************************************/
20
25#ifndef __ARCH_ARM_INCLUDE_CXD56XX_HOSTIF_H
26#define __ARCH_ARM_INCLUDE_CXD56XX_HOSTIF_H
27
33/****************************************************************************
34 * Included Files
35 ****************************************************************************/
36
37#include <nuttx/config.h>
38#include <stdint.h>
39
40/****************************************************************************
41 * Pre-processor Definitions
42 ****************************************************************************/
43
46#define MAX_BUFFER_NUM 32
47
50#define HOSTIF_BUFF_ATTR_ADDR_OFFSET(n) (((n) & 0x3) << 4)
52#define HOSTIF_BUFF_ATTR_FIXLEN (0 << 2)
53#define HOSTIF_BUFF_ATTR_VARLEN (1 << 2)
54#define HOSTIF_BUFF_ATTR_WRITE (0 << 1)
55#define HOSTIF_BUFF_ATTR_READ (1 << 1)
57/****************************************************************************
58 * Public Types
59 ****************************************************************************/
60
63struct hostif_buff_s
65 uint16_t size;
66 uint16_t flag;
67};
68
73 int address;
75};
76
81 struct hostif_buff_s buff[MAX_BUFFER_NUM];
82};
83
84#ifndef __ASSEMBLY__
85
86#undef EXTERN
87#if defined(__cplusplus)
88#define EXTERN extern "C"
89extern "C"
90{
91#else
92#define EXTERN extern
93#endif
94
95/****************************************************************************
96 * Public Function Prototypes
97 ****************************************************************************/
98
108int hostif_i2cinitialize(struct hostif_i2cconf_s *config);
119int hostif_spiinitialize(struct hostif_spiconf_s *config);
128int hostif_uninitialize(void);
132#endif /* __ASSEMBLY__ */
133#endif /* __ARCH_ARM_INCLUDE_CXD56XX_HOSTIF_H */
int hostif_uninitialize(void)
int hostif_spiinitialize(struct hostif_spiconf_s *config)
#define MAX_BUFFER_NUM
Host interface maximum number of buffers.
Definition: hostif.h:46
int hostif_i2cinitialize(struct hostif_i2cconf_s *config)
Common buffer configuration.
Definition: hostif.h:65
uint16_t size
Definition: hostif.h:66
uint16_t flag
Definition: hostif.h:67
I2C buffer configuration.
Definition: hostif.h:73
int address
Definition: hostif.h:74
SPI buffer configuration.
Definition: hostif.h:81