12345678910111213141516171819202122232425262728293031323334353637383940 |
- #ifndef USER_SPIM_H__
- #define USER_SPIM_H__
- #include <stdint.h>
- #include <stdbool.h>
- #include "define.h"
- #include "nrf_drv_spi.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- //typedef void (*spim_xfer_func)(bool stat);
- typedef void (*spim_ss_func)(bool stat);
- typedef void (*spim_timeout_func)(void);
-
- typedef struct{
- // spim_xfer_func spim_xfer; //SPI传输完成标志
- spim_ss_func spim_ss; //spi片选
- spim_timeout_func spim_timeout;
- bool spim_xfer_done; //传输完成
- }user_spim_s;
-
- void spim1_init(void);
- void spim1_uinit(void);
- ret_code_t nrf_drv_spim1_transfer(uint8_t const * spi_tx_buf,uint8_t tx_len,uint8_t * spi_rx_buf,uint8_t rx_len);
- void set_ss_func(spim_ss_func ss_func);
- //void set_xfer_done_func(spim_xfer_func done);
- extern user_spim_s user_spim1_s;
- extern bool lock;
- #ifdef __cplusplus
- }
- #endif
- #endif // USER_SPIM_H__
- /** @} */
|