HT32SX Monarch Scan
Monarch Scan application for HT32SX
spi.h
Go to the documentation of this file.
1 
19 /* Define to prevent recursive inclusion -------------------------------------*/
20 #ifndef __spi_H
21 #define __spi_H
22 #ifdef __cplusplus
23  extern "C" {
24 #endif
25 
26 /* Includes ------------------------------------------------------------------*/
27 #include "main.h"
28 
29 /* USER CODE BEGIN Includes */
30 
31 /* USER CODE END Includes */
32 
33 extern SPI_HandleTypeDef hspi1;
34 
35 /* USER CODE BEGIN Private defines */
36 
37 /* USER CODE END Private defines */
38 
39 void MX_SPI1_Init(void);
40 
41 /* USER CODE BEGIN Prototypes */
42 
51 extern uint16_t S2LPSpiWriteRegisters(uint8_t address, uint8_t n_bytes, uint8_t* buffer);
52 
61 extern uint16_t S2LPSpiReadRegisters(uint8_t RegisterAddr, uint8_t NumByteToRead, uint8_t* pBuffer);
62 
63 /*!******************************************************************
64  * \fn void S2LPSetSpiInUse(uint8_t state)
65  * \brief Set the S2LP in use flag.
66  *
67  * \param[in] state 1 if in use, else 0
68  * \param[out] none
69  *
70  * \retval none
71  *******************************************************************/
72 extern void S2LPSetSpiInUse(uint8_t state);
73 
74 /*!******************************************************************
75  * \fn uint8_t S2LPGetSpiInUse(void)
76  * \brief Get the S2LP in use flag.
77  *
78  * \param[in] none
79  * \param[out] none
80  *
81  * \retval spi_in_use 1 if in use, else 0
82  *******************************************************************/
83 extern uint8_t S2LPGetSpiInUse(void);
84 
85 extern uint16_t S2LPSpiCommandStrobes(uint8_t command);
86 extern uint16_t S2LPSpiReadFifo(uint8_t n_bytes, uint8_t* buffer);
87 extern uint16_t S2LPSpiWriteFifo(uint8_t n_bytes, uint8_t* buffer);
88 
89 /* USER CODE END Prototypes */
90 
91 #ifdef __cplusplus
92 }
93 #endif
94 #endif /*__ spi_H */
95 
104 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
S2LPGetSpiInUse
uint8_t S2LPGetSpiInUse(void)
Get the S2LP in use flag.
Definition: spi.c:391
S2LPSpiReadRegisters
uint16_t S2LPSpiReadRegisters(uint8_t RegisterAddr, uint8_t NumByteToRead, uint8_t *pBuffer)
SPI function to read registers from a slave device.
Definition: spi.c:189
S2LPSpiWriteRegisters
uint16_t S2LPSpiWriteRegisters(uint8_t address, uint8_t n_bytes, uint8_t *buffer)
SPI function to write registers of a slave device.
Definition: spi.c:217
S2LPSetSpiInUse
void S2LPSetSpiInUse(uint8_t state)
Set the S2LP in use flag.
Definition: spi.c:386
main.h
: Header for main.c file. This file contains the common defines of the application.