[[ANT]] * Library for LPC1114 [#a440fa7b] > This is a sample code of the library for LPC1114, a 32bit microcontroller (IC) produced by NXP Semiconductors. (The product page at NXP Semiconductors is available [[here>http://www.nxp.com/products/microcontrollers/cortex_m0/lpc1100_x_l/#overview]].)~ > This library is still alpha version, and there is possibly a lot bug in the code. (Please handle it carefully)~ > ant.c calls functions listed at uart.c. The functions are used for exchnaging commands and results with the ANT chip. In this sample, therefore, uart.c as well as uart.h are required.~ >> For uart.c and uart.h, their licenses are checking right now. > - header file &ref(ant.h);~ - C source file &ref(ant.c);~ ** Example [#n9172ee0] > #include <ant.h> #include <uart.h> #define DEVICE_NUMBER 31 #define MAX_BUFSIZE 32 #define ANT_CH 0 unsigned char buffer[MAX_BUFSIZE]; void OpenANT() { // This function sets the communication parameter 0 and opens the communication channel. ANT_ResetSystem(); // Resetting ANT device ANT_AssignChannel( ANT_CH, ANT_Bidirectional_Slave, 0) ; // Assigning a channel to a receiving channel ANT_SetChannelId( ANT_CH, DEVICE_NUMBER, 1, 1 ); // Setting Device Number and other Device ID ANT_SetChannelPeriod_Hz( ANT_CH, 4 ); // Setting Channel Period as 4Hz (This is the default setting. ) ANT_SetChannelRFFreq( ANT_CH, 4 ); // Frequency is at 2404MHz ANT_OpenChannel( ANT_CH ); // Opening a channel and starting communication return; } void main () { int s; OpenANT(); while(1) { if ( s = BC_ANT_RecvPacket( buffer, MAX_BUFSIZE )) { // Receiving data from the ANT chip, and processing.... // Receiving packets, and processing events, which the ANT chip has sent . } } } * Revision History [#bbddba0e] > - 2013/02/01 This article is initially uploaded