<commit_before>/**
 * File: spi_transmitter.c
 * Author: <NAME>
 * 
 * Simple SPI usage between two Atmel ATmega328 microcontrollers.
 */
 
#ifndef _AVR_SPI_XMIT_H
#define _AVR_SPI_XMIT_H 1

#include <avr/io.h>


void init_SPI(void) {
	// Enable SPI by turning off PRSPI bit in Power Reduction Register
	PRR &= ~(1 << PRSPI);
}

#endif /* _AVR_SPI_XMIT_H */<commit_msg>Configured SPI module pins SCK, MOSI and SS as output pins.<commit_after>/**
 * File: spi_transmitter.c
 * Author: <NAME>
 * 
 * Simple SPI usage between two Atmel ATmega328 microcontrollers.
 */
 
#ifndef _AVR_SPI_XMIT_H
#define _AVR_SPI_XMIT_H 1

#include <avr/io.h>
#include "spi_transmitter.h"

void init_SPI(void) {
	// Enable SPI by turning off PRSPI bit in Power Reduction Register
	PRR &= ~(1 << PRSPI);
	
	// Config SCK and MOSI for output
	SPI_DDR |= (1 << SPI_SCK) | (1 << SPI_MOSI);
	
	// Config SS as output 
	// (see datasheet and App Note AVR151 for setting SS as input in 
	// SPI multi-master mode. Things get more complicated for SS in 
	// that mode).
	SPI_DDR |= (1 << SPI_SS);
}

#endif /* _AVR_SPI_XMIT_H */
{'fraction_non_alphanumeric': 0.11657559198542805, 'fraction_numerical': 0.014571948998178506, 'mean_word_length': 3.5791666666666666, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5350128', 'n_tokens_mistral': 437, 'n_tokens_neox': 407, 'n_words': 130}