Bluecontroller (BCA8-BTM)  Epsilon
Bluecontroller BCA8-BTM (bluetooth module BTM-222, microcontroller ATmega328P)
 All Files Functions Macros
bluecontroller.h File Reference
#include "uart.h"
#include <inttypes.h>
#include <avr/io.h>
#include <util/delay.h>
Include dependency graph for bluecontroller.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BC_PIN_LED   PINB6
 
#define BC_PIN_RESET   PINB7
 
#define BC_RESET_PORT   PORTB
 
#define BC_RESET_PIN   PINB
 
#define BC_RESET_DDR   DDRB
 
#define BC_PUTC_DELAY   10
 
#define BC_DEBUG
 

Functions

void bt_init (void)
 Initialization. More...
 
void bt_setut (void)
 Setup. More...
 
void bt_reset (void)
 Reset the Bluetooth module. More...
 
void bt_turn_off (void)
 Turn off Bluetooth module. More...
 
void bt_turn_on (void)
 Turn on Bluetooth module. More...
 
void bt_escape_sequence (void)
 Send escape sequence. More...
 
void bt_putc (char c)
 Send a character. More...
 
void bt_puts (char *s)
 Send a string. More...
 
void bt_send_cmd (char *s)
 Send a command. More...
 
void bt_debug (char *s)
 Debug method. More...
 
void bt_led_on (uint8_t i)
 Turn LED on or off. More...
 

Detailed Description

Author
Fabi Rosenthal
Version
Epsilon
Date
18.05.2013

LICENSE

Licence: CC BY 3.0 (http://creativecommons.org/licenses/by/3.0/)

DESCRIPTION

Code: http://github.com/Xennis/Bluecontroller_BCA8_BTM

Documentation: http://xennis.org/wiki/Bluecontroller

Macro Definition Documentation

#define BC_DEBUG

Activate bt_debug method

#define BC_PIN_LED   PINB6

PIN 19 (PB6): LED

#define BC_PIN_RESET   PINB7

PIN 20 (PB7): BT-Reset

#define BC_PUTC_DELAY   10

Delay (in ms) after send a char

Function Documentation

void bt_debug ( char *  s)

Debug method.

Send a string, if debug is on.

Parameters
sstring
void bt_escape_sequence ( void  )

Send escape sequence.

Sends escape sequence (+++)

void bt_init ( void  )

Initialization.

Initialize Bluecontroller

void bt_led_on ( uint8_t  i)

Turn LED on or off.

Turns LED on (i==1) / off (i!=1).

Parameters
iIf i==1 turn LED on, else off
void bt_putc ( char  c)

Send a character.

Sends a character

Parameters
ccharacter
void bt_puts ( char *  s)

Send a string.

Sends a string (char*)

Parameters
sstring
void bt_reset ( void  )

Reset the Bluetooth module.

This terminates the current Bluetooth connection.

void bt_send_cmd ( char *  s)

Send a command.

Sends a Bluecontroller command (needed for setup)

Parameters
sstring
void bt_setut ( void  )

Setup.

Setup Bluetooth module

void bt_turn_off ( void  )

Turn off Bluetooth module.

Turns off Bluetooth module

void bt_turn_on ( void  )

Turn on Bluetooth module.

Turns on the Bluetooth module