• Main Page
  • Modules
  • Index
  • File List
  • Globals

hal/nrf24le1/hal_spi.h

Go to the documentation of this file.
00001 /* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.
00002  *
00003  * The information contained herein is confidential property of Nordic 
00004  * Semiconductor ASA.Terms and conditions of usage are described in detail 
00005  * in NORDIC SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 
00006  *
00007  * Licensees are granted free, non-transferable use of the information. NO
00008  * WARRENTY of ANY KIND is provided. This heading must NOT be removed from
00009  * the file.
00010  *              
00011  * $LastChangedRevision: 167 $
00012  */
00013 
00032 #ifndef HAL_SPI_H__
00033 #define HAL_SPI_H__
00034 
00035 #include <stdint.h>
00036 #include <stdbool.h>
00037 
00041 typedef enum
00042 {
00043     SPI_CLK_DIV2,        
00044     SPI_CLK_DIV4,        
00045     SPI_CLK_DIV8,        
00046     SPI_CLK_DIV16,       
00047     SPI_CLK_DIV32,       
00048     SPI_CLK_DIV64,       
00049     SPI_CLK_DIV128       
00050 } hal_spi_clkdivider_t;  
00051 
00055 typedef enum {
00056    HAL_SPI_LSB_MSB,      
00057    HAL_SPI_MSB_LSB       
00058 } hal_spi_byte_order_t;
00059     
00063 typedef enum {           
00064    HAL_SPI_MODE_0,       
00065    HAL_SPI_MODE_1,       
00066    HAL_SPI_MODE_2,       
00067    HAL_SPI_MODE_3        
00068 } hal_spi_mode_t;
00069 
00070 
00073 void hal_spi_master_init(hal_spi_clkdivider_t ck, hal_spi_mode_t mode, hal_spi_byte_order_t bo);
00074 
00082 uint8_t hal_spi_master_read_write(uint8_t pLoad);
00083 
00086 void hal_spi_slave_init(hal_spi_mode_t mode, hal_spi_byte_order_t bo);
00087 
00095 uint8_t hal_spi_slave_rw(uint8_t pLoad);
00096 
00100 uint8_t hal_spi_slave_read(void);
00101 
00105 void hal_spi_slave_preload(uint8_t pLoad);
00106 
00110 bool spi_slave_data_ready(void);
00111 
00112 bool hal_spi_slave_csn_high(void);
00113 
00114 
00115 #endif // HAL_SPI_H__
00116 

Generated on Fri Apr 20 2012 14:11:45 for nRFGo SDK by  doxygen 1.7.2