# example_znp_spi_interface_mdb1.c File Reference

Single file example of how to interface with ZNP; hardware platform MDB-1. More...

`#include "msp430x24x.h"`
`#include <stdio.h>`

## Defines
#define | RADIO_ON() (P1OUT |= BIT2)
#define | RADIO_OFF() (P1OUT &= ~BIT2)
#define | SPI_SS_SET() (P5OUT &= ~BIT0)
#define | SPI_SS_CLEAR() (P5OUT |= BIT0)
#define | SRDY_IS_HIGH() (P1IN & BIT3)
#define | SRDY_IS_LOW() ((~P1IN) & BIT3)
#define | TICKS_IN_ONE_MS_8MHZ 1980
#define | TICKS_IN_ONE_MS TICKS_IN_ONE_MS_8MHZ
## Functions
void | oscInit ()
void | portInit ()
void | debugConsoleInit ()
int | putchar (int c)
void | halSpiInit ()
void | spiWrite (unsigned char *bytes, unsigned char numBytes)
void | delayMs (unsigned int ms)
signed int | spiPoll (unsigned char *bytes)
int | main (void)

## Detailed Description

Single file example of how to interface with ZNP; hardware platform MDB-1.

Rev
  587

Author
  dsmith

Date
  2010-06-11 10:17:52 -0700 (Fri, 11 Jun 2010)

See also:
  http://processors.wiki.ti.com/index.php/Tutorial_on_the_Examples and http://e2e.ti.com/support/low_power_rf/default.aspx

YOU ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.

## Function Documentation

void debugConsoleInit | ( |  | ) |

Initialize serial console

void delayMs | ( | unsigned int | ms | ) |

Delay by the specified number of mSec

void halSpiInit | ( |  | ) |

Initialize SPI interface to ZNP

void oscInit | ( |  | ) |

Initialize oscillator to 8MHz DCO, 2MHz SMCLK

void portInit | ( |  | ) |

Initialize GPIO ports

signed int spiPoll | ( | unsigned char * | bytes | ) |

Poll for data from the ZNP

void spiWrite | ( | unsigned char * | bytes,
|  | unsigned char | numBytes |
| ) |  |  |

Write bytes to SPI port.

All Data Structures Files Functions Variables Defines