AppNearMe µNFC stack for the NXP PN532 chip License: You can use the stack free of charge to prototype with mbed; if you want to use the stack with your commercial product, get in touch!

Dependents:   IOT_sensor_nfc AppNearMe_MuNFC_PN532_Test p2p_nfc_test NFCMoodLamp ... more

License

You can use the stack free of charge to prototype with mbed; if you want to use the stack with your commercial product, get in touch!

Committer:
AppNearMe
Date:
Tue Jan 15 15:34:39 2013 +0000
Revision:
13:6f98851e025b
Parent:
11:5be631376e5b
renamed rtos.h to platform_rtos.h to prevent insludes mess

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AppNearMe 11:5be631376e5b 1 /*
AppNearMe 11:5be631376e5b 2 spi.h
AppNearMe 11:5be631376e5b 3 Copyright (c) Donatien Garnier 2012
AppNearMe 11:5be631376e5b 4 donatien.garnier@appnearme.com
AppNearMe 11:5be631376e5b 5 http://www.appnearme.com/
AppNearMe 11:5be631376e5b 6 */
AppNearMe 11:5be631376e5b 7
AppNearMe 11:5be631376e5b 8 #ifndef SPI_H_
AppNearMe 11:5be631376e5b 9 #define SPI_H_
AppNearMe 11:5be631376e5b 10
AppNearMe 11:5be631376e5b 11 #ifdef __cplusplus
AppNearMe 11:5be631376e5b 12 extern "C" {
AppNearMe 11:5be631376e5b 13 #endif
AppNearMe 11:5be631376e5b 14
AppNearMe 11:5be631376e5b 15 #include "core/fwk.h"
AppNearMe 11:5be631376e5b 16
AppNearMe 11:5be631376e5b 17 //These functions must be implemented for each platform
AppNearMe 11:5be631376e5b 18
AppNearMe 11:5be631376e5b 19 /*
AppNearMe 11:5be631376e5b 20 * After skipping outSkip bytes, write outLen bytes
AppNearMe 11:5be631376e5b 21 * After skipping inSkip bytes, read inLen bytes
AppNearMe 11:5be631376e5b 22 * This will generate MAX(outSkip + outLen, inSkip + inLen) transfers on the SPI bus
AppNearMe 11:5be631376e5b 23 */
AppNearMe 11:5be631376e5b 24 int spi_transfer( uint8_t* outBuf, size_t outLen, size_t outSkip, uint8_t* inBuf, size_t inLen, size_t inSkip );
AppNearMe 11:5be631376e5b 25
AppNearMe 11:5be631376e5b 26 /*
AppNearMe 11:5be631376e5b 27 * Write outLen bytes
AppNearMe 11:5be631376e5b 28 */
AppNearMe 11:5be631376e5b 29 int spi_write( uint8_t* outBuf, size_t outLen );
AppNearMe 11:5be631376e5b 30
AppNearMe 11:5be631376e5b 31 /*
AppNearMe 11:5be631376e5b 32 * Read inLen bytes
AppNearMe 11:5be631376e5b 33 */
AppNearMe 11:5be631376e5b 34 int spi_read( uint8_t* inBuf, size_t inLen );
AppNearMe 11:5be631376e5b 35
AppNearMe 11:5be631376e5b 36 /*
AppNearMe 11:5be631376e5b 37 * Skip len bytes
AppNearMe 11:5be631376e5b 38 */
AppNearMe 11:5be631376e5b 39 int spi_skip( size_t len );
AppNearMe 11:5be631376e5b 40
AppNearMe 11:5be631376e5b 41 #ifdef __cplusplus
AppNearMe 11:5be631376e5b 42 }
AppNearMe 11:5be631376e5b 43 #endif
AppNearMe 11:5be631376e5b 44
AppNearMe 11:5be631376e5b 45 #endif /* SPI_H_ */