hamownia_F7/Core/Src/main.c
/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */
Private user code
USER CODE BEGIN 0
Private user code USER CODE BEGIN 0
void adxl_zapisz (uint8_t adres, uint8_t wartosc)
{
	uint8_t data[2];
	data[0] = adres|0x40;  
	data[1] = wartosc;
	HAL_GPIO_WritePin (CS_GPIO_Port, CS_Pin, GPIO_PIN_RESET);  
	HAL_SPI_Transmit (&hspi2, data, 2, 100);  
	HAL_GPIO_WritePin (CS_GPIO_Port, CS_Pin, GPIO_PIN_SET);  
}
void adxl_zapisz ( uint8_t adres , uint8_t wartosc ) { uint8_t data [ 2 ] ; data [ 0 ] = adres | 0x40 ; data [ 1 ] = wartosc ; HAL_GPIO_WritePin ( CS_GPIO_Port , CS_Pin , GPIO_PIN_RESET ) ; HAL_SPI_Transmit ( & hspi2 , data , 2 , 100 ) ; HAL_GPIO_WritePin ( CS_GPIO_Port , CS_Pin , GPIO_PIN_SET ) ; }
Private user code
USER CODE BEGIN 0
Private user code USER CODE BEGIN 0
// multibyte write
 // pull the cs pin low
 // write data to register
 // pull the cs pin high
