ATY_LIB
V2_102_230218
ATY_LIB for general devices or ALGO
Loading...
Searching...
No Matches
fw_spi.c
Go to the documentation of this file.
1
// Copyright 2021 IOsetting <iosetting(at)outlook.com>
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#include "
fw_spi.h
"
16
#include "
fw_tim.h
"
17
#include "
fw_sys.h
"
18
19
20
uint8_t
SPI_TxRx
(
uint8_t
dat
)
21
{
22
SPDAT =
dat
;
23
while
(!
SPI_RxTxFinished
());
24
SPI_ClearInterrupts
();
25
return
SPDAT;
26
}
27
28
void
SPI_TxRxBytes
(
uint8_t
*pBuf,
uint8_t
len)
29
{
30
while
(len--)
31
{
32
*pBuf++ =
SPI_TxRx
(*pBuf);
33
}
34
}
dat
__CODE int8_t dat[20]
Definition:
at24c08_stc8h3k.c:29
SPI_TxRx
uint8_t SPI_TxRx(uint8_t dat)
Definition:
fw_spi.c:20
SPI_TxRxBytes
void SPI_TxRxBytes(uint8_t *pBuf, uint8_t len)
Definition:
fw_spi.c:28
fw_spi.h
SPI_ClearInterrupts
#define SPI_ClearInterrupts()
Definition:
fw_spi.h:66
SPI_RxTxFinished
#define SPI_RxTxFinished()
Definition:
fw_spi.h:63
fw_sys.h
fw_tim.h
uint8_t
unsigned char uint8_t
Definition:
fw_types.h:18
ATY_LIB
FwLib_STC8
src
fw_spi.c
Generated by
1.9.6